mbox series

[0/2] soundwire: improve pm_runtime handling

Message ID 20230803065220.3823269-1-yung-chuan.liao@linux.intel.com
Headers show
Series soundwire: improve pm_runtime handling | expand

Message

Liao, Bard Aug. 3, 2023, 6:52 a.m. UTC
This patchset improves the pm_runtime behavior in rare corner cases
identified by the Intel CI in the last 6 months.

a) in stress-tests, it's not uncommon to see the following type of
warnings when the codec reports as ATTACHED

    "rt711 sdw:0:025d:0711:00: runtime PM trying to activate child device
    sdw:0:025d:0711:00 but parent (sdw-master-0) is not active"

This warning was not correlated with any functional issue, but it
exposed a design issue on when to enable pm_runtime. The recommended
practice in the pm_runtime documentation is to keep the devices in
'suspended' mode and mark them as 'active' when they are really
functional.

Pierre-Louis Bossart (2):
  soundwire: intel_auxdevice: enable pm_runtime earlier on startup
  soundWire: intel_auxdevice: resume 'sdw-master' on startup and system
    resume

 drivers/soundwire/intel_auxdevice.c | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

Comments

Charles Keepax Aug. 4, 2023, 9:44 a.m. UTC | #1
On Thu, Aug 03, 2023 at 02:52:19PM +0800, Bard Liao wrote:
> From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> 
> As soon as the bus starts, physical peripheral devices may report as
> ATTACHED and set their status with pm_runtime_set_active() in their
> update_status()/io_init().
> 
> This is problematic with the existing code, since the parent
> pm_runtime status is changed to "active" after starting the bus. This
> creates a time window where the pm_runtime framework can report an
> issue, e.g.
> 
> "rt711 sdw:0:025d:0711:00: runtime PM trying to activate child device
> sdw:0:025d:0711:00 but parent (sdw-master-0) is not active"
> 
> This patch enables runtime_pm earlier to make sure the auxiliary
> device is pm_runtime active after powering-up, but before starting the
> bus.
> 
> This problem was exposed by recent changes in the timing of the bus
> reset, but was present in this driver since we introduced pm_runtime
> support.
> 
> Closes: https://github.com/thesofproject/linux/issues/4328
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> Reviewed-by: Rander Wang <rander.wang@intel.com>
> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> ---

Doesn't seem to cause any problems on my SoundWire devices, so
very loosely:

Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles