[PATCH 2/5] lib: sbi: Add error message for sbi_timer_event_start

Anup Patel anup at brainfault.org
Thu May 15 04:42:46 PDT 2025


On Sun, Apr 13, 2025 at 8:36 PM Xiang W <wxjstz at 126.com> wrote:
>
> Added error message output when no timer device is available.
>
> Signed-off-by: Xiang W <wxjstz at 126.com>

We don't need this patch because we are already printing the
platform timer device at boot time.

Regards,
Anup

> ---
>  lib/sbi/sbi_timer.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/lib/sbi/sbi_timer.c b/lib/sbi/sbi_timer.c
> index 7ad12bff..14e5ee46 100644
> --- a/lib/sbi/sbi_timer.c
> +++ b/lib/sbi/sbi_timer.c
> @@ -145,11 +145,17 @@ void sbi_timer_event_start(u64 next_event)
>  #else
>                 csr_write(CSR_STIMECMP, next_event);
>  #endif
> -       } else if (timer_dev && timer_dev->timer_event_start) {
> +               return;
> +       }
> +
> +       if (timer_dev && timer_dev->timer_event_start) {
>                 timer_dev->timer_event_start(next_event);
>                 csr_clear(CSR_MIP, MIP_STIP);
>                 csr_set(CSR_MIE, MIP_MTIP);
> +               return;
>         }
> +
> +       sbi_printf("%s: called without timer device\n", __func__);
>  }
>
>  void sbi_timer_process(void)
> --
> 2.47.2
>



More information about the opensbi mailing list