[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241210145335.GA3239578@bhelgaas>
Date: Tue, 10 Dec 2024 08:53:35 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Shuai Xue <xueshuai@...ux.alibaba.com>
Cc: Will Deacon <will@...nel.org>, Mark Rutland <mark.rutland@....com>,
Ilkka Koskinen <ilkka@...amperecomputing.com>,
Krishna chaitanya chundru <quic_krichai@...cinc.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH] perf/dwc_pcie: Qualify RAS DES VSEC Capability by
Vendor, Revision
On Tue, Dec 10, 2024 at 08:04:17PM +0800, Shuai Xue wrote:
> 在 2024/12/10 06:29, Bjorn Helgaas 写道:
> > From: Bjorn Helgaas <bhelgaas@...gle.com>
> >
> > PCI Vendor-Specific (VSEC) Capabilities are defined by each vendor.
> > Devices from different vendors may advertise a VSEC Capability with the DWC
> > RAS DES functionality, but the vendors may assign different VSEC IDs.
> >
> > Search for the DWC RAS DES Capability using the VSEC ID and VSEC Rev
> > chosen by the vendor.
> > - for (vid = dwc_pcie_vendor_ids; vid->vendor_id; vid++) {
> > + for (vid = dwc_pcie_pmu_vsec_ids; vid->vendor_id; vid++) {
>
> How about checking the pdev->vendor with vid->vendor_id before
> search the vesc cap?
>
> + if (pdev->vendor != vid->vendor_id)
> + continue;
Every user of VSEC needs to specify the (Vendor ID, VSEC ID) and
verify that the Vendor ID matches the device Vendor ID, so
pci_find_vsec_capability() does this check internally, so I don't
think we need to do it here.
> > vsec = pci_find_vsec_capability(pdev, vid->vendor_id,
> > - DWC_PCIE_VSEC_RAS_DES_ID);
> > - if (vsec)
> > - break;
> > + vid->vsec_id);
Powered by blists - more mailing lists