[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <45de80bc-d4ab-44fd-945c-f0ff7ce3b8b0@linux.alibaba.com>
Date: Mon, 30 Oct 2023 18:29:38 +0800
From: Shuai Xue <xueshuai@...ux.alibaba.com>
To: Krishna Chaitanya Chundru <quic_krichai@...cinc.com>,
chengyou@...ux.alibaba.com, kaishen@...ux.alibaba.com,
helgaas@...nel.org, yangyicong@...wei.com, will@...nel.org,
Jonathan.Cameron@...wei.com, baolin.wang@...ux.alibaba.com,
robin.murphy@....com
Cc: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-pci@...r.kernel.org, rdunlap@...radead.org,
mark.rutland@....com, zhuo.song@...ux.alibaba.com,
renyu.zj@...ux.alibaba.com
Subject: Re: [PATCH v9 3/4] drivers/perf: add DesignWare PCIe PMU driver
On 2023/10/30 14:28, Krishna Chaitanya Chundru wrote:
>
...
>> +
>> +static int dwc_pcie_pmu_probe(struct platform_device *plat_dev)
>> +{
>> + struct pci_dev *pdev = NULL;
>> + struct dwc_pcie_pmu *pcie_pmu;
>> + bool notify = false;
>> + char *name;
>> + u32 bdf;
>> + int ret;
>> +
>> + /* Match the rootport with VSEC_RAS_DES_ID, and register a PMU for it */
>> + for_each_pci_dev(pdev) {
>> + u16 vsec;
>> + u32 val;
>> +
>> + if (!(pci_is_pcie(pdev) &&
>> + pci_pcie_type(pdev) == PCI_EXP_TYPE_ROOT_PORT))
>> + continue;
>> +
>> + vsec = pci_find_vsec_capability(pdev, PCI_VENDOR_ID_ALIBABA,
>> + DWC_PCIE_VSEC_RAS_DES_ID);
>
> We are searching for ALIBABA vendor only for this capability.
>
> Can we have a list of vendor ID's and we can check for all those vendors for this capability so that it will be easy to add new vendors in the list
>
> something like this
>
> struct vendor_ids {
>
> int vendor_id;
>
> };
>
> struct vendor_ids dwc_ids[] = {
>
> {.vendor_id =PCI_VENDOR_ID_ALIBABA },
>
> {.vendor_id = XXX},
>
> };
>
> for_each_pci_dev(pdev) {
> u16 vsec;
> u32 val;
>
> if (!(pci_is_pcie(pdev) &&
> pci_pcie_type(pdev) == PCI_EXP_TYPE_ROOT_PORT))
> continue;
> for (int i = 0; i < num of elements of dwc_ids < i++) {
> ---
>
> }
>
> ---
> }
>
> Thanks & Regards,
> Krishna Chaitanya.
>
Good idea, with vendor_ids, I think it will be easy to extend for other vendors in the future.
Thank you.
Best Regards,
Shuai
Powered by blists - more mailing lists