Skip to contentSkip to conversation

drivers: qcom: rpmh-rsc: Do not read back the register write on trigger

PATCH Superseded Maulik Shah 2 participants 4 messages Nov 24, 2020 – Dec 9, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: qcom: rpmh-rsc: Do not read back the register write on trigger

From: Lina Iyer <[email protected]>

When triggering a TCS to send its contents, reading back the trigger value may return an incorrect value. That is because, writing the trigger may raise an interrupt which could be handled immediately and the trigger value could be reset in the interrupt handler.

A write_tcs_reg_sync() would read back the value that is written and try to match it to the value written to ensure that the value is written, but if that value is different, we may see false error for same.

---
 drivers/soc/qcom/rpmh-rsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/rpmh-rsc.c +1 -1
index 37969dc..0b082ec 100644
@@ -364,7 +364,7 @@ static void __tcs_set_trigger(struct rsc_drv *drv, int tcs_id, bool trigger)
 		enable = TCS_AMC_MODE_ENABLE;
 		write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable);
 		enable |= TCS_AMC_MODE_TRIGGER;
-		write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable);
+		write_tcs_reg(drv, RSC_DRV_CONTROL, tcs_id, enable);
 	}
 }
 
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
#1 lore raw

Hi,

Quoted 12 lines · Maulik Shah

From: Lina Iyer <[email protected]>

When triggering a TCS to send its contents, reading back the trigger value may return an incorrect value. That is because, writing the trigger may raise an interrupt which could be handled immediately and the trigger value could be reset in the interrupt handler.

A write_tcs_reg_sync() would read back the value that is written and try to match it to the value written to ensure that the value is written, but if that value is different, we may see false error for same.

Quoted 5 lines
---
 drivers/soc/qcom/rpmh-rsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Fixes 658628e7ef78 ("drivers: qcom: rpmh-rsc: add RPMH controller for

QCOM SoCs")

Reviewed-by
#2 lore raw

Hi,

Quoted 22 lines · Doug Anderson

Hi,

Quoted 12 lines · Maulik Shah

From: Lina Iyer <[email protected]>

When triggering a TCS to send its contents, reading back the trigger value may return an incorrect value. That is because, writing the trigger may raise an interrupt which could be handled immediately and the trigger value could be reset in the interrupt handler.

A write_tcs_reg_sync() would read back the value that is written and try to match it to the value written to ensure that the value is written, but if that value is different, we may see false error for same.

Quoted 5 lines
---
 drivers/soc/qcom/rpmh-rsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 3 lines
Fixes 658628e7ef78 ("drivers: qcom: rpmh-rsc: add RPMH controller for

QCOM SoCs")

Ugh, brain-fart. Not Signed-off-by, but:

#3 lore raw

Hi Doug,

Quoted 22 lines · Doug Anderson

Hi,

Quoted 19 lines · Doug Anderson

Hi,

Quoted 16 lines · Maulik Shah

From: Lina Iyer <[email protected]>

When triggering a TCS to send its contents, reading back the trigger value may return an incorrect value. That is because, writing the trigger may raise an interrupt which could be handled immediately and the trigger value could be reset in the interrupt handler.

A write_tcs_reg_sync() would read back the value that is written and try to match it to the value written to ensure that the value is written, but if that value is different, we may see false error for same.

---
  drivers/soc/qcom/rpmh-rsc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 6 lines
Quoted 3 lines
Fixes 658628e7ef78 ("drivers: qcom: rpmh-rsc: add RPMH controller for

QCOM SoCs")

Ugh, brain-fart. Not Signed-off-by, but:

Thanks for the review, i will send v2 adding Fixes: tag.

Thanks,
Maulik

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