Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp658923ybi; Fri, 26 Jul 2019 17:02:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLzn5JIVwkIOmO5UulMPQYP0eWbhV00ktCGObVY4ViSgnZVd7Xa1lGMd+emUIL46FKqfuo X-Received: by 2002:a62:8643:: with SMTP id x64mr25658336pfd.7.1564185775195; Fri, 26 Jul 2019 17:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564185775; cv=none; d=google.com; s=arc-20160816; b=ZK+XEQJdP871+vOhPrTIjKIQFOQY0FIgk5YtfV+A3K6q6carT5jAfub5Q7fLterAfJ n0W9OE1I0nbRihCu7xJ50v9Z+Lnzj6VlAnT+Iis2hmuB2Lu41pcoCs+fmU/yG1BhPHKg m33I40TzQ3ddzoe2QtUhK2yy8NTcA3nwXlOW9ZiY7mKGFsodDImXrHc7b+qNBO0UK1l2 Py6MX36fVLUzWv12SS2xpirbL0YVQPhQxQhofxxi+OW2FgDpimzEwPLJSEzyoYoXjeq1 GNxOoFKK8LzQX7ibuf8lvtlwBt5ZCHqLceODREvRwLjmKoklnhfUqYnrGxvJHXSqfsYN ucRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:mail-followup-to:message-id:subject:cc:to:from:date; bh=u3Im0nZTj1anLcV726UGdmoWiNs4pI3xhSYeHgKaMuk=; b=zLOaePhhSbrObn94LHJFfynhvD+m8bmV6ZdrKK0ckuCP6mpX9QdXQ6TJe7R4GMef30 m0wkaxbuuooTt1/bGN05E70cO3rQvugQ0hvn7YcLUFsmhIm62/yNOL9nCY8Q9WI7zvqF 0I63ZlzFMB7+nDAiFY1epcJqPTslqe42mWqaEUpFhObY2zQ+bW7h6XXBbg6gEFxOoN97 RuV8RL7jftwDUHtQNo9xYr/45x02xxu+ws14XtY5HwP6UqjtWe0TRlX/6rCdPvFvXTMB 75OvNV8foiRgYsDOQAtfJgKv9o5UIEU4E7JcCZN957J1OoPCE5hbqYKhUICHTZCxHARm siWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si20653821pfa.89.2019.07.26.17.02.40; Fri, 26 Jul 2019 17:02:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727608AbfGZVrG (ORCPT + 99 others); Fri, 26 Jul 2019 17:47:06 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:41062 "EHLO hera.aquilenet.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbfGZVrF (ORCPT ); Fri, 26 Jul 2019 17:47:05 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 3556D19315; Fri, 26 Jul 2019 23:47:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HgFx9HJp6DC3; Fri, 26 Jul 2019 23:47:03 +0200 (CEST) Received: from function (105.251.129.77.rev.sfr.net [77.129.251.105]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 861ED19312; Fri, 26 Jul 2019 23:47:03 +0200 (CEST) Received: from samy by function with local (Exim 4.92) (envelope-from ) id 1hr83K-00012p-Gb; Fri, 26 Jul 2019 23:47:02 +0200 Date: Fri, 26 Jul 2019 23:47:02 +0200 From: Samuel Thibault To: Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, 931507@bugs.debian.org Subject: [PATCHv2] hda: Fix 1-minute detection delay when i915 module is not available Message-ID: <20190726214702.kxi2gavlieiwyf7q@function> Mail-Followup-To: Samuel Thibault , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, 931507@bugs.debian.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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");