Re: [PATCH v1] soundwire: intel_auxdevice: Fix system suspend/resume handling

Liao, Bard
2025-05-07T08:51:41Z

On 4/26/2025 1:12 AM, Pierre-Louis Bossart wrote:
> On 4/24/25 20:13, Rafael J. Wysocki wrote:
>> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>
>> The code in intel_suspend() and intel_resume() needs to be properly
>> synchronized with runtime PM which is not the case currently, so fix
>> it.
>>
>> First of all, prevent runtime PM from triggering after intel_suspend()
>> has started because the changes made by it to the device might be
>> undone by a runtime resume of the device. For this purpose, add a
>> pm_runtime_disable() call to intel_suspend().
>
> Allow me to push back on this, because we have to be very careful with a hidden state transition that needs to happen.
>
> If a controller was suspended by pm_runtime, it will enter the clock stop mode.
>
> If the system needs to suspend, the controller has to be forced to exit the clock stop mode and the bus has to restart before we can suspend it, and that's why we had those pm_runtime_resume().
>
> Disabling pm_runtime when entering system suspend would be problematic for Intel hardware, it's a known can of worms.
>
> It's quite possible that some of the code in intel_suspend() is no longer required because the .prepare will resume the bus properly, but I wanted to make sure this state transition out of clock-stop is known and taken into consideration.
>
> Bard, is this a configuration you've tested?

Sorry for the late reply. Yes, I tested jack detection in runtime
suspended. Also, the CI test is passed.