Skip to content

Commit 9f828bc

Browse files
mdchitalepalmer-dabbelt
authored andcommitted
drivers/perf: RISC-V: Allow programming custom firmware events
Applications need to be able to program the SBI implementation specific or custom firmware events in addition to the standard firmware events. Remove a check in the driver that prohibits the programming of the custom firmware events. Signed-off-by: Mayuresh Chitale <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 81a1dd1 commit 9f828bc

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/perf/riscv_pmu_sbi.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,8 @@ static int pmu_sbi_event_map(struct perf_event *event, u64 *econfig)
385385
bSoftware = config >> 63;
386386
raw_config_val = config & RISCV_PMU_RAW_EVENT_MASK;
387387
if (bSoftware) {
388-
if (raw_config_val < SBI_PMU_FW_MAX)
389-
ret = (raw_config_val & 0xFFFF) |
390-
(SBI_PMU_EVENT_TYPE_FW << 16);
391-
else
392-
return -EINVAL;
388+
ret = (raw_config_val & 0xFFFF) |
389+
(SBI_PMU_EVENT_TYPE_FW << 16);
393390
} else {
394391
ret = RISCV_PMU_RAW_EVENT_IDX;
395392
*econfig = raw_config_val;

0 commit comments

Comments
 (0)