[PATCH v2 2/2] lib: sbi: pmu: Remove MIP clearing from pmu_sse_enable()
Samuel Holland
samuel.holland at sifive.com
Mon May 19 14:35:46 PDT 2025
On 2025-05-19 3:39 AM, Clément Léger wrote:
> Clearing MIP at that point means that we can probably lose a pending
> interrupt. This should not happen, remove MIP clearing from there.
>
> Signed-off-by: Clément Léger <cleger at rivosinc.com>
> ---
> lib/sbi/sbi_pmu.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/lib/sbi/sbi_pmu.c b/lib/sbi/sbi_pmu.c
> index dee50b9b..50476d7a 100644
> --- a/lib/sbi/sbi_pmu.c
> +++ b/lib/sbi/sbi_pmu.c
> @@ -1099,7 +1099,6 @@ static void pmu_sse_enable(uint32_t event_id)
> {
> unsigned long irq_mask = sbi_pmu_irq_mask();
>
> - csr_clear(CSR_MIP, irq_mask);
> csr_set(CSR_MIE, irq_mask);
> }
>
This is now the same content as pmu_sse_complete(), so the two functions could
be combined, if that does not hurt clarity.
Reviewed-by: Samuel Holland <samuel.holland at sifive.com>
More information about the opensbi
mailing list