From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1284C0650F for ; Mon, 5 Aug 2019 13:31:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B922320644 for ; Mon, 5 Aug 2019 13:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565011864; bh=I5NZIyZZlv8ZEO1IZmmwcSXPI8K4vbdP0BRpONsv+QE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=gnbcsFVCB6eFBdtr8Kll13C58wuLkyiQpVzp8rBCv8tE6KiRdfmYMPI7wb6jYuR3L 1fnNhYL9GnfRdzdjb4amHcj59ciXwmH04pPuRgSY1PkJT3D3PP6+RBGDGobMgdb7aP lPhdkAXOl17WDEs4KwcypA4elX1a/Wgs0r7mEwkk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729792AbfHENTq (ORCPT ); Mon, 5 Aug 2019 09:19:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:55890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729788AbfHENTp (ORCPT ); Mon, 5 Aug 2019 09:19:45 -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 DF58121743; Mon, 5 Aug 2019 13:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565011184; bh=I5NZIyZZlv8ZEO1IZmmwcSXPI8K4vbdP0BRpONsv+QE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vO8UimynPea8FAnmKwH0Rpu2c9BDaQaIkFw5lddwNRNfyUL9z1ijTUpy9PitHmOyS qqclniKceQ91pKyVdDqjvR5iazZqKsEJOh3QgbhNlXPEPFWmZfHu9IBtk5ezwOsFm5 A+3RtgzKQxIgHSWGBKRIPxDdqyc6eGIYxvStw1ic= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Samuel Thibault , Takashi Iwai Subject: [PATCH 4.19 52/74] ALSA: hda: Fix 1-minute detection delay when i915 module is not available Date: Mon, 5 Aug 2019 15:03:05 +0200 Message-Id: <20190805124940.087422108@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805124935.819068648@linuxfoundation.org> References: <20190805124935.819068648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 @@ -143,10 +143,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");