Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Wang Xingchao <xingchao.wang@linux.intel.com>
Cc: alsa-devel@alsa-project.org, jocelyn.li@intel.com,
	mengdong.lin@intel.com, intel-gfx@lists.freedesktop.org,
	liam.r.girdwood@intel.com, david.henningsson@canonical.com
Subject: Re: [PATCH 4/4 V2] ALSA: hda - Continue probe in work context to avoid request_module deadlock
Date: Thu, 23 May 2013 08:49:20 +0200	[thread overview]
Message-ID: <s5hip2a8a33.wl%tiwai@suse.de> (raw)
In-Reply-To: <1369273867-2067-1-git-send-email-xingchao.wang@linux.intel.com>

At Thu, 23 May 2013 09:51:07 +0800,
Wang Xingchao wrote:
> 
> There's deadlock when request_module(i915) in azx_probe.
> It looks like:
> device_lock(audio pci device) -> azx_probe -> module_request
> (or symbol_request) -> modprobe (userspace) -> i915 init ->
> drm_pci_init -> pci_register_driver -> bus_add_driver -> driver_attach ->
> which in turn tries all locks on pci bus, and when it tries the one on the
> audio device, it will deadlock.
> 
> This patch introduce a work to store remaining probe stuff, and let
> request_module run in safe work context.
> 
> Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
> ---
>  sound/pci/hda/hda_i915.c  |  13 ++++--
>  sound/pci/hda/hda_intel.c | 105 +++++++++++++++++++++++++++-------------------
>  2 files changed, 71 insertions(+), 47 deletions(-)
> 
> diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c
> index 76c13d5..7547b20 100644
> --- a/sound/pci/hda/hda_i915.c
> +++ b/sound/pci/hda/hda_i915.c
> @@ -42,13 +42,18 @@ int hda_i915_init(void)
>  {
>  	int err = 0;
>  
> -	get_power = symbol_request(i915_request_power_well);
> +	get_power = symbol_get(i915_request_power_well);
>  	if (!get_power) {
> -		snd_printk(KERN_WARNING "hda-i915: get_power symbol get fail\n");
> -		return -ENODEV;
> +		request_module("i915");
> +		get_power = symbol_get(i915_request_power_well);
> +		if (!get_power) {
> +			snd_printk(KERN_WARNING "hda-i915: get_power symbol get fail\n");
> +			return -ENODEV;
> +		}
> +		snd_printdd("hda-i915: get_power symbol get successful\n");

Why do you need this change?


Takashi

  reply	other threads:[~2013-05-23  6:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23  1:51 [PATCH 4/4 V2] ALSA: hda - Continue probe in work context to avoid request_module deadlock Wang Xingchao
2013-05-23  6:49 ` Takashi Iwai [this message]
2013-05-23 10:19   ` Wang, Xingchao
2013-05-23 10:26     ` Takashi Iwai
2013-05-23 10:29       ` Wang, Xingchao
2013-05-23 17:41         ` David Henningsson
2013-05-24  8:48           ` Takashi Iwai

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=s5hip2a8a33.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=david.henningsson@canonical.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jocelyn.li@intel.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=mengdong.lin@intel.com \
    --cc=xingchao.wang@linux.intel.com \
    /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