linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
To: Suzuki K Poulose <suzuki.poulose@arm.com>,
	mathieu.poirier@linaro.org, leo.yan@linaro.org,
	alexander.shishkin@linux.intel.com, andy.gross@linaro.org,
	david.brown@linaro.org, mark.rutland@arm.com
Cc: rnayak@codeaurora.org, vivek.gautam@codeaurora.org,
	sibis@codeaurora.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 1/2] coresight: Set affinity to invalid for missing CPU phandle
Date: Thu, 20 Jun 2019 20:24:21 +0530	[thread overview]
Message-ID: <fc72dab8-d287-38d4-1abd-faca02c09118@codeaurora.org> (raw)
In-Reply-To: <f7a3592b-7ed7-b011-9ae1-dc2ca0e49ae4@arm.com>

Hi Suzuki,

Thanks for the review.

On 6/20/2019 7:25 PM, Suzuki K Poulose wrote:
> 
> Sai,
> 
> Thanks for the patch. Please could you change the subject to :
> 
> "coresight: Do not default to CPU0 for missing CPU phandle"
> 

Sure.

> On 20/06/2019 14:45, Sai Prakash Ranjan wrote:
>> Affinity defaults to CPU0 in case of missing CPU phandle
>> and this leads to crashes in some cases because of such
>> wrong assumption. Fix this by returning -ENODEV in
> 
> Thats not the right justification. Causing crashes is due to
> bad DT/firmware. I would be happy with something like :
> 
> "Coresight platform support assumes that a missing \"cpu\" phandle
> defaults to CPU0. This could be problematic and unnecessarily binds
> components to CPU0, where they may not be. Let us make the DT binding
> rules a bit stricter by not defaulting to CPU0 for missing "cpu"
> affinity information."
> 
> Also, you must
> 
> 1) update the devicetree/bindings document to reflect the same.
> 2) update the drivers to take appropriate action on the missing CPU
>     where they are expected (e.g, CPU-debug, etm*), to prevent
>     breaking a bisect.
> 
> 

Sure will do it and repost.

>> coresight platform for such cases and then handle it
>> in the coresight drivers.
>>
>> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
>> ---
>>   drivers/hwtracing/coresight/coresight-platform.c | 10 ++++++----
>>   1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-platform.c 
>> b/drivers/hwtracing/coresight/coresight-platform.c
>> index 3c5ceda8db24..b1ea60c210e1 100644
>> --- a/drivers/hwtracing/coresight/coresight-platform.c
>> +++ b/drivers/hwtracing/coresight/coresight-platform.c
>> @@ -160,15 +160,17 @@ static int of_coresight_get_cpu(struct device *dev)
>>       if (!dev->of_node)
>>           return 0;
>> +
>>       dn = of_parse_phandle(dev->of_node, "cpu", 0);
>> -    /* Affinity defaults to CPU0 */
>> +
>> +    /* Affinity defaults to invalid if no cpu nodes are found*/
> 
> The code is self explanatory here. You could drop the comment.
> 

Sure.

>>       if (!dn)
>> -        return 0;
>> +        return -ENODEV;
>> +
>>       cpu = of_cpu_node_to_id(dn);
>>       of_node_put(dn);
>> -    /* Affinity to CPU0 if no cpu nodes are found */
>> -    return (cpu < 0) ? 0 : cpu;
>> +    return cpu;
>>   }
> 
> Suzuki

-Sai

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

  reply	other threads:[~2019-06-20 14:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 13:45 [PATCH 0/2] coresight: Set affinity to invalid for missing CPU phandle Sai Prakash Ranjan
2019-06-20 13:45 ` [PATCH 1/2] " Sai Prakash Ranjan
2019-06-20 13:55   ` Suzuki K Poulose
2019-06-20 14:54     ` Sai Prakash Ranjan [this message]
2019-06-20 17:39   ` Mathieu Poirier
2019-06-20 18:05     ` Sai Prakash Ranjan
2019-06-20 13:45 ` [PATCH 2/2] coresight: Abort probe " Sai Prakash Ranjan
2019-06-20 13:58   ` Suzuki K Poulose
2019-06-20 14:55     ` Sai Prakash Ranjan
2019-06-20 15:23       ` Suzuki K Poulose
2019-06-20 16:10         ` Sai Prakash Ranjan
2019-06-20 17:43   ` Mathieu Poirier
2019-06-20 18:07     ` Sai Prakash Ranjan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fc72dab8-d287-38d4-1abd-faca02c09118@codeaurora.org \
    --to=saiprakash.ranjan@codeaurora.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=rnayak@codeaurora.org \
    --cc=sibis@codeaurora.org \
    --cc=suzuki.poulose@arm.com \
    --cc=vivek.gautam@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).