From: Takashi Iwai <tiwai-l3A5Bk7waGM@public.gmane.org>
To: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
Kevin Hilman <khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Tyler Baker <tyler.baker-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 0/3] ALSA: hda - Avoid potential deadlock
Date: Sat, 19 Sep 2015 18:42:25 +0200 [thread overview]
Message-ID: <s5hwpvmxswe.wl-tiwai@suse.de> (raw)
In-Reply-To: <1442484006-9614-1-git-send-email-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Thu, 17 Sep 2015 12:00:03 +0200,
Thierry Reding wrote:
>
> From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> 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
>
>
next prev parent reply other threads:[~2015-09-19 16:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-17 10:00 [PATCH 0/3] ALSA: hda - Avoid potential deadlock Thierry Reding
2015-09-17 10:00 ` [PATCH 1/3] ALSA: hda/hdmi - Add missing MODALIAS information Thierry Reding
2015-09-17 10:00 ` [PATCH 2/3] ALSA: hda - Advertise MODALIAS in uevent Thierry Reding
2015-09-17 10:00 ` [PATCH 3/3] ALSA: hda: Do not rely on explicit module loading Thierry Reding
[not found] ` <1442484006-9614-1-git-send-email-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-19 16:42 ` Takashi Iwai [this message]
2015-09-23 9:03 ` [PATCH 0/3] ALSA: hda - Avoid potential deadlock Takashi Iwai
[not found] ` <s5hfv258q33.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2015-09-24 9:49 ` Takashi Iwai
[not found] ` <s5hio705epm.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2015-09-24 10:50 ` Thierry Reding
2015-09-24 11:49 ` Takashi Iwai
2015-09-23 18:01 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hwpvmxswe.wl-tiwai@suse.de \
--to=tiwai-l3a5bk7wagm@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tyler.baker-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).