Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp185821ybi; Fri, 26 Jul 2019 08:07:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1kKLX8rhdhHRnt/xZCCEbmFeIfOUCGZ0BFdCcUzx9QjgSc0VzrH2Mr4VyJidzy8wXVdum X-Received: by 2002:a17:902:8649:: with SMTP id y9mr95090260plt.289.1564153666432; Fri, 26 Jul 2019 08:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564153666; cv=none; d=google.com; s=arc-20160816; b=ki4oQqH8IN7mS1OqatyWpCf9pKeXQluWJfBi4i25GiPhg3q4oqqJkk1JSzeLy/kaqv nWDTshp/rxReXzVTmcpjDmm/CKiCK0mbXnl8gtH0UNpGehmc5vbsQv+QHVGHhHqXAL4n vdjJEU9zfF36o//RU0kwAymyZ4jZz+x6d8FCL83k4Y8FCTeaCOq+/1TnQUyn4iS5PaRj +vIGlLHTswVohdPkWzz9wen0Q8he8IWAEO3GutYR+mxQuH30B5wIxyJpSoJnLB/gBowL 6EgsSbj/l0a5Fd283lJE6cqvFJk2Fd/E47DqJsfTAa/1J3Q8/4DxU4cO54FbivIzx4JV S7Sw== 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=xlfseuO2iCWrugEtyJvjVc/e14BPSncU9jdGRS+ZCqY=; b=PhNA0UcMd4+QLm+94Gq3raowYYl+npV6ds29JpLcVmqVfnIGwZbAWpQAQiDmSg7/fT 6wUzeUoSwt8Fg2g3wxhQj+riC4P0B35gKmGZW3oYt34RO5NsS9ANweuy1jAirniGE/Se f3rimv4MwGtaYjaBk4llItFOCLmPbBZtULmjvBaPcDSVBCIAwzKb4QKAPKa3llwMVCp1 QG/0AvRy+ykJYsYvuiS9Ap0i090JWn+OMjwkehyyeiXeCLGh+wzdkeH9JsZC9igL6qYG mUvtt70zeFzLA/trfgYdvfnJzWXfiL2xyU8QZfCiOtaLNLnmxAFncaGjqBSycJphm/U0 IdEg== 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 e13si11302255pge.266.2019.07.26.08.07.30; Fri, 26 Jul 2019 08:07:46 -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 S1728209AbfGZPFd (ORCPT + 99 others); Fri, 26 Jul 2019 11:05:33 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:58088 "EHLO hera.aquilenet.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727287AbfGZPFd (ORCPT ); Fri, 26 Jul 2019 11:05:33 -0400 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 Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, 931507@bugs.debian.org Subject: hda: Fix 1-minute detection delay when i915 module is not available 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-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 | 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");