From patchwork Tue Aug 15 15:27:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Singh Tomar X-Patchwork-Id: 13353925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5E8AC04A6A for ; Tue, 15 Aug 2023 15:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sGqpcGfO1OVh3XZN7iamLL8zyCVCs84eWqx9tlPu+Tw=; b=C8dhnCywbDdN7w SeD+WCGJ5AEWUPBiQXqxMAD3e2FWJUooRbgCXuzfUaHlSuWNFrnqq8kMjeN+DYw10ywxeUNKwRJsw EWnQAvINtgsDDlB7X7dS2P3l8aKjJcJ5808ahH8zi8Z2H8lEqBsx8S9jkn6uDZlfBBMW0WoVMEqIr XqIa4zNosmaCXR86kU+Trrs6fh27tDvSylLawmbbLmm03yavOm869LyZMs8PjqdfTVJHldOjbirr+ yeYs2O4n+nNMs7jvdvQE4fFWKX8pbth/V9OF04TR30c8YbxGKyq3ZckgGpCvgL47dtqfxd+GKHstA Vbu6uKGcNXEOFb2VYqWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVvyO-001rWM-24; Tue, 15 Aug 2023 15:28:44 +0000 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qVvy9-001rMy-30 for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2023 15:28:31 +0000 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37FAGTxV003830; Tue, 15 Aug 2023 08:28:22 -0700 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=X52rhhnaJfUS4+lgw3taAm1Dv6OGkopQSygQ6G+3g7A=; b=U9FGU4MrrqYv7Ylal7lGTPOFV7E2EAA/VYrZoEDxE6rE6BPA51lZBq4KGDj0p9Fe2Lb8 fOd+d8ibJYpCQpgXkLJVTqjxHYoMZAMgu1aAPIjlX+zBesm0uW0zzFSlW5vzRsuAGisz Am9MeDUu4I6ZzkAff2d0xLmPN5EgXnKB1YHC+tvfjMIANH30Oe/LaPIw2ata2EZmVAHh 6mMxjaX0F2EZoPa25Isn6Ng0fSvjkwiS7qjETCqy448u7D4p7jsSbSLKrEG7SBVgMnh6 5Z/jHKV3wUKNFHI47TJifho5cMvogvqKNGhgXrDS3hbaJCWWwWXgn4tVmBLJwjI4hJds ZA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3se9kjajwq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 15 Aug 2023 08:28:22 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 15 Aug 2023 08:28:20 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 15 Aug 2023 08:28:20 -0700 Received: from localhost.localdomain (unknown [10.28.36.167]) by maili.marvell.com (Postfix) with ESMTP id 1ACD83F7063; Tue, 15 Aug 2023 08:28:14 -0700 (PDT) From: Amit Singh Tomar To: , CC: , , , , , , Amit Singh Tomar Subject: [RFC 11/12] arm_mpam: Fix Downstream priority mask Date: Tue, 15 Aug 2023 20:57:11 +0530 Message-ID: <20230815152712.1760046-12-amitsinght@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230815152712.1760046-1-amitsinght@marvell.com> References: <20230815152712.1760046-1-amitsinght@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: Ca4QYOtQNqaA5F5wu-J3VSMVewF57DdI X-Proofpoint-ORIG-GUID: Ca4QYOtQNqaA5F5wu-J3VSMVewF57DdI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-15_16,2023-08-15_02,2023-05-22_02 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230815_082830_083234_74624507 X-CRM114-Status: GOOD ( 16.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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, by subtracting 1 from DSPRI_WD value. Signed-off-by: Amit Singh Tomar --- drivers/platform/mpam/mpam_devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/mpam/mpam_devices.c b/drivers/platform/mpam/mpam_devices.c index c0c83c04c77c..59022e42920c 100644 --- a/drivers/platform/mpam/mpam_devices.c +++ b/drivers/platform/mpam/mpam_devices.c @@ -1099,7 +1099,7 @@ 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 dspri = GENMASK((rprops->dspri_wd-1), 0); u16 intpri = GENMASK(rprops->intpri_wd, 0); lockdep_assert_held(&msc->lock);