From: Aksh Garg <a-garg7@ti.com>
To: "Linmao Li" <lilinmao@kylinos.cn>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>
Cc: Rob Herring <robh@kernel.org>, Tom Joseph <tjoseph@cadence.com>,
"Vladimir Oltean" <vladimir.oltean@nxp.com>,
<linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PCI: cadence: Store the core controller in platform drvdata
Date: Tue, 15 Sep 2026 11:22:01 +0530 [thread overview]
Message-ID: <14112866-62d3-43f5-985f-942baa5b5637@ti.com> (raw)
In-Reply-To: <20260915030044.4019259-1-lilinmao@kylinos.cn>
On 15/09/26 08:30, Linmao Li wrote:
> cdns_plat_pcie_probe() stores a struct cdns_plat_pcie pointer with
> platform_set_drvdata(). cdns_plat_pcie_shutdown() and the callbacks in
> cdns_pcie_pm_ops retrieve the same pointer with dev_get_drvdata() and
> use it as a struct cdns_pcie pointer. This makes them read phy_count
> and phy beyond the wrapper.
>
> Store the wrapped struct cdns_pcie pointer instead.
>
> Fixes: bd22885aa188 ("PCI: cadence: Refactor driver to use as a core library")
> Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
> ---
Hi Linmao,
Since commit e111ac7025cb ("PCI: cadence: Drop unused member from struct
cdns_plat_pcie"), struct cdns_plat_pcie only contains a pointer to
struct cdns_pcie.
As sashiko pointed pointed, struct cdns_plat_pcie now becomes redundant
and should be removed.
Regards,
Aksh Garg
> drivers/pci/controller/cadence/pcie-cadence-plat.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/cadence/pcie-cadence-plat.c b/drivers/pci/controller/cadence/pcie-cadence-plat.c
> index 13edc6be21f5..7fef237cdbb7 100644
> --- a/drivers/pci/controller/cadence/pcie-cadence-plat.c
> +++ b/drivers/pci/controller/cadence/pcie-cadence-plat.c
> @@ -55,7 +55,6 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev)
> if (!cdns_plat_pcie)
> return -ENOMEM;
>
> - platform_set_drvdata(pdev, cdns_plat_pcie);
> if (is_rc) {
> if (!IS_ENABLED(CONFIG_PCIE_CADENCE_PLAT_HOST))
> return -ENODEV;
> @@ -114,6 +113,8 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev)
> goto err_init;
> }
>
> + platform_set_drvdata(pdev, cdns_plat_pcie->pcie);
> +
> return 0;
>
> err_init:
>
> base-commit: 9a9d18547ddc97a73d5d90cff4d5aef90bd8c15d
prev parent reply other threads:[~2026-09-15 5:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 3:00 Linmao Li
2026-09-15 5:52 ` Aksh Garg [this message]
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=14112866-62d3-43f5-985f-942baa5b5637@ti.com \
--to=a-garg7@ti.com \
--cc=bhelgaas@google.com \
--cc=kwilczynski@kernel.org \
--cc=lilinmao@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=robh@kernel.org \
--cc=tjoseph@cadence.com \
--cc=vladimir.oltean@nxp.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
all inboxes | Powered by JetHome®