Skip to content

ALSA: hda - Avoid potential deadlock

Thierry Reding alsa-devel linux-arm-kernel linux-tegra lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ALSA: hda/hdmi - Add missing MODALIAS informationsound/pci/hda/patch_hdmi.c+3 -00 replies
2/3ALSA: hda - Advertise MODALIAS in ueventsound/hda/hda_bus_type.c+12 -00 replies
3/3ALSA: hda: Do not rely on explicit module loadingsound/pci/hda/hda_bind.c+0 -800 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by.

PatchKevin HilmanThierry Reding
SeriesT-b T-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] ALSA: hda - Avoid potential deadlock

From: Thierry Reding <[email protected]>

The Tegra HDA controller driver committed in v3.16 causes deadlocks when loaded as a module. The reason is that the driver core will lock the HDA controller device upon calling its probe callback and the probe callback then goes on to create child devices for detected codecs and loads their modules via a request_module() call. This is problematic because the new driver will immediately be bound to the device, which will in turn cause the parent of the codec device (the HDA controller device) to be locked again, causing a deadlock.

This problem seems to have been present since the modularization of the HD-audio driver in commit 1289e9e8b42f ("ALSA: hda - Modularize HD-audio driver"). On Intel platforms this has been worked around by splitting up the probe sequence into a synchronous and an asynchronous part where the request_module() calls are asynchronous and hence avoid the deadlock.

An alternative proposal is provided in this series of patches. Rather than relying on explicit request_module() calls to load kernel modules for HDA codec drivers, this implements a uevent callback for the HDA bus to advertises the MODALIAS information to the userspace helper.

Effectively this results in the same modules being loaded, but it uses the more canonical infrastructure to perform this. Deferring the module loading to userspace removes the need for the explicit request_module() calls and works around the recursive locking issue because both drivers will be bound from separate contexts.

Thierry

Thierry Reding (3):
ALSA: hda/hdmi - Add missing MODALIAS information
ALSA: hda - Advertise MODALIAS in uevent
ALSA: hda: Do not rely on explicit module loading

 sound/hda/hda_bus_type.c   | 12 +++++++
 sound/pci/hda/hda_bind.c   | 80 ----------------------------------------------
 sound/pci/hda/patch_hdmi.c |  3 ++
 3 files changed, 15 insertions(+), 80 deletions(-)
Signature · 1 line
2.5.0