From patchwork Wed Mar 15 19:35:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13176591 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 8F038C7618A for ; Wed, 15 Mar 2023 19:36:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232736AbjCOTgD (ORCPT ); Wed, 15 Mar 2023 15:36:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232789AbjCOTgB (ORCPT ); Wed, 15 Mar 2023 15:36:01 -0400 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D99F98F720 for ; Wed, 15 Mar 2023 12:35:59 -0700 (PDT) Received: by mail-qt1-x82f.google.com with SMTP id c19so17415029qtn.13 for ; Wed, 15 Mar 2023 12:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678908959; 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=erRl2xavC/v8RCG0iGxQtKfxSfjcWRGZhzPnMxXYyms=; b=syf2MHuNA5s5VBnyIDPYogKU3AXFQCUZgbXRKEzUafSRlVP/42EQWCyRl4OHJYHcFW Wk+2eOgSe/kzjvo5bjj4D8CARFP7tVYdNo4v5xJFIBh8tz2QYXIAwMPmb9EwvnZi2ujU 5jwaQXIILl9/IZiuwUJA4deWfxjK1KZYhxFbheAxDvg4KAsbYVHO4XBgC4P4NU9F2Hve xvPRTyU3SL1mtQEYCi1cRedp4hxxzEfDWTOQ/MbecgEX1z+yRSMCK/+mABl1uGiUluYJ LKS45G3TKGpoq6cRabFFhn7my6UJamjGj4yfu/hwSS9m14XPDBfYIVNlfDTzCFeGVnbh XVbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678908959; 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=erRl2xavC/v8RCG0iGxQtKfxSfjcWRGZhzPnMxXYyms=; b=PwaVrsAKvSjDFUUFiXdnpUd1i5T0mfPsLL2B3di611K4XgqZQl0fuR28xqRpSzxEfl sH3XPWjNWp8V7oY0/XaMFuaJsOeHOyYA5teuKBmLR3ku+dgYFBFqiqZg4ah/HLeGX5QY SzW5XvE39A2cExKgOoylFJNCRPpfpsJlrSMPLPb8LrOByNqq+hFCgRwAvXC6V/g9rxsB FdAZU7IoogkHIyNJvhqfjgthXe8nitxeC2AgZfX5VDv/oiVsKhlZNI0ZnxpnqegcYiVP 82m8sMXrBUT8SzkS1etDCeeJDXZKCuHhtYmgJuPdf/7cdwV4U4qjKZAhF0WL8brlCX5W Nu7g== X-Gm-Message-State: AO0yUKWEJArCtY2fRMwpQuF5tnPAhXEX5qeeLWQuL+5F/A1brGn+BbSq RBxkJfr/0hJ4XD8FL1UpMwZZ2Q== X-Google-Smtp-Source: AK7set9dHEALzKOulqYYDBAhnymWtF4QNOfjv1Gy30FmFLGHtk9RA6oXYi2QQMTXY2e5Mu323NL4aw== X-Received: by 2002:a05:622a:34d:b0:3d0:7bdf:42c4 with SMTP id r13-20020a05622a034d00b003d07bdf42c4mr1586720qtw.59.1678908958994; Wed, 15 Mar 2023 12:35:58 -0700 (PDT) Received: from localhost.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id q9-20020a05620a024900b0071eddd3bebbsm4369462qkn.81.2023.03.15.12.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 12:35:58 -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 v2 1/4] net: ipa: reg: include Date: Wed, 15 Mar 2023 14:35:49 -0500 Message-Id: <20230315193552.1646892-2-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230315193552.1646892-1-elder@linaro.org> References: <20230315193552.1646892-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: 81772e444dbe ("net: ipa: start generalizing "ipa_reg"") Signed-off-by: Alex Elder --- v2: Correct the "Fixes" commit hash. 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 Wed Mar 15 19:35:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13176592 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 8B306C76195 for ; Wed, 15 Mar 2023 19:36:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232884AbjCOTgE (ORCPT ); Wed, 15 Mar 2023 15:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232864AbjCOTgC (ORCPT ); Wed, 15 Mar 2023 15:36:02 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E4A48FBF2 for ; Wed, 15 Mar 2023 12:36:01 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id d7so17408631qtr.12 for ; Wed, 15 Mar 2023 12:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678908960; 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=UM6PqEpDoYuItRnCoM9ACC1yo8IO9qbwassRTpRpyUE=; b=x64Vi1XlTqVBMESG/QoSugcbctTPG3L0iaMw3eAXEezzHsQT6myX/M05MGMEhXFgt6 dM6sojav9dd2uglGN2BTX3Lr5zq4T0KVhePWJWOal1i1MtG0TBkrN+x6ayLTaCallH2P Atv96GM4sb+gsb5YIg/2Zu/7rRj5oDzieQRwSQNjZkOdFnNTEUPpAI++lPFt0yly/Ck0 KG89V7e1lktkRMSo2DOpIXZZhkd6CX058zbaHwJbXUSg3webymtZF9YaStO/pzw1nFT4 rNgJbzMPz6lyJ4IrvuwnGLbmsyCglkvurx5hEZthJEcy59sTQR7nLmj1qn8Tel8ZGBfy RvGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678908960; 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=UM6PqEpDoYuItRnCoM9ACC1yo8IO9qbwassRTpRpyUE=; b=OmOu+AuRtpL3i9ZcOBy95vg7I0fCwOCVWTKFo7EWt0IlmGUzN9iq+GjhGiFV4xsruX yZYqqgzc4xBD6IGa7secoXqHYhhHpeU9+r4ZFFyUCPAFOlZylQyAbVDbl1hkdEwIzhb2 tuzBYOmFBinS2yhhbvafS14sND8fH1Q1XK7eAjqOSO909vbHpMqiYinFLv4NTcx6UX4J o6xOvn2e8f/tEdNvSN+wr6+kmfPqhMibB8Jr1SNL9V1BwbzXf82e2Oe2pBwzc/eX/F3F 7udzYuw3Zr0jqKuqnxbptBgWYIARxwxd1/wY1s0Ovn/1AsHqs1VGZRWhiN/pz6SxeW32 9lgg== X-Gm-Message-State: AO0yUKVmFDkpc+h/lcu7GDKiWjG1mQs5YIcDlGYkyyp96sPBWCuQnzB1 ychNzDldDuBHmigjLgFltE+LNw== X-Google-Smtp-Source: AK7set+V+XR6LUL/OKH/AUxnGqhmmizumRWjhbFW2SILS1IJRMAPhnNRyCH1P53MBYmBdFIrId725Q== X-Received: by 2002:ac8:7dd5:0:b0:3d2:90b1:d161 with SMTP id c21-20020ac87dd5000000b003d290b1d161mr1773437qte.48.1678908960330; Wed, 15 Mar 2023 12:36:00 -0700 (PDT) Received: from localhost.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id q9-20020a05620a024900b0071eddd3bebbsm4369462qkn.81.2023.03.15.12.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 12:36:00 -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 v2 2/4] net: ipa: add two missing declarations Date: Wed, 15 Mar 2023 14:35:50 -0500 Message-Id: <20230315193552.1646892-3-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230315193552.1646892-1-elder@linaro.org> References: <20230315193552.1646892-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: 3c506add35c7 ("net: ipa: introduce gsi_reg_init()") Signed-off-by: Alex Elder --- v2: Correct the "Fixes" commit hash. 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 Wed Mar 15 19:35:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13176593 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 97D6AC61DA4 for ; Wed, 15 Mar 2023 19:36:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232916AbjCOTgI (ORCPT ); Wed, 15 Mar 2023 15:36:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232877AbjCOTgE (ORCPT ); Wed, 15 Mar 2023 15:36:04 -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 BB9A78F720 for ; Wed, 15 Mar 2023 12:36:02 -0700 (PDT) Received: by mail-qv1-xf2e.google.com with SMTP id y3so17382624qvn.4 for ; Wed, 15 Mar 2023 12:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678908962; 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=goxfksMxxS0wvDg+0DKlxwLsgC8+1ARldTlIMUZ3/VcwtI2pL+kTB5l8e0gWnpM5AW DPCBxTky9Z9T5eSmYXjJHrAKyNQfS+LBkQvB1YveytnHQVOo7MKpzc68FS+BXulqZyIb u87hjFLACYpc8uHi0yZrRmcKyaSym3KwSrPEurB+NOmWIRheUAzVsVNLCf6AjDHVph/4 0ENFkUQHBAvUjlZw2MfmKEoROg1g1VToUXjwTnFfoLlOxcTlzV1+ch/fWn3b81PEWldb VT5SFH3RdL2rBiZN+WnjkyeFuPIqB98Vg5TceuoInMmA9oOmh5GWiCkFY2ENMW/1VR9f NLZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678908962; 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=AkXVsdmWWzBAkE1asHE6onTdAlSDmlsvdNL9KfqCHAS/MlRsWJzMnv9baaMEtIwgtt jljOE29zULunCT4+W06L3ZsmsMfMZ71Fmt9CqfkoUZc4HzzbeNJLYc9K2ySsKTG/tr9d ARBAfA7BSTM4tY4lDDwUWp20nT1/9dyDpqw7U23bbhSn+ofxDqlrLnDBiLfDubDvUCAv QMJRtC3a0q8vH45/Qz2EPi6CBc6+KNvMM9fGK2Tvd7iRp1PH8ViSwDfEqJH1mAYg3QVt 9jbmYbo2VlyCYU5lvdZW31ll1YqY1tCm84ae4bFqIBogQefj8DQI03WDkCHI2AIpPLFh 8e9g== X-Gm-Message-State: AO0yUKVycksYjIKzdORLV9eZDm4ny71La+B8sjFPHCl776oEiqWhs0Jk XbXG3NyyWoRGX1rRcu7pIxv8FA== X-Google-Smtp-Source: AK7set81DVTf/PeXHcxLJh3Oq4FOb+aFal75uj2MhDq+DgdAsLus6txbZxC8Fsfyff4rSNeJdAa77A== X-Received: by 2002:a05:6214:29c3:b0:56f:52ba:ccf7 with SMTP id gh3-20020a05621429c300b0056f52baccf7mr28984724qvb.14.1678908961862; Wed, 15 Mar 2023 12:36:01 -0700 (PDT) Received: from localhost.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id q9-20020a05620a024900b0071eddd3bebbsm4369462qkn.81.2023.03.15.12.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 12:36:01 -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 v2 3/4] net: ipa: kill FILT_ROUT_CACHE_CFG IPA register Date: Wed, 15 Mar 2023 14:35:51 -0500 Message-Id: <20230315193552.1646892-4-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230315193552.1646892-1-elder@linaro.org> References: <20230315193552.1646892-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 Wed Mar 15 19:35:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13176594 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 7556AC7618D for ; Wed, 15 Mar 2023 19:36:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232760AbjCOTgJ (ORCPT ); Wed, 15 Mar 2023 15:36:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230473AbjCOTgH (ORCPT ); Wed, 15 Mar 2023 15:36:07 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5341C943A7 for ; Wed, 15 Mar 2023 12:36:04 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id c18so17481610qte.5 for ; Wed, 15 Mar 2023 12:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678908963; 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=LRZIr8EOtR7vPhVL/8fZKri2FBwpq1DATSDu8qdhg7H/qEa1Bse+g8fzymLPe1dAnr +gBIKvIPJoi+Gw3g+bCKvLblHkKjmk7bSNzAb4bQDfxMWdbCPpU6u1sMvS16YSEuGIFz FxuffdYg3eNixFWTRdHufKYQgJoBFCStkK85hPp3CzmmnL2ka+uM1gOEaIfKtv0UtdxM w3DB4gxpBpfKa8vc4EbYfGjqDTy0qqZE0H4v2gnT9hewy3ABMfhwhuujXvd3/gEgdL/l g/OJcSILdNoKIROyMdDP9MlAbt+y2AeaU0Q0DhwHYXMKEcO659B8UJOB7QdlTYKc9r2j 6kIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678908963; 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=27SvZJVsNYqxS8SVGIYb9Qo89k1Pxr3r8mroe0f8bZAPY0QBWZuGTD1Fnnfetb1+5C 5SI85upKD/nLL33vfqo3yHU87+3nbe1Z3X3pnOjpcL/t3C4ZgEPifml5gDzVRdUAytYF ckoNJLC4JNnBpILGLdv7CxzZ/6pZHSL+rWiOrLi2Zoi6ZKD+GGxgxT+3Vwu6x8dlq04K w4cTxYD2f976flOOHOi5yufbxI1YQEtO5XSJdX9TbhoD45T0n5tr561rR3NH18zeFeF+ Ef4/wMSh1mWcknN783uEpHEXR4kZCFdlkJy4VVWFoAwdpvXsgKo7j2pcN0wwiBD9I3VE LMzg== X-Gm-Message-State: AO0yUKWWfLzuJnTum0q6cwiBg5EH1//cFW0WbTAWjFB9Rn8TfalCQt8K 5Lpmsik460xalBwZWzb5sFGQrw== X-Google-Smtp-Source: AK7set9ep/xUaQg/f9zebgMn0sDUL+eL1TXqjZ3dZ2PbHiaRnTBe1OhUZO+U+feqfGcb7KCyJ3v/9g== X-Received: by 2002:ac8:7f4e:0:b0:3bf:d149:8966 with SMTP id g14-20020ac87f4e000000b003bfd1498966mr1796958qtk.62.1678908963393; Wed, 15 Mar 2023 12:36:03 -0700 (PDT) Received: from localhost.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id q9-20020a05620a024900b0071eddd3bebbsm4369462qkn.81.2023.03.15.12.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 12:36:02 -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 v2 4/4] net: ipa: fix some register validity checks Date: Wed, 15 Mar 2023 14:35:52 -0500 Message-Id: <20230315193552.1646892-5-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230315193552.1646892-1-elder@linaro.org> References: <20230315193552.1646892-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 */