From: Bjorn Helgaas <helgaas@kernel.org>
To: Shradha Todi <shradha.t@samsung.com>
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
manivannan.sadhasivam@linaro.org, lpieralisi@kernel.org,
kw@linux.com, robh@kernel.org, bhelgaas@google.com,
jingoohan1@gmail.com, fancer.lancer@gmail.com,
yoshihiro.shimoda.uh@renesas.com, conor.dooley@microchip.com,
pankaj.dubey@samsung.com, gost.dev@samsung.com
Subject: Re: [PATCH 1/3] PCI: dwc: Add support for vendor specific capability search
Date: Fri, 26 Jul 2024 12:32:06 -0500 [thread overview]
Message-ID: <20240726173206.GA911626@bhelgaas> (raw)
In-Reply-To: <20240625093813.112555-2-shradha.t@samsung.com>
On Tue, Jun 25, 2024 at 03:08:11PM +0530, Shradha Todi wrote:
> Add vendor specific extended configuration space capability search API
> using struct dw_pcie pointer for DW controllers.
>
> Signed-off-by: Shradha Todi <shradha.t@samsung.com>
> ---
> drivers/pci/controller/dwc/pcie-designware.c | 16 ++++++++++++++++
> drivers/pci/controller/dwc/pcie-designware.h | 1 +
> 2 files changed, 17 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
> index 250cf7f40b85..b74e4a97558e 100644
> --- a/drivers/pci/controller/dwc/pcie-designware.c
> +++ b/drivers/pci/controller/dwc/pcie-designware.c
> @@ -275,6 +275,22 @@ static u16 dw_pcie_find_next_ext_capability(struct dw_pcie *pci, u16 start,
> return 0;
> }
>
> +u16 dw_pcie_find_vsec_capability(struct dw_pcie *pci, u8 vsec_cap)
> +{
> + u16 vsec = 0;
> + u32 header;
IIUC, any use of PCI_EXT_CAP_ID_VNDR should check dev->vendor, as
pci_find_vsec_capability() does.
You only know how "vsec" works if you also know the vendor who defined
vsec.
Do you expect DW_PCIE_RAS_DES_CAP to be present only in devices with
Vendor ID of PCI_VENDOR_ID_SYNOPSYS?
I was hoping that this was generic DesignWare functionality that might
be present in devices from other vendors that incorporated the DWC IP.
Those devices would likely have other Vendor IDs. In that case, a
DVSEC (not VSEC) capability might be more appropriate.
> + while ((vsec = dw_pcie_find_next_ext_capability(pci, vsec,
> + PCI_EXT_CAP_ID_VNDR))) {
> + header = dw_pcie_readl_dbi(pci, vsec + PCI_VNDR_HEADER);
> + if (PCI_VNDR_HEADER_ID(header) == vsec_cap)
> + return vsec;
> + }
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(dw_pcie_find_vsec_capability);
next prev parent reply other threads:[~2024-07-26 17:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20240625094434epcas5p2e48bda118809ccb841c983d737d4f09d@epcas5p2.samsung.com>
2024-06-25 9:38 ` [PATCH v3 0/3] Add support for RAS DES feature in PCIe DW Shradha Todi
[not found] ` <CGME20240625094438epcas5p2760f4d1537d86541940177543cea5aa8@epcas5p2.samsung.com>
2024-06-25 9:38 ` [PATCH 1/3] PCI: dwc: Add support for vendor specific capability search Shradha Todi
2024-07-01 10:55 ` Jonathan Cameron
2024-07-26 17:32 ` Bjorn Helgaas [this message]
[not found] ` <CGME20240625094443epcas5p3093ac786a7d0f09de5a3bba17bbd4458@epcas5p3.samsung.com>
2024-06-25 9:38 ` [PATCH 2/3] PCI: debugfs: Add support for RASDES framework in DWC Shradha Todi
2024-07-01 11:09 ` Jonathan Cameron
2024-07-19 12:12 ` Shradha Todi
2024-07-24 17:15 ` Manivannan Sadhasivam
2024-07-26 17:41 ` Bjorn Helgaas
[not found] ` <CGME20240625094446epcas5p4e5e864d5f56af0a44e950a426bc9f5f5@epcas5p4.samsung.com>
2024-06-25 9:38 ` [PATCH 3/3] PCI: dwc: Create debugfs files in DWC driver Shradha Todi
2024-07-01 11:10 ` Jonathan Cameron
2024-07-01 11:15 ` [PATCH v3 0/3] Add support for RAS DES feature in PCIe DW Jonathan Cameron
2024-11-26 5:16 ` Krishna Chaitanya Chundru
2024-11-26 5:17 ` Krishna Chaitanya Chundru
2024-11-26 7:15 ` Nitesh Gupta
2024-11-26 10:15 ` Shradha Todi
2021-05-18 17:46 [PATCH 0/3] Add support for RAS DES feature in PCIe DW controller Shradha Todi
[not found] ` <CGME20210518173819epcas5p1ea10c2748b4bb0687184ff04a7a76796@epcas5p1.samsung.com>
2021-05-18 17:46 ` [PATCH 1/3] PCI: dwc: Add support for vendor specific capability search Shradha Todi
2021-05-21 23:31 ` Krzysztof Wilczyński
2021-05-27 11:49 ` Vidya Sagar
2021-05-27 11:54 ` Vidya Sagar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240726173206.GA911626@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=conor.dooley@microchip.com \
--cc=fancer.lancer@gmail.com \
--cc=gost.dev@samsung.com \
--cc=jingoohan1@gmail.com \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=pankaj.dubey@samsung.com \
--cc=robh@kernel.org \
--cc=shradha.t@samsung.com \
--cc=yoshihiro.shimoda.uh@renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).