Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1226861 > unrolled thread
| Started by | Thierry Reding <thierry.reding@gmail.com> |
|---|---|
| First post | 2015-09-17 12:10 +0200 |
| Last post | 2015-09-19 18:50 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/3] ALSA: hda - Avoid potential deadlock Thierry Reding <thierry.reding@gmail.com> - 2015-09-17 12:10 +0200
[PATCH 1/3] ALSA: hda/hdmi - Add missing MODALIAS information Thierry Reding <thierry.reding@gmail.com> - 2015-09-17 12:10 +0200
Re: [PATCH 0/3] ALSA: hda - Avoid potential deadlock Takashi Iwai <tiwai@suse.de> - 2015-09-19 18:50 +0200
| From | Thierry Reding <thierry.reding@gmail.com> |
|---|---|
| Date | 2015-09-17 12:10 +0200 |
| Subject | [PATCH 0/3] ALSA: hda - Avoid potential deadlock |
| Message-ID | <q9EiC-kL-17@gated-at.bofh.it> |
From: Thierry Reding <treding@nvidia.com>
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(-)
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Thierry Reding <thierry.reding@gmail.com> |
|---|---|
| Date | 2015-09-17 12:10 +0200 |
| Subject | [PATCH 1/3] ALSA: hda/hdmi - Add missing MODALIAS information |
| Message-ID | <q9EiE-kL-55@gated-at.bofh.it> |
| In reply to | #1226861 |
From: Thierry Reding <treding@nvidia.com>
Add MODALIAS definitions for the Tegra30 HDMI, Tegra114 HDMI and
Tegra210 HDMI/DP codecs. The preset match table already contains
corresponding entries, but the MODALIAS list wasn't updated.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
sound/pci/hda/patch_hdmi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index acbfbe087ee8..70f7d873e65e 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -3585,7 +3585,10 @@ MODULE_ALIAS("snd-hda-codec-id:10de0019");
MODULE_ALIAS("snd-hda-codec-id:10de001a");
MODULE_ALIAS("snd-hda-codec-id:10de001b");
MODULE_ALIAS("snd-hda-codec-id:10de001c");
+MODULE_ALIAS("snd-hda-codec-id:10de0020");
+MODULE_ALIAS("snd-hda-codec-id:10de0022");
MODULE_ALIAS("snd-hda-codec-id:10de0028");
+MODULE_ALIAS("snd-hda-codec-id:10de0029");
MODULE_ALIAS("snd-hda-codec-id:10de0040");
MODULE_ALIAS("snd-hda-codec-id:10de0041");
MODULE_ALIAS("snd-hda-codec-id:10de0042");
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Takashi Iwai <tiwai@suse.de> |
|---|---|
| Date | 2015-09-19 18:50 +0200 |
| Message-ID | <qatuN-6ZZ-13@gated-at.bofh.it> |
| In reply to | #1226861 |
On Thu, 17 Sep 2015 12:00:03 +0200,
Thierry Reding wrote:
>
> From: Thierry Reding <treding@nvidia.com>
>
> 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.
This looks like a sane cleanup at a glance, but I can't review in
details now because I'm traveling on vacation. I'll take a closer
look in the next week.
thanks,
Takashi
>
> 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(-)
>
> --
> 2.5.0
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web