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 C231942668E for ; Fri, 10 Jul 2026 11:56:13 +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=1783684579; cv=none; b=KCmiwAPrwxpbywM4Zz1o9dFlvRHF6LG1NHHNuFrumOKBx2M1mCvAlEO6nY0MqHeERbeAfvAh/taLdeqy18J5NdUhUkaDGTkws0Hgs/t6drBqt7ImLXMYVzfrulmYTJpB1anMuCTIeNvVCA+ThHNdfCgAHaxATKK/OAL55G+08OY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783684579; c=relaxed/simple; bh=z6Yw8rX9lhuvUYL7iVZ70LrMuiszLXXFpXGsedcDnR0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EMQP+S7NRuh3kPI80oTszA77iiqZpOqaPC+/QiOKuWSPtQh8SOQ8kbGnpnh093vJTrZi2zN//3KnZwkMcOcC1dkvSX5wEJYlLt1FlcHj7MnQrppDSYxd73vU6nXO92x4s7Zp5r+rFQC+QzC5p2CSumHXf+A2LAhOpZgIpos/73Y= 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=lhZR2iH0; 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="lhZR2iH0" 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 999691EA6; Fri, 10 Jul 2026 04:56:04 -0700 (PDT) Received: from e134344.cambridge.arm.com (e134344.arm.com [10.2.212.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9C22E3FD88; Fri, 10 Jul 2026 04:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1783684568; bh=z6Yw8rX9lhuvUYL7iVZ70LrMuiszLXXFpXGsedcDnR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lhZR2iH00PsmgnjR/ZIgIHLdfYAnVujMShZGqrn9jW2TddzI8yWMaIPFdZEU++Rx/ G26O5blQhXl9E0BKdjkF7cZj2MBNPg629ClIF42MP9ltsgfJI6yzk4pogqcyn/yJqx lzMjBxsbQY3l1HNSPfmZVu8xihfGXwD3zfDp7/lI= From: Ben Horgan To: ben.horgan@arm.com Cc: james.morse@arm.com, reinette.chatre@intel.com, fenghuay@nvidia.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dave.martin@arm.com, andre.przywara@arm.com Subject: [PATCH v1 08/11] arm_mpam: resctrl: Correct check that existing class is L3 Date: Fri, 10 Jul 2026 12:55:42 +0100 Message-ID: <20260710115546.29644-9-ben.horgan@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260710115546.29644-1-ben.horgan@arm.com> References: <20260710115546.29644-1-ben.horgan@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The class used to back mbm_total_bytes can be either at the L3 or the memory. If a platform had candidate classes at both the memory and the L3 then, as the check for whether the existing class is L3 or not in counter_update_class() is broken, the class that will be chosen depends on which order the classes are considered and so the probe order. Fix the check. Fixes: 1458c4f05335 ("arm_mpam: resctrl: Add support for csu counters") Signed-off-by: Ben Horgan --- drivers/resctrl/mpam_resctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c index 226ff6f532fa..59dea750ff56 100644 --- a/drivers/resctrl/mpam_resctrl.c +++ b/drivers/resctrl/mpam_resctrl.c @@ -931,7 +931,7 @@ static void counter_update_class(enum resctrl_event_id evt_id, struct mpam_class *existing_class = mpam_resctrl_counters[evt_id].class; if (existing_class) { - if (class->level == 3) { + if (existing_class->level == 3) { pr_debug("Existing class is L3 - L3 wins\n"); return; } -- 2.43.0