From patchwork Tue Apr 7 07:14:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Wang X-Patchwork-Id: 1267271 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48xJb65DMvz9sSt; Tue, 7 Apr 2020 17:15:30 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jLiSE-0006rd-3g; Tue, 07 Apr 2020 07:15:26 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jLiSA-0006oL-NG for kernel-team@lists.ubuntu.com; Tue, 07 Apr 2020 07:15:22 +0000 Received: from [114.254.47.51] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jLiS9-0001HR-QM for kernel-team@lists.ubuntu.com; Tue, 07 Apr 2020 07:15:22 +0000 From: Hui Wang To: kernel-team@lists.ubuntu.com Subject: [SRU][F][PATCH 3/6] ALSA: hda: Allow non-Intel device probe gracefully Date: Tue, 7 Apr 2020 15:14:45 +0800 Message-Id: <20200407071448.16335-10-hui.wang@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407071448.16335-1-hui.wang@canonical.com> References: <20200407071448.16335-1-hui.wang@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Takashi Iwai BugLink: https://bugs.launchpad.net/bugs/1871284 The recent addition of snd_intel_dsp_driver_probe() check caused a spurious kernel warning when the driver is loaded for a non-Intel hardware due to snd_BUG_ON(). Moreover, for such a hardware, we should always return SND_INTEL_DSP_DRIVER_ANY, not check the dsp_driver option at all. This patch fixes these issues for non-Intel devices. Fixes: 82d9d54a6c0e ("ALSA: hda: add Intel DSP configuration / probe code") Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20191028130634.3501-1-tiwai@suse.de Signed-off-by: Takashi Iwai (cherry picked from commit 91636a82044a2821201b54faac4d1d2425260842) Signed-off-by: Hui Wang --- sound/hda/intel-dsp-config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c index 0b2a7201a46a..be1df80ed013 100644 --- a/sound/hda/intel-dsp-config.c +++ b/sound/hda/intel-dsp-config.c @@ -307,13 +307,13 @@ int snd_intel_dsp_driver_probe(struct pci_dev *pci) { const struct config_entry *cfg; - if (dsp_driver > 0 && dsp_driver <= SND_INTEL_DSP_DRIVER_LAST) - return dsp_driver; - /* Intel vendor only */ - if (snd_BUG_ON(pci->vendor != 0x8086)) + if (pci->vendor != 0x8086) return SND_INTEL_DSP_DRIVER_ANY; + if (dsp_driver > 0 && dsp_driver <= SND_INTEL_DSP_DRIVER_LAST) + return dsp_driver; + /* * detect DSP by checking class/subclass/prog-id information * class=04 subclass 03 prog-if 00: no DSP, use legacy driver