2020-11-25 02:00:24

by Maulik Shah

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Lina Iyer <[email protected]>
Signed-off-by: Maulik Shah <[email protected]>
---
drivers/soc/qcom/rpmh-rsc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
index 37969dc..0b082ec 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -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);
}
}

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


2020-12-03 21:20:20

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH] drivers: qcom: rpmh-rsc: Do not read back the register write on trigger

Hi,

On Thu, Dec 3, 2020 at 1:15 PM Doug Anderson <[email protected]> wrote:
>
> Hi,
>
> On Tue, Nov 24, 2020 at 1:53 AM Maulik Shah <[email protected]> wrote:
> >
> > 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.
> >
> > Signed-off-by: Lina Iyer <[email protected]>
> > Signed-off-by: Maulik Shah <[email protected]>
> > ---
> > 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")
> Signed-off-by: Douglas Anderson <[email protected]>

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

Reviewed-by: Douglas Anderson <[email protected]>

2020-12-03 21:20:20

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH] drivers: qcom: rpmh-rsc: Do not read back the register write on trigger

Hi,

On Tue, Nov 24, 2020 at 1:53 AM Maulik Shah <[email protected]> wrote:
>
> 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.
>
> Signed-off-by: Lina Iyer <[email protected]>
> Signed-off-by: Maulik Shah <[email protected]>
> ---
> 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")
Signed-off-by: Douglas Anderson <[email protected]>

2020-12-09 19:37:14

by Maulik Shah

[permalink] [raw]
Subject: Re: [PATCH] drivers: qcom: rpmh-rsc: Do not read back the register write on trigger

Hi Doug,

On 12/4/2020 2:47 AM, Doug Anderson wrote:
> Hi,
>
> On Thu, Dec 3, 2020 at 1:15 PM Doug Anderson <[email protected]> wrote:
>> Hi,
>>
>> On Tue, Nov 24, 2020 at 1:53 AM Maulik Shah <[email protected]> wrote:
>>> 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.
>>>
>>> Signed-off-by: Lina Iyer <[email protected]>
>>> Signed-off-by: Maulik Shah <[email protected]>
>>> ---
>>> 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")
>> Signed-off-by: Douglas Anderson <[email protected]>
> Ugh, brain-fart. Not Signed-off-by, but:
>
> Reviewed-by: Douglas Anderson <[email protected]>

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

Thanks,
Maulik

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