[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250321130010.s6svrtqlpdkgxmir@thinkpad>
Date: Fri, 21 Mar 2025 18:30:10 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Hans Zhang <18255117159@....com>
Cc: lpieralisi@...nel.org, kw@...ux.com, robh@...nel.org,
bhelgaas@...gle.com, jingoohan1@...il.com,
thomas.richard@...tlin.com, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [v4 1/4] PCI: Introduce generic capability search functions
On Fri, Mar 21, 2025 at 06:17:07PM +0800, Hans Zhang wrote:
> Existing controller drivers (e.g., DWC, custom out-of-tree drivers)
> duplicate logic for scanning PCI capability lists. This creates
> maintenance burdens and risks inconsistencies.
>
> To resolve this:
>
> 1. Add pci_generic_find_capability() and pci_generic_find_ext_capability()
> in drivers/pci/pci.c, accepting controller-specific read functions
> and device data as parameters.
>
I'd reword pci_generic* as pci_host_bridge* to reflect the fact that these APIs
are meant for host bridges.
> 2. Refactor dwc_pcie_find_capability() and similar functions to utilize
> these new generic interfaces.
>
This is not part of this patch. So should be dropped.
> 3. Update out-of-tree drivers to leverage the common implementation,
> eliminating code duplication.
>
This also.
> This approach:
> - Centralizes critical PCI capability scanning logic
> - Allows flexible adaptation to varied hardware access methods
> - Reduces future maintenance overhead
> - Aligns with kernel code reuse best practices
>
> Tested with DWC PCIe controller and CDNS PCIe drivers.
>
This tested info is also not required since the DWC and CDNS changes are not
part of this patch.
- Mani
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists