mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Mika Westerberg <westeri@kernel.org>
Cc: Andreas Noever <andreas.noever@gmail.com>,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Sven Peter <sven@kernel.org>,
	Yehezkel Bernat <YehezkelShB@gmail.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	<linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>
Subject: [PATCH v4 02/14] thunderbolt: Prefix NHI core symbols with tb_ and tb_ring_
Date: Sat, 5 Dec 2026 16:33:27 +0800	[thread overview]
Message-ID: <20261205083342.4009278-3-chunfeng.yun@mediatek.com> (raw)
In-Reply-To: <20261205083342.4009278-1-chunfeng.yun@mediatek.com>

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

Rename these functions and symbols to conform to Thunderbolt subsystem
naming conventions before exporting them:

- ring_msix       -> tb_ring_msix
- nhi_probe       -> tb_nhi_probe
- nhi_pm_ops      -> tb_nhi_pm_ops

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v4: Dropped renaming of nhi_msi and nhi_shutdown

v3: no changes
v2: new patch
---
 drivers/thunderbolt/nhi.c | 8 ++++----
 drivers/thunderbolt/nhi.h | 6 +++---
 drivers/thunderbolt/pci.c | 6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index d998d3caad75..01311ad1f693 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -535,7 +535,7 @@ static void ring_clear_msix(const struct tb_ring *ring)
 			  4 * (ring->nhi->hop_count / 32));
 }
 
-irqreturn_t ring_msix(int irq, void *data)
+irqreturn_t tb_ring_msix(int irq, void *data)
 {
 	struct tb_ring *ring = data;
 
@@ -935,7 +935,7 @@ void tb_ring_free(struct tb_ring *ring)
 
 	/*
 	 * ring->work can no longer be scheduled (it is scheduled only
-	 * by nhi_interrupt_work, ring_stop and ring_msix). Wait for it
+	 * by nhi_interrupt_work, ring_stop and tb_ring_msix). Wait for it
 	 * to finish before freeing the ring.
 	 */
 	flush_work(&ring->work);
@@ -1306,7 +1306,7 @@ static struct tb *nhi_select_cm(struct tb_nhi *nhi)
 	return tb;
 }
 
-int nhi_probe(struct tb_nhi *nhi)
+int tb_nhi_probe(struct tb_nhi *nhi)
 {
 	struct device *dev = nhi->dev;
 	struct tb *tb;
@@ -1399,7 +1399,7 @@ int nhi_probe(struct tb_nhi *nhi)
  * the tunnels asap. A corresponding pci quirk blocks the downstream bridges
  * resume_noirq until we are done.
  */
-const struct dev_pm_ops nhi_pm_ops = {
+const struct dev_pm_ops tb_nhi_pm_ops = {
 	.suspend_noirq = nhi_suspend_noirq,
 	.resume_noirq = nhi_resume_noirq,
 	.freeze_noirq = nhi_freeze_noirq,  /*
diff --git a/drivers/thunderbolt/nhi.h b/drivers/thunderbolt/nhi.h
index 88af9ab9fde7..594a38b4225d 100644
--- a/drivers/thunderbolt/nhi.h
+++ b/drivers/thunderbolt/nhi.h
@@ -33,10 +33,10 @@ void nhi_enable_int_throttling(struct tb_nhi *nhi);
 void nhi_disable_interrupts(struct tb_nhi *nhi);
 void nhi_interrupt_work(struct work_struct *work);
 irqreturn_t nhi_msi(int irq, void *data);
-irqreturn_t ring_msix(int irq, void *data);
-int nhi_probe(struct tb_nhi *nhi);
+irqreturn_t tb_ring_msix(int irq, void *data);
+int tb_nhi_probe(struct tb_nhi *nhi);
 void nhi_shutdown(struct tb_nhi *nhi);
-extern const struct dev_pm_ops nhi_pm_ops;
+extern const struct dev_pm_ops tb_nhi_pm_ops;
 
 /**
  * struct tb_nhi_ops - NHI specific optional operations
diff --git a/drivers/thunderbolt/pci.c b/drivers/thunderbolt/pci.c
index 4408229d8ac7..9cdfadf8b1b7 100644
--- a/drivers/thunderbolt/pci.c
+++ b/drivers/thunderbolt/pci.c
@@ -281,7 +281,7 @@ static int nhi_pci_ring_request_msix(struct tb_ring *ring, bool no_suspend)
 	ring->irq = ret;
 
 	irqflags = no_suspend ? IRQF_NO_SUSPEND : 0;
-	ret = request_irq(ring->irq, ring_msix, irqflags, "thunderbolt", ring);
+	ret = request_irq(ring->irq, tb_ring_msix, irqflags, "thunderbolt", ring);
 	if (ret)
 		goto err_ida_remove;
 
@@ -588,7 +588,7 @@ static int nhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	pci_set_master(pdev);
 
-	return nhi_probe(&nhi_pci->nhi);
+	return tb_nhi_probe(&nhi_pci->nhi);
 }
 
 static void nhi_pci_do_remove(struct pci_dev *pdev, bool reset)
@@ -724,7 +724,7 @@ static struct pci_driver nhi_driver = {
 	.probe = nhi_pci_probe,
 	.remove = nhi_pci_remove,
 	.shutdown = nhi_pci_shutdown,
-	.driver.pm = &nhi_pm_ops,
+	.driver.pm = &tb_nhi_pm_ops,
 };
 
 static int __init nhi_init(void)
-- 
2.45.2


  parent reply	other threads:[~2026-12-05  8:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05  8:33 [PATCH v4 00/14] thunderbolt: Add platform NHI driver and modularize PCIe NHI Chunfeng Yun
2026-12-05  8:33 ` [PATCH v4 01/14] thunderbolt: Fix error handling and unwind paths in nhi_probe() Chunfeng Yun
2026-12-05  8:33 ` Chunfeng Yun [this message]
2026-12-05  8:33 ` [PATCH v4 03/14] thunderbolt: Internalize non-MSI-X interrupt request and work in NHI core Chunfeng Yun
2026-12-05  8:33 ` [PATCH v4 04/14] thunderbolt: Encapsulate router device type checks in switch.c Chunfeng Yun
2026-12-05  8:33 ` [PATCH v4 05/14] thunderbolt: Move rpm_complete bus walk to domain.c Chunfeng Yun
2026-12-05  8:33 ` [PATCH v4 06/14] thunderbolt: Consolidate domain and NHI teardown into tb_nhi_remove() Chunfeng Yun
2026-12-05  8:33 ` [PATCH v4 07/14] thunderbolt: Move ICM mailbox functions to icm.c Chunfeng Yun
2026-12-05  8:33 ` [PATCH v4 08/14] thunderbolt: Decouple ICM probe from NHI core via .select_cm hook Chunfeng Yun
2026-12-05  8:33 ` [PATCH v4 09/14] thunderbolt: Make PCIe NHI support opt-in Chunfeng Yun
2026-12-05  8:33 ` [PATCH v4 10/14] thunderbolt: Make nhi->ops optional Chunfeng Yun
2026-12-05  8:33 ` [PATCH v4 11/14] thunderbolt: Add platform NHI driver Chunfeng Yun
2026-12-05  8:33 ` [PATCH v4 12/14] thunderbolt: Increase the lane adapter link-up timeout value Chunfeng Yun
2026-12-05  8:33 ` [PATCH v4 13/14] thunderbolt: Decouple the waiting time of TB_PORT_UNPLUGGED and TB_PORT_UP Chunfeng Yun
2026-12-05  8:33 ` [PATCH v4 14/14] thunderbolt: Drop WARN_ON() in tb_disconnect_pci() Chunfeng Yun

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=20261205083342.4009278-3-chunfeng.yun@mediatek.com \
    --to=chunfeng.yun@mediatek.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=sven@kernel.org \
    --cc=westeri@kernel.org \
    /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®