[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240521222121.GA51329@bhelgaas>
Date: Tue, 21 May 2024 17:21:21 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Minda Chen <minda.chen@...rfivetech.com>
Cc: Lorenzo Pieralisi <lpieralisi@...nel.org>,
Conor Dooley <conor@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Rob Herring <robh+dt@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Daire McNamara <daire.mcnamara@...rochip.com>,
Emil Renner Berthing <emil.renner.berthing@...onical.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org, linux-pci@...r.kernel.org,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Philipp Zabel <p.zabel@...gutronix.de>,
Mason Huo <mason.huo@...rfivetech.com>,
Leyfoon Tan <leyfoon.tan@...rfivetech.com>,
Kevin Xie <kevin.xie@...rfivetech.com>
Subject: Re: [PATCH v16 08/22] PCI: microchip: Change the argument of
plda_pcie_setup_iomems()
The patch is OK, but the subject line is not very informative. It
should be useful all by itself even without the commit log. "Change
the argument of X" doesn't say anything about why we would want to do
that.
On Thu, Mar 28, 2024 at 05:18:21PM +0800, Minda Chen wrote:
> If other vendor do not select PCI_HOST_COMMON, the driver data is not
> struct pci_host_bridge.
Also, I don't think this is the real problem. Your
PCIE_MICROCHIP_HOST Kconfig selects PCI_HOST_COMMON, and the driver
calls pci_host_common_probe(), so the driver wouldn't even build
without PCI_HOST_COMMON.
This patch is already applied and ready to go, but if you can tell us
what's really going on here, I'd like to update the commit log.
> Move calling platform_get_drvdata() to mc_platform_init().
>
> Signed-off-by: Minda Chen <minda.chen@...rfivetech.com>
> Reviewed-by: Conor Dooley <conor.dooley@...rochip.com>
> ---
> drivers/pci/controller/plda/pcie-microchip-host.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c
> index 9b367927cd32..805870aed61d 100644
> --- a/drivers/pci/controller/plda/pcie-microchip-host.c
> +++ b/drivers/pci/controller/plda/pcie-microchip-host.c
> @@ -876,11 +876,10 @@ static void plda_pcie_setup_window(void __iomem *bridge_base_addr, u32 index,
> writel(0, bridge_base_addr + ATR0_PCIE_WIN0_SRC_ADDR);
> }
>
> -static int plda_pcie_setup_iomems(struct platform_device *pdev,
> +static int plda_pcie_setup_iomems(struct pci_host_bridge *bridge,
> struct plda_pcie_rp *port)
> {
> void __iomem *bridge_base_addr = port->bridge_addr;
> - struct pci_host_bridge *bridge = platform_get_drvdata(pdev);
> struct resource_entry *entry;
> u64 pci_addr;
> u32 index = 1;
> @@ -1018,6 +1017,7 @@ static int mc_platform_init(struct pci_config_window *cfg)
> {
> struct device *dev = cfg->parent;
> struct platform_device *pdev = to_platform_device(dev);
> + struct pci_host_bridge *bridge = platform_get_drvdata(pdev);
> void __iomem *bridge_base_addr =
> port->axi_base_addr + MC_PCIE_BRIDGE_ADDR;
> int ret;
> @@ -1031,7 +1031,7 @@ static int mc_platform_init(struct pci_config_window *cfg)
> mc_pcie_enable_msi(port, cfg->win);
>
> /* Configure non-config space outbound ranges */
> - ret = plda_pcie_setup_iomems(pdev, &port->plda);
> + ret = plda_pcie_setup_iomems(bridge, &port->plda);
> if (ret)
> return ret;
>
> --
> 2.17.1
>
Powered by blists - more mailing lists