[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <96f0f689-5fa1-40b1-9381-41dbd4836ad6@163.com>
Date: Wed, 30 Apr 2025 23:49:42 +0800
From: Hans Zhang <18255117159@....com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: lpieralisi@...nel.org, bhelgaas@...gle.com,
manivannan.sadhasivam@...aro.org, kw@...ux.com, cassel@...nel.org,
robh@...nel.org, jingoohan1@...il.com, thomas.richard@...tlin.com,
linux-pci@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v10 3/6] PCI: Refactor capability search into common
macros
On 2025/4/30 16:03, Ilpo Järvinen wrote:
> On Tue, 29 Apr 2025, Hans Zhang wrote:
>
>> The PCI Capability search functionality is duplicated across the PCI core
>> and several controller drivers. The core's current implementation requires
>> fully initialized PCI device and bus structures, which prevents controller
>> drivers from using it during early initialization phases before these
>> structures are available.
>>
>> Move the Capability search logic into a header-based macro that accepts a
>> config space accessor function as an argument. This enables controller
>> drivers to perform Capability discovery using their early access
>> mechanisms prior to full device initialization while sharing the
>> Capability search code.
>>
>> Convert the existing PCI core Capability search implementation to use this
>> new macro.
>>
>> The macros now implement, parameterized by the config access method. The
>
> This sentence is incomplete (and sounds pretty much duplicated
> information anyway).
>
Dear Ilpo,
Thank you very much for pointing out my problems patiently. These will
be deleted.
>> PCI core functions are converted to utilize these macros with the standard
>> pci_bus_read_config accessors.
>
> This info is duplicated.
>
Will delete.
>> Controller drivers can later use the same
>> macros with their early access mechanisms while maintaining the existing
>> protection against infinite loops through preserved TTL checks.
>>
>> The ttl parameter was originally an additional safeguard to prevent
>> infinite loops in corrupted config space. However, the
>> PCI_FIND_NEXT_CAP_TTL macro already enforces a TTL limit internally.
>> Removing redundant ttl handling simplifies the interface while maintaining
>> the safety guarantee. This aligns with the macro's design intent of
>> encapsulating TTL management.
Best regards,
Hans
Powered by blists - more mailing lists