[PATCH v2 0/2] lib: sbi_pmu: propagate hardware counter errors

Sebastian Alba Vives sebasjosue84 at gmail.com
Sun Oct 25 07:53:36 PDT 2026


The two patches Anup asked for in the thread for Pengpeng Hou's
SKIP_MATCH class check. v1 is at

  https://lore.kernel.org/r/20261025062836.2445655-1-sebasjosue84@gmail.com

Changes in v2:
 - patch 1: propagate SBI_EALREADY_STARTED as well, per Anup's review.
   An already running counter may have been configured for a different
   event previously, so the configure must not report success. The
   commit message was reworked around that and the special case is gone.
 - patch 2: unchanged except for the context line that patch 1 touches.
   Picked up Anup's Reviewed-by.

They stay a series because both touch the same if block in
sbi_pmu_ctr_cfg_match() and the second does not apply without the first.

Built clean for rv64 and rv32, PLATFORM=generic, no new warnings.

Sebastian Alba Vives (2):
  lib: sbi_pmu: do not ignore pmu_ctr_start_hw() error in cfg_match
  lib: sbi_pmu: reject out-of-bounds counter index in pmu_ctr_write_hw()

 lib/sbi/sbi_pmu.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

-- 
2.43.0




More information about the opensbi mailing list