Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp230181ybi; Fri, 26 Jul 2019 08:50:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcroxjqWDmbBUBrpwWY7012NOlkgBPnS+K3xHoFY5PrNNz+13/wvAtTwq4CY7C1E+4AO2e X-Received: by 2002:a63:f13:: with SMTP id e19mr91655377pgl.132.1564156201060; Fri, 26 Jul 2019 08:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564156201; cv=none; d=google.com; s=arc-20160816; b=gkW0EMEoSwHdELFenFXYLPW4EJcfCCXoT4eNvfdGWs+PV2i9oqLkGemobX+hY4etln HTWig8xFbWQ1I3YFdQbpqrIlvymt9Wz/tju4XhASjOyT9VQdn1eg7b97NEMM2pO0aboa Lo55P+rTVNJNY3N8+bJ2qDS/6GwjXYGxwV6NnoMBcQeyvvRQSCyzPnhoGkLCkRzcM/b6 nzE+KZAEeEIiKKo+quFKWY6GC0wiJx/JFgxu6M80XxpwPOeeYbDBYVAXAA8cLxym2Yqb aWMCV790TuHcYMmDAC9Kd48OaF8aMQCdnUOk5iDYIpYiK6qLitXuIZ6ipRiQVY9PLi++ wklQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=TCplNW1K204aqrPjD8H2zAeKl+/yPwlQCGeu6H1dnig=; b=E896ZlRj5TfGiCYSCrP0Pg8s9T9u9tggHgpEnRYaCWnExmNpoOuI5lX2I5FcdPZ1P7 KzJ2DLVe3mXc+QOBvOkN1xgFxvua0jS8QPE8p4kFGetYpi5m/zZ+iK5xCkdt6fqD6m7P /tseQEnuwgu5iEC8dwqdzSoq9xP2DeKvfctKUZGngHX0aiDgv8vyKxBUqc1F/wBv80dW WlCmWV+0j/WcGl+p1ldBtsXKwzoNuMgiOChkRBnULAbm1b0MiqfsjwiXxh/dd4mD3XDb G1eiNPygKuqAsDfzdnhb+2rZT+uJ5qKl2VkDPI0cw4+N64gatHd7ORo7J1GilNRJwCbv vurw== 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 bj5si17922678plb.227.2019.07.26.08.49.45; Fri, 26 Jul 2019 08:50:01 -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 S2387807AbfGZPsg (ORCPT + 99 others); Fri, 26 Jul 2019 11:48:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:41420 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725970AbfGZPsg (ORCPT ); Fri, 26 Jul 2019 11:48:36 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BABF1AE2F; Fri, 26 Jul 2019 15:48:34 +0000 (UTC) Date: Fri, 26 Jul 2019 17:48:34 +0200 Message-ID: From: Takashi Iwai To: Samuel Thibault Cc: Jaroslav Kysela , , <931507@bugs.debian.org>, Subject: Re: hda: Fix 1-minute detection delay when i915 module is not available In-Reply-To: <20190726150530.cibwiaohhexl5jdc@function> References: <20190726150530.cibwiaohhexl5jdc@function> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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