Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1626168

Re: [PATCH v6 6/8] coresight: add support for CPU debug module

From Suzuki K Poulose <Suzuki.Poulose@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v6 6/8] coresight: add support for CPU debug module
Date 2017-04-19 16:40 +0200
Message-ID <txYVX-4yJ-17@gated-at.bofh.it> (permalink)
References <ttfNL-DZ-7@gated-at.bofh.it> <ttfNM-DZ-25@gated-at.bofh.it> <txXQd-3X1-1@gated-at.bofh.it> <txYVY-4yJ-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 19/04/17 15:28, Leo Yan wrote:
> Hi Suzuki,
>
> On Wed, Apr 19, 2017 at 02:23:04PM +0100, Suzuki K Poulose wrote:
>> Hi Leo,
>>
>> This version looks good to me. I have two minor comments below.
>
> Thanks for reviewing. Will take the suggestions. Just check a bit for
> last comment.
>
> [...]
>
>>> +static int debug_probe(struct amba_device *adev, const struct amba_id *id)
>>> +{
>>> +	void __iomem *base;
>>> +	struct device *dev = &adev->dev;
>>> +	struct debug_drvdata *drvdata;
>>> +	struct resource *res = &adev->res;
>>> +	struct device_node *np = adev->dev.of_node;
>>> +	int ret;
>>> +
>>> +	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
>>> +	if (!drvdata)
>>> +		return -ENOMEM;
>>> +
>>> +	drvdata->cpu = np ? of_coresight_get_cpu(np) : 0;
>>> +	if (per_cpu(debug_drvdata, drvdata->cpu)) {
>>> +		dev_err(dev, "CPU%d drvdata has been initialized\n",
>>> +			drvdata->cpu);
>>
>> May be we could warn about a possible issue in the DT ?
>
> So can I understand the suggestion is to add warning in function
> of_coresight_get_cpu() when cannot find CPU number, and here directly
> bail out?

No. One could have single CPU DT, where he doesn't need to provide the CPU number.
Hence, it doesn't make sense to WARN  in of_coresight_get_cpu().

But when we hit the case above, we find that the some node was registered for
the given CPU (be it 0 or any other), which is definitely an error in DT. Due to

1) Hasn't specified the CPU number for more than one node

OR

2) CPU number duplicated in the more than one nodes.

Cheers
Suzuki

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v6 6/8] coresight: add support for CPU debug module Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2017-04-19 15:30 +0200
  Re: [PATCH v6 6/8] coresight: add support for CPU debug module Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2017-04-19 16:40 +0200
    Re: [PATCH v6 6/8] coresight: add support for CPU debug module Leo Yan <leo.yan@linaro.org> - 2017-04-19 17:10 +0200
  Re: [PATCH v6 6/8] coresight: add support for CPU debug module Leo Yan <leo.yan@linaro.org> - 2017-04-19 16:40 +0200

csiph-web