Skip to content

[26.04_linux-nvidia] NVIDIA: SAUCE: usb: misc: add LSTP adapter support - #530

Draft
nirmoy wants to merge 8 commits into
NVIDIA:26.04_linux-nvidiafrom
nirmoy:agent/lstp-driver-26.04
Draft

[26.04_linux-nvidia] NVIDIA: SAUCE: usb: misc: add LSTP adapter support#530
nirmoy wants to merge 8 commits into
NVIDIA:26.04_linux-nvidiafrom
nirmoy:agent/lstp-driver-26.04

Conversation

@nirmoy

@nirmoy nirmoy commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • import the LSTP USB multi-function driver from the LSTP GitLab source through main commit f662fa18e05d
  • adapt the out-of-tree source to the Linux 7.0 in-tree GPIO, I2C, allocation, and xarray APIs
  • include the firmware-provided I2C retry policy and combined SMBus block-read fixes
  • integrate lstp.ko under drivers/usb/misc/
  • enable CONFIG_USB_LSTP=m for amd64 and arm64 NVIDIA flavours
  • enable automatic spidev creation for SPI channels without firmware-described children
  • keep separate IPMI POST-code routing disabled by default

Motivation

The temporary DKMS delivery works for image enablement, but carrying LSTP in NV-Kernels lets the normal kernel packaging and signing pipeline produce a module that supports Secure Boot.

Platform software requires the LSTP SPI channels to expose spidev children, so CONFIG_USB_LSTP_SPI_SPIDEV=y enables this behavior without a separate modprobe configuration file.

This is the 26.04_linux-nvidia companion to BOS PR #524.

BugLink: https://jirasw.nvidia.com/browse/DGX-17400

Source and scope

The driver is synchronized through LSTP GitLab main commit f662fa18e05d8c4b5a2b0bc83acc4e8687c9a9fb. The latest source includes these kernel changes after the original c3e97053446a snapshot:

  • 4f28fdedaf85: use the firmware I2C configuration for bus retry policy
  • f662fa18e05d: fix combined userspace SMBus block reads

Out-of-tree packaging, CI, README, specification PDFs, and other repository-local files are not imported.

Device-tree schemas remain omitted because the released copies still need kernel-tree $id and maintainers normalization. They can follow with the upstream-oriented patch series.

The source exposes USB vendor ID 0x0955. The previously tested DKMS snapshot also exposed 0x0424; the LSTP owners should confirm whether that second alias is approved and required before this draft is marked ready.

Validation

  • based on the current 26.04_linux-nvidia tip
  • git diff --check: pass
  • driver commit has the same stable patch ID as BOS PR [26.04_linux-nvidia-bos] NVIDIA: SAUCE: usb: misc: add LSTP adapter support #524: 8a2f5316851f356d9e08ddacceeff7e05c4f7c1b
  • CONFIG_USB_LSTP=m resolves for amd64-nvidia, arm64-nvidia, and arm64-nvidia-64k
  • CONFIG_USB_LSTP_SPI_SPIDEV=y makes auto_bind_spidev default to true for all three flavours
  • CONFIG_SEPARATE_LSTP_IPMI_POSTCODES remains disabled for all three flavours
  • x86_64: all seven LSTP objects compile and link into lstp.o with W=1 against this branch

The matching BOS source has passed arm64 compilation and modprobe testing. Standard-kernel package builds and runtime testing remain required for this companion PR.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

PR Validation Report

Patchscan ✅ No Missing Fixes

All cherry-picked commits checked — no missing upstream fixes found.

PR Lint ❌ Errors found

Details
Checking 8 commits...

Cherry-pick digest:
┌──────────────┬──────────────────────────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local        │ Referenced upstream / Patch subject                              │ Patch-ID   │ Subject │ SoB chain                 │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 95a561534950 │ [SAUCE] usb: lstp: skip zero-length mmio commands                │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 195fa574470a │ [SAUCE] usb: lstp: preserve unread ipmi requests                 │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 5271494ae3cc │ [SAUCE] usb: lstp: recover chip select after errors              │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ e4f8b9ac8cf1 │ [SAUCE] usb: lstp: auto-bind empty spi firmware nodes            │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 7b3293eb6fb2 │ [SAUCE] usb: lstp: advertise fixed spi settings                  │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ c41554d1d6dd │ [SAUCE] usb: lstp: bind auto-created spi devices                 │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 50fafedb229d │ [SAUCE] [config] enable usb_lstp as a module                     │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 2f317e05648f │ [SAUCE] usb: misc: add lstp adapter support                      │ N/A        │ N/A     │ aambroze, nirmoyd         │
└──────────────┴──────────────────────────────────────────────────────────────────┴────────────┴─────────┴───────────────────────────┘

Lint: all checks passed.

PR metadata:
E: PR targets 26.04_linux-nvidia but body has no https://bugs.launchpad.net/... link

The Low-Speed Transport Protocol (LSTP) adapter exposes
firmware-configured I2C, SPI, GPIO, UART, IPMI, and MMIO channels over a
single USB interface.

Add the driver as a downstream patch and integrate it with Kconfig,
Kbuild, and MAINTAINERS. Adapt the GPIO, I2C, memory-allocation, and
UART interfaces to the APIs available in this kernel.

Use the configured I2C retry count and avoid a spurious zero-length
write before a userspace SMBus block read.

(backported from
 https://gitlab-master.nvidia.com/spt-firmware-taskforce/lstp/lstp_module)

Signed-off-by: Adrian Ambrozewicz <aambrozewicz@nvidia.com>
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
@nirmoy
nirmoy force-pushed the agent/lstp-driver-26.04 branch from f0b9473 to 2aa061d Compare August 5, 2026 11:27
Enable CONFIG_USB_LSTP=m for the amd64 and arm64 NVIDIA flavours.
Building lstp.ko through the kernel packaging pipeline also allows the
module to be signed for Secure Boot.

Enable CONFIG_USB_LSTP_SPI_SPIDEV so auto_bind_spidev defaults to true
and LSTP SPI channels without firmware-described children create
spidev devices. Keep separate IPMI POST-code routing disabled.

Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
@nirmoy
nirmoy force-pushed the agent/lstp-driver-26.04 branch from 2aa061d to 50fafed Compare August 5, 2026 15:34
nirmoy added 6 commits August 5, 2026 11:08
The generic spidev modalias is not present in the spidev device ID table,
so dynamically created LSTP SPI devices remain unbound.

Load spidev before creating the devices and set its name as a driver
override before registration. Fail channel startup if a child cannot
be created or bound.

Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
LSTP firmware supplies one clock rate for each SPI channel and supports
only 8-bit words, but the controller currently accepts other settings
and silently ignores them during transfers.

Publish the firmware rate as both the minimum and maximum controller
speed and restrict the word-size mask to 8 bits so the SPI core rejects
unsupported requests.

Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
A channel fwnode may be present without describing any available
SPI child devices. Treat that case like a missing fwnode so the
auto_bind_spidev option creates the fallback devices it promises.

Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
A failed transfer can leave chip select asserted in the adapter. Send a
best-effort zero-length write with the deassert flag before completing
the failed message, while preserving the original transfer error.

Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Removing a FIFO record before checking the userspace buffer loses the
request on a short read or copy fault. Serialize readers and retain
one dequeued record until copy_to_user() succeeds.

Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Zero-length read and write calls must complete without issuing hardware
operations. Return immediately after validating the file offset instead
of sending empty LSTP commands.

Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
@nirmoy

nirmoy commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

BaseOS Kernel Review

Summary

LSTP has an IPMI open/disconnect UAF window and reports rejected UART and SPI operations as successful. This can expose freed memory, lose UART bytes, and claim NACKed SPI transfers completed.

Findings: Critical: 0, High: 3, Medium: 3, Low: 3

Latest watcher review: open review

Generated test plan: open test plan

Kernel deb build: successful (download debs, 4 files)

Head: 95a561534950

This comment is maintained by nv-pr-bot. It is updated when the GitHub watcher publishes a newer review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants