Skip to contentSkip to conversation

Updates to AMD NTB driver

PATCH In review Basavaraj Natikar 2 participants 4 messages Sep 18, 2025

Subsystems (2)
lore
Share & tools
lore

Basavaraj Natikar

author maintainer
#0 lore raw

v2 cover Updates to AMD NTB driver

This patch series include changes for:
- Adding a new gen CPU support.
- Update for the NTB AMD driver maintainer.

Changes in v2:
- Reformatted block to reduce indentation by using early returns.

Basavaraj Natikar (2):
ntb_hw_amd: Update amd_ntb_get_link_status to support latest
generation secondary topology
MAINTAINERS: Update for the NTB AMD driver maintainer

 MAINTAINERS                     |  1 +
 drivers/ntb/hw/amd/ntb_hw_amd.c | 18 +++++++++++++++++-
 drivers/ntb/hw/amd/ntb_hw_amd.h |  1 +
 3 files changed, 19 insertions(+), 1 deletion(-)
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH v2 1/2 ntb_hw_amd: Update amd_ntb_get_link_status to support latest generation secondary topology

In the NTB secondary topology configuration of the latest generation, the device behaves like an endpoint. Hence, add endpoint support and update amd_ntb_get_link_status to accommodate endpoint devices.

---
 drivers/ntb/hw/amd/ntb_hw_amd.c | 18 +++++++++++++++++-
 drivers/ntb/hw/amd/ntb_hw_amd.h |  1 +
 2 files changed, 18 insertions(+), 1 deletion(-)
drivers/ntb/hw/amd/ntb_hw_amd.c +17 -1
index 63ceed89b62e..1a163596ddf5 100644
@@ -197,13 +197,22 @@ static int amd_ntb_mw_set_trans(struct ntb_dev *ntb, int pidx, int idx,
 
 static int amd_ntb_get_link_status(struct amd_ntb_dev *ndev)
 {
-	struct pci_dev *pdev = NULL;
+	struct pci_dev *pdev = ndev->ntb.pdev;
 	struct pci_dev *pci_swds = NULL;
 	struct pci_dev *pci_swus = NULL;
 	u32 stat;
 	int rc;
 
 	if (ndev->ntb.topo == NTB_TOPO_SEC) {
+		if (ndev->dev_data->is_endpoint) {
+			rc = pcie_capability_read_dword(pdev, PCI_EXP_LNKCTL, &stat);
+			if (rc)
+				return rc;
+
+			ndev->lnk_sta = stat;
+			return 0;
+		}
+
 		/* Locate the pointer to Downstream Switch for this device */
 		pci_swds = pci_upstream_bridge(ndev->ntb.pdev);
 		if (pci_swds) {
@@ -1311,6 +1320,11 @@ static const struct ntb_dev_data dev_data[] = {
 		.mw_count = 2,
 		.mw_idx = 2,
 	},
+	{ /* for device 0x17d7 */
+		.mw_count = 2,
+		.mw_idx = 2,
+		.is_endpoint = true,
+	},
 };
 
 static const struct pci_device_id amd_ntb_pci_tbl[] = {
@@ -1319,6 +1333,8 @@ static const struct pci_device_id amd_ntb_pci_tbl[] = {
 	{ PCI_VDEVICE(AMD, 0x14c0), (kernel_ulong_t)&dev_data[1] },
 	{ PCI_VDEVICE(AMD, 0x14c3), (kernel_ulong_t)&dev_data[1] },
 	{ PCI_VDEVICE(AMD, 0x155a), (kernel_ulong_t)&dev_data[1] },
+	{ PCI_VDEVICE(AMD, 0x17d4), (kernel_ulong_t)&dev_data[1] },
+	{ PCI_VDEVICE(AMD, 0x17d7), (kernel_ulong_t)&dev_data[2] },
 	{ PCI_VDEVICE(HYGON, 0x145b), (kernel_ulong_t)&dev_data[0] },
 	{ 0, }
 };
drivers/ntb/hw/amd/ntb_hw_amd.h +1 -0
index 5f337b1572a0..e8c3165fa38b 100644
@@ -168,6 +168,7 @@ enum {
 struct ntb_dev_data {
 	const unsigned char mw_count;
 	const unsigned int mw_idx;
+	const bool is_endpoint;
 };
 
 struct amd_ntb_dev;
Signature · 1 line
2.25.1
author maintainer
#2 lore raw

PATCH v2 2/2 MAINTAINERS: Update for the NTB AMD driver maintainer

In reply to Basavaraj Natikar

Adding myself to the maintainers list for the ntb_hw_amd driver.

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 6bbe4b4f8ec0..34c72616410a 100644
@@ -18060,6 +18060,7 @@ F:	Documentation/core-api/symbol-namespaces.rst
 F:	scripts/nsdeps
 
 NTB AMD DRIVER
+M:	Basavaraj Natikar <[email protected]>
 M:	Shyam Sundar S K <[email protected]>
 L:	[email protected]
 S:	Supported
Signature · 1 line
2.25.1
maintainer Reviewed-by on the v2 series
#3 lore raw
In reply to Basavaraj Natikar
Quoted 13 lines · Basavaraj Natikar

This patch series include changes for:
- Adding a new gen CPU support.
- Update for the NTB AMD driver maintainer.

Changes in v2:
- Reformatted block to reduce indentation by using early returns.

Basavaraj Natikar (2):
ntb_hw_amd: Update amd_ntb_get_link_status to support latest
generation secondary topology
MAINTAINERS: Update for the NTB AMD driver maintainer

Quoted 5 lines
 MAINTAINERS                     |  1 +
 drivers/ntb/hw/amd/ntb_hw_amd.c | 18 +++++++++++++++++-
 drivers/ntb/hw/amd/ntb_hw_amd.h |  1 +
 3 files changed, 19 insertions(+), 1 deletion(-)

For the series,