Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2756108ybh; Mon, 5 Aug 2019 06:21:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQReVhu2ZbQBvrbk/TJ5nV4zi7tuY1YmzZRkx39BDAOe1/yvIJqQme7CWZQg78ItR/N8Jv X-Received: by 2002:a63:6f81:: with SMTP id k123mr139102708pgc.12.1565011274305; Mon, 05 Aug 2019 06:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565011274; cv=none; d=google.com; s=arc-20160816; b=d8WPG/oV0/VFYY6qnbL4RUcXDs3tyRKbsqjt4WNZ/fAEemywDGfGlgPiOteLnVyb2y xN0hYFqEsaLemdZyuysPlSp1lUApZJEneK2RQeRiECAEvj14/UmJveRGbDOxUlXN6Jef VNhLqXyd7yqDHkBMWO6JFHzYAf8L8+MsPmP7Fzp+RxUhBDot3PGvcp7LjBIrufCxwxUY C50CFmSwzqRivRwwOwEKOUoH3tA35lYuV54TWFOK/poS7i34/Xv4ap+XUFupE4EvRB/C 4nGw0iSO/g3nd9GIZcoYPo4TYbTP4ZASTUiL70lQmAfaW08JugF/e+zfdTnqiy3f4Oa5 +cag== 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=jjjr7VFo/BBSQ2Z3WBb47wtd8F0pySKtORRdeuhNi5c=; b=wzqRIetUD7QeOuZ+9ZI2x6W/rIGEjpIuXeERX9tKlg/zXPwzSrTD5YKQof2tPuHbvT +XWZOk7sTdS10LFIVEECPbLgQ8zw1Ip8L/XBwkwcbpxFlxHG8QTDiUek8+mssjP5Xoih M+CtonG+wErpdD/Kb+U1awDst1zPdhdA+sYD8LpgutM7FBoNJsPDfs88P1uDJOr21iR/ 9z3lQBbGLObhitl4wCHaFQDozg2o6L6yYoQn6W0QQme8wkpIlEkz9OXbfrUM3DiL+AQ5 vgJTgf/YSAocc4d+gMZN5IkYzA3/OVAJHB87z96xYEO3T56yULwJuUCoi5rhQjOs/9OR MU6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vO8Uimyn; 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 m3si29379738pld.385.2019.08.05.06.20.58; Mon, 05 Aug 2019 06:21:14 -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=vO8Uimyn; 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 S1729940AbfHENTu (ORCPT + 99 others); Mon, 5 Aug 2019 09:19:50 -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: 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 @@ -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");