From patchwork Fri Jul 26 15:05:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 11061201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 189C5746 for ; Fri, 26 Jul 2019 15:06:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02A5028B16 for ; Fri, 26 Jul 2019 15:06:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAAC028B20; Fri, 26 Jul 2019 15:06:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E4F3428B2D for ; Fri, 26 Jul 2019 15:06:29 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C61F22094; Fri, 26 Jul 2019 17:05:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C61F22094 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1564153587; bh=Ks0LOzDj+Tc2mBv0cpxzAdfg9lcEkdYD5ShGgxnRddM=; h=Date:From:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=G8Qyf2B3SHQbgwXoJhxo2D1HAMpGbAkhIyaDnP0ffZZ0penIGz7gV2qJQIavt9Vb8 Szm2t6KCr8AYgsOAxX/BRJ0SBH7r/N7xtnlU51YH14BQSBRHNZQjmlNMk7BJ7JsoBS B+6Pne+FntHrUXamx0YAslVrcmsOXFOVnRKcrcp8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5039CF80368; Fri, 26 Jul 2019 17:05:37 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 23F82F80393; Fri, 26 Jul 2019 17:05:35 +0200 (CEST) Received: from hera.aquilenet.fr (hera.aquilenet.fr [185.233.100.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C2A67F801A4 for ; Fri, 26 Jul 2019 17:05:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C2A67F801A4 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 95EAB18AFA; Fri, 26 Jul 2019 17:05:31 +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 f04B5gwHognF; Fri, 26 Jul 2019 17:05:31 +0200 (CEST) Received: from function (dhcp-13-113.lip.ens-lyon.fr [140.77.13.113]) by hera.aquilenet.fr (Postfix) with ESMTPSA id DFBD318AF8; Fri, 26 Jul 2019 17:05:30 +0200 (CEST) Received: from samy by function with local (Exim 4.92) (envelope-from ) id 1hr1mk-0001Vd-Gv; Fri, 26 Jul 2019 17:05:30 +0200 Date: Fri, 26 Jul 2019 17:05:30 +0200 From: Samuel Thibault To: Jaroslav Kysela , Takashi Iwai Message-ID: <20190726150530.cibwiaohhexl5jdc@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-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, 931507@bugs.debian.org Subject: [alsa-devel] hda: Fix 1-minute detection delay when i915 module is not available X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 | 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 + { + /* 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");