[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251118221244.372423-1-rrendec@redhat.com>
Date: Tue, 18 Nov 2025 17:12:42 -0500
From: Radu Rendec <rrendec@...hat.com>
To: Marc Zyngier <maz@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Manivannan Sadhasivam <mani@...nel.org>
Cc: Will Deacon <will@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof WilczyĆski <kwilczynski@...nel.org>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
linux-pci@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 0/2] PCI: host-common: Allow drivers to use the device's drvdata pointer
Currently there's only one user of pci_host_common_init(), the
pcie-apple driver, and it goes to great lengths to store its own
per-device private pointer, because the device's drvdata is used by
pci_host_common_init() to store a pointer to struct pci_host_bridge.
See commit 643c0c9d0496 ("PCI: apple: Add tracking of probed root
ports").
However, it looks like this is necessary only for simple drivers that
use pci_host_common_{probe,remove}() directly as their platform
probe/remove functions. More complex drivers that allocate their own
private structure, like pcie-apple, can store a pointer to that instead;
the pointer to struct pci_host_bridge can be encapsulated in the private
structure if it's needed.
The first patch changes the pci-host-common library to free up drvdata
for drivers that do not use pci_host_common_{probe,remove}() directly.
The second patch uses the changes in the first patch to simplify the
pointer storage logic. This patch is *untested* because I don't have
access to the hardware.
Radu Rendec (2):
PCI: host-common: Do not set drvdata in pci_host_common_init()
PCI: apple: Store private pointer in platform device's drvdata
drivers/pci/controller/pci-host-common.c | 36 +++++++++++-----
drivers/pci/controller/pci-host-common.h | 6 ++-
drivers/pci/controller/pcie-apple.c | 53 ++++--------------------
3 files changed, 36 insertions(+), 59 deletions(-)
--
2.51.1
Powered by blists - more mailing lists