lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <370e4055-c44b-460c-9ac3-ccac37527c8f@163.com>
Date: Fri, 21 Mar 2025 21:57:37 +0800
From: Hans Zhang <18255117159@....com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
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 2025/3/21 21:00, Manivannan Sadhasivam wrote:
> 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.
> 

Hi Mani,

Thanks your for reply. Will change.

>> 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.

Will change.

>> 3. Update out-of-tree drivers to leverage the common implementation,
>> eliminating code duplication.
>>
> 
> This also.

Will change.

>> 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.

Will change.

Best regards,
Hans


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ