Skip to content

!boards/boardctl: Remove BOARDIOC_SPINLOCK. - #21696

Merged
acassis merged 1 commit into
apache:masterfrom
casaroli:boardctl-spinlock-remove-up
Nov 14, 2026
Merged

acassis merged 1 commit into
apache:masterfrom
casaroli:boardctl-spinlock-remove-up

Conversation

@casaroli

@casaroli casaroli commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

After #21693, pthread_spin_*() no longer use the BOARDIOC_SPINLOCK boardctl() command, and nothing else in nuttx or nuttx-apps uses it. This PR removes the command, CONFIG_BOARDCTL_SPINLOCK and struct boardioc_spinlock_s. The value 0x000f stays unused, so the other commands keep their numbers.

It also removes the documentation page of the boardioc_spinlock example: the example is not in nuttx-apps.

BREAKING CHANGE

The BOARDIOC_SPINLOCK boardctl() command and CONFIG_BOARDCTL_SPINLOCK are removed.

Quick fix: an application that called boardctl(BOARDIOC_SPINLOCK) uses pthread_spin_lock(), pthread_spin_trylock() and pthread_spin_unlock() (CONFIG_PTHREAD_SPINLOCKS); kernel code uses spin_lock() and spin_unlock() from <nuttx/spinlock.h>. A defconfig drops CONFIG_BOARDCTL_SPINLOCK.

Impact

  • In nuttx and nuttx-apps master, only boards/boardctl.c, include/sys/boardctl.h, boards/Kconfig, the example page and libs/libc/pthread/pthread_spinlock.c name BOARDIOC_SPINLOCK or CONFIG_BOARDCTL_SPINLOCK; libs/libc/pthread: Implement spin locks with atomics. #21693 removes the use in pthread_spinlock.c and the select in libs/libc/pthread/Kconfig. No defconfig sets CONFIG_BOARDCTL_SPINLOCK.
  • Out-of-tree code that uses the command must change (quick fix above).

Testing

pthread_spin_*() no longer use the BOARDIOC_SPINLOCK boardctl() command,
and nothing else in nuttx or nuttx-apps uses it.  Remove the command,
CONFIG_BOARDCTL_SPINLOCK and struct boardioc_spinlock_s.  The value
0x000f stays unused, so the other commands keep their numbers.  Remove
the documentation page of the boardioc_spinlock example too: the example
is not in nuttx-apps.

BREAKING CHANGE: the BOARDIOC_SPINLOCK boardctl() command and
CONFIG_BOARDCTL_SPINLOCK are removed.  Quick fix: an application uses
pthread_spin_lock(), pthread_spin_trylock() and pthread_spin_unlock()
(CONFIG_PTHREAD_SPINLOCKS); kernel code uses spin_lock() and
spin_unlock() from <nuttx/spinlock.h>.  A defconfig drops
CONFIG_BOARDCTL_SPINLOCK.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
@casaroli casaroli added the breaking change This change requires a mitigation entry in the release notes. label Nov 11, 2026
@casaroli

Copy link
Copy Markdown
Contributor Author

@xiaoxiang781216 should we keep this a breaking change and send dev@ email? User code should not use this anyway, so I guess we can skip dev@ email. what do you think?

@xiaoxiang781216

Copy link
Copy Markdown
Contributor

@xiaoxiang781216 should we keep this a breaking change and send dev@ email? User code should not use this anyway, so I guess we can skip dev@ email. what do you think?

yes, I think so.

@github-actions github-actions Bot added Area: Build system Size: M The size of the change in this PR is medium and removed breaking change This change requires a mitigation entry in the release notes. labels Nov 11, 2026
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

arduino-mega2560

  • flash: .data +24 B, .text +74 B (+0.1%, 67,011 B / 262,144 B, total: 26% used)
  • sram: .bss +19 B, .data +24 B (+1.5%, 2,828 B / 8,192 B, total: 35% used)

esp32-devkitc

  • ROM: .dram0.data +4 B, .flash.rodata +24 B, .flash.text +48 B (+0.1%, 130,244 B / 4,194,272 B, total: 3% used)
  • dram0_0_seg: .dram0.bss +16 B, .dram0.data +4 B (+0.2%, 10,044 B / 180,736 B, total: 6% used)
  • drom0_0_seg: .flash.rodata +24 B (+0.2%, 13,860 B / 4,194,272 B, total: 0% used)
  • irom0_0_seg: .flash.text +48 B (+0.0%, 96,152 B / 3,342,304 B, total: 3% used)

hifive1-revb

  • flash: .data +8 B, .text +20 B (+0.0%, 86,440 B / 4,194,304 B, total: 2% used)
  • sram: .data +8 B (+0.2%, 3,964 B / 16,384 B, total: 24% used)

mirtoo

  • kseg0_progmem: .data +4 B, .text +20 B (+0.0%, 69,076 B / 131,072 B, total: 53% used)
  • kseg1_datamem: .data +4 B (+0.2%, 2,604 B / 32,256 B, total: 8% used)

qemu-armv8a

  • Code: .rodata +24 B, .text.arm64_irq_handler +8 B, .text.arm64_oneshot_initialize +12 B, .text.arm64_sync_exc +8 B, .text.file_vopen +36 B, .text.group_initialize +4 B, .text.hostfs_bind +36 B, .text.nxsem_recover +20 B, .text.nxsem_wait_irq +16 B, .text.procfs_read +12 B, .text.task_restart +12 B, .text.work_queue_create +8 B (+0.1%, 364,152 B)
  • Data: .data.g_version +2 B (+0.0%, 77,919 B)

qemu-intel64

  • Data: .rodata +32 B (+0.0%, 126,777 B)

rx65n-rsk2mb

  • RAM: .bss +22 B, .data +4 B (+0.4%, 6,724 B / 262,144 B, total: 3% used)
  • ROM: .rodata +20 B, .text +32 B (+0.1%, 92,080 B / 2,097,152 B, total: 4% used)

s698pm-dkit

  • Code: .text +624 B (+0.2%, 391,168 B)
  • Data: .data +16 B (+0.1%, 11,947 B)

stm32-nucleo-f103rb

  • flash: .text +24 B (+0.1%, 35,296 B / 131,072 B, total: 27% used)

Catch memory regressions in CI with MemBrowse. Free for open source.

@xiaoxiang781216
xiaoxiang781216 marked this pull request as ready for review November 13, 2026 06:41
@casaroli
casaroli marked this pull request as draft November 14, 2026 07:33
@casaroli
casaroli marked this pull request as ready for review November 14, 2026 07:33
@acassis
acassis merged commit 2d5aeeb into apache:master Nov 14, 2026
97 of 101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Build system Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants