Skip to content

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

Closed
nirmoy wants to merge 9 commits into
NVIDIA:26.04_linux-nvidia-bosfrom
nirmoy:agent/lstp-driver-26.04-bos
Closed

[26.04_linux-nvidia-bos] NVIDIA: SAUCE: usb: misc: add LSTP adapter support#524
nirmoy wants to merge 9 commits into
NVIDIA:26.04_linux-nvidia-bosfrom
nirmoy:agent/lstp-driver-26.04-bos

Conversation

@nirmoy

@nirmoy nirmoy commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • import the LSTP USB multi-function driver from the public NVIDIA/lstp_module source at commit a91dee07c285
  • adapt the out-of-tree source to the Linux 7.0 in-tree GPIO, I2C, allocation, and xarray APIs
  • carry the firmware-provided I2C retry policy and combined SMBus block-read fix included in the public source
  • integrate lstp.ko under drivers/usb/misc/
  • enable CONFIG_USB_LSTP=m for amd64 and arm64 NVIDIA BOS 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-bos companion to standard-kernel PR #530.

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

Source and scope

The driver is based on public NVIDIA/lstp_module commit a91dee07c285a22139f17533049b2924c1fbf045. That snapshot includes the firmware-provided I2C retry policy and the combined userspace SMBus block-read fix. The in-tree copy adds the documented Linux 7.0 API adaptations and the follow-up fixes carried as separate commits in this PR.

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

Device-tree schemas remain omitted because the public 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

  • rebased onto the current 26.04_linux-nvidia-bos tip
  • git diff --check: pass
  • compared the imported source with public commit a91dee07c285; unchanged files match byte-for-byte and the remaining deltas are the documented Linux 7.0 GPIO, I2C, allocation, and xarray API adaptations
  • scripts/checkpatch.pl --strict for the latest sync: 0 errors, 0 warnings, 0 checks
  • amd64 BOS config resolves CONFIG_USB_LSTP=m with the required USB, I2C, SPI, GPIO, LED, and TTY dependencies enabled
  • x86_64: all seven LSTP objects compile with W=1 against the PR's Linux 7.0 tree
  • arm64: LSTP compiled natively against 7.0.0-2015-nvidia-bos-64k
  • arm64 runtime: temporarily removed the DKMS shadow, confirmed modinfo -n lstp selected /lib/modules/7.0.0-2015-nvidia-bos-64k/kernel/drivers/usb/misc/lstp/lstp.ko, and ran modprobe lstp successfully
  • runtime evidence: lsmod showed lstp; dmesg recorded usbcore: registered new interface driver lstp; taint remained unchanged (12288 before and after)
  • config annotations resolve CONFIG_USB_LSTP=m and CONFIG_USB_LSTP_SPI_SPIDEV=y for amd64, arm64, and arm64-64k BOS flavours

The arm64 runtime test predates the two I2C-only source updates. A refreshed kernel package build and I2C functional test remain required. The BOS configuration already has CONFIG_MODULE_SIG=y and CONFIG_MODULE_SIG_ALL=y; CI/package output will verify the production signature.

@nirmoy
nirmoy force-pushed the agent/lstp-driver-26.04-bos branch 3 times, most recently from fdb866d to 266c382 Compare August 3, 2026 15:22
@github-actions

github-actions Bot commented Aug 3, 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 9 commits...

Cherry-pick digest:
┌──────────────┬──────────────────────────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local        │ Referenced upstream / Patch subject                              │ Patch-ID   │ Subject │ SoB chain                 │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ bad10ed86d95 │ [SAUCE] usb: lstp: roll back failed spi startup                  │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ c2e5dd312fa5 │ [SAUCE] usb: lstp: skip zero-length mmio commands                │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ a1b19fc14cc6 │ [SAUCE] usb: lstp: preserve unread ipmi requests                 │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 860b5966a683 │ [SAUCE] usb: lstp: recover chip select after errors              │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 92b36d082a01 │ [SAUCE] usb: lstp: auto-bind empty spi firmware nodes            │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 1188df5c06cd │ [SAUCE] usb: lstp: advertise fixed spi settings                  │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 39b68f006676 │ [SAUCE] usb: lstp: bind auto-created spi devices                 │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ fcd2f2f18268 │ [SAUCE] [config] enable usb_lstp as a module                     │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ a3c70a737731 │ [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-bos but body has no https://bugs.launchpad.net/... link

@nirmoy
nirmoy force-pushed the agent/lstp-driver-26.04-bos branch 2 times, most recently from 01fb73b to 5d52b11 Compare August 3, 2026 15:40
@nirmoy nirmoy changed the title NVIDIA: SAUCE: Add LSTP USB driver [26.04_linux-nvidia-bos] NVIDIA: SAUCE: usb: misc: add LSTP adapter support Aug 3, 2026
@nirmoy
nirmoy force-pushed the agent/lstp-driver-26.04-bos branch 2 times, most recently from c8318a3 to c342480 Compare August 3, 2026 18:14
@nirmoy

nirmoy commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

BaseOS Kernel Review

Summary

LSTP has false-success UART writes after repeated NACKs, a poll race that can hide pending IPMI requests, and incomplete SPI-child rollback that leaves unusable devices exposed.

Findings: Critical: 0, High: 0, Medium: 5, Low: 2

Latest watcher review: open review

Generated test plan: open test plan

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

Head: 3c4975e4550f

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

@nirmoy
nirmoy force-pushed the agent/lstp-driver-26.04-bos branch 3 times, most recently from 96b683a to f4cb906 Compare August 5, 2026 08:43
@nirmoy
nirmoy force-pushed the agent/lstp-driver-26.04-bos branch 2 times, most recently from 0d63a60 to b9d70b2 Compare August 5, 2026 15:34
@nvidia-bfigg
nvidia-bfigg force-pushed the 26.04_linux-nvidia-bos branch from 9ef5052 to ab2723a Compare August 14, 2026 12:11
@nirmoy
nirmoy force-pushed the agent/lstp-driver-26.04-bos branch from 3c4975e to f0a297f Compare August 18, 2026 17:12
@nirmoy

nirmoy commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator Author

Boro watcher review skipped

The PR watcher skips automatic boro reviews for changes with more than 50 commits. This change currently has 100 commits.

To run the review anyway, ask BaseOS_Kernel_Bot in #baseos-kernel:

review https://github.com/NVIDIA/NV-Kernels/pull/524

Head: f0a297fe4926

This comment is maintained by BaseOS Reviewer. It is updated when the watcher sees a newer head.

aambroze and others added 9 commits August 18, 2026 10:35
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://github.com/NVIDIA/lstp_module)

Signed-off-by: Adrian Ambrozewicz <[email protected]>
Signed-off-by: Nirmoy Das <[email protected]>
Enable CONFIG_USB_LSTP=m for the amd64 and arm64 NVIDIA BOS 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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Channel startup failures do not abort USB probe. If fallback spidev
creation fails after controller registration, the controller and any
children created before the failure otherwise remain registered.

Group controller registration and child creation under devres so the
complete SPI channel is rolled back on an error.

Signed-off-by: Nirmoy Das <[email protected]>
@nirmoy
nirmoy force-pushed the agent/lstp-driver-26.04-bos branch from f0a297f to bad10ed Compare August 18, 2026 17:39
@nirmoy

nirmoy commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Closing because host-OS LSTP support is no longer required by the product and is not needed to provide Secure Boot.

@nirmoy nirmoy closed this Aug 21, 2026
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