linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] hda: Fix 1-minute detection delay when i915 module is not available
@ 2019-07-26 21:47 Samuel Thibault
  2019-07-27  6:33 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Samuel Thibault @ 2019-07-26 21:47 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai; +Cc: alsa-devel, linux-kernel, 931507

Distribution installation images such as Debian include different sets
of modules which can be downloaded dynamically.  Such images may notably
include the hda sound modules but not the i915 DRM module, even if the
latter was enabled at build time, as reported on
https://bugs.debian.org/931507

In such a case hdac_i915 would be linked in and try to load the i915
module, fail since it is not there, but still wait for a whole minute
before giving up binding with it.

This fixes such as case by only waiting for the binding if the module
was properly loaded (or module support is disabled, in which case i915
is already compiled-in anyway).

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 sound/hda/hdac_i915.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

--- a/sound/hda/hdac_i915.c
+++ b/sound/hda/hdac_i915.c
@@ -136,10 +136,13 @@ int snd_hdac_i915_init(struct hdac_bus *
 	if (!acomp)
 		return -ENODEV;
 	if (!acomp->ops) {
-		request_module("i915");
-		/* 60s timeout */
-		wait_for_completion_timeout(&bind_complete,
-					    msecs_to_jiffies(60 * 1000));
+		if (!IS_ENABLED(CONFIG_MODULES) ||
+		    !request_module("i915"))
+		{
+			/* 60s timeout */
+			wait_for_completion_timeout(&bind_complete,
+						   msecs_to_jiffies(60 * 1000));
+		}
 	}
 	if (!acomp->ops) {
 		dev_info(bus->dev, "couldn't bind with audio component\n");

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCHv2] hda: Fix 1-minute detection delay when i915 module is not available
  2019-07-26 21:47 [PATCHv2] hda: Fix 1-minute detection delay when i915 module is not available Samuel Thibault
@ 2019-07-27  6:33 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2019-07-27  6:33 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: Jaroslav Kysela, alsa-devel, 931507, linux-kernel

On Fri, 26 Jul 2019 23:47:02 +0200,
Samuel Thibault wrote:
> 
> Distribution installation images such as Debian include different sets
> of modules which can be downloaded dynamically.  Such images may notably
> include the hda sound modules but not the i915 DRM module, even if the
> latter was enabled at build time, as reported on
> https://bugs.debian.org/931507
> 
> In such a case hdac_i915 would be linked in and try to load the i915
> module, fail since it is not there, but still wait for a whole minute
> before giving up binding with it.
> 
> This fixes such as case by only waiting for the binding if the module
> was properly loaded (or module support is disabled, in which case i915
> is already compiled-in anyway).
> 
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

Applied with a slight coding style fix in my side.  Also added Fixes
and Cc-to-stable tags.

At the next time, please check the patch before submission via
checkpatch.pl.


Thanks!

Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-27  6:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26 21:47 [PATCHv2] hda: Fix 1-minute detection delay when i915 module is not available Samuel Thibault
2019-07-27  6:33 ` Takashi Iwai

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).