Skip to contentSkip to conversation

coresight: etm4x: Skip setting LPOVERRIDE bit for qcom,skip-power-up

PATCH Applied Sai Prakash Ranjan 4 participants 7 messages Oct 16, 2020 – Dec 29, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coresight: etm4x: Skip setting LPOVERRIDE bit for qcom,skip-power-up

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")
---
 drivers/hwtracing/coresight/coresight-etm4x-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-etm4x-core.c +1 -1
index abd706b216ac..6096d7abf80d 100644
@@ -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

Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
maintainer
#1 lore raw

Hi Sai,

Quoted 8 lines · 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")

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 )

Quoted 20 lines
---
  drivers/hwtracing/coresight/coresight-etm4x-core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-etm4x-core.c +1 -1
index abd706b216ac..6096d7abf80d 100644
@@ -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

#2 lore raw

Hi Suzuki,

Quoted 9 lines · Suzuki Poulose

Hi Sai,

Quoted 6 lines · 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.

Quoted 7 lines
Quoted 2 lines
Fixes 02510a5aa78d ("coresight: etm4x: Add support to skip trace unit power up")

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

Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
maintainer Reviewed-by
#3 lore raw
Quoted 15 lines · Sai Prakash Ranjan

Hi Suzuki,

Quoted 12 lines · Suzuki Poulose

Hi Sai,

Quoted 8 lines · 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")
Quoted 6 lines
Quoted 4 lines

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.

Quoted 4 lines

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 ;-)

#4 lore raw

Hi Suzuki,

Quoted 16 lines · Suzuki Poulose
Quoted 15 lines · Sai Prakash Ranjan

Hi Suzuki,

Quoted 12 lines · Suzuki Poulose

Hi Sai,

Quoted 8 lines · 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")
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

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.

Quoted 5 lines
Quoted 4 lines

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.

Quoted 7 lines

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 ;-)

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

Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
#5 lore raw
In reply to Sai Prakash Ranjan
Quoted 18 lines · 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")
---
 drivers/hwtracing/coresight/coresight-etm4x-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-etm4x-core.c +0 -0
index abd706b216ac..6096d7abf80d 100644

drivers/hwtracing/coresight/coresight-etm4x-core.c static void etm4_init_arch_data(void *info) · line 785

Quoted 8 lines
drivers/hwtracing/coresight/coresight-etm4x-core.c +1 -1
@@ -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

Quoted 5 lines

base-commit: 3477326277451000bc667dfcc4fd0774c039184c

Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
#6 lore raw
In reply to Sai Prakash Ranjan
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 10 lines · On Fri, 16 Oct 2020 15:40:25 +0530 you 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")

[...]

Here is the summary with links:
- coresight: etm4x: Skip setting LPOVERRIDE bit for qcom,skip-power-up

    https://git.kernel.org/qcom/c/ac0f82b1b495

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html