Thread (200 messages) 200 messages, 10 authors, 2025-09-10

Re: [PATCH 28/33] arm_mpam: Track bandwidth counter state for overflow and power management

From: Fenghua Yu <fenghuay@nvidia.com>
Date: 2025-08-28 00:58:33
Also in: linux-acpi, linux-devicetree, lkml

Hi, James,

On 8/22/25 08:30, James Morse wrote:
Bandwidth counters need to run continuously to correctly reflect the
bandwidth.

The value read may be lower than the previous value read in the case
of overflow and when the hardware is reset due to CPU hotplug.

Add struct mbwu_state to track the bandwidth counter to allow overflow
and power management to be handled.

Signed-off-by: James Morse <james.morse@arm.com>
[SNIP]
quoted hunk ↗ jump to hunk
@@ -2291,11 +2395,35 @@ static void mpam_unregister_irqs(void)
  
  static void __destroy_component_cfg(struct mpam_component *comp)
  {
+	struct mpam_msc *msc;
+	struct mpam_vmsc *vmsc;
+	struct mpam_msc_ris *ris;
+
+	lockdep_assert_held(&mpam_list_lock);
+
  	add_to_garbage(comp->cfg);
+	list_for_each_entry(vmsc, &comp->vmsc, comp_list) {
+		msc = vmsc->msc;
+
+		mpam_mon_sel_outer_lock(msc);
+		if (mpam_mon_sel_inner_lock(msc)) {
+			list_for_each_entry(ris, &vmsc->ris, vmsc_list)
+				add_to_garbage(ris->mbwu_state);
+			mpam_mon_sel_inner_unlock(msc);
+		}
+		mpam_mon_sel_outer_lock(msc);
s/mpam_mon_sel_outer_lock(msc);/mpam_mon_sel_outer_unlock(msc);/

Or this will hit a dead lock.

[SNIP]

Thanks.

-Fenghua

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help