Linux-ARM-MSM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] coresight: etm4x: Skip setting LPOVERRIDE bit for qcom,skip-power-up
@ 2020-10-16 10:10 Sai Prakash Ranjan
  2020-10-16 11:21 ` Suzuki Poulose
  2020-10-16 16:31 ` Mathieu Poirier
  0 siblings, 2 replies; 6+ messages in thread
From: Sai Prakash Ranjan @ 2020-10-16 10:10 UTC (permalink / raw)
  To: Mathieu Poirier, Suzuki K Poulose, Mike Leach
  Cc: coresight, Stephen Boyd, denik, linux-arm-msm, linux-kernel,
	linux-arm-kernel, Sai Prakash Ranjan

There is a bug on the systems supporting to skip power up
(qcom,skip-power-up) where setting LPOVERRIDE bit(low-power
state override behaviour) will result in CPU hangs/lockups
even on the implementations which supports it. So skip
setting the LPOVERRIDE bit for such platforms.

Fixes: 02510a5aa78d ("coresight: etm4x: Add support to skip trace unit power up")
Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
---
 drivers/hwtracing/coresight/coresight-etm4x-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
index abd706b216ac..6096d7abf80d 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
@@ -779,7 +779,7 @@ static void etm4_init_arch_data(void *info)
 	 * LPOVERRIDE, bit[23] implementation supports
 	 * low-power state override
 	 */
-	if (BMVAL(etmidr5, 23, 23))
+	if (BMVAL(etmidr5, 23, 23) && (!drvdata->skip_power_up))
 		drvdata->lpoverride = true;
 	else
 		drvdata->lpoverride = false;

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] coresight: etm4x: Skip setting LPOVERRIDE bit for qcom,skip-power-up
  2020-10-16 10:10 [PATCH] coresight: etm4x: Skip setting LPOVERRIDE bit for qcom,skip-power-up Sai Prakash Ranjan
@ 2020-10-16 11:21 ` Suzuki Poulose
  2020-10-16 11:47   ` Sai Prakash Ranjan
  2020-10-16 16:31 ` Mathieu Poirier
  1 sibling, 1 reply; 6+ messages in thread
From: Suzuki Poulose @ 2020-10-16 11:21 UTC (permalink / raw)
  To: Sai Prakash Ranjan, Mathieu Poirier, Mike Leach
  Cc: coresight, Stephen Boyd, denik, linux-arm-msm, linux-kernel,
	linux-arm-kernel

Hi Sai,

On 10/16/20 11:10 AM, Sai Prakash Ranjan wrote:
> There is a bug on the systems supporting to skip power up
> (qcom,skip-power-up) where setting LPOVERRIDE bit(low-power
> state override behaviour) will result in CPU hangs/lockups
> even on the implementations which supports it. So skip
> setting the LPOVERRIDE bit for such platforms.
> 
> Fixes: 02510a5aa78d ("coresight: etm4x: Add support to skip trace unit power up")
> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>

The fix is fine by me. Btw, is there a hardware Erratum assigned for
this ? It would be good to have the Erratum documented somewhere,
preferrably ( Documentation/arm64/silicon-errata.rst )

> ---
>   drivers/hwtracing/coresight/coresight-etm4x-core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
> index abd706b216ac..6096d7abf80d 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
> @@ -779,7 +779,7 @@ static void etm4_init_arch_data(void *info)
>   	 * LPOVERRIDE, bit[23] implementation supports
>   	 * low-power state override
>   	 */
> -	if (BMVAL(etmidr5, 23, 23))
> +	if (BMVAL(etmidr5, 23, 23) && (!drvdata->skip_power_up))
>   		drvdata->lpoverride = true;
>   	else
>   		drvdata->lpoverride = false;
> 
> base-commit: 3477326277451000bc667dfcc4fd0774c039184c
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] coresight: etm4x: Skip setting LPOVERRIDE bit for qcom,skip-power-up
  2020-10-16 11:21 ` Suzuki Poulose
@ 2020-10-16 11:47   ` Sai Prakash Ranjan
  2020-10-16 13:15     ` Suzuki Poulose
  0 siblings, 1 reply; 6+ messages in thread
From: Sai Prakash Ranjan @ 2020-10-16 11:47 UTC (permalink / raw)
  To: Suzuki Poulose
  Cc: Mathieu Poirier, Mike Leach, coresight, Stephen Boyd, denik,
	linux-arm-msm, linux-kernel, linux-arm-kernel

Hi Suzuki,

On 2020-10-16 16:51, Suzuki Poulose wrote:
> Hi Sai,
> 
> On 10/16/20 11:10 AM, Sai Prakash Ranjan wrote:
>> There is a bug on the systems supporting to skip power up
>> (qcom,skip-power-up) where setting LPOVERRIDE bit(low-power
>> state override behaviour) will result in CPU hangs/lockups
>> even on the implementations which supports it. So skip
>> setting the LPOVERRIDE bit for such platforms.
>> 
>> Fixes: 02510a5aa78d ("coresight: etm4x: Add support to skip trace unit 
>> power up")
>> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> 
> The fix is fine by me. Btw, is there a hardware Erratum assigned for
> this ? It would be good to have the Erratum documented somewhere,
> preferrably ( Documentation/arm64/silicon-errata.rst )
> 

No, afaik we don't have any erratum assigned to this bug.
It was already present in downstream kernel and since we
support these targets with the previous HW bug
(qcom,skip-power-up) now in upstream, we would need this
fix in upstream kernel as well.

Thanks,
Sai

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] coresight: etm4x: Skip setting LPOVERRIDE bit for qcom,skip-power-up
  2020-10-16 11:47   ` Sai Prakash Ranjan
@ 2020-10-16 13:15     ` Suzuki Poulose
  2020-10-16 13:40       ` Sai Prakash Ranjan
  0 siblings, 1 reply; 6+ messages in thread
From: Suzuki Poulose @ 2020-10-16 13:15 UTC (permalink / raw)
  To: Sai Prakash Ranjan
  Cc: Mathieu Poirier, Mike Leach, coresight, Stephen Boyd, denik,
	linux-arm-msm, linux-kernel, linux-arm-kernel

On 10/16/20 12:47 PM, Sai Prakash Ranjan wrote:
> Hi Suzuki,
> 
> On 2020-10-16 16:51, Suzuki Poulose wrote:
>> Hi Sai,
>>
>> On 10/16/20 11:10 AM, Sai Prakash Ranjan wrote:
>>> There is a bug on the systems supporting to skip power up
>>> (qcom,skip-power-up) where setting LPOVERRIDE bit(low-power
>>> state override behaviour) will result in CPU hangs/lockups
>>> even on the implementations which supports it. So skip
>>> setting the LPOVERRIDE bit for such platforms.
>>>
>>> Fixes: 02510a5aa78d ("coresight: etm4x: Add support to skip trace 
>>> unit power up")
>>> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
>>
>> The fix is fine by me. Btw, is there a hardware Erratum assigned for
>> this ? It would be good to have the Erratum documented somewhere,
>> preferrably ( Documentation/arm64/silicon-errata.rst )
>>
> 
> No, afaik we don't have any erratum assigned to this bug.

Ok. Please double check, if there are any.

> It was already present in downstream kernel and since we
> support these targets with the previous HW bug
> (qcom,skip-power-up) now in upstream, we would need this
> fix in upstream kernel as well.

I understand the need for the fix and we must fix it. I was
looking to document this in the central place for errata's
handled in the kernel. And I missed asking this question
when the original patch was posted. So, thought of asking
the question now anyways. Better late than never ;-)

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] coresight: etm4x: Skip setting LPOVERRIDE bit for qcom,skip-power-up
  2020-10-16 13:15     ` Suzuki Poulose
@ 2020-10-16 13:40       ` Sai Prakash Ranjan
  0 siblings, 0 replies; 6+ messages in thread
From: Sai Prakash Ranjan @ 2020-10-16 13:40 UTC (permalink / raw)
  To: Suzuki Poulose
  Cc: Mathieu Poirier, Mike Leach, coresight, Stephen Boyd, denik,
	linux-arm-msm, linux-kernel, linux-arm-kernel

Hi Suzuki,

On 2020-10-16 18:45, Suzuki Poulose wrote:
> On 10/16/20 12:47 PM, Sai Prakash Ranjan wrote:
>> Hi Suzuki,
>> 
>> On 2020-10-16 16:51, Suzuki Poulose wrote:
>>> Hi Sai,
>>> 
>>> On 10/16/20 11:10 AM, Sai Prakash Ranjan wrote:
>>>> There is a bug on the systems supporting to skip power up
>>>> (qcom,skip-power-up) where setting LPOVERRIDE bit(low-power
>>>> state override behaviour) will result in CPU hangs/lockups
>>>> even on the implementations which supports it. So skip
>>>> setting the LPOVERRIDE bit for such platforms.
>>>> 
>>>> Fixes: 02510a5aa78d ("coresight: etm4x: Add support to skip trace 
>>>> unit power up")
>>>> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
>>> 
>>> The fix is fine by me. Btw, is there a hardware Erratum assigned for
>>> this ? It would be good to have the Erratum documented somewhere,
>>> preferrably ( Documentation/arm64/silicon-errata.rst )
>>> 
>> 
>> No, afaik we don't have any erratum assigned to this bug.
> 
> Ok. Please double check, if there are any.
> 

Sure I will check again.

>> It was already present in downstream kernel and since we
>> support these targets with the previous HW bug
>> (qcom,skip-power-up) now in upstream, we would need this
>> fix in upstream kernel as well.
> 
> I understand the need for the fix and we must fix it. I was
> looking to document this in the central place for errata's
> handled in the kernel. And I missed asking this question
> when the original patch was posted. So, thought of asking
> the question now anyways. Better late than never ;-)
> 
> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>

Thanks. One more thing, does the internal erratum
number (if it exists) is good enough to be documented in
the Documentation/arm64/silicon-errata.rst ? I ask this
because outside qualcomm, it won't mean much right.

Thanks,
Sai

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] coresight: etm4x: Skip setting LPOVERRIDE bit for qcom,skip-power-up
  2020-10-16 10:10 [PATCH] coresight: etm4x: Skip setting LPOVERRIDE bit for qcom,skip-power-up Sai Prakash Ranjan
  2020-10-16 11:21 ` Suzuki Poulose
@ 2020-10-16 16:31 ` Mathieu Poirier
  1 sibling, 0 replies; 6+ messages in thread
From: Mathieu Poirier @ 2020-10-16 16:31 UTC (permalink / raw)
  To: Sai Prakash Ranjan
  Cc: Suzuki K Poulose, Mike Leach, coresight, Stephen Boyd, denik,
	linux-arm-msm, linux-kernel, linux-arm-kernel

On Fri, Oct 16, 2020 at 03:40:25PM +0530, Sai Prakash Ranjan wrote:
> There is a bug on the systems supporting to skip power up
> (qcom,skip-power-up) where setting LPOVERRIDE bit(low-power
> state override behaviour) will result in CPU hangs/lockups
> even on the implementations which supports it. So skip
> setting the LPOVERRIDE bit for such platforms.
> 
> Fixes: 02510a5aa78d ("coresight: etm4x: Add support to skip trace unit power up")
> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> ---
>  drivers/hwtracing/coresight/coresight-etm4x-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
> index abd706b216ac..6096d7abf80d 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
> @@ -779,7 +779,7 @@ static void etm4_init_arch_data(void *info)
>  	 * LPOVERRIDE, bit[23] implementation supports
>  	 * low-power state override
>  	 */
> -	if (BMVAL(etmidr5, 23, 23))
> +	if (BMVAL(etmidr5, 23, 23) && (!drvdata->skip_power_up))
>  		drvdata->lpoverride = true;
>  	else
>  		drvdata->lpoverride = false;
>

I have applied your patch.

Thanks,
Mathieu
 
> base-commit: 3477326277451000bc667dfcc4fd0774c039184c
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16 10:10 [PATCH] coresight: etm4x: Skip setting LPOVERRIDE bit for qcom,skip-power-up Sai Prakash Ranjan
2020-10-16 11:21 ` Suzuki Poulose
2020-10-16 11:47   ` Sai Prakash Ranjan
2020-10-16 13:15     ` Suzuki Poulose
2020-10-16 13:40       ` Sai Prakash Ranjan
2020-10-16 16:31 ` Mathieu Poirier

Linux-ARM-MSM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-msm/0 linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ https://lore.kernel.org/linux-arm-msm \
		linux-arm-msm@vger.kernel.org
	public-inbox-index linux-arm-msm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arm-msm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git