Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mpfs handle pending plic irqs #359

Merged
merged 1 commit into from
Feb 19, 2025
Merged

Conversation

jlaitine
Copy link

No description provided.

@jlaitine jlaitine requested a review from pussuw February 19, 2025 08:24
@jlaitine jlaitine force-pushed the mpfs_handle_pending_plic_irqs branch 2 times, most recently from c437f19 to cf70c6c Compare February 19, 2025 08:27

/* Return the irq priority to 1 */

putreg32(1, MPFS_PLIC_PRIORITY + (4 * extirq));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion, make the two interrupt priority levels into define macros:

#define PLIC_PRIO_DEFAULT 1
#define PLIC_PRIO_MAX 0xfffffffff

And so forth ? To get rid of the magic number ?


void mpfs_plic_clear_and_enable_irq(int extirq)
{
int hartid = riscv_mhartid();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use up_cpu_index, to make it easier to upstream this. riscv_mhartid has been deprecated.

@jlaitine jlaitine force-pushed the mpfs_handle_pending_plic_irqs branch from cf70c6c to a2ec8dc Compare February 19, 2025 09:51
….c and handle pending interrupts

- Move PLIC interrupt enable and disable functions into mpfs_plic.c
- When enabling interrupts, always clear pending interrupt

A pending interrupt would trigger immediately when enabling the interrupt source,
but this is not expected. The interrupt source is level sensitive, so it should
only trigger if the source is active at the time when it is enabled. Not if it
was active sometime in the past.

Signed-off-by: Jukka Laitinen <[email protected]>
@jlaitine jlaitine force-pushed the mpfs_handle_pending_plic_irqs branch from a2ec8dc to f3ae36b Compare February 19, 2025 09:53
@jlaitine jlaitine merged commit 35bc0e3 into master Feb 19, 2025
10 checks passed
@jlaitine jlaitine deleted the mpfs_handle_pending_plic_irqs branch February 19, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants