Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp423765rdb; Wed, 17 Jan 2024 06:17:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpMTdH54GWN9hISEjYOMtxZoZ1NA3MrsrsuvwCqK4DhKXeJkdJqPXWy9Bl34tdIP/EC372 X-Received: by 2002:a17:902:6b01:b0:1d5:63fb:a687 with SMTP id o1-20020a1709026b0100b001d563fba687mr4824343plk.128.1705501048565; Wed, 17 Jan 2024 06:17:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705501048; cv=pass; d=google.com; s=arc-20160816; b=kJP9YZDvrTEbnDutBRnljSql8P0iP44y13mV6SnfdWyHzKnWmmxH3J6rSXxz3h/UXf 5NbkUKMIyE8Ng81PIks+eK1p4xPhjuzuSBmtyzmI+8xnknr3PAGRW3Nfx1hhZ30R6Sqg 14s4Lg/9mrTPyQwLbMxYEhglHEI0iuV1GyzAO+zwxEqC3fCir+uauhkKSQ6RwmVrbic1 Y2JQgFv1f8ku0vzDhKLeaYVQwgWHzyymPpwRgzglVMDMlkYkRzJ4PvBDB7BlPhLhnEDT mRMxJvLJRlp4u0uWHQTGkQjulguOj7Q0BKdtHgRzQbB4csW8n4x1beLa/mzqAjodHQzP TVMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=l+S3NRJZhZMZgic+Qg3QaXyHk6lYRiz6QfTJLOdTtvU=; fh=j6SLEof9e8AyCQLu0pJpTyZST5iXPx6e/Ker9f2ENNE=; b=kfSNua+AIxhS4RLI6m+L/F5CKqOLGE7MPa4nfKCFBUckV5K65WFyAH8vmQzwg979Dz QDE5fHqBC7nVSeTCigFMvKfuo9Vs3EREd0g18SwAkYXmxKiUQnbl0FsWNITvjdcE1ozc iOcuGSGYe8lxkEnNrgEi3riSU9AzIwnemxkiLb1dmmN/Jr6AA9KI5Ztx6xQGBQy44Zb+ UwETjVJN4oiajtz24krdj4iLzGzXp64/ekM/0AbT9NBciZXDOeTpZdqX7VkIntu+62Qn pFmTdpNUQnmFFpf4UxOd2VaGHAkdkK2DrMTedi8kGxTW36BAxkpxebqzbnnOR6Vjn41Q 2bbA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="O/fsvbkW"; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-29061-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p19-20020a1709028a9300b001d5baac6265si8849008plo.463.2024.01.17.06.17.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 06:17:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29061-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="O/fsvbkW"; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-29061-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 24F3528710B for ; Wed, 17 Jan 2024 14:17:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 143A020320; Wed, 17 Jan 2024 14:15:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="O/fsvbkW" Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (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 F295E224DA for ; Wed, 17 Jan 2024 14:15:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705500913; cv=none; b=LsTCiglRl21L0RUW40zlr3ZhYK2zT7VO1UKwKvSIgcV9P3LmZnc2ev4mAfbutHiE1GAIFnjBgyBydLvUeoAkH8FR3iMQViO2Vp86+9Ecv/cG0j0awnam/Lnz0gpHBgjYWauSnykISdkqcWEJCvzp35bPu6ZOR1KoYLGUFBFxFyY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705500913; c=relaxed/simple; bh=R2ihv3gxBjZQJ8LHAqGvREa3UZH1OP8g3M6pOjjvNd0=; h=Received:DKIM-Signature:Received:Received:Received:Received:From: To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type: X-Proofpoint-ORIG-GUID:X-Proofpoint-GUID: X-Proofpoint-Virus-Version; b=N+QvQWRAqPypHUjIa7KTQuK8cj8OWmSB7yJFPI56fRltjgubnhzztD3SWuhvcorgny84uWdhcR0uzkJ5gdAqO8K6+r4sGca/DzJs1fDyAlavw7Z0YP78RVFIZpbt5XLsmcz3JN1ee7I7avjz0GZcbIRb+CA/+BI7VF0NQ7KaY7A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=O/fsvbkW; arc=none smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40H7jROq028480; Wed, 17 Jan 2024 06:14:56 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= pfpt0220; bh=l+S3NRJZhZMZgic+Qg3QaXyHk6lYRiz6QfTJLOdTtvU=; b=O/f svbkW6gIfyjwmzl/FgCh5iDYg3mix3P3+KVpgMAEqve/+AsSgxL6BV4lvUhkCoHf mCGvyeGIDFklERsAt54ZI7TLXsfmgiivYxvmJLRpi9zm6iczAXQYRHxhXd4EBwTk fXFC67TQA1r6rWymkarDh1f9Owr/THgfkfkJtWqkLpLwhDOm12Y+kGsQE88KBkDd U+TwIFtfKlCC6OTlsNNu1AHA0FqFJVi6UA24loSUsGZZ36BpijjYHORHXoEadpiu 1tLPGvJsv3Pa/gYb3067n5D0Px+5+Xi+bnYbD/Pzucmgs5EHDq/Hd52AXjknIQb3 Tk1UEan28F1T0uLDDmA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3vpask9538-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 06:14:56 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 17 Jan 2024 06:14:54 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 17 Jan 2024 06:14:54 -0800 Received: from localhost.localdomain (unknown [10.28.36.167]) by maili.marvell.com (Postfix) with ESMTP id 00B125B6932; Wed, 17 Jan 2024 06:14:50 -0800 (PST) From: Amit Singh Tomar To: , CC: , , , , , , , , Amit Singh Tomar Subject: [PATCH v1 11/14] arm_mpam: Fix Downstream and internal priority mask Date: Wed, 17 Jan 2024 19:44:02 +0530 Message-ID: <20240117141405.3063506-12-amitsinght@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240117141405.3063506-1-amitsinght@marvell.com> References: <20240117141405.3063506-1-amitsinght@marvell.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 Content-Type: text/plain X-Proofpoint-ORIG-GUID: f_mntF0stDJ-zIfagyjHlMshtsHXYiSJ X-Proofpoint-GUID: f_mntF0stDJ-zIfagyjHlMshtsHXYiSJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-17_08,2024-01-17_01,2023-05-22_02 MPAMF_PRI_IDR_NS[DSPRI_WD] determines the number of implemented bits in the downstream priority field (MPAMCFG_PRI_NS). For instance, if the value of DSPRI_WD is 4, then the maximum value for dspri is 0xf, and mask should be GENMASK(3,0). But with current implementation, it turned out to be GENMASK(4,0) .i.e. 0x1f instead of 0xf. u16 dspri = GENMASK(rprops->dspri_wd, 0); Let's fix it (for both downstream, and internal), by subtracting 1 from DSPRI_WD, and INTPRI_WD value. Signed-off-by: Amit Singh Tomar --- Changes since RFC: * Include fix for INTPRI as well. --- drivers/platform/mpam/mpam_devices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/mpam/mpam_devices.c b/drivers/platform/mpam/mpam_devices.c index 3ef9e5d70afc..9953f2050d35 100644 --- a/drivers/platform/mpam/mpam_devices.c +++ b/drivers/platform/mpam/mpam_devices.c @@ -1099,8 +1099,8 @@ static void mpam_reprogram_ris_partid(struct mpam_msc_ris *ris, u16 partid, struct mpam_msc *msc = ris->msc; u16 bwa_fract = MPAMCFG_MBW_MAX_MAX; struct mpam_props *rprops = &ris->props; - u16 dspri = GENMASK(rprops->dspri_wd, 0); - u16 intpri = GENMASK(rprops->intpri_wd, 0); + u16 dspri = GENMASK((rprops->dspri_wd - 1), 0); + u16 intpri = GENMASK((rprops->intpri_wd - 1), 0); lockdep_assert_held(&msc->lock); -- 2.25.1