Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Hans Zhang <18255117159@163.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: lpieralisi@kernel.org, bhelgaas@google.com,
	manivannan.sadhasivam@linaro.org, kw@linux.com,
	cassel@kernel.org, robh@kernel.org, jingoohan1@gmail.com,
	thomas.richard@bootlin.com, linux-pci@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v10 3/6] PCI: Refactor capability search into common macros
Date: Wed, 30 Apr 2025 23:49:42 +0800	[thread overview]
Message-ID: <96f0f689-5fa1-40b1-9381-41dbd4836ad6@163.com> (raw)
In-Reply-To: <df929c0d-f318-023e-cf7d-97a2b344f6fc@linux.intel.com>



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


  reply	other threads:[~2025-04-30 15:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-29 12:50 [PATCH v10 0/6] Refactor capability search into common macros Hans Zhang
2025-04-29 12:50 ` [PATCH v10 1/6] PCI: Introduce generic bus config read helper function Hans Zhang
2025-04-29 12:50 ` [PATCH v10 2/6] PCI: Clean up __pci_find_next_cap_ttl() readability Hans Zhang
2025-04-29 15:17   ` Ilpo Järvinen
2025-04-29 15:23     ` Hans Zhang
2025-04-29 15:26     ` Hans Zhang
2025-04-29 12:50 ` [PATCH v10 3/6] PCI: Refactor capability search into common macros Hans Zhang
2025-04-30  8:03   ` Ilpo Järvinen
2025-04-30 15:49     ` Hans Zhang [this message]
2025-04-29 12:50 ` [PATCH v10 4/6] PCI: dwc: Use common PCI host bridge APIs for finding the capabilities Hans Zhang
2025-04-29 12:50 ` [PATCH v10 5/6] PCI: cadence: " Hans Zhang
2025-04-29 12:50 ` [PATCH v10 6/6] PCI: cadence: Use cdns_pcie_find_*capability to avoid hardcode Hans Zhang

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=96f0f689-5fa1-40b1-9381-41dbd4836ad6@163.com \
    --to=18255117159@163.com \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jingoohan1@gmail.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=robh@kernel.org \
    --cc=thomas.richard@bootlin.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