max30009_flush_rtio is only called after the streaming request was
already completed with rtio_iodev_sqe_ok and data->sqe was set to
NULL, so calling rtio_iodev_sqe_err(data->sqe, -ENOMEM) on SQE
acquire failure dereferenced NULL. Drop any partially acquired SQE
with rtio_sqe_drop_all instead, matching the other error paths.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The decoder wrote a full struct sensor_q31_data per decoded FIFO
sample, striding ~32 bytes per frame, while get_size_info advertises
frame_size = sizeof(struct sensor_q31_sample_data) (8 bytes),
overflowing contract-sized buffers when max_count > 1. Fill a single
header/shift once and append samples to out->readings[] with proper
timestamp deltas, matching the sibling FIFO decoders.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The driver runs all SPI transfers at the configured spi-max-frequency,
including the reset and oscillator-register accesses performed during
init. When pll-enable is set, SYSCLK is only the raw oscillator until
the PLL locks in mcp251xfd_init_osc_reg(). The datasheet requires
FSCK <= 0.85 * (FSYSCLK / 2) (DS20006624B, Table 9-7 Note 3; §5.0
Note 1) and the silicon errata (DS80000984A, item 4) warns that
exceeding it corrupts RAM writes that coincide with CAN bus activity.
With, for example, a 4 MHz oscillator and an 18 MHz SPI clock the init
transfers run roughly 10x over the limit.
Run the init transfers on a clamped copy of the devicetree SPI config
and switch back to the devicetree config once the PLL has locked. The
active config is exchanged as a pointer rather than modified in place,
since SPI drivers detect configuration changes by pointer comparison
and would ignore an in-place frequency update. Without the PLL, the
devicetree config is used from the start.
Signed-off-by: Andreas Petter <Andreas.Petter@mcnetic.de>
mcp251xfd_get_core_clock() returns the raw osc-freq value regardless of
whether the PLL is enabled. When pll-enable is set, the controller's
SYSCLK is the oscillator frequency multiplied by 10 (OSC.PLLEN), and
the driver does enable the PLL in mcp251xfd_init_osc_reg(). The bit
timing is therefore computed against a tenth of the real SYSCLK, so the
actual bus bitrate ends up 10x higher than configured and the node
cannot communicate (it stays error-passive).
Return osc-freq * 10 when pll-enable is set so the timing calculation
uses the real SYSCLK.
Signed-off-by: Andreas Petter <Andreas.Petter@mcnetic.de>
On SoCs that power off the OS Timer in deep low-power states, the driver
can now delegate low-power timekeeping to the generic system-timer
low-power companion framework (CONFIG_SYSTEM_TIMER_LPM_COMPANION_*).
Select SYSTEM_TIMER_HAS_LPM_COMPANION_SUPPORT and add a new
"handoff-power-states" devicetree property: when entering one of the listed
states the driver arms the companion counter chosen via
/chosen/zephyr,system-timer-companion and recovers the elapsed time on
wakeup.
The legacy deep-sleep-counter path is unchanged; boards on it do not set
handoff-power-states and keep handing off in PM_STATE_STANDBY as before.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
k_sleep() and k_usleep() resolve to an out of line implementation living in
another translation unit, a system call under CONFIG_USERSPACE and a plain
call otherwise. Either way the compiler sees neither whether the requested
duration is a constant nor whether the caller cares about the returned
value, so it always emits the tick to millisecond and microsecond
conversions. Those conversions are the only thing that drags the 64 bit
division helper into many small builds: CONFIG_SYS_CLOCK_TICKS_PER_SEC
defaults to 10000 on tickless platforms, which lands in the integer
division path and divides a 64 bit value by ten, something GCC will not
strength reduce on a 32 bit target.
Promote the former z_tick_sleep() helper to a k_sleep_ticks() system call
that reports the remaining time in ticks, and rebuild k_sleep() and
k_usleep() as inlines on top of it. The conversions now live at the call
site where the compiler can fold or discard them. Nearly every caller
discards them: of the 4036 sleep call sites in the tree, exactly six use
the returned value, and only three of those are outside of tests.
What this removes is best seen in the two out of line entry points that
disappear, which on a nucleo_f030r8 (Cortex-M0, 10000 ticks/s) were the
only two callers of the 64 bit division helper in the whole image:
08002594 <z_impl_k_sleep>:
bl 8001... <z_tick_sleep>
...
movs r0, #9 /* the ceil() bias, 10 - 1 */
adds r0, r0, r2
adcs r1, r3
movs r2, #10 /* ticks / 10 -> milliseconds */
bl 8000180 <__aeabi_uldivmod>
080025c0 <z_impl_k_usleep>:
movs r0, #99 /* the ceil() bias, 100 - 1 */
...
movs r2, #100 /* microseconds / 100 -> ticks */
bl 8000180 <__aeabi_uldivmod>
bl 8001... <z_tick_sleep>
Both are gone, and so are __aeabi_uldivmod and __udivmoddi4, which are no
longer referenced anywhere. A k_usleep(250) call site now passes the
literal 3 ticks the compiler worked out on its own, where it used to pass
250 microseconds to a helper that divided by 100 at runtime. For a loop
calling k_msleep(100), k_sleep(K_SECONDS(1)) and k_usleep(250) without
using the results, FLASH drops from 11028 to 10600 bytes.
No trace point is emitted here. The existing sleep hooks take a duration
in milliseconds or microseconds, which no longer describes what this
function is handed, and tracing cannot live in the inlines either: every
tracing backend header includes kernel.h, so a translation unit reaching a
backend header first would expand SYS_PORT_TRACING_* before those macros
exist. The following commit gives k_sleep_ticks() a hook of its own.
The duration goes through Z_TIMEOUT_US() rather than an open coded
conversion. That clamps a negative argument to zero, which k_usleep()
never did: it used to truncate the 64 bit conversion into an int32_t
first, which hid the worst of it, and passing it through whole would turn a
negative duration into a sleep of roughly 1.8e17 ticks rather than a bogus
absolute deadline. The macro also carries the cast to k_ticks_t that C++
needs, since Z_TIMEOUT_TICKS_INIT() is a braced initializer there and an
unsigned to signed conversion inside one is a narrowing error.
This also removes a potential link error. k_usleep() had no
implementation at all with CONFIG_MULTITHREADING=n, since nothread.c only
ever provided z_impl_k_sleep(), so any caller failed to link. Nothing in
the tree happens to call it in that configuration, which is presumably why
it went unnoticed; a single z_impl_k_sleep_ticks() now serves both.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Use the uhc_dwc2_get_base() in port_suspend()
and port_resume() as the base member is available
via helper, that calls DEVICE_MMIO_NAMED_GET as a
follow-up for 528a0627ed.
Signed-off-by: Roman Leonov <jam_roma@yahoo.com>
WIFI_RECOVERY was only available for RW610 and IW610,
extend the depends to also support IW61X
and IW416 which use SDIO interface and can leverage
the same command-timeout-based recovery mechanism.
Signed-off-by: Gaofeng Zhang <gaofeng.zhang@nxp.com>
The static 'dlf' property is valid only for a specific PCLK/baud rate
combination. The current calculation accounts for this fixed value when
selecting the integer divisor, but cannot adapt to runtime baud rate
changes.
A low fixed PCLK may require a fractional divisor to reduce baud rate
error for the requested baudrate.
Add an opt-in 'dlf-auto' property to calculate the integer divisor and
DLF value together whenever the baud rate changes, using 1/64-resolution
fixed-point arithmetic. When enabled, 'dlf-auto' overrides 'dlf'.
Also enable DLF support when an instance uses either 'dlf' or
'dlf-auto'. Existing 'dlf' users are unaffected.
Signed-off-by: Bo Sun <bo.sun@kernel.li>
Add reset driver for the reset part of the ch32 rcc.
Use this new reset driven in `wch,usart` to reset the usart peripheral
before use.
Signed-off-by: Fiona Behrens <me@kloenk.dev>
Add a driver for the VIRTIO GPIO device (virtio spec 1.3, section 5.18),
letting a Zephyr guest drive GPIO lines exposed by a hypervisor or a
vhost-user backend.
The number of lines is read from the device configuration space at init,
and interrupts use the event virtqueue when the device offers
VIRTIO_GPIO_F_IRQ. Every operation is a round trip to the device, so the
GPIO API can only be used from a thread.
Assisted-by: Claude Code:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Commit 62c1fb2097 replaced both minimum-brightness uses with
LED_BRIGHTNESS_MAX, so turning an LED off and the off phase of a blink
program set full brightness instead. Use 0, the minimum brightness the
LED API defines.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Update EUSART driver to use new HAL library that supports both
Series 2 and Series 3 SoCs.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
The sdmmc_ll_set_command helper writes the command register
through memcpy, which the compiler expands into four byte
stores. The peripheral bus only accepts 32-bit accesses, so
the command never reached the card interface unit and the
driver spun forever waiting for it to be taken.
Restore the single word store to the command register. This
is a regression from f4c7092ad6.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Channel restore was only performed for failed CSL receptions
(gPlmeTimeoutInd_c in plme_mac_sap_handler). Successful CSL
receptions (gPdDataInd_c in pd_mac_sap_handler) were missing
the rf_restore_main_channel() call, leaving the PHY on the
temporary CSL channel after a successful reception.
Add rf_restore_main_channel() call in pd_mac_sap_handler so
that the main network channel is always restored after any
CSL RX slot, regardless of the outcome.
Signed-off-by: Baptiste Coffin <baptiste.coffin_1@nxp.com>
Two bugs are fixed:
1. IEEE802154_HW_SELECTIVE_TXCHANNEL capability was always advertised
regardless of CONFIG_IEEE802154_SELECTIVE_TXCHANNEL. Guard it behind
the Kconfig option as required by the driver API documentation.
2. The selective TX channel feature was not implemented. When
CONFIG_IEEE802154_SELECTIVE_TXCHANNEL is enabled, use the per-packet
TX channel (set by the upper layer for CSL timed transmissions) for
TXTIME and TXTIME_CCA modes. The txchannel field is only valid for
timed TX modes as it shares storage with the lqi/rssi fields.
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/111211
Signed-off-by: Baptiste Coffin <baptiste.coffin_1@nxp.com>
The port writers update the data register with an unlocked read-modify-
write. port_set_masked_raw() reads and writes DR directly, and on parts
without the DR_SET/DR_CLEAR/DR_TOGGLE aliases the HAL degrades
GPIO_PortSet/Clear/Toggle() to "DR |= mask" and friends. Pin
configuration is affected too: GPIO_PinWrite() falls back the same way,
and the GDIR update is a read-modify-write on every part.
Two contexts touching different pins of the same port therefore race:
each reads the register, changes its own bits and writes the whole value
back, so the last writer reverts the other's pin.
Serialize the accesses with a spinlock, which unlike irq_lock() also
covers a concurrent write from another CPU on an SMP build. The lock
cannot be limited to the parts that lack the set/clear aliases, because
port_set_masked_raw() read-modify-writes DR everywhere: an atomic DR_SET
from another context would still be clobbered by it.
While here, use GPIO_PinWrite() instead of the deprecated
GPIO_WritePinOutput() wrapper.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Marvin Gnad <marvin.gnad@gmail.com>
Add device power management so the sensor can sit under a power domain
that may be unpowered at init. Bring-up moves to a PM_DEVICE_ACTION_TURN_ON
handler, and RESUME/SUSPEND toggle the config register shutdown bit.
Signed-off-by: Corey Wharton <xodus7@cwharton.com>
The akm09918c driver imposes and unconditional wait time on fetch. This
is only neccesary for single-shot sampling. If the sensor is configured in
continuous mode, an application can time the fetch to align with the sensor
ODR. For continous mode operation it does not make sense to have an
artificial delay added - if the application is trying to fetch values at a
higher frequency than the ODR it can just handle the -EBUSY by adding
its own delay and retrying the fetch or reading the old values.
Verified this change testing parallel sampling with an LSM6DSO IMU,
Fetching all channels on DRDY of the IMU with the same ODR configured
for both IMU and magnetometer.
Signed-off-by: Jose Morales <josfemova@gmail.com>
Add a driver for the simple hardware RNG block on the BCM2835 /
BCM2836 / BCM2837 / BCM2710 SoCs (Raspberry Pi 1/2/3/Zero family).
The block is a small four-register FIFO, distinct from the iProc
RNG200 on the BCM2711 (Raspberry Pi 4).
Enable it on the Raspberry Pi Zero 2 W as the board entropy source.
Signed-off-by: Jonathan E. Peace <jep@alphabetiq.com>
This fixes a potential build warning introduced in 7b2a3c0cca, where
the static functions would get declard but not used if the board has:
- CONFIG_PM=y
- CONFIG_UART_ASYNC_API=y
- CONFIG_DMA=y
- the dma node enabled in devicetree
Reproduced with:
west build -p -b stm32f4_disco samples/hello_world -DCONFIG_PM=y
-DCONFIG_UART_ASYNC_API=y -DCONFIG_DMA=y
zephyrproject/zephyr/drivers/serial/uart_stm32.c:218:13: warning:
'uart_stm32_rx_wakeup_lock_get' defined but not used
Found this downstream, finding the specific combination of option and
dt override to reproduce this was a big mess, there's no benefit chasing
down the specific combination of ifdeffery here so let's just mark them
as maybe unused and if that combo hits the compiler can just drop them.
Between ifdefs form Kconfig and the HAL this driver is already VERY hard
to follow.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
TIMER_CORE_MAX_UNANNOUNCED_CYCLES is the smaller of what the counter can
resolve and what the alarm register holds, and those two bound different
things. Outrunning the counter leaves the masked delta ambiguous, which
no amount of re-arming recovers. Outrunning the alarm only means the
deadline takes more than one arm to reach.
Asserting on the pair therefore rejects configurations that keep time
correctly, such as the kernel benchmarks at one tick per second on a
25 MHz SysTick: a tick is 25000000 cycles against a 24-bit LOAD, yet
sits well inside the counter's span. Assert on the counter alone.
The arm path still clamps to the pair, so no alarm is programmed out of
range. A tick past the alarm's reach costs extra interrupts, as it did
before the assert existed.
Assisted-by: Claude:opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The tick-versus-span BUILD_ASSERT sits in the branch where cycles per
tick is a macro, but that branch also covers
CONFIG_SYSTEM_CLOCK_HW_CYCLES_PER_SEC_RUNTIME_UPDATE, whose rate is a
function call. The assertion expression is then not constant and the
build fails, as it does for sample.cpu_freq.thermal_cap on frdm_mcxn236.
Emit it only where TIMER_CORE_CHECK_CYC_PER_TICK_AT_INIT is unset, the
same guard the neighbouring cycles-per-tick != 0 assert already uses.
timer_core_init() runs the check at run time for the remaining cases.
Assisted-by: Claude:opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
eth_nxp_enet_isr() branches on ENET_GetInterruptStatus(), a plain read
of EIR, which is not the set of pending interrupts: "EIR[RXF] reflects
the state of the interrupt signal even if the corresponding EIMR field
is cleared", and an interrupt is raised only "if the corresponding bit
in the interrupt mask register (EIMR) is also set" (i.MX RT1170 RM rev
5, sections 60.5.1.2 and 60.5.1.3).
So a branch is taken for an event the driver has masked off. The receive
path relies on masking: it disables kENET_RxFrameInterrupt, submits
work, and re-enables only once the handler has drained the ring. Until
then every transmit interrupt re-enters the receive branch and resubmits
work that is already queued.
Masking the status loses nothing, since the interrupt line is itself EIR
qualified by EIMR.
Signed-off-by: Hashimoto Kenichi <hashimoto.kenichi@genetec.co.jp>
Assisted-by: Claude:claude-opus-5
The core describes timer_driver_cycle_get() and the arming primitives as
static inline, which reads as a requirement. It is not one: they have a
single call site each, and the compiler folds them in at -Os without the
keyword. Checked on kit_psc3m5_evk, where neither
timer_driver_set_reload() nor the lptimer_delay() it calls leaves a
symbol behind.
Thirteen of the drivers converted so far declare the arming primitive
plain static already, the split falling by size rather than by intent, so
say static and leave inline to whoever writes the driver.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
TIMER_CORE_MAX_SPAN_TICKS is how many whole ticks the core may arm ahead:
the smaller of what the counter can resolve and what the alarm register
can hold, divided by the cycles in a tick. Nothing checked that it comes
out at least one.
Where it does not, the arm path clamps every request to zero ticks and
the minimum-delay floor rearms a couple of cycles out, over and over,
while each announce is worth no ticks at all. Time stops advancing and
the system wedges, which is a poor way to learn that a 16-bit counter
cannot span a tick at the configured rate.
Assert it instead. Both terms are build constants in the common case, so
that is a BUILD_ASSERT naming the two ways out; the runtime-rate cases
already have an init-time check for the companion condition and get this
one alongside it.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Remove the val < 0 comparison in nrf_wifi_util_req_extended_sleep().
val is unsigned long, so that condition is always false.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Remove the trailing `return;` at the end of the void RX work function.
A return statement as the last line of a void function is superfluous
and is flagged by the compliance check, so drop it.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Now that the ENET QoS `nxp,enet-qos-mac` child node has been folded into
the parent `nxp,enet-qos` controller node, the driver no longer models a
separate MAC sub-device, so the `_mac` suffix in the file, symbols and
Kconfig option names is redundant.
- Rename the driver source file `eth_nxp_enet_qos_mac.c` to
`eth_nxp_enet_qos.c` and update the CMakeLists.txt reference.
- Drop the `_mac` suffix from the log module, init function, ISR and
device-define macro.
- Rename the Kconfig option `ETH_NXP_ENET_QOS_MAC_UNIQUE_MAC_ADDRESS`
to `ETH_NXP_ENET_QOS_UNIQUE_MAC_ADDRESS` and update its users.
- Add a migration guide entry documenting the Kconfig rename.
Assisted-by: Claude:opus-4-8
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Fold the NXP ENET QoS child node `nxp,enet-qos-mac` into the parent
`nxp,enet-qos` controller node to match standard `snps,dwmac` bindings
and flatten the devicetree representation.
Summary of changes:
- dts: bindings: Merge `nxp,enet-qos-mac` binding into `nxp,enet-qos`
and remove the obsolete binding file.
- dts/boards: Flatten devicetree structure across MCX A and MCX N
families (and EVK/FRDM board overlays) by moving interrupts, MAC
properties and PTP clock configuration up to the parent `enet` node.
- drivers: Update `nxp_enet_qos` ethernet and PTP clock drivers for the
single-node layout, remove the redundant `eth_nxp_enet_qos.c` module
driver and consolidate Kconfig under `ETH_NXP_ENET_QOS`.
- docs: Add a migration guide entry detailing the devicetree node changes.
Assisted-by: Claude:opus-4-8
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
flash_size/erase-block-size/write-block-size now live on the
soc-nv-flash child instead of the controller node. Update
flash_renesas_rz_qspi.c/flash_renesas_rza2m_qspi.c and the
bindings to match.
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
MISRA C:2012 Rule 8.2 requires every parameter in a function type to be
named, including the parameters of function pointer parameters.
The WCH SDI and Whisper console drivers re-declared the stdout and
printk hook install functions locally instead of including the headers
that already declare them, and both copies left the hook parameter
unnamed. Include <zephyr/sys/libc-hooks.h> and
<zephyr/sys/printk-hooks.h> instead. The Whisper console keeps its no-op
fallbacks for the configurations where the hooks are not built in.
Name them after the arguments the documentation or the
definitions already use. No functional change.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Follow up of #115694.
Align reset driver prompts with the Kconfig style guide
(doc/contribute/style/kconfig.rst), which specifies for /drivers:
"{Driver Name} {Driver Type} driver" for prompts.
These drivers were left as-is in #115694 because "reset" is
embedded into their IP block name (RSTC, RSTCTL) or spelled out
in the original prompt ("Reset Control Module"). Use the vendor
abbreviation and apply the standard format.
- RESET_MCHP_RSTC_G1: "Microchip RSTC G1 reset driver"
- RESET_NXP_RSTCTL: "NXP RSTCTL reset driver"
- RESET_FOCALTECH_FT9001: "FocalTech FT9001 reset driver"
Signed-off-by: Jonggeun Park <jakejgpark@gmail.com>
The PIT driver (d8e551cee2) includes the deprecated
zephyr/sys_clock.h header, which since 5b2fd0761d emits a
deprecation warning. With -Werror=cpp in CI this fails the build of
every configuration for the sama5d27 boards, which are the only
users of this driver.
Include zephyr/sys/clock.h instead, which is where the sys_clock
API lives since the headers were merged in c08544a87b.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
In lptimer_delay, we reset the MCWDT counters using the PDL-recommended
210us. On some devices during CPU-intensive processes, this is slightly
too short for the counter to reset, causing the following
ASSERT(counter = 0) to rarely trigger.
Adding a WAITFOR prior to the assert to offer up to 100us for MCWDT to
finish resetting. Using a WAITFOR instead of upping the ResetCounters
delay so this extra wait is optional and only used when necessary.
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
Drop the hand-rolled tick accounting for the generic core. The driver is
left with the cycle-domain primitives: read TTCR, write TTMR, acknowledge
the match.
TTMR matches only TTCR[27:0] == TP, so a target written at or behind the
count is missed until the 28-bit count wraps, 13.4 s at 20 MHz. That is
the COMPARE_EXACT backend, and the core writes the register through its
verify loop. set_compare_safe(), cyc_diff() and the MIN_DELAY floor go
away with it, as does the driver's own spinlock: the core takes the
system clock lock.
qemu_or1k joins the sloppy-idle test variant.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
MISRA C:2012 Rule 8.2 requires every parameter in a function type to be
named, including the parameters of function pointer parameters.
The cache, clock control, comparator, entropy, Ethernet, I2S and serial
drivers left callback parameters unnamed, or carried forward
declarations that dropped the names the definitions already use. The two
virtio callbacks get ARG_UNUSED() for the arguments they deliberately
ignore.
Name them after the arguments the documentation or the
definitions already use. No functional change.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Added support for lp-mode for the autanalog-sar in PSE84.
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Richard Mc Sweeney <Richard.McSweeney@infineon.com>
Convert the RISC-V supervisor timer to system_timer_generic.h. The
"time" CSR with the SBI set-timer deadline is a COMPARE_ORDERED backend:
the driver keeps timer_driver_cycle_get() (stime) and
timer_driver_set_compare() (sbi_set_timer), and the core takes over the
tick accounting, the deadline math, the range clamp and the announce.
smp_timer_init() primes the timer through timer_core_smp_prime(). The
counter is 64 bits wide on a 32-bit build as well, so the driver states
that width instead of taking the core's native-register default.
This also drops the driver's private spinlock: it now runs under the
kernel timer lock via the core's sys_clock_lock() / announce_locked(),
which is the intended locking for a system-timer driver.
timer_api and context pass on qemu_riscv64/qemu_virt_riscv64/smode
(supervisor timer under OpenSBI).
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
STIP is level sensitive and stays asserted until the SBI timer call
clears it. The ISR never made that call, relying on
sys_clock_set_timeout() being reached after the announce to move the
deadline forward.
That holds only as long as something does call it. On SMP each hart has
its own deadline, but sys_clock_announce_locked() returns early on all
but the announcing one, so the rest return from the ISR with the
interrupt still pending and take it again immediately. Nothing
guarantees a new deadline is armed on UP either: with no timeout pending
the kernel may legitimately choose not to.
Ask for an infinite expiry on entry, which the SBI spec defines as
clearing the pending interrupt without scheduling another, so the
interrupt fires once for the deadline it was armed with. The arming path
overwrites it in the normal case.
Fixes: #115442
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>