linuxkm: Fix spinlock initialization on Tegra kernels for __SPIN_LOCK…#9478
Merged
douzzer merged 1 commit intowolfSSL:masterfrom Dec 2, 2025
Merged
linuxkm: Fix spinlock initialization on Tegra kernels for __SPIN_LOCK…#9478douzzer merged 1 commit intowolfSSL:masterfrom
douzzer merged 1 commit intowolfSSL:masterfrom
Conversation
douzzer
requested changes
Nov 26, 2025
douzzer
requested changes
Nov 26, 2025
Contributor
douzzer
left a comment
There was a problem hiding this comment.
Needs a couple more tweaks.
…_UNLOCKED macro incompatibility
Tegra vendor kernels (L4T / NVIDIA Yocto BSP) fail to compile the
wolfSSL Linux kernel module due to the use of the legacy assignment form
of the spinlock initializer:
m->lock = __SPIN_LOCK_UNLOCKED(m);
On Tegra, __SPIN_LOCK_UNLOCKED() expands to a braced-struct initializer
that is *not* valid as an assignment expression, causing:
error: expected expression before '{' token
This patch applies a Tegra-specific workaround by replacing the
assignment with the stable kernel API:
spin_lock_init(&m->lock);
This is guarded behind CONFIG_ARCH_TEGRA so that non-Tegra platforms
retain the current initialization behavior until further validation is
completed.
This fix restores successful kernel module builds on NVIDIA Tegra-based
Yocto images without modifying behavior on other architectures.
Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
Contributor
Author
|
@douzzer Thanks for the comments, fixed all of them now. |
Contributor
|
retest this please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
linuxkm: Fix spinlock initialization on Tegra kernels for __SPIN_LOCK_UNLOCKED macro incompatibility
Tegra vendor kernels (L4T / NVIDIA Yocto BSP) fail to compile the wolfSSL Linux kernel module due to the use of the legacy assignment form of the spinlock initializer:
On Tegra, __SPIN_LOCK_UNLOCKED() expands to a braced-struct initializer that is not valid as an assignment expression, causing:
This patch applies a Tegra-specific workaround by replacing the assignment with the stable kernel API:
This is guarded behind CONFIG_ARCH_TEGRA so that non-Tegra platforms retain the current initialization behavior until further validation is completed.
This fix restores successful kernel module builds on NVIDIA Tegra-based Yocto images without modifying behavior on other architectures.
Testing
Compiled with tegra Kernel
Checklist