public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
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: Mon, 1 Jul 2024 11:55:50 +0100	[thread overview]
Message-ID: <20240701115550.00004200@Huawei.com> (raw)
In-Reply-To: <20240625093813.112555-2-shradha.t@samsung.com>

On Tue, 25 Jun 2024 15:08:11 +0530
Shradha Todi <shradha.t@samsung.com> 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;
> +
> +	while ((vsec = dw_pcie_find_next_ext_capability(pci, vsec,
> +					PCI_EXT_CAP_ID_VNDR))) {

Trivial but one more set of outer brackets than makes sense here.

> +		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);
> +
>  u16 dw_pcie_find_ext_capability(struct dw_pcie *pci, u8 cap)
>  {
>  	return dw_pcie_find_next_ext_capability(pci, 0, cap);
> diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h
> index f8e5431a207b..77686957a30d 100644
> --- a/drivers/pci/controller/dwc/pcie-designware.h
> +++ b/drivers/pci/controller/dwc/pcie-designware.h
> @@ -423,6 +423,7 @@ void dw_pcie_version_detect(struct dw_pcie *pci);
>  
>  u8 dw_pcie_find_capability(struct dw_pcie *pci, u8 cap);
>  u16 dw_pcie_find_ext_capability(struct dw_pcie *pci, u8 cap);
> +u16 dw_pcie_find_vsec_capability(struct dw_pcie *pci, u8 vsec_cap);
>  
>  int dw_pcie_read(void __iomem *addr, int size, u32 *val);
>  int dw_pcie_write(void __iomem *addr, int size, u32 val);


  reply	other threads:[~2024-07-01 10:55 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
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 [this message]
2024-07-26 17:32     ` Bjorn Helgaas
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
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
     [not found] <CGME20210518173819epcas5p1ea10c2748b4bb0687184ff04a7a76796@epcas5p1.samsung.com>
2021-05-18 17:46 ` [PATCH 0/3] Add support for RAS DES feature in PCIe DW controller Shradha Todi
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=20240701115550.00004200@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --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