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 29A5C36EA98 for ; Mon, 11 May 2026 11:19:16 +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=1778498359; cv=none; b=TMii6Czf2/IqmsYMJ5Yn7MmsqCBgkZQoQvUdxay2DDyWhtekljmX/HXh3xNWre458/gwF7uE5LkZYmzwicJN+93/+apLgw6jqvddjIfxsoPibmu3PRrLEMiVLT8d8notzm/yqx7w1s7Oayb+mAGqhrzIFshisQ3kw5b/Rskh/XI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778498359; c=relaxed/simple; bh=ozWQ3fOF6yFVeR5A9evTnQARUzjgjv/GHbGPvJHcwHU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LbctO/lVfs+zOJDs2fzRdNVa0uyrBOvIRN6UZfhWhuDnlhCQL6wTLrELIK7zpNVB0DxlB61YDYzjKzlaVkOdx4izKpz5BHvQ/BjbORY0QHDEMt2xqLHGRMibm77tL+T4gVUlJ3TStgKFWBi63XXYSJpHyVgYEfAMYCAkPTCgArY= 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; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=VaPKa3o8; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="VaPKa3o8" 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 21AC41595; Mon, 11 May 2026 04:19:11 -0700 (PDT) Received: from [10.1.196.46] (e134344.arm.com [10.1.196.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B88A73F85F; Mon, 11 May 2026 04:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778498356; bh=ozWQ3fOF6yFVeR5A9evTnQARUzjgjv/GHbGPvJHcwHU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=VaPKa3o8ELSK/39g+WB5sWUGgG3AIiw7sy4uUe2cx0lULntEI0lpr+Fc6zTyTR4Pw tcuW/XsazM2T+mE+XYO6DbTTibI5Zb8nv1e3GkkPkwx+WKOgUAQuWiYRsdbcICKBIT doS29S3ucOFusc92OBWqUpFAJN8DK73oDpNBBVpo= Message-ID: <3f51d2a8-e699-4acf-9903-e62e27d2213a@arm.com> Date: Mon, 11 May 2026 12:19:06 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Thunderbird Daily Subject: Re: [PATCH v3 1/4] arm_mpam: Fix false positive assert failure during mpam_disable() To: James Morse , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, zengheng4@huawei.com Cc: wangkefeng.wang@huawei.com, xry111@xry111.site, catalin.marinas@arm.com, yang@os.amperecomputing.com, reinette.chatre@intel.com, will@kernel.org, thuth@redhat.com, mrigendra.chaubey@gmail.com, fenghuay@nvidia.com, ahmed.genidi@arm.com References: <20260508162341.3762549-1-james.morse@arm.com> <20260508162341.3762549-2-james.morse@arm.com> Content-Language: en-US From: Ben Horgan In-Reply-To: <20260508162341.3762549-2-james.morse@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi James, On 5/8/26 17:23, James Morse wrote: > mpam_assert_partid_sizes_fixed() is used to document that the caller > doesn't expect the discovered PARTID size to change while it is walking > a list sized by PARTID. Typically the MSC state is not written to until > all the MSC have been discovered and this value is set. > > However, if discovering the MSC fails and schedules mpam_disable(), > then the MSC state is written to reset it. In this case the > discovered PARTID size may be become smaller - but only PARTID 0 > will be used once resctrl_exit() has been called. > > Skip the WARN_ON_ONCE() if mpam_disable_reason has been set. > > Fixes: 3bd04fe7d807bb ("arm_mpam: Extend reset logic to allow devices to be reset at any time") > Signed-off-by: James Morse > --- > drivers/resctrl/mpam_devices.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c > index 41b14344b16f..bef5e9e9e844 100644 > --- a/drivers/resctrl/mpam_devices.c > +++ b/drivers/resctrl/mpam_devices.c > @@ -164,11 +164,17 @@ static void mpam_free_garbage(void) > /* > * Once mpam is enabled, new requestors cannot further reduce the available > * partid. Assert that the size is fixed, and new requestors will be turned > - * away. > + * away. This is needed when walking over structures sized by PARTID. > + * > + * During mpam_disable() these structures are not fixed, but the MSC state > + * is still reset using whatever sizes have been discovered so far. As only > + * PARTID 0 will be used after mpam_disable(), any race would be benign. > + * Skip the check if a mpam_disable_reason has been set. > */ > static void mpam_assert_partid_sizes_fixed(void) > { > - WARN_ON_ONCE(!partid_max_published); > + if (!mpam_disable_reason) > + WARN_ON_ONCE(!partid_max_published); A little bit nasty to use mpam_disable_reason this way but a simple better way eludes me. Reviewed-by: Ben Horgan Thanks, Ben > } > > static u32 __mpam_read_reg(struct mpam_msc *msc, u16 reg)