2019-12-12 10:50:06

by Amit Kucheria

[permalink] [raw]
Subject: [PATCH v2] drivers: thermal: tsens: Work with old DTBs

In order for the old DTBs to continue working, the new interrupt code
must not return an error if interrupts are not defined. Don't return an
error in case of -ENXIO.

Fixes: 634e11d5b450a ("drivers: thermal: tsens: Add interrupt support")
Suggested-by: Stephan Gerhold <[email protected]>
Signed-off-by: Amit Kucheria <[email protected]>
---
drivers/thermal/qcom/tsens.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 015e7d2015985..0e7cf52369326 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -110,6 +110,9 @@ static int tsens_register(struct tsens_priv *priv)
irq = platform_get_irq_byname(pdev, "uplow");
if (irq < 0) {
ret = irq;
+ /* For old DTs with no IRQ defined */
+ if (irq == -ENXIO)
+ ret = 0;
goto err_put_device;
}

--
2.20.1


2019-12-13 00:06:49

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v2] drivers: thermal: tsens: Work with old DTBs

On Thu 12 Dec 02:38 PST 2019, Amit Kucheria wrote:

> In order for the old DTBs to continue working, the new interrupt code
> must not return an error if interrupts are not defined. Don't return an
> error in case of -ENXIO.
>
> Fixes: 634e11d5b450a ("drivers: thermal: tsens: Add interrupt support")
> Suggested-by: Stephan Gerhold <[email protected]>
> Signed-off-by: Amit Kucheria <[email protected]>

Reviewed-by: Bjorn Andersson <[email protected]>
Tested-by: Bjorn Andersson <[email protected]>

> ---
> drivers/thermal/qcom/tsens.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
> index 015e7d2015985..0e7cf52369326 100644
> --- a/drivers/thermal/qcom/tsens.c
> +++ b/drivers/thermal/qcom/tsens.c
> @@ -110,6 +110,9 @@ static int tsens_register(struct tsens_priv *priv)
> irq = platform_get_irq_byname(pdev, "uplow");
> if (irq < 0) {
> ret = irq;
> + /* For old DTs with no IRQ defined */
> + if (irq == -ENXIO)
> + ret = 0;
> goto err_put_device;
> }
>
> --
> 2.20.1
>

2020-01-01 21:17:05

by Amit Kucheria

[permalink] [raw]
Subject: Re: [PATCH v2] drivers: thermal: tsens: Work with old DTBs

On Mon, Dec 16, 2019 at 2:58 PM Daniel Lezcano
<[email protected]> wrote:
>
> On 12/12/2019 11:38, Amit Kucheria wrote:
> > In order for the old DTBs to continue working, the new interrupt code
> > must not return an error if interrupts are not defined. Don't return an
> > error in case of -ENXIO.
> >
> > Fixes: 634e11d5b450a ("drivers: thermal: tsens: Add interrupt support")
> > Suggested-by: Stephan Gerhold <[email protected]>
> > Signed-off-by: Amit Kucheria <[email protected]>
>
> Applied.

Hi Daniel,

I haven't seen this fix until -rc4. Do you plan to send it?

Regards,
Amit

2020-01-01 21:45:22

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH v2] drivers: thermal: tsens: Work with old DTBs

On 01/01/2020 22:15, Amit Kucheria wrote:
> On Mon, Dec 16, 2019 at 2:58 PM Daniel Lezcano
> <[email protected]> wrote:
>>
>> On 12/12/2019 11:38, Amit Kucheria wrote:
>>> In order for the old DTBs to continue working, the new interrupt code
>>> must not return an error if interrupts are not defined. Don't return an
>>> error in case of -ENXIO.
>>>
>>> Fixes: 634e11d5b450a ("drivers: thermal: tsens: Add interrupt support")
>>> Suggested-by: Stephan Gerhold <[email protected]>
>>> Signed-off-by: Amit Kucheria <[email protected]>
>>
>> Applied.
>
> Hi Daniel,
>
> I haven't seen this fix until -rc4. Do you plan to send it?

Hi Amit,

right, I've put it in the thermal/linux-next branch. I'll move it to
thermal/fixes and send a PR tomorrow.




--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

2020-01-01 22:04:24

by Amit Kucheria

[permalink] [raw]
Subject: Re: [PATCH v2] drivers: thermal: tsens: Work with old DTBs

On Thu, Jan 2, 2020 at 3:14 AM Daniel Lezcano <[email protected]> wrote:
>
> On 01/01/2020 22:15, Amit Kucheria wrote:
> > On Mon, Dec 16, 2019 at 2:58 PM Daniel Lezcano
> > <[email protected]> wrote:
> >>
> >> On 12/12/2019 11:38, Amit Kucheria wrote:
> >>> In order for the old DTBs to continue working, the new interrupt code
> >>> must not return an error if interrupts are not defined. Don't return an
> >>> error in case of -ENXIO.
> >>>
> >>> Fixes: 634e11d5b450a ("drivers: thermal: tsens: Add interrupt support")
> >>> Suggested-by: Stephan Gerhold <[email protected]>
> >>> Signed-off-by: Amit Kucheria <[email protected]>
> >>
> >> Applied.
> >
> > Hi Daniel,
> >
> > I haven't seen this fix until -rc4. Do you plan to send it?
>
> Hi Amit,
>
> right, I've put it in the thermal/linux-next branch. I'll move it to
> thermal/fixes and send a PR tomorrow.

Thanks.