Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9093756pxu; Mon, 28 Dec 2020 06:29:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZW27DKzxZbctyssVRmsZopKILxJ++eaolnhl+fcAbMgfkt1zZ2YzhXbhpjXYhn+Xb4aRG X-Received: by 2002:a17:906:c414:: with SMTP id u20mr41105577ejz.511.1609165779017; Mon, 28 Dec 2020 06:29:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165779; cv=none; d=google.com; s=arc-20160816; b=Tnh7l0wXXOkB5a92JA6xpZBns0xTo9SbC6Gr6S9Ejlssokt2WKvJlgwK0FMjv4DrYX vEjhpaCF+KD0ssnPRhvtanKnbMRk85S0Gnl6+MrcBw2W3XFLFXYaRJaU8oqRy3secasX e/kam90kugIvoU82M3t7A866G9gwNitwQUY22TQedQPmTnKHeb7odlXGSLWaB9p6rgp9 JRUG3iqVniz4h6/lV7loirYoHhlyrwAWPsocbcsQphWJCsnbsFAwHSPoqBAfB7ylVTu8 TwjyjgB415KtlKCOHQcpd4+GbRrG+Knl51uJybZtbSckAEvW1NciZBcGCltD2VRrj1oO T8Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Irx0E7t/wvqNWUr+qQqkwmpBgCxr0LqyItACaLOq+/4=; b=X9tOXmJ0cpabODi3nsWwhYGjBNLz0Vqag96EPSM2gtwZttOR22c4O178HEgbSd1E+d P22oOUre4P2/EVzsjhk0QI+D1pMw/W8jB3dE/AVj2buFT0+fLeKhdMtoMienWtMyEXoA XK4LyjREKyeyEbhJ85vys6m45FUjJM3rKQ8wLNSwZB4v3rm48l0226bWkyQnH9+FuJzU jTOFtmPX8t/gL2J7WZsTwriRnikl89Niw1kLloSaqTSPUC85ScOHTSR+xcpgiW8LtA5c dU1+u8GjTw0EHCtp4+cCboLMKPqI8GRNTQTQMYTZihh7+KdIzY5i823WSf8KIgaAW63H oRtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MO5MwaZN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw4si18516617ejb.196.2020.12.28.06.29.16; Mon, 28 Dec 2020 06:29:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MO5MwaZN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502290AbgL1O1Z (ORCPT + 99 others); Mon, 28 Dec 2020 09:27:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:34000 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503578AbgL1O0G (ORCPT ); Mon, 28 Dec 2020 09:26:06 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2B1C422B40; Mon, 28 Dec 2020 14:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165525; bh=MJb6rgT/CLr74sfiJb2dNz0DdNWAxqXSu6EFZIFb3qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MO5MwaZN6hlZHM4NeergFBimZc2XnhTkAwJRCqFurH68pGXN1kx/ncW0iG06T32mA 64df6XkQf8okW83fcYocsc9N/+6E2ordXgqpKzFbjdqCRKt1p3+WiIrvs3Bv6Ta9FV 2WjljDZ1WWcumS93z+j5owGZUYyR0STnTaXiK2ak= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Vijendar Mukunda , Mark Brown , Jaroslav Kysela Subject: [PATCH 5.10 562/717] ASoC: AMD Raven/Renoir - fix the PCI probe (PCI revision) Date: Mon, 28 Dec 2020 13:49:20 +0100 Message-Id: <20201228125047.848721184@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jaroslav Kysela commit 55d8e6a85bce21f748c42eedea63681219f70523 upstream. The Raven and Renoir ACP can be distinguished by the PCI revision. Let's do the check very early, otherwise the wrong probe code can be run. Link: https://lore.kernel.org/alsa-devel/2e4587f8-f602-cf23-4845-fd27a32b1cfc@amd.com/ Cc: Cc: Vijendar Mukunda Cc: Mark Brown Signed-off-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20201208181233.2745726-1-perex@perex.cz Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/amd/raven/pci-acp3x.c | 4 ++++ sound/soc/amd/renoir/rn-pci-acp3x.c | 4 ++++ 2 files changed, 8 insertions(+) --- a/sound/soc/amd/raven/pci-acp3x.c +++ b/sound/soc/amd/raven/pci-acp3x.c @@ -118,6 +118,10 @@ static int snd_acp3x_probe(struct pci_de int ret, i; u32 addr, val; + /* Raven device detection */ + if (pci->revision != 0x00) + return -ENODEV; + if (pci_enable_device(pci)) { dev_err(&pci->dev, "pci_enable_device failed\n"); return -ENODEV; --- a/sound/soc/amd/renoir/rn-pci-acp3x.c +++ b/sound/soc/amd/renoir/rn-pci-acp3x.c @@ -188,6 +188,10 @@ static int snd_rn_acp_probe(struct pci_d int ret, index; u32 addr; + /* Renoir device check */ + if (pci->revision != 0x01) + return -ENODEV; + if (pci_enable_device(pci)) { dev_err(&pci->dev, "pci_enable_device failed\n"); return -ENODEV;