Skip to content

Commit 021c218

Browse files
schythanyakunvidia-bfigg
authored andcommitted
NVIDIA: SAUCE: MEDIATEK: platform: Add PCIe Hotplug Driver for CX7 on DGX Spark
BugLink: https://bugs.launchpad.net/bugs/2138269 This driver manages PCIe link for NVIDIA ConnectX-7 (CX7) hot-plug/unplug on DGX Spark systems with GB10 SoC. It disables the PCIe link on cable removal and enables it on cable insertion. Upstream-friendly improvements over 6.14 driver: - Separated from MTK pinctrl driver into NVIDIA platform driver - Configuration via ACPI (_CRS and _DSD), no hardcoded values - Device-managed resources (devm_*) for automatic cleanup - Thread-safe state management with locking - Enhanced error handling and logging - Uses standard Linux kernel APIs The driver exposes a sysfs interface to emulate cable plug in/out: echo 1 > /sys/devices/platform/MTKP0001:00/pcie_hotplug/debug_state # plug in echo 0 > /sys/devices/platform/MTKP0001:00/pcie_hotplug/debug_state # plug out It also provides a runtime enable/disable switch via sysfs: echo 1 > /sys/devices/platform/MTKP0001:00/pcie_hotplug/hotplug_enabled # Enable echo 0 > /sys/devices/platform/MTKP0001:00/pcie_hotplug/hotplug_enabled # Disable This allows enabling/disabling hotplug functionality. Hotplug is disabled by default and must be explicitly enabled via userspace. It also implements uevent notifications for coordination with userspace: * cable plug-in: Report plug-in uevent (driver) Enable PCIe link (driver) Rescan CX7 devices (application) * cable removal: Report removal uevent (driver) Remove CX7 devices (application) Disable PCIe link (driver) Signed-off-by: Vaibhav Vyas <vavyas@nvidia.com> Signed-off-by: Scott Fudally <sfudally@nvidia.com> Signed-off-by: Surabhi Chythanya Kumar <schythanyaku@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Noah Wager <noah.wager@canonical.com> Acked-by: Jacob Martin <jacob.martin@canonical.com> Signed-off-by: Brad Figg <bfigg@nvidia.com>
1 parent 592cd39 commit 021c218

File tree

6 files changed

+2356
-0
lines changed

6 files changed

+2356
-0
lines changed

debian.nvidia-6.17/config/annotations

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ CONFIG_MICROSOFT_MANA note<'LP: #2084598'>
141141
CONFIG_MTD policy<{'amd64': 'm', 'arm64': 'y'}>
142142
CONFIG_MTD note<'Essential for boot on ARM64'>
143143

144+
CONFIG_MTK_PCIE_HOTPLUG policy<{'arm64': 'm'}>
145+
CONFIG_MTK_PCIE_HOTPLUG note<'CX7 PCIe hotplug driver for NVIDIA DGX Spark systems with GB10 SoC.'>
146+
144147
CONFIG_NOUVEAU_DEBUG policy<{'amd64': '-', 'arm64': '-'}>
145148
CONFIG_NOUVEAU_DEBUG note<'Disable nouveau for NVIDIA kernels'>
146149

drivers/platform/arm64/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,6 @@ config NVIDIA_FFA_EC
9595

9696
Say M or Y here to include this support.
9797

98+
source "drivers/platform/arm64/nvidia/Kconfig"
99+
98100
endif # ARM64_PLATFORM_DEVICES

drivers/platform/arm64/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ obj-$(CONFIG_EC_HUAWEI_GAOKUN) += huawei-gaokun-ec.o
1010
obj-$(CONFIG_EC_LENOVO_YOGA_C630) += lenovo-yoga-c630.o
1111
obj-$(CONFIG_EC_LENOVO_YOGA_SLIM7X) += lenovo-yoga-slim7x.o
1212
obj-$(CONFIG_NVIDIA_FFA_EC) += nvidia-ffa-ec.o
13+
obj-y += nvidia/
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
#
3+
# NVIDIA ARM64 Platform-Specific Device Drivers
4+
#
5+
6+
config MTK_PCIE_HOTPLUG
7+
tristate "CX7 PCIe Hotplug Driver"
8+
depends on EINT_MTK
9+
depends on PCI && ACPI
10+
help
11+
Say Y here to support PCIe device plug in/out detection.
12+
It will disable PCIe link when plug out and enable
13+
PCIe link after plug in.
14+
15+
This is particularly useful for GB10 SoC.
16+
17+
If unsure, say N.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
#
3+
# Makefile for NVIDIA ARM64 platform-specific drivers
4+
#
5+
# CX7 PCIe Hotplug Driver
6+
# Provides hotplug support for CX7 PCIe devices on GB10 SoC-based systems
7+
#
8+
9+
obj-$(CONFIG_MTK_PCIE_HOTPLUG) += mtk-pcie-hotplug.o

0 commit comments

Comments
 (0)