From patchwork Thu Mar 16 14:51:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13177758 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 BD9B8C7618D for ; Thu, 16 Mar 2023 14:51:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231185AbjCPOvq (ORCPT ); Thu, 16 Mar 2023 10:51:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbjCPOvp (ORCPT ); Thu, 16 Mar 2023 10:51:45 -0400 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75B68AA25B for ; Thu, 16 Mar 2023 07:51:43 -0700 (PDT) Received: by mail-qt1-x82d.google.com with SMTP id t9so1945567qtx.8 for ; Thu, 16 Mar 2023 07:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678978302; 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=gCPQuLjvLejF5Bs9SISYbcocVLoSdH1EFnC28LHWJfA=; b=IuQIGEw66a482p1YniFxZvunqJqPMKdI3zvhvlAXGvUX0rYqCYHraV7TlilLeJteEd sRe2nwI+wbzGHGZj06Hymz2Du8IRlsU31IGLTtgA3q1rfSfK6ZgQt2eoI0VMz4E5OTDW KHBz1ms0jtfF1ax2r+vV+DE4bgvG+vU8XKJT39OdjnaKhlPSpZlBhDna6AH3/7UhEZAD R7AYtM7H9NzY+j0AX0uVEeIE0KaXhAfd7FFekpQctiYBS214Oicq6TiRU7TTNCmQZ6IH 00snNUNm1t5acXSpGthanuHoSMLHO3RXzm0n0mMDf79a4+TKKrIfpPj0whDG2pY/Rf08 6eQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678978302; 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=gCPQuLjvLejF5Bs9SISYbcocVLoSdH1EFnC28LHWJfA=; b=7DLFl0CEw12uxfjGxGUK2t1RdduitcnIEFRctyqPCVgh3rMkQ2JetcSh0NP8sbUvou vn5xMhHBHXpipZCxqzdSoFDNuMJl7SCulGeHGZ+pOFXWXDy8O6LyIUNWZdtYxXW2M/4r z6eo7MZW7o5423bRke+/bL9f/OvNtENIWXB6mPfGE0XdfolZpNRs3SezaV9uIE3N+01N TE+2madZGpOzxb/bx64GvBibfG1IXfCpOXhuGvB6cU/VmoiLEfi6glP7g592Jl9Rg9E5 GQ59s7jDSfx3oWupi+IG/GrkyKilf28wfcRzUY2AdQc95IvcKt2kSt3up+kEzJaW8mD7 oLhg== X-Gm-Message-State: AO0yUKWQwX11c0XKYIrpWEI1A9syoSLuOEpZugtGsix0Q0OuGe+Kz6Bc sH6WZIOVStHwIgsIzeF89HPSzg== X-Google-Smtp-Source: AK7set88m4FG8rPtIvz1v9Fu9IFGHjZ9TuiNU4Bs9nFGYtCQsOf32cxMsCgjrmcB9UIcXaEWUZm4pA== X-Received: by 2002:a05:622a:1653:b0:3ba:1d8d:f6d0 with SMTP id y19-20020a05622a165300b003ba1d8df6d0mr6177955qtj.23.1678978301805; Thu, 16 Mar 2023 07:51:41 -0700 (PDT) Received: from localhost.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id n129-20020a37bd87000000b007456b2759efsm2844070qkf.28.2023.03.16.07.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Mar 2023 07:51:41 -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 v3 1/4] net: ipa: reg: include Date: Thu, 16 Mar 2023 09:51:33 -0500 Message-Id: <20230316145136.1795469-2-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230316145136.1795469-1-elder@linaro.org> References: <20230316145136.1795469-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 --- 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 Thu Mar 16 14:51:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13177759 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 C01AEC6FD19 for ; Thu, 16 Mar 2023 14:51:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231276AbjCPOvs (ORCPT ); Thu, 16 Mar 2023 10:51:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbjCPOvp (ORCPT ); Thu, 16 Mar 2023 10:51:45 -0400 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83262A677D for ; Thu, 16 Mar 2023 07:51:44 -0700 (PDT) Received: by mail-qv1-xf2d.google.com with SMTP id g9so1370642qvt.8 for ; Thu, 16 Mar 2023 07:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678978303; 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=PKqWcLfcs3UmhMvL5K01K9FuLeIx9ZVjwoD0JyqWTuo=; b=DNNVsRdstp9GXxAlTzZMwPKZHrhjXBxXrr41KyXv4TaGZT2jG+NcsGXMPSCVa2Vn7h 42JQDHB5hHosaVozlRoRXNGAaC7JcNdX45C623KL2WDwO4s+iE8yb/8I9nI2BHPaWYgZ ZbJS6MGBAUwEtYavojtBFoPnYcGKRO5vw7HtLHmko8Y6Cm2fviTDjpLp6kitG0dbF3Yj NzsEtq78ubo1utWJ3RU0QB/Syf/pQeTdFPE7nEtH6AhzaAcjUehwa55jFaNKnTxfXJhI ygVttIHqnynljMGWOF6Ry23rS8xFdh+qO2oEvXKfKtBQhWl7Hmbr34Yk68EITfCfAQMT hAsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678978303; 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=PKqWcLfcs3UmhMvL5K01K9FuLeIx9ZVjwoD0JyqWTuo=; b=7kkt8M+cnoT/a+G5QJm1bqCcM7ErzLoO7HCLcEblKI5AJanZoQJK4MMXS4Da9u6h9r ItMZR0bOELUccyJDSTxm6UyfonkgsFUsXg7KxfXJUPhTeW4OuSJfwjtHKPC0R48kZQpv jUifaAo8es6Ah4vOPTwzNWI9gXXu6H+r9pAmPTZ5iqAWyD1xeRJSk9OW10GIk74mWLs1 XPO+a13xZDtWwlFFmrPLb6rMD1tr5ti0/AwQFtp08YWnn1VcgOtiBxtByqOIGKP35zCj MC7XjIcR45/Y/ZRCM6p+eanp6k+vtuox8MycYiqzLmrehATeSqw2amhF4zhhWto0qIQS 8Gcw== X-Gm-Message-State: AO0yUKX/waP/WRXM7vVGgq66lVkNTcifOw7elEVR+7cYJFfxS4Icbrzc ptWJzCfc8YVH8yRLnQfdTJt/4A== X-Google-Smtp-Source: AK7set9ennyVepKlBZYOOwCBNDuA2JSfxamJtSEn8L4rLCJ5oK6uxISaeI6s+YWNUNU3Rpdlud1iiA== X-Received: by 2002:a05:6214:23cd:b0:56b:fb58:c350 with SMTP id hr13-20020a05621423cd00b0056bfb58c350mr25263549qvb.26.1678978303262; Thu, 16 Mar 2023 07:51:43 -0700 (PDT) Received: from localhost.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id n129-20020a37bd87000000b007456b2759efsm2844070qkf.28.2023.03.16.07.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Mar 2023 07:51:42 -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 v3 2/4] net: ipa: add two missing declarations Date: Thu, 16 Mar 2023 09:51:34 -0500 Message-Id: <20230316145136.1795469-3-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230316145136.1795469-1-elder@linaro.org> References: <20230316145136.1795469-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 --- 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 Thu Mar 16 14:51:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13177760 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 F3615C7618E for ; Thu, 16 Mar 2023 14:51:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230390AbjCPOvr (ORCPT ); Thu, 16 Mar 2023 10:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231189AbjCPOvq (ORCPT ); Thu, 16 Mar 2023 10:51:46 -0400 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41CCEA6771 for ; Thu, 16 Mar 2023 07:51:45 -0700 (PDT) Received: by mail-qt1-x82d.google.com with SMTP id t9so1945709qtx.8 for ; Thu, 16 Mar 2023 07:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678978305; 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=n9PDFYuVYy1JnFh9er4YyEDGQhbBjgJ9zKhwhKEYADA=; b=NAmUYBwLeXTIs4g0JI6sodFDifpu5ZrHU//Zvo1zLl9HLFYQ7jwcwd3kCkMaOg183s h5F9VjYLgk14uQoUg852KqZ4tzhp/ffH908wU1YDMrl0b4cPj16No4IN2jDrooHtWH2m ChxBseknq8oIMV37IwbPvDgS1DZc8NKCTCOZsAuGCgey+T3K9L/kNKUGNbkOWA1Worv6 c1KpPuhkPVpFyVSNAlEC1uUad0iZ0kyocqn6qOGiB7If5CtHuNLjeufNMXfyU1M5wg6W Orq+FFdaLK3oWXXa+gGyvAd+uFEBdNCWh0u4Tz78uZh40EiDKFR7sgB3PzRwJYKf1l98 4R0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678978305; 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=n9PDFYuVYy1JnFh9er4YyEDGQhbBjgJ9zKhwhKEYADA=; b=YDmDFG8NZzn2c1h9LBbqM0E6Mr5IjKfeXH9KA95l/2VYrgj9myr46+bKD+1r9tkLsR Qf5SenR+IzXsIF5+bPT+SVrtkF9EHxm4XCtd47GGZaqUkBAy0hCgQsHAnGYL1m8ntt2I gXuL54jGG6KzNLUstnyOG1wShomJQ/EWs3+b6GkpNm2n76Zhi8L3acKZZQYHcw/mdT9a oNLAfIuUH9Hfv6xIpfSlJ4tsvLattBBvVKwOw0F+bH/kzoy88uY6clqZTMHcwDJsXK5n 7l5xtAIDSYdOnvyUf2CEq/JmY5+UBNO7OKAfrAQYOCvMg0kZk1kI1a8cW9nV++xjDCyD BTOg== X-Gm-Message-State: AO0yUKUbsDO4nKSAne/eKfwsKHPePvaLyrdyQapF9bJGvdIAoOuVfQrE lOBn7FsruWr6vRtcWhcsJwG5jiq4X/f4j85ICuyR5A== X-Google-Smtp-Source: AK7set8LmiWDbj5mwlXi7S1W1OQjFZhCe/12/deUZwZTSnD3fAGCampp2J12L4WtAPl3jpdNAGp+Zg== X-Received: by 2002:a05:622a:174c:b0:3d4:6185:72d4 with SMTP id l12-20020a05622a174c00b003d4618572d4mr6332476qtk.7.1678978304754; Thu, 16 Mar 2023 07:51:44 -0700 (PDT) Received: from localhost.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id n129-20020a37bd87000000b007456b2759efsm2844070qkf.28.2023.03.16.07.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Mar 2023 07:51:44 -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 v3 3/4] net: ipa: kill FILT_ROUT_CACHE_CFG IPA register Date: Thu, 16 Mar 2023 09:51:35 -0500 Message-Id: <20230316145136.1795469-4-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230316145136.1795469-1-elder@linaro.org> References: <20230316145136.1795469-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: 8ba59716d16a ("net: ipa: define IPA v5.0+ registers") Signed-off-by: Alex Elder --- v3: "Fixes" tag now refers to the proper upstream commit. 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 Thu Mar 16 14:51:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13177761 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 C734FC7618E for ; Thu, 16 Mar 2023 14:51:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231359AbjCPOv6 (ORCPT ); Thu, 16 Mar 2023 10:51:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231295AbjCPOvt (ORCPT ); Thu, 16 Mar 2023 10:51:49 -0400 Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40844AE132 for ; Thu, 16 Mar 2023 07:51:47 -0700 (PDT) Received: by mail-qt1-x830.google.com with SMTP id s12so1936868qtq.11 for ; Thu, 16 Mar 2023 07:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678978306; 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=hUp7pyBsncONN8/7SfJhKZfaXUj30AHJA4aMTpXKddYqFtSZDl1VYOROVr3vJ8BmDS dxkbVIpgPbILenzACywdpqwy0llyQYb7vm+WiyhUUsQqUde37h4OjGFcF7cS97nkE9nn RgQS2P1ExRIGrWc2DxDXcNk0C3mVBcJlydpc8dXqOGtSHErJRmGxaUDokXwatIrkdkaB olvYgt8ENXIqz6kYWhoAGPSNkRdUaRp/01rJ+NdGloUdzWbh15g+bo8XhpIOGOANTDrQ Eawb2PojStoZrQLK/usbIigE6/VTFIU2/SkMJ6KZO1WhYtR3EQ2vr7wCQsTwgbcoUVlF TiTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678978306; 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=Q8n5rPCkxvxhf942ja5hsjzrtMG6ZaW8J40nTCeg9Bac1KzHpH4xWEfuUB+Kvga+dD Bu7yW5ZO2NepiRxHchDwFhBZZG0lEvcg4fsIc5xEhgE7DwT6RsZFJuscIAhOmPKiCUaW 0c1dWi1pDf9hT/MxvuiC1/TkzIqibZ/x6akpK6H780o/AQtz7JgRkyi9zVltgnC1h37G CM4ueoUrQKcmjI049UQQ9020tN7bu2f+BaGf8jLApxN+mKmD5+IVMCSDY9hKzrMs7bdA 0E9UKPv3M3/X0q94TotWIPxjvpaFvsXGtsXmpi8LspZ6gnVyp1EuJ2jeo4mwlegIYm5h 5Vww== X-Gm-Message-State: AO0yUKWoClsgu/LY4rexgk6I0H2Ft+aEtFcKRYzyvRbo1mBVAfAhfy+a JvQjwrNZ/Z3ngi+kdZpt3h5IqQ== X-Google-Smtp-Source: AK7set9aU8OTQcKkAJZu6S5XrTD6Q/DugKAix7xScAWmT0t6UvDFy68Te3C053RGvr/pdgdVL17Xxw== X-Received: by 2002:ac8:5886:0:b0:3bf:a575:54c with SMTP id t6-20020ac85886000000b003bfa575054cmr6999437qta.9.1678978306204; Thu, 16 Mar 2023 07:51:46 -0700 (PDT) Received: from localhost.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id n129-20020a37bd87000000b007456b2759efsm2844070qkf.28.2023.03.16.07.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Mar 2023 07:51:45 -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 v3 4/4] net: ipa: fix some register validity checks Date: Thu, 16 Mar 2023 09:51:36 -0500 Message-Id: <20230316145136.1795469-5-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230316145136.1795469-1-elder@linaro.org> References: <20230316145136.1795469-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 */