riscv: timer: Fix M-mode early timer support
Get series with b4
b4 am 20260911-riscv_fix_early_timer_mmode-v5-0-98e7aaf91396@maquefel.me change-id 20260904-riscv_fix_early_timer_mmode-174f3ee4e106Versions newest first
- v5 Latest2 patches 1 replyIn review
- v42 patches 4 repliesSuperseded
- v32 patches 0 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 2 patches | 4 replies | Superseded | |
| v1 | 1 patch | 3 replies | Superseded |
Changes in v5 from the cover letter
- Rephrased commit message for Patch 2.
- Link to v4: https://lore.kernel.org/r/20260911-riscv_fix_early_timer_mmode-v4-0-87a7b5abf958@maquefel.me
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | riscv: timer: Make RISCV_TIMER definitions weakdrivers/ | +2 | 0 replies | |
| 2/2 | riscv: timer: Enable early timer for M‑modedrivers/ drivers/ | +16 | 0 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Yao Zi |
|---|---|
| Series | R-b |
| 1/2 | |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v5 0/2] riscv: timer: Fix M-mode early timer support
This series addresses two issues with the generic RISC-V timer driver.
Patch 1 marks timer_early_get_rate() and timer_early_get_count() as __weak to prevent link conflicts with other drivers (e.g., ACLINT MTIMER) that may also provide their own implementation.
Patch 2 adds proper M‑mode support: timer_early_get_rate() is now defined for M‑mode using RISCV_MMODE_TIMER_FREQ, and timer_early_get_count() is no longer guarded by RISCV_SMODE, making it available whenever CONFIG_TIMER_EARLY is enabled. This is necessary because functions like net_random_ethaddr() rely on get_ticks() which uses timer_early_get_count().
---
Changes in v5:
- Rephrased commit message for Patch 2.
- Link to v4: https://lore.kernel.org/r/20260911-riscv_fix_early_timer_mmode-v4-0-87a7b5abf958@maquefel.me
Changes in v4:
- Change KConfig description for RISCV_TIMER: drop ACLINT warning as we define funcs as weak, rephrase note about macros and make int make it more compact.
- Link to v3: https://lore.kernel.org/r/20260910-riscv_fix_early_timer_mmode-v3-0-52b569fa1d6d@maquefel.me
Changes in v3:
- reoder patches so weak definitions come first
- Link to v2: https://lore.kernel.org/r/20260909-riscv_fix_early_timer_mmode-v2-0-563bff2a50c5@maquefel.me
Changes in v2:
- Updated Kconfig help text and driver comments to clarify M-mode support
- Simplified code a bit
- Add patch to make timer_early_get_count() weak (optional)
- Link to v1: https://lore.kernel.org/r/20260904-riscv_fix_early_timer_mmode-v1-1-210e769b0ac2@maquefel.me
---
Nikita Shubin (2):
riscv: timer: Make RISCV_TIMER definitions weak
riscv: timer: Enable early timer for M‑mode
drivers/timer/Kconfig | 9 +++++++-- drivers/timer/riscv_timer.c | 16 +++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-)
---
base-commit: cc557af4553382f6f50e3ed62b9577054e7bc54f
change-id: 20260904-riscv_fix_early_timer_mmode-174f3ee4e106
Best regards,
Signature · 1 line
Nikita Shubin