From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0EB1606A31E for ; Mon, 23 Nov 2026 11:38:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=oarwF6mF; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=ErTUaYgV DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=D0XxOveY3MvX4YNA5Xd6Wt1k8TtEcHHOm0lTDavOO54=; b=oarwF6mFxnCwBRoN9nnIL21ReN vV/Cjlb53Ruyb4wHhIUQqlDnthzsYWz0p+XWqbDWk7RLi9aZTCNn9saC9Fe5k644+F4Tz1SjnbyMb 7gNFnakq89qqAw7+CapP/Po1gcQsWv2CefqVaY9OBRbggV4b9Up3evw5VxIGZfNMi0uuYgTPeLZLW 218MA7vY6z5YTSCNRnSs66tyAv65ERDaK7nH703A4qN3ATuu+R7DT+O3V1gGzlHkTm0FrEj4ExXrG VHTgHcDaxTNK45jTIb5AZTZFpMiSTN0UM1ne0F2gup7n0djUEedhevX7nBB2fG/ctm4gUj/hDrHHR QQyjqW0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xVSMn-00000003Cfo-0cPH; Mon, 23 Nov 2026 11:37:49 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xVSMh-00000003CWs-3GqH; Mon, 23 Nov 2026 11:37:44 +0000 X-UUID: 4918d782e73211f1acbe4559397dec65-20261123 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=D0XxOveY3MvX4YNA5Xd6Wt1k8TtEcHHOm0lTDavOO54=; b=ErTUaYgVbge0eg7FoHBWn7/VYkyBYYxFHirm1FJSoae9LUe4ns8YTOW5UH3lVyOEvtYt6lhnTAEAgmYv2Ky1oONdmaNC/3hGJvEFHbOuzGIUTknn3WCj83inEOXdmcJYDRiZhQJPJO9F3FKS73RJ2dPhOZv/lblM9pHMOGxDx0I=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.21,REQID:2d5574c6-c684-429f-b56a-964ccbd75d60,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:b0318ac,CLOUDID:035b3c31-f289-4656-bb36-27baf4489f11,B ulkID:nil,BulkQuantity:0,SF:81|82|102|836|865|888|898,TC:-5,Content:0|15|5 0|99,EDM:-3,IP:nil,URL:0,File:130,RT:0,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0 ,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 4918d782e73211f1acbe4559397dec65-20261123 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1501865315; Mon, 23 Nov 2026 04:37:38 -0700 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by MTKMBS14N2.mediatek.inc (172.21.101.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Mon, 23 Nov 2026 19:37:34 +0800 Received: from gcnsap21.gcn.mediatek.inc (10.17.81.22) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.2562.53 via Frontend Transport; Mon, 23 Nov 2026 19:37:33 +0800 From: Chunfeng Yun To: Mika Westerberg CC: Andreas Noever , Konrad Dybcio , Sven Peter , Yehezkel Bernat , Matthias Brugger , Greg Kroah-Hartman , AngeloGioacchino Del Regno , , , , , Chunfeng Yun Subject: [PATCH v3 1/8] thunderbolt: Prefix NHI core functions with tb_ and tb_ring_ Date: Mon, 23 Nov 2026 19:36:48 +0800 Message-ID: <20261123113705.2297329-2-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261123113705.2297329-1-chunfeng.yun@mediatek.com> References: <20261123113705.2297329-1-chunfeng.yun@mediatek.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261123_033743_824099_025493C3 X-CRM114-Status: GOOD ( 18.63 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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 - nhi_msi -> tb_nhi_isr - nhi_probe -> tb_nhi_probe - nhi_shutdown -> tb_nhi_shutdown - nhi_pm_ops -> tb_nhi_pm_ops Signed-off-by: Chunfeng Yun --- v3: no changes --- drivers/thunderbolt/nhi.c | 14 +++++++------- drivers/thunderbolt/nhi.h | 10 +++++----- drivers/thunderbolt/pci.c | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c index e99a3fcc4a29..c574c336f25b 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); @@ -1072,7 +1072,7 @@ void nhi_interrupt_work(struct work_struct *work) spin_unlock_irq(&nhi->lock); } -irqreturn_t nhi_msi(int irq, void *data) +irqreturn_t tb_nhi_isr(int irq, void *data) { struct tb_nhi *nhi = data; schedule_work(&nhi->interrupt_work); @@ -1216,7 +1216,7 @@ static int nhi_runtime_resume(struct device *dev) return tb_domain_runtime_resume(tb); } -void nhi_shutdown(struct tb_nhi *nhi) +void tb_nhi_shutdown(struct tb_nhi *nhi) { int i; @@ -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; @@ -1371,7 +1371,7 @@ int nhi_probe(struct tb_nhi *nhi) */ tb_domain_put(tb); wait_for_completion(&nhi->domain_released); - nhi_shutdown(nhi); + tb_nhi_shutdown(nhi); return dev_err_probe(dev, res, "failed to add domain\n"); } dev_set_drvdata(dev, tb); @@ -1391,7 +1391,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..a36c62c49a5c 100644 --- a/drivers/thunderbolt/nhi.h +++ b/drivers/thunderbolt/nhi.h @@ -32,11 +32,11 @@ enum nhi_fw_mode nhi_mailbox_mode(struct tb_nhi *nhi); 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); -void nhi_shutdown(struct tb_nhi *nhi); -extern const struct dev_pm_ops nhi_pm_ops; +irqreturn_t tb_nhi_isr(int irq, void *data); +irqreturn_t tb_ring_msix(int irq, void *data); +int tb_nhi_probe(struct tb_nhi *nhi); +void tb_nhi_shutdown(struct tb_nhi *nhi); +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..2f0abf4d27a3 100644 --- a/drivers/thunderbolt/pci.c +++ b/drivers/thunderbolt/pci.c @@ -212,7 +212,7 @@ static int nhi_pci_init_msi(struct tb_nhi *nhi) if (irq < 0) return irq; - res = devm_request_irq(&pdev->dev, irq, nhi_msi, + res = devm_request_irq(&pdev->dev, irq, tb_nhi_isr, IRQF_NO_SUSPEND, "thunderbolt", nhi); if (res) return res; @@ -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) @@ -610,7 +610,7 @@ static void nhi_pci_do_remove(struct pci_dev *pdev, bool reset) tb_domain_remove(tb); wait_for_completion(&nhi->domain_released); - nhi_shutdown(nhi); + tb_nhi_shutdown(nhi); } static void nhi_pci_remove(struct pci_dev *pdev) @@ -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