Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4213711rdb; Mon, 11 Dec 2023 12:07:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3gnFdF3N35oXju0AcUqVDED6TJuU/8k7xqHaaeHlEncjgQAYvtc9SIUoXwxOe+kFEVVr4 X-Received: by 2002:a05:6a20:1604:b0:190:3b35:5999 with SMTP id l4-20020a056a20160400b001903b355999mr6820988pzj.9.1702325255362; Mon, 11 Dec 2023 12:07:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702325255; cv=none; d=google.com; s=arc-20160816; b=nDTg8XfI9J2Rx1Rtr9X4ZHP8juKd+VU/w5q1g5b0ltJSumR9M4TPW+9jdMfZ/sBLUO Vz1Ii0t6Zn4u8kc4JLEtujNdwRZXUjYMrZ1B79Pa3dBu+bugXt77WM9k8ME3HQGkgzHY GRUT+lknj3Q2BTOXIY3l0C/yUWbKmXari2mZGjsIVxM9Mqle/zG8V/RumCTRFm+UYzEk uAYjPUxchTY+IDZL7LHNrxVDU21X6Gq1srdQFVDuevWSR8NtecDfgxksVZNVUqOYNtZR Fme2QhVnXWX5AlHq2sO47uqP+LGPjee2hNEY1DqARmot0YiXJjY3bRkAeMwKBBHnIOhV X/YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=EDa7uMWL6/2sNcTzbxFEQRTNBtW67tyYh0guTAhOmYk=; fh=A5LnFD/VO9GCKfL+mD+pegdHwPJyaMD9Xzclqj1uuhs=; b=rRLlZd2IQS0DPToViS/nO4QJJr2QCXbB3abp899ZlQMRvl3/D3B8ikY7WZJsR8m7bf Rprza0y34e6eGQNvOlbW0dCK4JXDUeMYvYDrbiQbcxLWo1tFv63mzBPC5wW4+41vDWc5 BUV+6fnHE+xZr5olVN208/Sb5Yu2vRGN3WT5tqdxOC11nqVkf57G/hoZgpxM8zE5MBtI mohPvChTJ0spCrVcoIs97Dl+99r97xaP1oUzfErYvmSYz9OdE4ByhnlVPKbhkd6uo2/D 0G009cLrBOYThgZYhqar1q0goO+MzbJxg8bNl5L7dxhGpQPdaUClXkI83pAjnin2XgVt ACmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fKunPx2/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q28-20020a056a0002bc00b006ce7ff254c2si6491394pfs.368.2023.12.11.12.07.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 12:07:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fKunPx2/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A28718092EC9; Mon, 11 Dec 2023 12:07:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344924AbjLKUHT (ORCPT + 99 others); Mon, 11 Dec 2023 15:07:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbjLKUHQ (ORCPT ); Mon, 11 Dec 2023 15:07:16 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B46AFD8 for ; Mon, 11 Dec 2023 12:07:22 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 303FDC433CC; Mon, 11 Dec 2023 20:07:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702325242; bh=LKeHZBb6JKYAmHddd83S8bgUsHx/KGnr+Nj4UjhnTOA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=fKunPx2/y1lVcA5+0696r1ULEr8fkc8usfCXm6B2wFFt3P1g2pWlXA7p5YnY3lkTO Z9vlROguNMK6BCBlFEna8tZM9nkz3gADukNqc0rFB3zKF7YSIUHXouvm7hgEwpJOGS 7CDlzSGYCF0LZLSeoN9m9vZCv2OABY9i+dgZqpAcJjmY5fekO8XrMrYGT+PXhm1taA eqS33bun+3bNCpBSczM/v3LFyDhhqOLzA6D4HKIIg0vBaRXBxDDGFiJrD33o5rRMru +H7hKxiMxLp9oDRkKOtdbpXaVyCDSDoVheo0Vur9YS0dLdpoHCKQjFfu0jA6ICK4hP 9zhAgcCmSLnPw== Date: Mon, 11 Dec 2023 14:07:19 -0600 From: Bjorn Helgaas To: LeoLiu-oc Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, CobeChen@zhaoxin.com, TonyWWang@zhaoxin.com, YeeLi@zhaoxin.com, Leoliu@zhaoxin.com Subject: Re: [PATCH v2] PCI: Extend PCI root port device IDs for Zhaoxin platforms Message-ID: <20231211200719.GA964402@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231211091543.735903-1-LeoLiu-oc@zhaoxin.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 11 Dec 2023 12:07:30 -0800 (PST) On Mon, Dec 11, 2023 at 05:15:43PM +0800, LeoLiu-oc wrote: > From: LeoLiuoc > > Add more PCI root port device IDs to the > pci_quirk_zhaoxin_pcie_ports_acs() for some new Zhaoxin platforms. > > v1 -> v2: > 1. Add a note to indicate future Zhaoxin devices will implement ACS > Capability based on the PCIe Spec. > 2. Includes DID of more Zhaoxin devices that have not yet implemented ACS > Capability. > > Signed-off-by: LeoLiuoc Applied as below to pci/virtualization for v6.8, thanks! This extends 299bd044a6f3 ("PCI: Add ACS quirk for Zhaoxin Root/Downstream Ports"), so I made the subject similar to that, added a Fixes: line for it, and added a stable tag. > --- > drivers/pci/quirks.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c > index ea476252280a..f4546590d9e3 100644 > --- a/drivers/pci/quirks.c > +++ b/drivers/pci/quirks.c > @@ -4706,10 +4706,14 @@ static int pci_quirk_zhaoxin_pcie_ports_acs(struct pci_dev *dev, u16 acs_flags) > (pci_pcie_type(dev) != PCI_EXP_TYPE_DOWNSTREAM))) > return -ENOTTY; > > + /* > + * Future Zhaoxin Root Ports and Switch Downstream Ports will implement ACS > + * capability in accordance with the PCIe Spec. > + */ > switch (dev->device) { > case 0x0710 ... 0x071e: > case 0x0721: > - case 0x0723 ... 0x0732: > + case 0x0723 ... 0x0752: > return pci_acs_ctrl_enabled(acs_flags, > PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF); > } > commit e367e3c765f5 ("PCI: Add ACS quirk for more Zhaoxin Root Ports") Author: LeoLiuoc Date: Mon Dec 11 17:15:43 2023 +0800 PCI: Add ACS quirk for more Zhaoxin Root Ports Add more Root Port Device IDs to pci_quirk_zhaoxin_pcie_ports_acs() for some new Zhaoxin platforms. Fixes: 299bd044a6f3 ("PCI: Add ACS quirk for Zhaoxin Root/Downstream Ports") Link: https://lore.kernel.org/r/20231211091543.735903-1-LeoLiu-oc@zhaoxin.com Signed-off-by: LeoLiuoc [bhelgaas: update subject, drop changelog, add Fixes, add stable tag, fix whitespace, wrap code comment] Signed-off-by: Bjorn Helgaas Cc: # 5.7 diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index ea476252280a..d55a3ffae4b8 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -4699,17 +4699,21 @@ static int pci_quirk_xgene_acs(struct pci_dev *dev, u16 acs_flags) * But the implementation could block peer-to-peer transactions between them * and provide ACS-like functionality. */ -static int pci_quirk_zhaoxin_pcie_ports_acs(struct pci_dev *dev, u16 acs_flags) +static int pci_quirk_zhaoxin_pcie_ports_acs(struct pci_dev *dev, u16 acs_flags) { if (!pci_is_pcie(dev) || ((pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT) && (pci_pcie_type(dev) != PCI_EXP_TYPE_DOWNSTREAM))) return -ENOTTY; + /* + * Future Zhaoxin Root Ports and Switch Downstream Ports will + * implement ACS capability in accordance with the PCIe Spec. + */ switch (dev->device) { case 0x0710 ... 0x071e: case 0x0721: - case 0x0723 ... 0x0732: + case 0x0723 ... 0x0752: return pci_acs_ctrl_enabled(acs_flags, PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF); }