From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 018B6276056; Fri, 12 Sep 2025 13:24:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757683467; cv=none; b=VFtg3ymN1QJ//E7xeT+iaO7MTpQSpo0fkk/myaRU69Iv81SLtNMmotQw8YcGZSKMCOqS1GMJuvLRZ5HpUnAbT3703hpgZ2k1LdeItpOL0UY1Qa3/5K8m9jx3GUUmoADpbY/yFCqkEdttCi/97DXGHFPpqKJJ6XDwwZn4kzWUAl8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757683467; c=relaxed/simple; bh=8hO1gh4QPpX+qUJtvAUp2n3+2tbru0yK4/bJ3sYDKoQ=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fD5ztY+L0oh4d0cEdPGFHgzlD3rOPHuGT2nVu13Z38/QlTj6hx4/cRak9B3zEf8YK73bzW/CBt1Jsnm7uvnMbnf7TLMqLQhNG2pQFUh74elYN+GMyqjS5w/eYm6tUcbuTyWO5Wv++91sqjU/hQbtULonxyj+MJU/VDvqcC3D1iM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4cNZqX0v5cz6GDGM; Fri, 12 Sep 2025 21:23:04 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 5579C14038F; Fri, 12 Sep 2025 21:24:22 +0800 (CST) Received: from localhost (10.203.177.15) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 12 Sep 2025 15:24:21 +0200 Date: Fri, 12 Sep 2025 14:24:19 +0100 From: Jonathan Cameron To: James Morse CC: , , , D Scott Phillips OS , , , , , , Jamie Iles , Xin Hao , , , , David Hildenbrand , Dave Martin , Koba Ko , Shanker Donthineni , , , Rob Herring , Rohit Mathew , "Rafael Wysocki" , Len Brown , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Catalin Marinas , "Will Deacon" , Greg Kroah-Hartman , Danilo Krummrich Subject: Re: [PATCH v2 24/29] arm_mpam: Track bandwidth counter state for overflow and power management Message-ID: <20250912142419.00006c6d@huawei.com> In-Reply-To: <20250910204309.20751-25-james.morse@arm.com> References: <20250910204309.20751-1-james.morse@arm.com> <20250910204309.20751-25-james.morse@arm.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500005.china.huawei.com (7.191.163.240) To frapeml500008.china.huawei.com (7.182.85.71) On Wed, 10 Sep 2025 20:43:04 +0000 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 Trivial comment inline. I haven't spent enough time thinking about this to give a proper review so no tags yet. Jonathan > --- > Changes since v1: > * Fixed lock/unlock typo. > --- > drivers/resctrl/mpam_devices.c | 154 +++++++++++++++++++++++++++++++- > drivers/resctrl/mpam_internal.h | 23 +++++ > 2 files changed, 175 insertions(+), 2 deletions(-) > > diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c > index 1543c33c5d6a..eeb62ed94520 100644 > --- a/drivers/resctrl/mpam_devices.c > +++ b/drivers/resctrl/mpam_devices.c > @@ -918,6 +918,7 @@ static void gen_msmon_ctl_flt_vals(struct mon_read *m, u32 *ctl_val, > *ctl_val |= MSMON_CFG_x_CTL_MATCH_PARTID; > > *flt_val = FIELD_PREP(MSMON_CFG_x_FLT_PARTID, ctx->partid); > + Unrelated change. If it makes sense figure out where to push it back to. > if (m->ctx->match_pmg) { > *ctl_val |= MSMON_CFG_x_CTL_MATCH_PMG; > *flt_val |= FIELD_PREP(MSMON_CFG_x_FLT_PMG, ctx->pmg);