Re: [RFC PATCH 24/36] arm_mpam: Extend reset logic to allow devices to be reset any time
From: James Morse <james.morse@arm.com>
Date: 2025-08-08 07:07:32
Also in:
lkml
Hi Ben, On 28/07/2025 11:22, Ben Horgan wrote:
On 7/11/25 19:36, James Morse wrote:quoted
cpuhp callbacks aren't the only time the MSC configuration may need to be reset. Resctrl has an API call to reset a class. If an MPAM error interrupt arrives it indicates the driver has misprogrammed an MSC. The safest thing to do is reset all the MSCs and disable MPAM. Add a helper to reset RIS via their class. Call this from mpam_disable(), which can be scheduled from the error interrupt handler.diff --git a/drivers/platform/arm64/mpam/mpam_devices.c b/drivers/platform/arm64/mpam/mpam_devices.c index 2e32e54cc081..145535cd4732 100644--- a/drivers/platform/arm64/mpam/mpam_devices.c +++ b/drivers/platform/arm64/mpam/mpam_devices.c
quoted
+/* + * Called in response to an error IRQ. + * All of MPAMs errors indicate a software bug, restore any modified + * controls to their reset values. + */ +void mpam_disable(void) +{ + int idx; + struct mpam_class *class; + + idx = srcu_read_lock(&mpam_srcu); + list_for_each_entry_srcu(class, &mpam_classes, classes_list, + srcu_read_lock_held(&mpam_srcu)) + mpam_reset_class(class); + srcu_read_unlock(&mpam_srcu, idx); +}Consider moving to the next patch where you introduce interrupt support.
I pulled these changes out of that patch to try and make it simpler! Doing that would leave a bunch of static functions unused. Thanks, James