linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: "Serge Semin" <Sergey.Semin@baikalelectronics.ru>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Cai Huoqing" <cai.huoqing@linux.dev>,
	"Robin Murphy" <robin.murphy@arm.com>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Gustavo Pimentel" <gustavo.pimentel@synopsys.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>
Cc: Serge Semin <fancer.lancer@gmail.com>,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,
	Frank Li <Frank.Li@nxp.com>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	caihuoqing <caihuoqing@baidu.com>, Vinod Koul <vkoul@kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v6 17/20] PCI: dwc: Introduce generic resources getter
Date: Wed, 9 Nov 2022 02:17:45 +0000	[thread overview]
Message-ID: <TYBPR01MB534178751E369DA4C031AE77D83E9@TYBPR01MB5341.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <20221107204934.32655-18-Sergey.Semin@baikalelectronics.ru>

Hi Serge,

> From: Serge Semin, Sent: Tuesday, November 8, 2022 5:50 AM
> 
> Currently the DW PCIe Root Port and Endpoint CSR spaces are retrieved in
> the separate parts of the DW PCIe core driver. It doesn't really make
> sense since the both controller types have identical set of the core CSR
> regions: DBI, DBI CS2 and iATU/eDMA. Thus we can simplify the DW PCIe Host
> and EP initialization methods by moving the platform-specific registers
> space getting and mapping into a common method. It gets to be even more
> justified seeing the CSRs base address pointers are preserved in the
> common DW PCIe descriptor. Note all the OF-based common DW PCIe settings
> initialization will be moved to the new method too in order to have a
> single function for all the generic platform properties handling in single
> place.
> 
> A nice side-effect of this change is that the pcie-designware-host.c and
> pcie-designware-ep.c drivers are cleaned up from all the direct dw_pcie
> storage modification, which makes the DW PCIe core, Root Port and Endpoint
> modules more coherent.
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> Reviewed-by: Rob Herring <robh@kernel.org>
> 
> ---
> 
> Changelog v3:
> - This is a new patch created on v3 lap of the series.
> 
> Changelog v4:
> - Convert the method name from dw_pcie_get_res() to
>   dw_pcie_get_resources(). (@Bjorn)
> ---
>  .../pci/controller/dwc/pcie-designware-ep.c   | 26 +------
>  .../pci/controller/dwc/pcie-designware-host.c | 15 +---
>  drivers/pci/controller/dwc/pcie-designware.c  | 75 ++++++++++++++-----
>  drivers/pci/controller/dwc/pcie-designware.h  |  3 +
>  4 files changed, 65 insertions(+), 54 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
> index 237bb01d7852..80a64b63c055 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-ep.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
> @@ -13,8 +13,6 @@
>  #include <linux/pci-epc.h>
>  #include <linux/pci-epf.h>
> 
> -#include "../../pci.h"
> -
>  void dw_pcie_ep_linkup(struct dw_pcie_ep *ep)
>  {
>  	struct pci_epc *epc = ep->epc;
> @@ -688,29 +686,14 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep)
>  	struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
>  	struct device *dev = pci->dev;
>  	struct platform_device *pdev = to_platform_device(dev);
> -	struct device_node *np = dev->of_node;

Removing this np causes the following build error if CONFIG_PCIE_DW_EP is enabled:
---
  CC      drivers/pci/controller/dwc/pcie-designware-ep.o
drivers/pci/controller/dwc/pcie-designware-ep.c: In function 'dw_pcie_ep_init':
drivers/pci/controller/dwc/pcie-designware-ep.c:751:35: error: 'np' undeclared (first use in this function); did you mean 'ep'?
  751 |         ret = of_property_read_u8(np, "max-functions", &epc->max_functions);
      |                                   ^~
      |                                   ep
drivers/pci/controller/dwc/pcie-designware-ep.c:751:35: note: each undeclared identifier is reported only once for each function it appears in
---

So, we should keep the np or use "dev->of_node" to the of_property_read_u8().

Best regards,
Yoshihiro Shimoda


  reply	other threads:[~2022-11-09  2:17 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 20:49 [PATCH v6 00/20] PCI: dwc: Add generic resources and Baikal-T1 support Serge Semin
2022-11-07 20:49 ` [PATCH v6 01/20] dt-bindings: imx6q-pcie: Fix clock names for imx6sx and imx8mq Serge Semin
2022-11-10 21:01   ` Rob Herring
2022-11-11 11:00     ` Serge Semin
2022-11-07 20:49 ` [PATCH v6 02/20] dt-bindings: visconti-pcie: Fix interrupts array max constraints Serge Semin
2022-11-07 20:49 ` [PATCH v6 03/20] dt-bindings: PCI: dwc: Detach common RP/EP DT bindings Serge Semin
2022-11-07 20:49 ` [PATCH v6 04/20] dt-bindings: PCI: dwc: Remove bus node from the examples Serge Semin
2022-11-07 20:49 ` [PATCH v6 05/20] dt-bindings: PCI: dwc: Add phys/phy-names common properties Serge Semin
2022-11-10 21:01   ` Rob Herring
2022-11-07 20:49 ` [PATCH v6 06/20] dt-bindings: PCI: dwc: Add max-link-speed common property Serge Semin
2022-11-07 20:49 ` [PATCH v6 07/20] dt-bindings: PCI: dwc: Apply generic schema for generic device only Serge Semin
2022-11-07 20:49 ` [PATCH v6 08/20] dt-bindings: PCI: dwc: Add max-functions EP property Serge Semin
2022-11-07 20:49 ` [PATCH v6 09/20] dt-bindings: PCI: dwc: Add interrupts/interrupt-names common properties Serge Semin
2022-11-08 12:40   ` Yoshihiro Shimoda
2022-11-08 13:52     ` Serge Semin
2022-11-08 22:32       ` Rob Herring
2022-11-10 12:26         ` Serge Semin
2022-11-10 21:18   ` Rob Herring
2022-11-07 20:49 ` [PATCH v6 10/20] dt-bindings: PCI: dwc: Add reg/reg-names " Serge Semin
2022-11-10 21:22   ` Rob Herring
2022-11-07 20:49 ` [PATCH v6 11/20] dt-bindings: PCI: dwc: Add clocks/resets " Serge Semin
2022-11-10 21:23   ` Rob Herring
2022-11-11 11:04     ` Serge Semin
2022-11-07 20:49 ` [PATCH v6 12/20] dt-bindings: PCI: dwc: Add dma-coherent property Serge Semin
2022-11-07 20:49 ` [PATCH v6 13/20] dt-bindings: PCI: dwc: Apply common schema to Rockchip DW PCIe nodes Serge Semin
2022-11-07 20:49 ` [PATCH v6 14/20] dt-bindings: PCI: dwc: Add Baikal-T1 PCIe Root Port bindings Serge Semin
2022-11-07 20:49 ` [PATCH v6 15/20] PCI: dwc: Introduce dma-ranges property support for RC-host Serge Semin
2022-11-07 20:49 ` [PATCH v6 16/20] PCI: dwc: Introduce generic controller capabilities interface Serge Semin
2022-11-07 20:49 ` [PATCH v6 17/20] PCI: dwc: Introduce generic resources getter Serge Semin
2022-11-09  2:17   ` Yoshihiro Shimoda [this message]
2022-11-10 13:10     ` Serge Semin
2022-11-07 20:49 ` [PATCH v6 18/20] PCI: dwc: Combine iATU detection procedures Serge Semin
2022-11-07 20:49 ` [PATCH v6 19/20] PCI: dwc: Introduce generic platform clocks and resets Serge Semin
2022-11-07 20:49 ` [PATCH v6 20/20] PCI: dwc: Add Baikal-T1 PCIe controller support Serge Semin

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=TYBPR01MB534178751E369DA4C031AE77D83E9@TYBPR01MB5341.jpnprd01.prod.outlook.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=Frank.Li@nxp.com \
    --cc=Pavel.Parkhomenko@baikalelectronics.ru \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=bhelgaas@google.com \
    --cc=cai.huoqing@linux.dev \
    --cc=caihuoqing@baidu.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=jingoohan1@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=vkoul@kernel.org \
    /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).