From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CA6A30AD05; Tue, 30 Sep 2025 17:06:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759251990; cv=none; b=Jq+JpF2lctrYB+V4pJXOJ8L8Z8UfmbZm3djL0TETL97oWzUMA243aZndjZWNThYNpaa+JB8a1YKvaX5/tnT13qpO7zdUzoOlF6PmnFOaCS95UTr2b+QMSdpkgzuUs//yBaGZ1dSdFFvP4wu5sWyoP9XJljiAElgYcLA+fTaJImQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759251990; c=relaxed/simple; bh=dxCbi5pelgO5PBkZQgjKIlz4PLLOs+UV27mWOnubvY4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lj4RcAa+bud10drkWetLHFRPbu2N9QgUPuHkUtgdlyPe/HIqSzvZxJ25XIXwAV66RQ8Sm4scuKIBNVgae3Vcy4gckxR1nEsaSvDbdyAtCHRtkCQYlmO3RGpWHZn7icEYYt03tSTcqixYQPeIAMB68NVcgSUziik9JZyzGWAP4sM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AD4F812FC; Tue, 30 Sep 2025 10:06:19 -0700 (PDT) Received: from [10.1.197.69] (eglon.cambridge.arm.com [10.1.197.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 08F273F59E; Tue, 30 Sep 2025 10:06:21 -0700 (PDT) Message-ID: Date: Tue, 30 Sep 2025 18:06:20 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 17/29] arm_mpam: Extend reset logic to allow devices to be reset any time To: Jonathan Cameron Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Dave Martin , Koba Ko , Shanker Donthineni , fenghuay@nvidia.com, baisheng.gao@unisoc.com, Rob Herring , Rohit Mathew , Rafael Wysocki , Len Brown , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Catalin Marinas , Will Deacon , Greg Kroah-Hartman , Danilo Krummrich References: <20250910204309.20751-1-james.morse@arm.com> <20250910204309.20751-18-james.morse@arm.com> <20250912130216.00006d92@huawei.com> Content-Language: en-GB From: James Morse In-Reply-To: <20250912130216.00006d92@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Jonathan, On 12/09/2025 13:02, Jonathan Cameron wrote: > On Wed, 10 Sep 2025 20:42:57 +0000 > James Morse wrote: > >> 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. >> Changes since v1: >> * Use guard macro for srcu. > > I'm not seeing a strong reason for doing this for the case here and not > for cases in earlier patches like in mpam_cpu_online() I just missed them... > I'm a fan of using > these broadly in a given code base, so would guard(srcu) in those earlier patches > as well. I've done the online/offline - I'll take another pass through them. > Anyhow, one other trivial thing inline that you can ignore or not as you wish. > > Reviewed-by: Jonathan Cameron Thanks! >> diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c >> index e7faf453b5d7..a9d3c4b09976 100644 >> --- a/drivers/resctrl/mpam_devices.c >> +++ b/drivers/resctrl/mpam_devices.c >> @@ -1340,8 +1338,56 @@ static void mpam_enable_once(void) >> +static void mpam_reset_component_locked(struct mpam_component *comp) >> +{ >> + struct mpam_msc *msc; >> + struct mpam_vmsc *vmsc; >> + struct mpam_msc_ris *ris; >> + >> + lockdep_assert_cpus_held(); >> + >> + guard(srcu)(&mpam_srcu); >> + list_for_each_entry_srcu(vmsc, &comp->vmsc, comp_list, >> + srcu_read_lock_held(&mpam_srcu)) { >> + msc = vmsc->msc; > > Might be worth reducing scope of msc and ris Sure, Thanks, James