nuttx/sched
Alan Carvalho de Assis 91008cf1b1 sched/clock: keep the seqlock sequence in uint32_t
clock_get_sched_ticks() stored the value of read_seqbegin(), a
uint32_t, in an unsigned int and passed it back to read_seqretry().
Where int is 16 bits the copy is truncated, so once the 32-bit
sequence number passes 65535 read_seqretry() always reports a change
and the loop never ends.  The sequence advances once per tick, so after
65536 ticks (11 minutes at 100 Hz) the next caller, the timer interrupt
itself, spins forever with interrupts disabled and the system stops.

Seen on the CDP1802 (16-bit int): NSH stopped answering after 55
minutes at 20 Hz.  AVR has the same problem.  hrtimer's readers of the
same lock already use uint32_t. Don't assume int is 32-bit :-D

Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>
Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
2026-10-01 10:17:21 -03:00
..
addrenv nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
clock sched/clock: keep the seqlock sequence in uint32_t 2026-10-01 10:17:21 -03:00
environ sched/environ: Serialize clearenv updates. 2026-09-09 10:22:01 +08:00
event sched/event: Fix uninitialized need_switch flag issue in event_post() 2025-11-04 21:43:59 +08:00
group sched: add per-group filesystem jail root 2026-09-20 22:27:38 +08:00
hrtimer sched/hrtimer: Fix reprogram with wrong expiration when reinserting hrtimer 2026-09-07 10:17:46 -03:00
init arch, sched/signal: Fix compilation with ENABLE_PARTIAL_SIGNALS=y 2026-06-16 17:07:32 +08:00
instrument
irq sched/irq: Fix nxstyle declaration spacing. 2026-09-22 13:27:42 +08:00
misc sched: avoid dumping raw memory at address 0 for tasks without kstack 2026-07-20 20:57:45 -03:00
module sched/module: Increase /proc/modules line buffer. 2026-09-22 13:27:42 +08:00
mqueue libc, sched: Resolve FDPIC descriptors at module callback entry points. 2026-09-25 10:46:48 -03:00
paging include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pthread sched/pthread: Implement pthread_sigqueue 2026-09-21 14:53:26 +08:00
sched sched/profil: Fix declaration spacing. 2026-09-28 06:44:34 -03:00
semaphore sched/semaphore: Correct the return value comment of nxsem_init/nxmutex_init 2026-09-25 10:37:43 +02:00
signal libc, sched: Resolve FDPIC descriptors at module callback entry points. 2026-09-25 10:46:48 -03:00
task libc, sched: Resolve FDPIC descriptors at module callback entry points. 2026-09-25 10:46:48 -03:00
timer libc, sched: Resolve FDPIC descriptors at module callback entry points. 2026-09-25 10:46:48 -03:00
tls sched: Fix stdio initialization of standard streams when buffering is disabled 2026-08-18 15:19:45 -03:00
wdog !sys/types.h: change time_t and clock_t to int64_t to align with other OSes 2026-05-19 16:21:28 +08:00
wqueue sched/wqueue: restore -ENOENT from work_cancel() for unqueued work 2026-09-13 11:31:41 +08:00
CMakeLists.txt
Kconfig arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
Makefile tools: fix stale archive members surviving a Kconfig-driven CSRCS change 2026-07-28 21:26:03 -03:00