Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2763485ybh; Mon, 5 Aug 2019 06:28:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqysx+hLCoeXw9scYRHUpcbaHKik6iXIsvw4R47hibwq8lA2nOHpgCP85GgVHivm5WEByWCz X-Received: by 2002:a62:7994:: with SMTP id u142mr74080671pfc.39.1565011712727; Mon, 05 Aug 2019 06:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565011712; cv=none; d=google.com; s=arc-20160816; b=iNkpxHwhwLNU/gqtojL+IYc0l2+TtiYSauHts5MRL+51qkgh0O3J6YRWMfW39iFehN Oy+FijXd5M2nP+iSYfZBbmP2j7VLHlYfOAF1gUh3svAqzlucWTkiAEVT7vrnRxeMOE1m hgfbZXwFyTRmjGoU/GxQuU27JY88GhB3nfoTRmrFdroqJqfXTGtHRiEHCjufC+YzPvRC JQb0v7qc7tEXolvZ8jH1f9Hh8qceDGN9BknYivKYVX2Mo1rRv9CYNEAUlMdbLpZbMnFj eh42wBsfyQPx7oH1kqeN1UiapyEf3mUQtrPIxyFb2GmVQIS3pij8kclgmS+OcnxreGi8 caRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OTVoTNMY4GvooaxgoJHqVD/8sekZi9G8SjX4ZAX9tMk=; b=vbhpb9pPACUlRHooJP/OK1lZwtka0So/iw96lon6iRufC2bRy7aNWkk7LkZSxMesDg Bl/6u1Ck813ZXijJ35i9z6cMLB4eQE9eR9zsFC/8uI3z0AU/kfp4chiIuFmlc/d96KFt e7Zu+zAMll5sIsG9ftfJZF6+ByOtwv34cfY0FWiGaCFADLm6fleAgS0VtBLScYDLSroG 4IF7Rz3CA8ppJB8OjuluwhHBMl/cMhOx+s4ZN0Zsb317MDkl1Xx6Jk0I+EYkayVTr+w4 xA8ykTEqV808a0mBWCZ5j2KcoMH+rU9MnDF6T6maMAOy/eDFDfcgB6DOJFgaBCKNVXC2 TAQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zlMRCpHG; 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 t19si44567294pfe.94.2019.08.05.06.28.17; Mon, 05 Aug 2019 06:28:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b=zlMRCpHG; 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 S1730766AbfHENYb (ORCPT + 99 others); Mon, 5 Aug 2019 09:24:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:32980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731014AbfHENY3 (ORCPT ); Mon, 5 Aug 2019 09:24:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1827D20651; Mon, 5 Aug 2019 13:24:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565011468; bh=kDASm8+AuMPNY/cREAHlH2bRIsXBL4K8DG62KX5A/mw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zlMRCpHGgGdSJjOGuTZCstlI+yAnznsEcvao72KYDk/2WYyUsPGRDtubcKDZjTWNp DLvSTLCrH7nVWUq8LG0SSE5I8KYjuwjLc69i4LdiOvLPytTDqMT2V9YokmFpXLkhyN iKEp7NvqrViDyjFwp7S18y4XvZqidtENTWFC2oVc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Samuel Thibault , Takashi Iwai Subject: [PATCH 5.2 099/131] ALSA: hda: Fix 1-minute detection delay when i915 module is not available Date: Mon, 5 Aug 2019 15:03:06 +0200 Message-Id: <20190805124958.585858607@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805124951.453337465@linuxfoundation.org> References: <20190805124951.453337465@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Samuel Thibault commit 74bf71ed792ab0f64631cc65ccdb54c356c36d45 upstream. 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). Fixes: f9b54e1961c7 ("ALSA: hda/i915: Allow delayed i915 audio component binding") Signed-off-by: Samuel Thibault Cc: Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/hda/hdac_i915.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/sound/hda/hdac_i915.c +++ b/sound/hda/hdac_i915.c @@ -136,10 +136,12 @@ 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");