Re: [RFC PATCH v7] platform/x86: panasonic-laptop: add fan speed mode for newer models

Alex Yeo <[email protected]> Wed, 29 Jul 2026 10:08:32 +0800
Newsgroups org.kernel.vger.platform-driver-x86,org.kernel.vger.linux-hwmon,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 2026/07/22 8:00 AM, Guenter Roeck wrote:
> 
> I for my part would like to understand why hwmon_lock() / hwmon_unlock()
> (or the hwmon_lock guard) are not sufficient. You suggest above that they
> are not sufficient and that you need the additional pwm_fan_lock, but you
> don't really explain the reason. You do explain that you need to lock the
> thermal access functions, and I agree, but you do not explain why the hwmon
> subsystem lock functions can not be used. It would be important to
> understand why that is the case because those functions exist for exactly
> that purpose. If they are insufficient, it is important to understand why
> that is the case.
> 
> Thanks,
> Guenter
> 

I have reworked the code to use hwmon_lock() via guard. I have tested 
the code on my machine and it works as expected. As a result, hwmon is 
now the primary owner of the fan.

I will submit a v8 patch with more details.

Thanks