From: Hans Zhang <18255117159@163.com>
To: Bjorn Helgaas <helgaas@kernel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Siddharth Vadapalli <s-vadapalli@ti.com>,
lpieralisi@kernel.org, kw@linux.com, robh@kernel.org,
bhelgaas@google.com, bwawrzyn@cisco.com,
thomas.richard@bootlin.com,
wojciech.jasko-EXT@continental-corporation.com,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [v2] PCI: cadence: Add configuration space capability search API
Date: Sat, 15 Mar 2025 08:06:52 +0800 [thread overview]
Message-ID: <88a44822-9b1a-4d59-a4ce-926d12f73147@163.com> (raw)
In-Reply-To: <20250314203157.GA793598@bhelgaas>
On 2025/3/15 04:31, Bjorn Helgaas wrote:
> On Fri, Mar 14, 2025 at 06:35:11PM +0530, Manivannan Sadhasivam wrote:
>> ...
>
>> Even though this patch is mostly for an out of tree controller
>> driver which is not going to be upstreamed, the patch itself is
>> serving some purpose. I really like to avoid the hardcoded offsets
>> wherever possible. So I'm in favor of this patch.
>>
>> However, these newly introduced functions are a duplicated version
>> of DWC functions. So we will end up with duplicated functions in
>> multiple places. I'd like them to be moved (both this and DWC) to
>> drivers/pci/pci.c if possible. The generic function
>> *_find_capability() can accept the controller specific readl/ readw
>> APIs and the controller specific private data.
>
> I agree, it would be really nice to share this code.
>
> It looks a little messy to deal with passing around pointers to
> controller read ops, and we'll still end up with a lot of duplicated
> code between __pci_find_next_cap() and __cdns_pcie_find_next_cap(),
> etc.
>
> Maybe someday we'll make a generic way to access non-PCI "config"
> space like this host controller space and PCIe RCRBs.
>
> Or if you add interfaces that accept read/write ops, maybe the
> existing pci_find_capability() etc could be refactored on top of them
> by passing in pci_bus_read_config_word() as the accessor.
>
Hi Bjorn,
I have already replied to an email, please help review whether it is
appropriate.
Best regards,
Hans
next prev parent reply other threads:[~2025-03-15 0:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-08 13:39 Hans Zhang
2025-03-09 2:38 ` Siddharth Vadapalli
2025-03-09 3:18 ` Hans Zhang
2025-03-09 5:48 ` Siddharth Vadapalli
2025-03-09 9:49 ` Hans Zhang
2025-03-09 10:02 ` Siddharth Vadapalli
2025-03-10 15:09 ` Hans Zhang
2025-03-14 13:05 ` Manivannan Sadhasivam
2025-03-14 20:31 ` Bjorn Helgaas
2025-03-15 0:06 ` Hans Zhang [this message]
2025-03-20 21:28 ` Bjorn Helgaas
2025-03-21 1:09 ` Hans Zhang
2025-03-15 0:05 ` 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=88a44822-9b1a-4d59-a4ce-926d12f73147@163.com \
--to=18255117159@163.com \
--cc=bhelgaas@google.com \
--cc=bwawrzyn@cisco.com \
--cc=helgaas@kernel.org \
--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=s-vadapalli@ti.com \
--cc=thomas.richard@bootlin.com \
--cc=wojciech.jasko-EXT@continental-corporation.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
all inboxes | Powered by JetHome®