mbox series

[0/3] thermal/drivers/mediatek/lvts_thermal: Fixes to the interrupt handling

Message ID 20230428195347.3832687-1-nfraprado@collabora.com (mailing list archive)
Headers show
Series thermal/drivers/mediatek/lvts_thermal: Fixes to the interrupt handling | expand

Message

Nícolas F. R. A. Prado April 28, 2023, 7:53 p.m. UTC
Fixes in the interrupt handling of the LVTS thermal driver noticed while
testing it on the Spherion Chromebook (mt8192-asurada-spherion) with the
MT8192 support series [1].

These are standalone fixes and don't depend on anything else.

[1] https://lore.kernel.org/all/20230307163413.143334-1-bchihi@baylibre.com/

Thanks,
Nícolas


Nícolas F. R. A. Prado (3):
  thermal/drivers/mediatek/lvts_thermal: Handle IRQ on all controllers
  thermal/drivers/mediatek/lvts_thermal: Honor sensors in immediate mode
  thermal/drivers/mediatek/lvts_thermal: Disable undesired interrupts

 drivers/thermal/mediatek/lvts_thermal.c | 54 +++++++++++++------------
 1 file changed, 28 insertions(+), 26 deletions(-)

Comments

Chen-Yu Tsai May 2, 2023, 10:33 a.m. UTC | #1
On Fri, Apr 28, 2023 at 03:53:44PM -0400, Nícolas F. R. A. Prado wrote:
> 
> Fixes in the interrupt handling of the LVTS thermal driver noticed while
> testing it on the Spherion Chromebook (mt8192-asurada-spherion) with the
> MT8192 support series [1].
> 
> These are standalone fixes and don't depend on anything else.
> 
> [1] https://lore.kernel.org/all/20230307163413.143334-1-bchihi@baylibre.com/
> 
> Thanks,
> Nícolas
> 
> 
> Nícolas F. R. A. Prado (3):
>   thermal/drivers/mediatek/lvts_thermal: Handle IRQ on all controllers
>   thermal/drivers/mediatek/lvts_thermal: Honor sensors in immediate mode
>   thermal/drivers/mediatek/lvts_thermal: Disable undesired interrupts

This series seems to have solved all interrupt storm issue I ran into, so

Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Daniel Lezcano May 30, 2023, 12:27 p.m. UTC | #2
Hi,

On 02/05/2023 12:33, Chen-Yu Tsai wrote:
> On Fri, Apr 28, 2023 at 03:53:44PM -0400, Nícolas F. R. A. Prado wrote:
>>
>> Fixes in the interrupt handling of the LVTS thermal driver noticed while
>> testing it on the Spherion Chromebook (mt8192-asurada-spherion) with the
>> MT8192 support series [1].
>>
>> These are standalone fixes and don't depend on anything else.
>>
>> [1] https://lore.kernel.org/all/20230307163413.143334-1-bchihi@baylibre.com/
>>
>> Thanks,
>> Nícolas
>>
>>
>> Nícolas F. R. A. Prado (3):
>>    thermal/drivers/mediatek/lvts_thermal: Handle IRQ on all controllers
>>    thermal/drivers/mediatek/lvts_thermal: Honor sensors in immediate mode
>>    thermal/drivers/mediatek/lvts_thermal: Disable undesired interrupts
> 
> This series seems to have solved all interrupt storm issue I ran into, so
> 
> Tested-by: Chen-Yu Tsai <wenst@chromium.org>

I gave a try on a mt8195 board and I don't see any interrupt firing when 
crossing the temperature thresholds.

Did I miss something ?
Nícolas F. R. A. Prado May 30, 2023, 7:46 p.m. UTC | #3
On Tue, May 30, 2023 at 02:27:36PM +0200, Daniel Lezcano wrote:
> 
> Hi,
> 
> On 02/05/2023 12:33, Chen-Yu Tsai wrote:
> > On Fri, Apr 28, 2023 at 03:53:44PM -0400, Nícolas F. R. A. Prado wrote:
> > > 
> > > Fixes in the interrupt handling of the LVTS thermal driver noticed while
> > > testing it on the Spherion Chromebook (mt8192-asurada-spherion) with the
> > > MT8192 support series [1].
> > > 
> > > These are standalone fixes and don't depend on anything else.
> > > 
> > > [1] https://lore.kernel.org/all/20230307163413.143334-1-bchihi@baylibre.com/
> > > 
> > > Thanks,
> > > Nícolas
> > > 
> > > 
> > > Nícolas F. R. A. Prado (3):
> > >    thermal/drivers/mediatek/lvts_thermal: Handle IRQ on all controllers
> > >    thermal/drivers/mediatek/lvts_thermal: Honor sensors in immediate mode
> > >    thermal/drivers/mediatek/lvts_thermal: Disable undesired interrupts
> > 
> > This series seems to have solved all interrupt storm issue I ran into, so
> > 
> > Tested-by: Chen-Yu Tsai <wenst@chromium.org>
> 
> I gave a try on a mt8195 board and I don't see any interrupt firing when
> crossing the temperature thresholds.
> 
> Did I miss something ?

No, indeed interrupts seem to be completely disabled on mt8195, even after
setting the controllers to filtered mode (a requirement to get interrupts). I
haven't investigated that further yet. This series was validated on mt8192,
which did have working interrupts, but they were being triggered too often.

Also note that I've sent a v2 with even more fixes:
https://lore.kernel.org/all/20230504004852.627049-1-nfraprado@collabora.com/

Thanks,
Nícolas
Daniel Lezcano June 2, 2023, 8:07 a.m. UTC | #4
On 30/05/2023 21:46, Nícolas F. R. A. Prado wrote:
> On Tue, May 30, 2023 at 02:27:36PM +0200, Daniel Lezcano wrote:
>>
>> Hi,
>>
>> On 02/05/2023 12:33, Chen-Yu Tsai wrote:
>>> On Fri, Apr 28, 2023 at 03:53:44PM -0400, Nícolas F. R. A. Prado wrote:
>>>>
>>>> Fixes in the interrupt handling of the LVTS thermal driver noticed while
>>>> testing it on the Spherion Chromebook (mt8192-asurada-spherion) with the
>>>> MT8192 support series [1].
>>>>
>>>> These are standalone fixes and don't depend on anything else.
>>>>
>>>> [1] https://lore.kernel.org/all/20230307163413.143334-1-bchihi@baylibre.com/
>>>>
>>>> Thanks,
>>>> Nícolas
>>>>
>>>>
>>>> Nícolas F. R. A. Prado (3):
>>>>     thermal/drivers/mediatek/lvts_thermal: Handle IRQ on all controllers
>>>>     thermal/drivers/mediatek/lvts_thermal: Honor sensors in immediate mode
>>>>     thermal/drivers/mediatek/lvts_thermal: Disable undesired interrupts
>>>
>>> This series seems to have solved all interrupt storm issue I ran into, so
>>>
>>> Tested-by: Chen-Yu Tsai <wenst@chromium.org>
>>
>> I gave a try on a mt8195 board and I don't see any interrupt firing when
>> crossing the temperature thresholds.
>>
>> Did I miss something ?
> 
> No, indeed interrupts seem to be completely disabled on mt8195, even after
> setting the controllers to filtered mode (a requirement to get interrupts).

Really? interrupts work only on filtered mode? That sounds strange

What board are you using for testing?

> I
> haven't investigated that further yet. This series was validated on mt8192,
> which did have working interrupts, but they were being triggered too often.

Ok.

> Also note that I've sent a v2 with even more fixes:
> https://lore.kernel.org/all/20230504004852.627049-1-nfraprado@collabora.com/

Yes, I'm reviewing it closely
Nícolas F. R. A. Prado June 2, 2023, 1:22 p.m. UTC | #5
On Fri, Jun 02, 2023 at 10:07:29AM +0200, Daniel Lezcano wrote:
> On 30/05/2023 21:46, Nícolas F. R. A. Prado wrote:
> > On Tue, May 30, 2023 at 02:27:36PM +0200, Daniel Lezcano wrote:
> > > 
> > > Hi,
> > > 
> > > On 02/05/2023 12:33, Chen-Yu Tsai wrote:
> > > > On Fri, Apr 28, 2023 at 03:53:44PM -0400, Nícolas F. R. A. Prado wrote:
> > > > > 
> > > > > Fixes in the interrupt handling of the LVTS thermal driver noticed while
> > > > > testing it on the Spherion Chromebook (mt8192-asurada-spherion) with the
> > > > > MT8192 support series [1].
> > > > > 
> > > > > These are standalone fixes and don't depend on anything else.
> > > > > 
> > > > > [1] https://lore.kernel.org/all/20230307163413.143334-1-bchihi@baylibre.com/
> > > > > 
> > > > > Thanks,
> > > > > Nícolas
> > > > > 
> > > > > 
> > > > > Nícolas F. R. A. Prado (3):
> > > > >     thermal/drivers/mediatek/lvts_thermal: Handle IRQ on all controllers
> > > > >     thermal/drivers/mediatek/lvts_thermal: Honor sensors in immediate mode
> > > > >     thermal/drivers/mediatek/lvts_thermal: Disable undesired interrupts
> > > > 
> > > > This series seems to have solved all interrupt storm issue I ran into, so
> > > > 
> > > > Tested-by: Chen-Yu Tsai <wenst@chromium.org>
> > > 
> > > I gave a try on a mt8195 board and I don't see any interrupt firing when
> > > crossing the temperature thresholds.
> > > 
> > > Did I miss something ?
> > 
> > No, indeed interrupts seem to be completely disabled on mt8195, even after
> > setting the controllers to filtered mode (a requirement to get interrupts).
> 
> Really? interrupts work only on filtered mode? That sounds strange

Sorry my reply was confusing, let me clarify. What I meant to say is that
the threshold interrupts (cold, hot2normal, hot, low offset, high offset) only
trigger in filtered mode. AFAICT that's by design, since immediate mode is meant
only for one-off temperature readings, and filtered mode is the one meant to be
used for temperature monitoring. But in immediate mode you could still get the
data ready for immediate mode (bits 16, 17, 18, 27) interrupts triggering.
Though note that I have disabled those in my series, since they are triggered
constantly.

> 
> What board are you using for testing?

I'm testing on the Acer Chromebook 514 (mt8192-asurada-spherion-r0). And noticed
the interrupts aren't triggered on Acer Chromebook Spin 513
(mt8195-cherry-tomato-r2).

> 
> > I
> > haven't investigated that further yet. This series was validated on mt8192,
> > which did have working interrupts, but they were being triggered too often.
> 
> Ok.
> 
> > Also note that I've sent a v2 with even more fixes:
> > https://lore.kernel.org/all/20230504004852.627049-1-nfraprado@collabora.com/
> 
> Yes, I'm reviewing it closely

Thanks!

Nícolas