Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7550049rwi; Mon, 24 Oct 2022 16:37:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6+lyT6gt2QSnbn0TSfQ4RIhFSi3d1BupM74nMf0GPerA/StsLJnTCpl/oEMaSrF5RFPCGx X-Received: by 2002:a65:6e47:0:b0:438:c2f0:c0eb with SMTP id be7-20020a656e47000000b00438c2f0c0ebmr30313506pgb.236.1666654637694; Mon, 24 Oct 2022 16:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666654637; cv=none; d=google.com; s=arc-20160816; b=KMl2X/Fgm6dt8MkrsbRK8O/Qxcrh2QMltoCypg4/J0Ofk6wspqqS9dZggQgpCd2Xha T4bLr1m7D8yZJbjir9cofnpKqpEgx+NWssTCqOYQD7SUJY3LjfWaTESsZMRdzB4jHUHP pdk0ZfhOnxip1/NDg0hRTO0ZtpR1a1rGgKQGzDktnzX1L2X7yEhuO0kHYW2VOWrb8P+N tsun1PFSmsEG3tXyGyGI3VMfHW3k8BFKGSBATh6f7GEuqL1ZpfHVb+Ix/OSvwywu4SgY 9GWTMSr9XISTO4JI7DKj+Vw37Ia8Gv1cy/levKX7ZJj5+bkKSGgqOK+OadcX+OHNarbF 3+Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=gk7TlUCe82Khl4QlorbqbbPFStHIH3+Iv/P2rNwZu0o=; b=YFB2RJZOsP2b0DXCdEUe6cl7i9jhCwJWjUcAGa8/IJYPXDEE/XMTwvegrtClBuP/ss oYjlpxsCW2xucPw9Cc5awYpjERufMssyRWN64P91qwyWvrOphqsUiuhpqP8eTLv6fWNo WnWfMmLThQp9lq4WCvi1DGmlDU+imbxYby+uMjQplwKs92h04kzKnk5IpovvVlnHTgdz 6yZtMft3rJpgM4RyGPC9alzaW1uuk9g8naYkiGbVkATMvZoxz2KpwBwoGnu5zM+7/87w nAAaCdeh7iPUd4R1wIdICOsUzwK8r4kIsX6z36/PoOXmkWQ46BysrP8b1TMnso2ZijNF bu2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uCMsBsZs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020a17090a474d00b0020a880cf1cbsi10092245pjg.134.2022.10.24.16.37.06; Mon, 24 Oct 2022 16:37:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uCMsBsZs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231293AbiJXXPw (ORCPT + 99 others); Mon, 24 Oct 2022 19:15:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230402AbiJXXPY (ORCPT ); Mon, 24 Oct 2022 19:15:24 -0400 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D19C72ED4 for ; Mon, 24 Oct 2022 14:36:27 -0700 (PDT) Received: by mail-qk1-x72e.google.com with SMTP id j21so6911023qkk.9 for ; Mon, 24 Oct 2022 14:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=gk7TlUCe82Khl4QlorbqbbPFStHIH3+Iv/P2rNwZu0o=; b=uCMsBsZsyNSicwFLc5eBQIDw9d/ijN5Z1RGIP8Hel2XXUFnaIsSFU+Z43X/zkM+5P/ 0qJThUC3pXejzgWcgINJoBNZzyUPoZNft8DNnebXE7WGxlFNJMyY/oAetcvt/19J+JsX e80ham7Ou9Ldkp3IxUmVFxMymo3CY/yDlJInbbTgFDYkfT3QeZPN5QKrBh8u3dur+CLy n1sNufly3U3//6xQ7I6snoo0dYCblPXViF9RBM2BraKoPxi4FP5Z3psUlQ1Isc5nXeDP loRP1blly4913PyruuJXHmkEHR4kcQsge82dROPhH30DdgouOYYxwfYPAcF1v6brRu9p Mb/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gk7TlUCe82Khl4QlorbqbbPFStHIH3+Iv/P2rNwZu0o=; b=GTeTE5G7KauUycuP/LdYchX9TRDKIiaSCV3ElMsJQ/tmEeoI2wzwMHPcVmotIiFC9M 895hN6qgXBjQxa+UKWXGVN/g4rS7ow0imhA/n8JpKayGkLWJeNEyED+htAT6oLfgHbOI EyLbE2YlLXS49AxskMjrFQgOq0QryJHZwX4jPtOySfmCNpg+LMF+rwxPCbJXdEpjnDVY I1I3DMq+30VCUy/OdtfutYVv+GVNl5H4bUrbS1QoFKIeysbj28EQWBil9MnXwQNfnQNA EBQK4ifMOGOIvRnYEP5RFgXfIqtwmkRYhDr3fKP7TSQ/vgPr5ZEjKFKQcZd6aZsuF/x9 NRYA== X-Gm-Message-State: ACrzQf0qBj09y0JxlqPJcjGRWeC/yYIDbqK0bS8Y8hCbe11/TYn9FFdJ FzLv9J+HfCeKBLbP7K/uv9TtflyXuIKDIA== X-Received: by 2002:a05:620a:40cb:b0:6ee:79ce:e985 with SMTP id g11-20020a05620a40cb00b006ee79cee985mr24019893qko.219.1666647368612; Mon, 24 Oct 2022 14:36:08 -0700 (PDT) Received: from [172.22.22.4] ([98.61.227.136]) by smtp.googlemail.com with ESMTPSA id bm33-20020a05620a19a100b006e42a8e9f9bsm650239qkb.121.2022.10.24.14.36.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Oct 2022 14:36:07 -0700 (PDT) Message-ID: <5424b68c-1192-455e-8c0f-f47d0bf0122f@linaro.org> Date: Mon, 24 Oct 2022 16:36:06 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v2 2/2] net: ipa: fix v3.1 resource limit masks Content-Language: en-US To: Caleb Connolly , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jami Kettunen Cc: Alex Elder , linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <20221024210336.4014983-1-caleb.connolly@linaro.org> <20221024210336.4014983-2-caleb.connolly@linaro.org> From: Alex Elder In-Reply-To: <20221024210336.4014983-2-caleb.connolly@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/24/22 4:03 PM, Caleb Connolly wrote: > The resource group limits for IPA v3.1 mistakenly used 6 bit wide mask > values, when the hardware actually uses 8. Out of range values were > silently ignored before, so the IPA worked as expected. However the > new generalised register definitions introduce stricter checking here, > they now cause some splats and result in the value 0 being written > instead. Fix the limit bitmask widths so that the correct values can be > written. > > Fixes: 1c418c4a929c ("net: ipa: define resource group/type IPA register fields") > Signed-off-by: Caleb Connolly Looks good to me, thanks for fixing this. Note: this is for net/master, to be back-ported to v6.0.y. Reviewed-by: Alex Elder > --- > drivers/net/ipa/reg/ipa_reg-v3.1.c | 96 ++++++++++-------------------- > 1 file changed, 32 insertions(+), 64 deletions(-) > > diff --git a/drivers/net/ipa/reg/ipa_reg-v3.1.c b/drivers/net/ipa/reg/ipa_reg-v3.1.c > index 116b27717e3d..0d002c3c38a2 100644 > --- a/drivers/net/ipa/reg/ipa_reg-v3.1.c > +++ b/drivers/net/ipa/reg/ipa_reg-v3.1.c > @@ -127,112 +127,80 @@ static const u32 ipa_reg_counter_cfg_fmask[] = { > IPA_REG_FIELDS(COUNTER_CFG, counter_cfg, 0x000001f0); > > static const u32 ipa_reg_src_rsrc_grp_01_rsrc_type_fmask[] = { > - [X_MIN_LIM] = GENMASK(5, 0), > - /* Bits 6-7 reserved */ > - [X_MAX_LIM] = GENMASK(13, 8), > - /* Bits 14-15 reserved */ > - [Y_MIN_LIM] = GENMASK(21, 16), > - /* Bits 22-23 reserved */ > - [Y_MAX_LIM] = GENMASK(29, 24), > - /* Bits 30-31 reserved */ > + [X_MIN_LIM] = GENMASK(7, 0), > + [X_MAX_LIM] = GENMASK(15, 8), > + [Y_MIN_LIM] = GENMASK(23, 16), > + [Y_MAX_LIM] = GENMASK(31, 24), > }; > > IPA_REG_STRIDE_FIELDS(SRC_RSRC_GRP_01_RSRC_TYPE, src_rsrc_grp_01_rsrc_type, > 0x00000400, 0x0020); > > static const u32 ipa_reg_src_rsrc_grp_23_rsrc_type_fmask[] = { > - [X_MIN_LIM] = GENMASK(5, 0), > - /* Bits 6-7 reserved */ > - [X_MAX_LIM] = GENMASK(13, 8), > - /* Bits 14-15 reserved */ > - [Y_MIN_LIM] = GENMASK(21, 16), > - /* Bits 22-23 reserved */ > - [Y_MAX_LIM] = GENMASK(29, 24), > - /* Bits 30-31 reserved */ > + [X_MIN_LIM] = GENMASK(7, 0), > + [X_MAX_LIM] = GENMASK(15, 8), > + [Y_MIN_LIM] = GENMASK(23, 16), > + [Y_MAX_LIM] = GENMASK(31, 24), > }; > > IPA_REG_STRIDE_FIELDS(SRC_RSRC_GRP_23_RSRC_TYPE, src_rsrc_grp_23_rsrc_type, > 0x00000404, 0x0020); > > static const u32 ipa_reg_src_rsrc_grp_45_rsrc_type_fmask[] = { > - [X_MIN_LIM] = GENMASK(5, 0), > - /* Bits 6-7 reserved */ > - [X_MAX_LIM] = GENMASK(13, 8), > - /* Bits 14-15 reserved */ > - [Y_MIN_LIM] = GENMASK(21, 16), > - /* Bits 22-23 reserved */ > - [Y_MAX_LIM] = GENMASK(29, 24), > - /* Bits 30-31 reserved */ > + [X_MIN_LIM] = GENMASK(7, 0), > + [X_MAX_LIM] = GENMASK(15, 8), > + [Y_MIN_LIM] = GENMASK(23, 16), > + [Y_MAX_LIM] = GENMASK(31, 24), > }; > > IPA_REG_STRIDE_FIELDS(SRC_RSRC_GRP_45_RSRC_TYPE, src_rsrc_grp_45_rsrc_type, > 0x00000408, 0x0020); > > static const u32 ipa_reg_src_rsrc_grp_67_rsrc_type_fmask[] = { > - [X_MIN_LIM] = GENMASK(5, 0), > - /* Bits 6-7 reserved */ > - [X_MAX_LIM] = GENMASK(13, 8), > - /* Bits 14-15 reserved */ > - [Y_MIN_LIM] = GENMASK(21, 16), > - /* Bits 22-23 reserved */ > - [Y_MAX_LIM] = GENMASK(29, 24), > - /* Bits 30-31 reserved */ > + [X_MIN_LIM] = GENMASK(7, 0), > + [X_MAX_LIM] = GENMASK(15, 8), > + [Y_MIN_LIM] = GENMASK(23, 16), > + [Y_MAX_LIM] = GENMASK(31, 24), > }; > > IPA_REG_STRIDE_FIELDS(SRC_RSRC_GRP_67_RSRC_TYPE, src_rsrc_grp_67_rsrc_type, > 0x0000040c, 0x0020); > > static const u32 ipa_reg_dst_rsrc_grp_01_rsrc_type_fmask[] = { > - [X_MIN_LIM] = GENMASK(5, 0), > - /* Bits 6-7 reserved */ > - [X_MAX_LIM] = GENMASK(13, 8), > - /* Bits 14-15 reserved */ > - [Y_MIN_LIM] = GENMASK(21, 16), > - /* Bits 22-23 reserved */ > - [Y_MAX_LIM] = GENMASK(29, 24), > - /* Bits 30-31 reserved */ > + [X_MIN_LIM] = GENMASK(7, 0), > + [X_MAX_LIM] = GENMASK(15, 8), > + [Y_MIN_LIM] = GENMASK(23, 16), > + [Y_MAX_LIM] = GENMASK(31, 24), > }; > > IPA_REG_STRIDE_FIELDS(DST_RSRC_GRP_01_RSRC_TYPE, dst_rsrc_grp_01_rsrc_type, > 0x00000500, 0x0020); > > static const u32 ipa_reg_dst_rsrc_grp_23_rsrc_type_fmask[] = { > - [X_MIN_LIM] = GENMASK(5, 0), > - /* Bits 6-7 reserved */ > - [X_MAX_LIM] = GENMASK(13, 8), > - /* Bits 14-15 reserved */ > - [Y_MIN_LIM] = GENMASK(21, 16), > - /* Bits 22-23 reserved */ > - [Y_MAX_LIM] = GENMASK(29, 24), > - /* Bits 30-31 reserved */ > + [X_MIN_LIM] = GENMASK(7, 0), > + [X_MAX_LIM] = GENMASK(15, 8), > + [Y_MIN_LIM] = GENMASK(23, 16), > + [Y_MAX_LIM] = GENMASK(31, 24), > }; > > IPA_REG_STRIDE_FIELDS(DST_RSRC_GRP_23_RSRC_TYPE, dst_rsrc_grp_23_rsrc_type, > 0x00000504, 0x0020); > > static const u32 ipa_reg_dst_rsrc_grp_45_rsrc_type_fmask[] = { > - [X_MIN_LIM] = GENMASK(5, 0), > - /* Bits 6-7 reserved */ > - [X_MAX_LIM] = GENMASK(13, 8), > - /* Bits 14-15 reserved */ > - [Y_MIN_LIM] = GENMASK(21, 16), > - /* Bits 22-23 reserved */ > - [Y_MAX_LIM] = GENMASK(29, 24), > - /* Bits 30-31 reserved */ > + [X_MIN_LIM] = GENMASK(7, 0), > + [X_MAX_LIM] = GENMASK(15, 8), > + [Y_MIN_LIM] = GENMASK(23, 16), > + [Y_MAX_LIM] = GENMASK(31, 24), > }; > > IPA_REG_STRIDE_FIELDS(DST_RSRC_GRP_45_RSRC_TYPE, dst_rsrc_grp_45_rsrc_type, > 0x00000508, 0x0020); > > static const u32 ipa_reg_dst_rsrc_grp_67_rsrc_type_fmask[] = { > - [X_MIN_LIM] = GENMASK(5, 0), > - /* Bits 6-7 reserved */ > - [X_MAX_LIM] = GENMASK(13, 8), > - /* Bits 14-15 reserved */ > - [Y_MIN_LIM] = GENMASK(21, 16), > - /* Bits 22-23 reserved */ > - [Y_MAX_LIM] = GENMASK(29, 24), > - /* Bits 30-31 reserved */ > + [X_MIN_LIM] = GENMASK(7, 0), > + [X_MAX_LIM] = GENMASK(15, 8), > + [Y_MIN_LIM] = GENMASK(23, 16), > + [Y_MAX_LIM] = GENMASK(31, 24), > }; > > IPA_REG_STRIDE_FIELDS(DST_RSRC_GRP_67_RSRC_TYPE, dst_rsrc_grp_67_rsrc_type,