Commit 021c218
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- debian.nvidia-6.17/config
- drivers/platform/arm64
- nvidia
6 files changed
+2356
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments