lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <s5h5znoztil.wl-tiwai@suse.de>
Date:   Fri, 26 Jul 2019 17:48:34 +0200
From:   Takashi Iwai <tiwai@...e.de>
To:     Samuel Thibault <samuel.thibault@...-lyon.org>
Cc:     Jaroslav Kysela <perex@...ex.cz>, <alsa-devel@...a-project.org>,
        <931507@...s.debian.org>, <linux-kernel@...r.kernel.org>
Subject: Re: hda: Fix 1-minute detection delay when i915 module is not available

On Fri, 26 Jul 2019 17:05:30 +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@...-lyon.org>
> ---
>  sound/hda/hdac_i915.c |   12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> --- a/sound/hda/hdac_i915.c
> +++ b/sound/hda/hdac_i915.c
> @@ -143,10 +143,14 @@ 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));
> +#ifdef CONFIG_MODULES
> +		if (request_module("i915") == 0)
> +#endif

Better to use IS_ENABLED(), so that we can avoid ugly ifdef.

		if (!IS_ENABLED(CONFIG_MODULES) ||
		    !request_module("i915")) {
			....

thanks,

Takashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ