[alsa-devel] [PATCH] ALSA: hda - Handle pm failure during hotplug

Takashi Iwai tiwai at suse.de
Wed Jun 27 23:57:28 CEST 2018


On Wed, 27 Jun 2018 08:30:37 +0200,
Takashi Iwai wrote:
> 
> On Wed, 27 Jun 2018 08:25:32 +0200,
> Chris Wilson wrote:
> > 
> > Obtaining the runtime pm wakeref can fail, especially in a hotplug
> > scenario where i915.ko has been unloaded. If we do not catch the
> > failure, we end up with an unbalanced pm.
> > 
> > References: 222bde03881c ("ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug")
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > Cc: Takashi Iwai <tiwai at suse.de>
> > Cc: Vinod Koul <vinod.koul at intel.com>
> 
> Thanks, applied with Cc to stable.

After the disaster (not about football game but of my further fix
patch), I revisited this change, and found that it's also buggy.

When pm_runtime_get_sync() returns an error, it doesn't decrement the
refcount.  That is, you'd need to call pm_runtime_put_noidle() or
whatever after getting the error.

And, pm_runtime_get_sync() returns 1, not only a negative error.
So, non-zero check is anyway incorrect.

Due to these reasons, I nuked the commit again.

For the HDMI error without i915 binding, I'll resubmit the proper
patch to disable HDMI codec after i915 component bind failure, as an
alternative workaround.  The previous patch didn't work as expected.


thanks,

Takashi


More information about the Alsa-devel mailing list