Re: [PATCH v3 1/8] thunderbolt: Prefix NHI core functions with tb_ and tb_ring_
From: Chunfeng Yun (云春峰)
Date: Wed Nov 25 2026 - 01:44:02 EST
On 二, 2026-11-24 at 17:11 +0100, Mika Westerberg wrote:
> On Mon, Nov 23, 2026 at 07:36:48PM +0800, Chunfeng Yun wrote:
> > In preparation for modularizing PCIe NHI support and allowing PCIe
> > and platform NHI drivers to be built as separate modules atop the
> > Thunderbolt core framework, several NHI functions and structures
> > will
> > need to be exported.
> >
> > Currently, several of these functions lack standard subsystem
> > prefixes,
> > risking namespace pollution or collisions across the flat kernel
> > symbol
> > namespace:
> >
> > - ring_msix() lacks any subsystem prefix and diverges from all
> > other
> > exported ring functions in the driver, which use the "tb_ring_"
> > prefix.
> > - nhi_probe(), nhi_shutdown(), and nhi_pm_ops lack the standard
> > "tb_"
> > prefix used across the Thunderbolt public interface (such as
> > struct
> > tb_nhi and struct tb_nhi_ops).
> > - nhi_msi() is named after PCI MSI, even though the ISR simply
> > schedules
> > the interrupt work and can serve as a generic ISR for non-PCIe
> > platform
> > controllers as well.
> >
> > Rename these functions and symbols to conform to Thunderbolt
> > subsystem
> > naming conventions before exporting them:
> >
> > - ring_msix -> tb_ring_msix
>
> I think we can move MSI-X completely to pci.c. As far as I can tell
> ARM
> stuff is not going to need that. While there we can drop MSI, that
> has been
> never used (MSI-X was supported from day 0 by the HW).
If move MSI-X completely to pci.c, then will rename and export another
two functions:
__ring_interrupt()
ring_interrupt_index()
is it fine for you?
>
> Then I would just make the glue driver to pass ->irq to the core
> driver and
> if that's set it does the request_irq() and so on. And PCI side does
> not
> fill that because it uses MSIX always. Then we don't need to export
> the
> interrupt handler functions either.
Sure.
Thanks
>
> > - nhi_msi -> tb_nhi_isr
>
>
> > - nhi_probe -> tb_nhi_probe
> > - nhi_shutdown -> tb_nhi_shutdown
> > - nhi_pm_ops -> tb_nhi_pm_ops
>
> These are good.