From patchwork Tue Mar 14 20:38:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13174990 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88FC9C74A44 for ; Tue, 14 Mar 2023 20:38:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230448AbjCNUiv (ORCPT ); Tue, 14 Mar 2023 16:38:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230208AbjCNUit (ORCPT ); Tue, 14 Mar 2023 16:38:49 -0400 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B24071BAC6 for ; Tue, 14 Mar 2023 13:38:48 -0700 (PDT) Received: by mail-qv1-xf32.google.com with SMTP id g9so13302377qvt.8 for ; Tue, 14 Mar 2023 13:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678826328; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FYMbUZDBIlnj1ReCNJ3ahlE/3pJm6Sf1PO2UoSuItdQ=; b=ebBgxQE+6bzMw61HnnufNimfW2+ah48mfRzvMc6ZTXSjcOR4+x6Toh/qDthboi7WkX 3i9LbI5fBkv4ffvyPJPiaa9z/LFS9zYFz7Kbu6EUAOwCFA6zjZDJfQNzNZKujH8tXVGf boz7AeF7K9TXCYRy+Km+IwYphLd6uTTNqKrns/nJovS4y20MIP9/QTgSNwuR727QJfK4 oBrV/4hNHVw5v0Hwwa5JQyElbY8Www+5zWtliSgcN/8nvD0J6hPkLs8wyr0zj4S2GqOO xKOaHpoDZGLsyxCymRX7nQgi6WuDgLQbKRNChjDhwtC5C1FUNUOypi3e30BM11snVmae iVIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678826328; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FYMbUZDBIlnj1ReCNJ3ahlE/3pJm6Sf1PO2UoSuItdQ=; b=EaES1zPHqwH/vdfbGj8sTPmwQHnBrw5gIcjMTyMxqTeqaVNehG2sdlmEZwrM6gWrh6 F6TvOYSyPUjX+jjUE/VMkz5LtEF03POyDutGJMlbVMGOknl0SPMvXkHN14WwfyOvunCb T+JG9sHVJ3SKisiT1Kkv/tOM0vafijW9I2eRMjkujWjLZe4Hyb4UvWg3OmKdT+6hVO7s CeS9+pmzDmI7oIvbaYWHZNVc595Cs6W4xnH3gfdY1gJayFX8O6KGqS8FE93JnYOLw4O2 hxAYC380QllBKxlKnFPOCBps1RXLrmMW0CFjjh6yhK8J0myZTZOAArJt1T9Y77jJmFs5 f4Dw== X-Gm-Message-State: AO0yUKV5tZgoZKCIJqv+Orb2FCf0+uQvcjwA/FIw+dXm6WLFxhMfA2le iZEJIcNumioIhK6BjHGvmIJTuQ== X-Google-Smtp-Source: AK7set96/RoQNwXjE0l0xFBJsYRLw4anu6diBhri0ZA++TNhnILbaUSuuRcMSQQM3GzZPwCjLvNV0w== X-Received: by 2002:ad4:5caa:0:b0:5aa:17d5:bbfe with SMTP id q10-20020ad45caa000000b005aa17d5bbfemr10951013qvh.10.1678826327838; Tue, 14 Mar 2023 13:38:47 -0700 (PDT) Received: from localhost.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id c2-20020a379a02000000b00745ca1c0eb6sm1947828qke.2.2023.03.14.13.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 13:38:47 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: caleb.connolly@linaro.org, mka@chromium.org, evgreen@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net 1/4] net: ipa: reg: include Date: Tue, 14 Mar 2023 15:38:38 -0500 Message-Id: <20230314203841.1574172-2-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230314203841.1574172-1-elder@linaro.org> References: <20230314203841.1574172-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When "reg.h" got created, it included calls to WARN() and WARN_ON(). Those macros are defined via . In addition, it uses is_power_of_2(), which is defined in . Include those files so IPA "reg.h" has access to all definitions it requires. Meanwhile, is included but nothing defined therein is required directly in "reg.h", so get rid of that. Fixes: a476ec164a50 ("net: ipa: start generalizing "ipa_reg"") Signed-off-by: Alex Elder --- drivers/net/ipa/reg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ipa/reg.h b/drivers/net/ipa/reg.h index 57b457f39b6e2..2ee07eebca677 100644 --- a/drivers/net/ipa/reg.h +++ b/drivers/net/ipa/reg.h @@ -6,7 +6,8 @@ #define _REG_H_ #include -#include +#include +#include /** * struct reg - A register descriptor From patchwork Tue Mar 14 20:38:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13174991 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54324C7618B for ; Tue, 14 Mar 2023 20:38:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230490AbjCNUiw (ORCPT ); Tue, 14 Mar 2023 16:38:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230208AbjCNUiv (ORCPT ); Tue, 14 Mar 2023 16:38:51 -0400 Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F5681CACD for ; Tue, 14 Mar 2023 13:38:50 -0700 (PDT) Received: by mail-qv1-xf2e.google.com with SMTP id t13so6434961qvn.2 for ; Tue, 14 Mar 2023 13:38:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678826329; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iA+I7Vbmw4P4QtwsVcv32pq9bGfwOxM9ux+hNncPv6w=; b=Xw84vR/rrW0uvmiI8/T/aJYVNdL+PYeQaYy4WwbQsdlLSUd78+PcMH/C/aGFklRNwJ 1HCz0y254ewOR1sOi0vzHR2WPwnMGX47qcaQZN1EmZ4WhYofEQee6jEfxCZ063qu3sM/ DGZNziqFE6SNOmM8stDGXBW2q8MoCQiMjSisbccfBUicjOHk75tHGHxcSKC5Mmnwed9g 51ykK6hJHKUm3kYSmFGL1CcdlFf8oB239aQCON4VkvxyMMmLCm+qwD1k+7mEMsHfoYHU bAEZb+Q2M2D88MEUr06Bt8e22cIhsozIRSFjzZJEJnfU91nSpaCLeZ8TBkfdrAavplF7 p+3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678826329; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iA+I7Vbmw4P4QtwsVcv32pq9bGfwOxM9ux+hNncPv6w=; b=XdmDc/nS0WvRFznzg4qeMSSpIieOvCPixgMNmOLecWEihehuyKBpO9K3wNPb0OgASv 9u1KZQn2gYPuU7UII73r7jsAJj6wCuPlfuyZiQ0kQH69Ml/dpYaOP/rbhkIGZ3fPta1W f1npVjSqfvQYUul/xgW/jQA3YcWwXVTFqmZLN90u0RQ53NBdB8ChSb1RwDrXaOyGT956 vrTUOGmOTiiIEozbSI8xtzN8bEKc9h2O5OSHDD+NTGoWFoHq8IFPo/NmInoWjVOdGPDd mOfmVFfVWVCyygab9f/ISosb0flrI8oewrjBta4Ad5bdrnACpEtxe+iKj3LDVAlcogn2 2q9A== X-Gm-Message-State: AO0yUKUvHbj6yxuCl1hH8uGEUJc4wxgfrl1z+c71ICeWpXPupdnkVlj7 ZllJvpHSC2mv3e5JUHoTZWnqNw== X-Google-Smtp-Source: AK7set/H+aTAGGQNuHTwbkDgRL8IF55BNAhI0jTHvBKYZ3J3IMOZIsv5joJ3KoTkN8GLprogJIebuA== X-Received: by 2002:a05:6214:29ef:b0:56e:9f05:6265 with SMTP id jv15-20020a05621429ef00b0056e9f056265mr19021056qvb.39.1678826329253; Tue, 14 Mar 2023 13:38:49 -0700 (PDT) Received: from localhost.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id c2-20020a379a02000000b00745ca1c0eb6sm1947828qke.2.2023.03.14.13.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 13:38:49 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: caleb.connolly@linaro.org, mka@chromium.org, evgreen@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net 2/4] net: ipa: add two missing declarations Date: Tue, 14 Mar 2023 15:38:39 -0500 Message-Id: <20230314203841.1574172-3-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230314203841.1574172-1-elder@linaro.org> References: <20230314203841.1574172-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When gsi_reg_init() got added, its declaration was added to "gsi_reg.h" without declaring the two struct pointer types it uses. Add these struct declarations to "gsi_reg.h". Fixes: e68cef8906ea ("net: ipa: introduce gsi_reg_init()") Signed-off-by: Alex Elder --- drivers/net/ipa/gsi_reg.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ipa/gsi_reg.h b/drivers/net/ipa/gsi_reg.h index f62f0a5c653d1..48fde65fa2e8a 100644 --- a/drivers/net/ipa/gsi_reg.h +++ b/drivers/net/ipa/gsi_reg.h @@ -10,6 +10,10 @@ #include +struct platform_device; + +struct gsi; + /** * DOC: GSI Registers * From patchwork Tue Mar 14 20:38:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13174992 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A225C05027 for ; Tue, 14 Mar 2023 20:39:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231260AbjCNUi7 (ORCPT ); Tue, 14 Mar 2023 16:38:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231134AbjCNUiw (ORCPT ); Tue, 14 Mar 2023 16:38:52 -0400 Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09D381B56B for ; Tue, 14 Mar 2023 13:38:51 -0700 (PDT) Received: by mail-qv1-xf2e.google.com with SMTP id y3so13323677qvn.4 for ; Tue, 14 Mar 2023 13:38:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678826330; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/MbviwZ9aPtBhKMJt0xAhfvjag7IUKbs0D6Z8ztPm0A=; b=K6WH0ppsbhLixeO5XppGQbKYT/nj06c8vXj6egUJlelvVZiVbj2RnCABbHOnFbufSA j/inxQUvSTssPa/OqKhp3ThM0YHfk9RGWZDHtQ94Htu1ChQPm3i25gKackitSMNrA2QO tFoDXHoxztoqS7EqKAyM0iPavFf5RiqSvFPsDiyw4nvCoxwLgUn/rQPtE4YPygBgLPrH OLoeTuhfM622kR+zoaRbgEdPgdzurxdpA54iUovjmODgFnLE9RMtj8cywe4SN76GKzoa HcPp8YzFbrDDMUpHxMT9dUOVwI0170w0SJXbaxJi+lsXiPSPYiVCr/gFdk3+h3JalIHy VbBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678826330; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/MbviwZ9aPtBhKMJt0xAhfvjag7IUKbs0D6Z8ztPm0A=; b=0bm5UUCKYOONiTSsQ18XRNdjQXd11Luu0+ghBnxJ5gr1zpYocCIJU60CMy5mm4pBA8 8i5xRr1LcNvZDZl8WRaNqH0oqv7P08+jGGfth529S9qdSOrZpqDhjLQQBEvkD2pfNiGa k3scoKWKKLOPia3SHt6SJn0ujp8riswiiBarzw8rxNtksQxRClGtc/PZ1GhW4WUEShqU LZyNe2SC4hWPDolaqCgyxZTHYtSz6/U/ElB1tOAdLPVRYJiwHu2gJ4AeDqFLDTVfOQmS zT1PAOqWOugseTsjnFqIcjbzYaF6up+T7G4VyM51zV/LnnbvGuJ/TJCNC9J6RTQz31PJ dTpg== X-Gm-Message-State: AO0yUKW2Ht6vVT60MsqYPT/axFkTUJxUkrN5SljgZs/hifsqN+VrhmhI xHjuW7dDUYxjwH2jTMcUWTFQQw== X-Google-Smtp-Source: AK7set9bf/e1JH8gdyHh9aGSNWRMX9/fsVTmd+jjCa5ZqmWf7EJ0bxQLvrTRjdWUcaDIN9dLLr2ZZw== X-Received: by 2002:a05:6214:1c88:b0:5a9:3882:f4c9 with SMTP id ib8-20020a0562141c8800b005a93882f4c9mr11540145qvb.5.1678826330626; Tue, 14 Mar 2023 13:38:50 -0700 (PDT) Received: from localhost.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id c2-20020a379a02000000b00745ca1c0eb6sm1947828qke.2.2023.03.14.13.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 13:38:50 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: caleb.connolly@linaro.org, mka@chromium.org, evgreen@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net 3/4] net: ipa: kill FILT_ROUT_CACHE_CFG IPA register Date: Tue, 14 Mar 2023 15:38:40 -0500 Message-Id: <20230314203841.1574172-4-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230314203841.1574172-1-elder@linaro.org> References: <20230314203841.1574172-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org A recent commit defined a few IPA registers used for IPA v5.0+. One of those was a mistake. Although the filter and router caches get *flushed* using a single register, they use distinct registers (ENDP_FILTER_CACHE_CFG and ENDP_ROUTER_CACHE_CFG) for configuration. And although there *exists* a FILT_ROUT_CACHE_CFG register, it is not needed in upstream code. So get rid of definitions related to FILT_ROUT_CACHE_CFG, because they are not needed. Fixes: de101ca79f97 ("net: ipa: define IPA v5.0+ registers") Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_reg.c | 4 ++-- drivers/net/ipa/ipa_reg.h | 9 --------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/net/ipa/ipa_reg.c b/drivers/net/ipa/ipa_reg.c index 735fa65916097..463a31dfa9f47 100644 --- a/drivers/net/ipa/ipa_reg.c +++ b/drivers/net/ipa/ipa_reg.c @@ -39,7 +39,8 @@ static bool ipa_reg_id_valid(struct ipa *ipa, enum ipa_reg_id reg_id) return version <= IPA_VERSION_3_1; case ENDP_FILTER_ROUTER_HSH_CFG: - return version != IPA_VERSION_4_2; + return version < IPA_VERSION_5_0 && + version != IPA_VERSION_4_2; case IRQ_SUSPEND_EN: case IRQ_SUSPEND_CLR: @@ -52,7 +53,6 @@ static bool ipa_reg_id_valid(struct ipa *ipa, enum ipa_reg_id reg_id) case QSB_MAX_WRITES: case QSB_MAX_READS: case FILT_ROUT_HASH_EN: - case FILT_ROUT_CACHE_CFG: case FILT_ROUT_HASH_FLUSH: case FILT_ROUT_CACHE_FLUSH: case STATE_AGGR_ACTIVE: diff --git a/drivers/net/ipa/ipa_reg.h b/drivers/net/ipa/ipa_reg.h index 28aa1351dd488..ff2be8be0f683 100644 --- a/drivers/net/ipa/ipa_reg.h +++ b/drivers/net/ipa/ipa_reg.h @@ -61,7 +61,6 @@ enum ipa_reg_id { QSB_MAX_WRITES, QSB_MAX_READS, FILT_ROUT_HASH_EN, /* Not IPA v5.0+ */ - FILT_ROUT_CACHE_CFG, /* IPA v5.0+ */ FILT_ROUT_HASH_FLUSH, /* Not IPA v5.0+ */ FILT_ROUT_CACHE_FLUSH, /* IPA v5.0+ */ STATE_AGGR_ACTIVE, @@ -206,14 +205,6 @@ enum ipa_reg_qsb_max_reads_field_id { GEN_QMB_1_MAX_READS_BEATS, /* IPA v4.0+ */ }; -/* FILT_ROUT_CACHE_CFG register */ -enum ipa_reg_filt_rout_cache_cfg_field_id { - ROUTER_CACHE_EN, - FILTER_CACHE_EN, - LOW_PRI_HASH_HIT_DISABLE, - LRU_EVICTION_THRESHOLD, -}; - /* FILT_ROUT_HASH_EN and FILT_ROUT_HASH_FLUSH registers */ enum ipa_reg_filt_rout_hash_field_id { IPV6_ROUTER_HASH, From patchwork Tue Mar 14 20:38:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13174993 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30C4EC74A44 for ; Tue, 14 Mar 2023 20:39:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231251AbjCNUjD (ORCPT ); Tue, 14 Mar 2023 16:39:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231236AbjCNUi6 (ORCPT ); Tue, 14 Mar 2023 16:38:58 -0400 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 839CF1E9C6 for ; Tue, 14 Mar 2023 13:38:52 -0700 (PDT) Received: by mail-qv1-xf32.google.com with SMTP id 97so354970qvb.6 for ; Tue, 14 Mar 2023 13:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678826332; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wQ1M5e4o784Td5MHB1XQg1XvARHHy1gJJ+s85YY31LE=; b=Qv+fIOx4olT6kvG/NE28c3mVHHcRvtsz29PbdQW4k39xYn/2U7aIomoBgzYVPy6mdc Ki5xlcXyXgH+4gUY+0a2JU5m1bO7A+9Qy4asmW/APnFWA9D37DSPJtd8ivXAfHi1WMm/ 6PTD+RTW1q1wPrOMi8RRXenHhgNGqI27JSgpy/T9DC2n4jXSgz5JtrSq2hK18ionBa6N wmNSOnxDX+oY0acbaLwSZ3NpW7pGX33QfEHHuG5WcmNCd6+eF7I8gZx+RhgJYpw7BGNr TqR+/HKNuYoqyPltvbvyLNzCfLXV8daXDxvBmVbG8wYFyyNIC2ksjjrBnT5e1+GLwwx3 vc9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678826332; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wQ1M5e4o784Td5MHB1XQg1XvARHHy1gJJ+s85YY31LE=; b=h0WKsAmoebrBs8HKNU7XEYqgnSMptiZmsFljQMTWSbkxjy/vlUHoy1N0AklH4P8MZe LvZVLpxJXss0n4nt7Iow4dWwJIvk06hVs9mehOGjhCepqxadEsKNwzmOV+t7RwA7g0UN 5FSD4l3ViWtiLkK20EMLZ3VJXnU5AuAcr+oC89z4vcKRwiRvgiiYK9DIdOvFVY8v7Vtc 0Uu/PmNmNTc6RDqycq2ImaRRI4I7LJlMQlDg9jx9Ae0xma/jWtPZlLUGL/Q6Oy5RgY/7 ta9pa1td+Eate0EZ7e9v2yGf0WC2e39xw4bvXRLroZCdiksf4EcDBChi3iE4H6Hpy9sI w2YA== X-Gm-Message-State: AO0yUKXlxQh9qIdVR3+JxGHlhBoJ8EZhzwDlclmYGet6i1JuDVwN9/yi L3anlM1XTr1dONsceD53zxvo5A== X-Google-Smtp-Source: AK7set91JPce8kweeABzSTCI3nJ4KzALbpsMqUOgFjRYuT+iNqQKCBoFsRBUb6uZg1tS0qa8lO3Nyw== X-Received: by 2002:ad4:5c4a:0:b0:56e:a976:7d16 with SMTP id a10-20020ad45c4a000000b0056ea9767d16mr20785739qva.51.1678826332026; Tue, 14 Mar 2023 13:38:52 -0700 (PDT) Received: from localhost.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id c2-20020a379a02000000b00745ca1c0eb6sm1947828qke.2.2023.03.14.13.38.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 13:38:51 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: caleb.connolly@linaro.org, mka@chromium.org, evgreen@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net 4/4] net: ipa: fix some register validity checks Date: Tue, 14 Mar 2023 15:38:41 -0500 Message-Id: <20230314203841.1574172-5-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230314203841.1574172-1-elder@linaro.org> References: <20230314203841.1574172-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org A recent commit defined HW_PARAM_4 as a GSI register ID but did not add it to gsi_reg_id_valid() to indicate it's valid (for IPA v5.0+). Add version checks for the HW_PARAM_2 and INTER_EE IRQ GSI registers there as well. IPA v5.0 supports up to 8 source and destination resource groups. Update the validity check (and the comments where the register IDs are defined) to reflect that. Similarly update comments and validity checks for the hash/cache-related registers. Note that this patch fixes an omission and constrains things further, but these don't technically represent bugs. Fixes: f651334e1ef5 ("net: ipa: add HW_PARAM_4 GSI register") Signed-off-by: Alex Elder --- drivers/net/ipa/gsi_reg.c | 9 ++++++++- drivers/net/ipa/ipa_reg.c | 24 ++++++++++++++++-------- drivers/net/ipa/ipa_reg.h | 12 ++++++------ 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/drivers/net/ipa/gsi_reg.c b/drivers/net/ipa/gsi_reg.c index 1412b67304c8e..1651fbad4bd54 100644 --- a/drivers/net/ipa/gsi_reg.c +++ b/drivers/net/ipa/gsi_reg.c @@ -15,6 +15,14 @@ static bool gsi_reg_id_valid(struct gsi *gsi, enum gsi_reg_id reg_id) switch (reg_id) { case INTER_EE_SRC_CH_IRQ_MSK: case INTER_EE_SRC_EV_CH_IRQ_MSK: + return gsi->version >= IPA_VERSION_3_5; + + case HW_PARAM_2: + return gsi->version >= IPA_VERSION_3_5_1; + + case HW_PARAM_4: + return gsi->version >= IPA_VERSION_5_0; + case CH_C_CNTXT_0: case CH_C_CNTXT_1: case CH_C_CNTXT_2: @@ -43,7 +51,6 @@ static bool gsi_reg_id_valid(struct gsi *gsi, enum gsi_reg_id reg_id) case CH_CMD: case EV_CH_CMD: case GENERIC_CMD: - case HW_PARAM_2: case CNTXT_TYPE_IRQ: case CNTXT_TYPE_IRQ_MSK: case CNTXT_SRC_CH_IRQ: diff --git a/drivers/net/ipa/ipa_reg.c b/drivers/net/ipa/ipa_reg.c index 463a31dfa9f47..3f475428ddddb 100644 --- a/drivers/net/ipa/ipa_reg.c +++ b/drivers/net/ipa/ipa_reg.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. - * Copyright (C) 2019-2022 Linaro Ltd. + * Copyright (C) 2019-2023 Linaro Ltd. */ #include @@ -15,6 +15,17 @@ static bool ipa_reg_id_valid(struct ipa *ipa, enum ipa_reg_id reg_id) enum ipa_version version = ipa->version; switch (reg_id) { + case FILT_ROUT_HASH_EN: + return version == IPA_VERSION_4_2; + + case FILT_ROUT_HASH_FLUSH: + return version < IPA_VERSION_5_0 && version != IPA_VERSION_4_2; + + case FILT_ROUT_CACHE_FLUSH: + case ENDP_FILTER_CACHE_CFG: + case ENDP_ROUTER_CACHE_CFG: + return version >= IPA_VERSION_5_0; + case IPA_BCR: case COUNTER_CFG: return version < IPA_VERSION_4_5; @@ -32,11 +43,13 @@ static bool ipa_reg_id_valid(struct ipa *ipa, enum ipa_reg_id reg_id) case SRC_RSRC_GRP_45_RSRC_TYPE: case DST_RSRC_GRP_45_RSRC_TYPE: return version <= IPA_VERSION_3_1 || - version == IPA_VERSION_4_5; + version == IPA_VERSION_4_5 || + version == IPA_VERSION_5_0; case SRC_RSRC_GRP_67_RSRC_TYPE: case DST_RSRC_GRP_67_RSRC_TYPE: - return version <= IPA_VERSION_3_1; + return version <= IPA_VERSION_3_1 || + version == IPA_VERSION_5_0; case ENDP_FILTER_ROUTER_HSH_CFG: return version < IPA_VERSION_5_0 && @@ -52,9 +65,6 @@ static bool ipa_reg_id_valid(struct ipa *ipa, enum ipa_reg_id reg_id) case SHARED_MEM_SIZE: case QSB_MAX_WRITES: case QSB_MAX_READS: - case FILT_ROUT_HASH_EN: - case FILT_ROUT_HASH_FLUSH: - case FILT_ROUT_CACHE_FLUSH: case STATE_AGGR_ACTIVE: case LOCAL_PKT_PROC_CNTXT: case AGGR_FORCE_CLOSE: @@ -76,8 +86,6 @@ static bool ipa_reg_id_valid(struct ipa *ipa, enum ipa_reg_id reg_id) case ENDP_INIT_RSRC_GRP: case ENDP_INIT_SEQ: case ENDP_STATUS: - case ENDP_FILTER_CACHE_CFG: - case ENDP_ROUTER_CACHE_CFG: case IPA_IRQ_STTS: case IPA_IRQ_EN: case IPA_IRQ_CLR: diff --git a/drivers/net/ipa/ipa_reg.h b/drivers/net/ipa/ipa_reg.h index ff2be8be0f683..7dd65d39333dd 100644 --- a/drivers/net/ipa/ipa_reg.h +++ b/drivers/net/ipa/ipa_reg.h @@ -60,8 +60,8 @@ enum ipa_reg_id { SHARED_MEM_SIZE, QSB_MAX_WRITES, QSB_MAX_READS, - FILT_ROUT_HASH_EN, /* Not IPA v5.0+ */ - FILT_ROUT_HASH_FLUSH, /* Not IPA v5.0+ */ + FILT_ROUT_HASH_EN, /* IPA v4.2 */ + FILT_ROUT_HASH_FLUSH, /* Not IPA v4.2 nor IPA v5.0+ */ FILT_ROUT_CACHE_FLUSH, /* IPA v5.0+ */ STATE_AGGR_ACTIVE, IPA_BCR, /* Not IPA v4.5+ */ @@ -76,12 +76,12 @@ enum ipa_reg_id { TIMERS_PULSE_GRAN_CFG, /* IPA v4.5+ */ SRC_RSRC_GRP_01_RSRC_TYPE, SRC_RSRC_GRP_23_RSRC_TYPE, - SRC_RSRC_GRP_45_RSRC_TYPE, /* Not IPA v3.5+, IPA v4.5 */ - SRC_RSRC_GRP_67_RSRC_TYPE, /* Not IPA v3.5+ */ + SRC_RSRC_GRP_45_RSRC_TYPE, /* Not IPA v3.5+; IPA v4.5, IPA v5.0 */ + SRC_RSRC_GRP_67_RSRC_TYPE, /* Not IPA v3.5+; IPA v5.0 */ DST_RSRC_GRP_01_RSRC_TYPE, DST_RSRC_GRP_23_RSRC_TYPE, - DST_RSRC_GRP_45_RSRC_TYPE, /* Not IPA v3.5+, IPA v4.5 */ - DST_RSRC_GRP_67_RSRC_TYPE, /* Not IPA v3.5+ */ + DST_RSRC_GRP_45_RSRC_TYPE, /* Not IPA v3.5+; IPA v4.5, IPA v5.0 */ + DST_RSRC_GRP_67_RSRC_TYPE, /* Not IPA v3.5+; IPA v5.0 */ ENDP_INIT_CTRL, /* Not IPA v4.2+ for TX, not IPA v4.0+ for RX */ ENDP_INIT_CFG, ENDP_INIT_NAT, /* TX only */