From patchwork Thu Apr 18 20:47:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13635431 Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1A0119067B for ; Thu, 18 Apr 2024 20:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473259; cv=none; b=LLzt/ybop/jccBWj3j+P6HmNVkzy6bEFLm3e/1E3bH4b3cKyxCXQ95tRsXt/wSsVWEQkgZd+ughpWS4S8Ofso4ZnJf0O41pdJgnu6dgbMBQcLEWx2ks38OVl4yH+JSPryC1AV1nNyfpYywf/mJ1to8GJe0Mtl+c4/Msjt/J2w8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473259; c=relaxed/simple; bh=wOZ29LhTx7wkAYOpITTHRSLIJcO3BmrsfUA3gU19uiE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tvqIDAJGIPgdBRi1GwUJrnBqi2uxHtaDnnYynwPmWGa0xv3mA9bS+xuFor3PgXGPLX7l7nLfJ4kDnQruUs6st9V2z84IiRjKQgMRlVhM/MfkOck4VgohI5JvmAZAGpcCiXQjXGD5/uojoxo6Ot/3OYSvS3R/VG75L+hhprIX7QU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=sp7hzYh/; arc=none smtp.client-ip=209.85.166.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="sp7hzYh/" Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7da42caa377so18162739f.3 for ; Thu, 18 Apr 2024 13:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713473257; x=1714078057; darn=vger.kernel.org; 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=6LzULljTo8+N+96QvC2qoioFAtmWDPdfpszoy4xuRkk=; b=sp7hzYh/vnpXl0kDurNytDvVYou5VVMG/nV/QX69u5/jedeyFyQTl8g9KWp/YGhLv5 I2F6KhK6BxRs9k9TWVzV/o5k4VPyx/5iAcpWkcacotk61zD3qWTApwbiqbeKNXAMPKRt Ib55CzRsWP70QU7miXjUcPcGm1J9rgqlvvfc+pPaJf7AECop/HBng2uaZ1ceEoUmSSTn 507zP0vzyPxWKlKAiTD9Tee5mhLdk6omuCKpGgwdBCjKod5TTDnw3mB+YZJiKn0rCIQq pmZAUSUM/1ghcCcY0flR8uJH6sDMhoXEjbBFwrUiWoBQ3Sr86CZ248PjQeLxMmeyHk05 SCLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713473257; x=1714078057; 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=6LzULljTo8+N+96QvC2qoioFAtmWDPdfpszoy4xuRkk=; b=ZK0P6r7+iPiTBfIbfysXpzpUBLhCqAQaIBD1a/NdpaMEcWMw3iu7aiOaGFXTV3z4cq 9ZUu34qgYwcqUYTcbF3uX2FurjZ9/qAsCJoTlULpX+KGFfoil8ziap1ZHlyJYq0eJWpi hZB4N9IC6qQ7v3hzAQC1vnssyOKkuZhxHxm3VBooFidgzDcKSRCwdKOi1f7IAQZbAFxl nGe1tnzLZ5A0X6w3xNzZFSi64wiDrzQvKYUmpQdR+ZnHe1H4DTtJlQnitHbLeYSxot1n YHY49T4QDEgtp0R5QSEhH4YhkBDkDWSmssbuTaSzNT2wRAd3GN6/vaf7TkPptaL61pN3 a0rw== X-Forwarded-Encrypted: i=1; AJvYcCUIJda0U2T3iMwNv9C6yJYqD7gZMKsEvvcYJp8xjOfvybLiIHMWzCUs4OFO++YX1kzagtb6F8qWLiKhSRTMqzzRV9zQTqSCyWFfT1pXkg== X-Gm-Message-State: AOJu0YxPhMIEvrPPYfrY20Cqr3qEcAsevCMZ6acTAc8P8SrcHrgtmrae uYJBDNaUyx1sS12vcc/DeXKFhXhPqAEFowmNPK7fhKLC3AviYizkrOOcob4wytk= X-Google-Smtp-Source: AGHT+IF/8sENsUBtrRO5r7kTRYkTSjppW5lU/+XdQth1kzRoara79a8dQ3dQQLUx9E2VuyuprtPmOw== X-Received: by 2002:a5d:9a9a:0:b0:7d6:5fb2:56bf with SMTP id c26-20020a5d9a9a000000b007d65fb256bfmr399803iom.11.1713473256983; Thu, 18 Apr 2024 13:47:36 -0700 (PDT) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id r6-20020a056638300600b00484948cb8f5sm626998jak.91.2024.04.18.13.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 13:47:36 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@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-next 1/8] net: ipa: maintain bitmap of suspend-enabled endpoints Date: Thu, 18 Apr 2024 15:47:22 -0500 Message-Id: <20240418204729.1952353-2-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240418204729.1952353-1-elder@linaro.org> References: <20240418204729.1952353-1-elder@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Keep track of which endpoints have the SUSPEND IPA interrupt enabled in a variable-length bitmap. This will be used in the next patch to allow the SUSPEND interrupt type to be disabled except when needed. Signed-off-by: Alex Elder Reviewed-by: Bryan O'Donoghue --- drivers/net/ipa/ipa_interrupt.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index c44ec05f71e6f..0e8d4e43275ea 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -37,11 +37,13 @@ * @ipa: IPA pointer * @irq: Linux IRQ number used for IPA interrupts * @enabled: Mask indicating which interrupts are enabled + * @suspend_enabled: Bitmap of endpoints with the SUSPEND interrupt enabled */ struct ipa_interrupt { struct ipa *ipa; u32 irq; u32 enabled; + unsigned long *suspend_enabled; }; /* Clear the suspend interrupt for all endpoints that signaled it */ @@ -211,6 +213,7 @@ static void ipa_interrupt_suspend_control(struct ipa_interrupt *interrupt, val |= mask; else val &= ~mask; + __change_bit(endpoint_id, interrupt->suspend_enabled); iowrite32(val, ipa->reg_virt + offset); } @@ -246,7 +249,16 @@ int ipa_interrupt_config(struct ipa *ipa) interrupt->ipa = ipa; - /* Disable all IPA interrupt types */ + /* Initially all IPA interrupt types are disabled */ + interrupt->enabled = 0; + interrupt->suspend_enabled = bitmap_zalloc(ipa->endpoint_count, + GFP_KERNEL); + if (!interrupt->suspend_enabled) { + ret = -ENOMEM; + goto err_kfree; + } + + /* Disable IPA interrupt types */ reg = ipa_reg(ipa, IPA_IRQ_EN); iowrite32(0, ipa->reg_virt + reg_offset(reg)); @@ -254,7 +266,7 @@ int ipa_interrupt_config(struct ipa *ipa) "ipa", interrupt); if (ret) { dev_err(dev, "error %d requesting \"ipa\" IRQ\n", ret); - goto err_kfree; + goto err_free_bitmap; } ret = dev_pm_set_wake_irq(dev, irq); @@ -270,6 +282,8 @@ int ipa_interrupt_config(struct ipa *ipa) err_free_irq: free_irq(interrupt->irq, interrupt); +err_free_bitmap: + bitmap_free(interrupt->suspend_enabled); err_kfree: kfree(interrupt); @@ -286,6 +300,7 @@ void ipa_interrupt_deconfig(struct ipa *ipa) dev_pm_clear_wake_irq(dev); free_irq(interrupt->irq, interrupt); + bitmap_free(interrupt->suspend_enabled); } /* Initialize the IPA interrupt structure */ From patchwork Thu Apr 18 20:47:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13635432 Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C6F6194C60 for ; Thu, 18 Apr 2024 20:47:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473260; cv=none; b=CmJkRBuxhStXjfWEpR4RK81NQ+z8VYNcWMpNylgWi+0PH5IHhIPzr7Sl67dZr85w7P6kuRpywOKFjFbal2rhuWmp15g69HYrOLDhfurkzBlO1UpL94XHEUih1VNARcvnOVZ7aY/Sjt4tW2H7NwWDu8IKF+Q3qrKUMM42ECibLHw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473260; c=relaxed/simple; bh=SvZGld3nMQ7dE2gk0jttFi3f7Z56qPw6gijv/jWfvuw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tqOULaryOA2cO60RdURfqV8243/hOylKzwJLN2KFSS/ci5srxtsB/NjwjyQx5Q0CyTdOslard71Y8k8wFLEJlHLJgO61Ib63YYYpEOkaQ1zjS2yeNMAJj4PGOXurhvXLQuqRj0CaeI9xSvaIjcS5tVk9V9sNrGW2wkT+7sy83uw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=G0RM36eV; arc=none smtp.client-ip=209.85.166.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="G0RM36eV" Received: by mail-il1-f175.google.com with SMTP id e9e14a558f8ab-36b2ec387a9so4918265ab.0 for ; Thu, 18 Apr 2024 13:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713473258; x=1714078058; darn=vger.kernel.org; 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=03uMyBMor63/6Po8Y4dDq22jgMVPIQliIIsTiCDwZ1I=; b=G0RM36eVMkq+RjztfcJrrLXdtJTC4PaLmDraFFWHHHi/4HPlMgtIo5twMGvrScXlNc kFptF0IzjrlRiZj1G4OAYZ5vIZiZE0JfgqEAsywmg4ybKYlZxPu1NVyX+5spN60MBcV+ cHZ7rd0w3sdaVzJouFjHvVcw/974z/WP9gHnc6mRLXMgTrgbjSeWiVaxYS6DWLg1boQ8 VIRrU03UyKNQZDXaacyLYJZEnQDcOvOAZ7hUY0D7CgFvY3Snd5LlwdRWai5aCgZU7GD+ mrAm358TQafIC9SehdJ/C0ADS3eaxBWmk9mKjXYCMOlS7NvTe7KqA7srYOumD7qOSCpu FUsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713473258; x=1714078058; 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=03uMyBMor63/6Po8Y4dDq22jgMVPIQliIIsTiCDwZ1I=; b=jjkvAD3OidgqE0FVRrrgNDr6sWY8A7ZujpPbEs3VmZI7m49JhysCBIPP5Bwct2eokH K2cYZlewLWjAfm4Kc2yqTd2L1rJw8kjDdBwCmkpBHoKVDUuDnuadq/KCQe5dRrdychH6 yerPnctjZ3K8i2bnQ+ML6uKbGEkgDLoiEjXSPUR3uj386T9KRWClfyHpiECDfcfPzA4z WD+O+g1GhkXUcrWkDeDhuM5fhr3QpVnOOUBVr++38oQbUGMgCGxlVelg79rA83sNVTbe 3gZPyzm63RtWbgAhUkoFE8InjijDxh3f+/jokL0ddZfwd/yHfZTeqLB5cy5KtkQ3ghQp 1w1g== X-Forwarded-Encrypted: i=1; AJvYcCXg1DQMiBGGJrrQrbI+uuZP7GOa7Wo3Nibfq66I1LEfraE/yUZF58A2IB2VHhxB6Btkh7lTLU+ptt0yGlOSbMiwrOc+3lSOwrysDeyiSQ== X-Gm-Message-State: AOJu0YyPZD+aExRBeJqwl05qRm/2s0RdjUzKnANTOWDpnH51PKe9KPBS gg7VLYOaFp37jJGRdmRJvlb0a/JD32JxD3S+hzmTI6iVjyJmYHWgNStPherjjHc= X-Google-Smtp-Source: AGHT+IHi9nm9iUmihVl+nUYkbY20SKDAPRl8ovl9feERHmDZj2/wHFbeuoMxKwaBgbMtCXTT0l1DLA== X-Received: by 2002:a05:6e02:1aa5:b0:36b:3c05:7163 with SMTP id l5-20020a056e021aa500b0036b3c057163mr309979ilv.32.1713473258189; Thu, 18 Apr 2024 13:47:38 -0700 (PDT) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id r6-20020a056638300600b00484948cb8f5sm626998jak.91.2024.04.18.13.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 13:47:37 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@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-next 2/8] net: ipa: only enable the SUSPEND IPA interrupt when needed Date: Thu, 18 Apr 2024 15:47:23 -0500 Message-Id: <20240418204729.1952353-3-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240418204729.1952353-1-elder@linaro.org> References: <20240418204729.1952353-1-elder@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Only enable the SUSPEND IPA interrupt type when at least one endpoint has that interrupt enabled. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_interrupt.c | 8 ++++++++ drivers/net/ipa/ipa_power.c | 11 +---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index 0e8d4e43275ea..e198712d46ebb 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -196,6 +196,7 @@ static void ipa_interrupt_suspend_control(struct ipa_interrupt *interrupt, u32 mask = BIT(endpoint_id % 32); u32 unit = endpoint_id / 32; const struct reg *reg; + unsigned long weight; u32 offset; u32 val; @@ -205,6 +206,10 @@ static void ipa_interrupt_suspend_control(struct ipa_interrupt *interrupt, if (ipa->version == IPA_VERSION_3_0) return; + weight = bitmap_weight(interrupt->suspend_enabled, ipa->endpoint_count); + if (weight == 1 && !enable) + ipa_interrupt_disable(ipa, IPA_IRQ_TX_SUSPEND); + reg = ipa_reg(ipa, IRQ_SUSPEND_EN); offset = reg_n_offset(reg, unit); val = ioread32(ipa->reg_virt + offset); @@ -216,6 +221,9 @@ static void ipa_interrupt_suspend_control(struct ipa_interrupt *interrupt, __change_bit(endpoint_id, interrupt->suspend_enabled); iowrite32(val, ipa->reg_virt + offset); + + if (!weight && enable) + ipa_interrupt_enable(ipa, IPA_IRQ_TX_SUSPEND); } /* Enable TX_SUSPEND for an endpoint */ diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c index 41ca7ef5e20fc..bdbcf965d5a30 100644 --- a/drivers/net/ipa/ipa_power.c +++ b/drivers/net/ipa/ipa_power.c @@ -234,21 +234,12 @@ void ipa_power_retention(struct ipa *ipa, bool enable) int ipa_power_setup(struct ipa *ipa) { - int ret; - - ipa_interrupt_enable(ipa, IPA_IRQ_TX_SUSPEND); - - ret = device_init_wakeup(ipa->dev, true); - if (ret) - ipa_interrupt_disable(ipa, IPA_IRQ_TX_SUSPEND); - - return ret; + return device_init_wakeup(ipa->dev, true); } void ipa_power_teardown(struct ipa *ipa) { (void)device_init_wakeup(ipa->dev, false); - ipa_interrupt_disable(ipa, IPA_IRQ_TX_SUSPEND); } /* Initialize IPA power management */ From patchwork Thu Apr 18 20:47:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13635433 Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60E82194C8A for ; Thu, 18 Apr 2024 20:47:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473262; cv=none; b=FnRNLiqkRk7gDhZNMh7KFYcNAOOheYhAPT9W/UrVbeCyTvbo9cPNM7a8Aa2BzPVGC4RGYkp+j+YvAkYsaNyCVvlO3heU8cy3Bn7jAmmmxZI3Tx5VOFwnn4R/llb6DSNAHxGTaWUArRgIX4Omil2AXHi1/Jgbi71uuP63L1I6Gv0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473262; c=relaxed/simple; bh=my3ly2Wt8vx7EPER+SS+EO/A3WGEO8ar2dDMeRrSXqs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WIb364AwEQli6FhgkabWI4YyGnLdNdfZfm0Xfh18TdzMGmncXqdkZVJJn4zWhxjTQ5UErTjP272OcLMefM9F9Q3mUzVv2+fgfXUA2eat6usFYhEOVEdkMO/kqEswmNIYslbr+BkB0E7zuE+zKqkgl91J0MxGIqdyXoZyIFmZSXU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=AbKW/29n; arc=none smtp.client-ip=209.85.166.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="AbKW/29n" Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-36a17999886so5321655ab.0 for ; Thu, 18 Apr 2024 13:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713473259; x=1714078059; darn=vger.kernel.org; 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=oFdFgfCb4QOPydRGJlzZ64gSPyRyXCV7EEtNqm4BTfY=; b=AbKW/29nNF7+Qsr8Gn2DcHE4JSwEwYEs5fgbAVEiOvl8Iz4xeDfydcSQWKeLy/3Anw /h2VhME0gHtTaL4yM/AeQFWVr3aEdEYy6XNdH2W4WSciHLWXqpci5E1A4y2OpNsD1fuX 8htgsCzbBLMjYIW/WbSa+JhySOvzixVVuSDRYJAajBr2JmtBknF+H2ve6EuFj5UOd+FF micIqPMcRgQ3xsDkvehPVujNoEVFBBfeJ3iPaL0e+Cwc78doTiihJ26+kIp3SmpGYTma ajT/AHAflZ25kY4TpoWKRRJpTzZxSCpLyVIgaH0nmazeAZPmnnbhXOFHVel90fGhPxCn cv5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713473259; x=1714078059; 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=oFdFgfCb4QOPydRGJlzZ64gSPyRyXCV7EEtNqm4BTfY=; b=NjQzFoAPfUlQ3CVFM7lQRxG0Vw604PrasdJFlnqXyW3qy8WtLiYXHHpphjz+9Bu3+J BPdLywA8MYVJ4wWVn6LpmHpY7LWXt4whHuItmJ6ZpTMQja3w71z2uZ51KOd6AcRZ6o7O svcHeyEIm6QT4+0V86T/KgUzUAuQefn6gy0Afs3L58izoSKunipi0g/jVq3tAdy/WElC EGHr/BIZVwqohI54EwZS2jMT2EDJm4k2myvV01YSBfucEr2qT2ii1srn2G9AHHTzW2o4 U4OvNe0u1JekRj4AoaHsCj8eueH15R8UwyNm6xSmeAgE/+BQTWfs7tnYuArofYyd8Pnk 8NDA== X-Forwarded-Encrypted: i=1; AJvYcCUESiN0N0JlJSehXEZtjsxfMzTy+EzodT/IOc+r1FYDfoMc4XLrkFZB35MUJ21e/2rnonThNOpGiVUEppOnxT5N/181faFlEYVcZtce2A== X-Gm-Message-State: AOJu0Yw+keVuODyhSq8kvvGbCR4cQJ9eBuKq0x506H4+PQBhG7nJzBaY /B4EC0vrFdRupal50W+M8fHi/GTtEa+ZGCz87EUnmRD6uCQ+yLz4bmFVRT2bSbY= X-Google-Smtp-Source: AGHT+IEVvi8jk4ox6CtFUWga062IqyvpAfeDY8vVQOMWIqClYhZqkkPQVN715E8NcqDiYKetdI1f6w== X-Received: by 2002:a05:6e02:1ca3:b0:36a:b4f3:7731 with SMTP id x3-20020a056e021ca300b0036ab4f37731mr361266ill.7.1713473259548; Thu, 18 Apr 2024 13:47:39 -0700 (PDT) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id r6-20020a056638300600b00484948cb8f5sm626998jak.91.2024.04.18.13.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 13:47:39 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@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-next 3/8] net: ipa: call device_init_wakeup() earlier Date: Thu, 18 Apr 2024 15:47:24 -0500 Message-Id: <20240418204729.1952353-4-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240418204729.1952353-1-elder@linaro.org> References: <20240418204729.1952353-1-elder@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Currently, enabling wakeup for the IPA device doesn't occur until the setup phase of initialization (in ipa_power_setup()). There is no need to delay doing that, however. We can conveniently do it during the config phase, in ipa_interrupt_config(), where we enable power management wakeup mode for the IPA interrupt. Moving the device_init_wakeup() out of ipa_power_setup() leaves that function empty, so it can just be eliminated. Similarly, rearrange all of the matching inverse calls, disabling device wakeup in ipa_interrupt_deconfig() and removing that function as well. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_interrupt.c | 11 ++++++++++- drivers/net/ipa/ipa_main.c | 7 ------- drivers/net/ipa/ipa_power.c | 10 ---------- drivers/net/ipa/ipa_power.h | 14 -------------- 4 files changed, 10 insertions(+), 32 deletions(-) diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index e198712d46ebb..a9a2c34115b5b 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -277,17 +277,25 @@ int ipa_interrupt_config(struct ipa *ipa) goto err_free_bitmap; } + ret = device_init_wakeup(dev, true); + if (ret) { + dev_err(dev, "error %d enabling wakeup\n", ret); + goto err_free_irq; + } + ret = dev_pm_set_wake_irq(dev, irq); if (ret) { dev_err(dev, "error %d registering \"ipa\" IRQ as wakeirq\n", ret); - goto err_free_irq; + goto err_disable_wakeup; } ipa->interrupt = interrupt; return 0; +err_disable_wakeup: + (void)device_init_wakeup(dev, false); err_free_irq: free_irq(interrupt->irq, interrupt); err_free_bitmap: @@ -307,6 +315,7 @@ void ipa_interrupt_deconfig(struct ipa *ipa) ipa->interrupt = NULL; dev_pm_clear_wake_irq(dev); + (void)device_init_wakeup(dev, false); free_irq(interrupt->irq, interrupt); bitmap_free(interrupt->suspend_enabled); } diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 57b241417e8cd..59e7abb4a0d19 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -120,10 +120,6 @@ int ipa_setup(struct ipa *ipa) if (ret) return ret; - ret = ipa_power_setup(ipa); - if (ret) - goto err_gsi_teardown; - ipa_endpoint_setup(ipa); /* We need to use the AP command TX endpoint to perform other @@ -170,8 +166,6 @@ int ipa_setup(struct ipa *ipa) ipa_endpoint_disable_one(command_endpoint); err_endpoint_teardown: ipa_endpoint_teardown(ipa); - ipa_power_teardown(ipa); -err_gsi_teardown: gsi_teardown(&ipa->gsi); return ret; @@ -196,7 +190,6 @@ static void ipa_teardown(struct ipa *ipa) command_endpoint = ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]; ipa_endpoint_disable_one(command_endpoint); ipa_endpoint_teardown(ipa); - ipa_power_teardown(ipa); gsi_teardown(&ipa->gsi); } diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c index bdbcf965d5a30..881bf9147b190 100644 --- a/drivers/net/ipa/ipa_power.c +++ b/drivers/net/ipa/ipa_power.c @@ -232,16 +232,6 @@ void ipa_power_retention(struct ipa *ipa, bool enable) ret, enable ? "en" : "dis"); } -int ipa_power_setup(struct ipa *ipa) -{ - return device_init_wakeup(ipa->dev, true); -} - -void ipa_power_teardown(struct ipa *ipa) -{ - (void)device_init_wakeup(ipa->dev, false); -} - /* Initialize IPA power management */ struct ipa_power * ipa_power_init(struct device *dev, const struct ipa_power_data *data) diff --git a/drivers/net/ipa/ipa_power.h b/drivers/net/ipa/ipa_power.h index 227cc04bea806..df93b07415f2a 100644 --- a/drivers/net/ipa/ipa_power.h +++ b/drivers/net/ipa/ipa_power.h @@ -30,20 +30,6 @@ u32 ipa_core_clock_rate(struct ipa *ipa); */ void ipa_power_retention(struct ipa *ipa, bool enable); -/** - * ipa_power_setup() - Set up IPA power management - * @ipa: IPA pointer - * - * Return: 0 if successful, or a negative error code - */ -int ipa_power_setup(struct ipa *ipa); - -/** - * ipa_power_teardown() - Inverse of ipa_power_setup() - * @ipa: IPA pointer - */ -void ipa_power_teardown(struct ipa *ipa); - /** * ipa_power_init() - Initialize IPA power management * @dev: IPA device From patchwork Thu Apr 18 20:47:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13635434 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B100B199E99 for ; Thu, 18 Apr 2024 20:47:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473263; cv=none; b=lcNyvfTjP8wkAi8N4c52NIPmbF8QnABADzcFg7SKbFPQqGkfv4bfYsC+zsuFk+qGPRDB/rZahj6/Dtamu16JwhDNSgV68GTPrqt/eZoscUf4FE1ImzODqOyAlmAJX2wQ7w9O1LjpzTJSFVGtaoRbM7PbKQ1is4CAcK5AMN5mn+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473263; c=relaxed/simple; bh=xghA/IKe2+zJPaTSn22evp4r7tz7T7gc2ns6uAWCT3E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tBqSN9hiPySnyVoTaSNsr2s2WxMqCKGEncHilEQlMIyUrO4Q206o5JFsoYuXYHsY0YPKKnuSD7z84nm2Uv9Cya3/NCcNmTOyiP822tENn2/ksHt+pSLR5hJCAQvLLFJtluAmhbVUf5Y49QY73Z6/N3qtv+qI3LlEbtN7GCOI3G0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=e4JaIsLe; arc=none smtp.client-ip=209.85.166.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="e4JaIsLe" Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-36aff02f998so3804045ab.3 for ; Thu, 18 Apr 2024 13:47:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713473261; x=1714078061; darn=vger.kernel.org; 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=xiHSwsewvF6JA/i3n1XYlFUoFzpIo8xMcAilX3ipKIk=; b=e4JaIsLeepF5UVLgjighmAWDK3ul/kn2UyM5P+jo5DdJOjcCi52Hk6dcfq37L6/JPy liwQci/qiRskQR/cs6cvXxeZc9HvIWUFww/J+7IV+x/MGkk+DR3xtBq4wo77klTbDAgf Ll/I8Lx//0EaxAVF8q5L/rgIlLsbRam4zFlQ9h21PiQyRPDx9HlBVKe8GfUf6Kx/OCLX eJK5Kf7j9Z1GmEoJulBVSjhWy9csUjgQs14MqkC/1/5Vkyzff2o6vZMF+C+tQ1rhILUZ Ih2gIoj0hEYu0BLSSBmXwjK9X931zXo8Rc3dUv42+pyKSVkWkfUzLji7J6/wwe6G1PUu v8QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713473261; x=1714078061; 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=xiHSwsewvF6JA/i3n1XYlFUoFzpIo8xMcAilX3ipKIk=; b=QOzZObUOcm4Px7By1n7J2MmXM2WBjeAq6HaDXPuunb1CURxZeCdZ/YPJ/f8cxX73ti T3sYykD2PHzCPbpP7O1EFbpJZyVd7f9nVwSXEQd/4VU7Ane2oGrM7w8+Th57hbWkqGdR LRAHXSqEBgB0WuPTaquLch+OGPKXwIFxBsO4yxKe7kYJR2F4qXSD51xsnWtl+kMcI7Q+ GUvoGh5vQvEYGBtUrSMRGRVRQowjFJoMhkRl9KLMw9samFPycm0vujdWq3ZuxK1ontym VkdvkJyyTAUPJr5je42SfNnybMF7N4SeZjTxPPawH0ptDtVp0io3hY7al3prIIu7/XgX ebog== X-Forwarded-Encrypted: i=1; AJvYcCUd2pXgF8ZIxredD8HPTkrqIKbVS69D4aM+DX80plVzlfkhiS+CQtAIxPq51UwPd3Gf575OJLzMaDm7vnoUJFzB6ZBUQMkCjczMgLk/xg== X-Gm-Message-State: AOJu0YzETSe3qW7VjwV0JFD+2a48FRkfQXMojB9XkzNgSQoRGDArnQri rZuRYHcSkJicrg2/yjP4vlhXDXLMQm2mqm3v/FxEyXzDsZjWuMB9OyAVaS+abPo= X-Google-Smtp-Source: AGHT+IGQ6BTpypWpACqqIEmHjce8/fc1/vHZDxgj0kcIec3Y2dkFk6ndzqZ7423P1OzFVdQi2pRFLg== X-Received: by 2002:a05:6e02:1541:b0:36b:3a3b:b2c0 with SMTP id j1-20020a056e02154100b0036b3a3bb2c0mr318004ilu.32.1713473260872; Thu, 18 Apr 2024 13:47:40 -0700 (PDT) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id r6-20020a056638300600b00484948cb8f5sm626998jak.91.2024.04.18.13.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 13:47:40 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@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-next 4/8] net: ipa: remove unneeded FILT_ROUT_HASH_EN definitions Date: Thu, 18 Apr 2024 15:47:25 -0500 Message-Id: <20240418204729.1952353-5-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240418204729.1952353-1-elder@linaro.org> References: <20240418204729.1952353-1-elder@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The FILT_ROUT_HASH_EN register is only used for IPA v4.2. There, routing and filter table hashing are not supported, and so the register must be written to disable the feature. No other version uses this register, so its definition can be removed. If we need to use these some day (for example, explicitly enable the feature) this commit can be reverted. Signed-off-by: Alex Elder --- drivers/net/ipa/reg/ipa_reg-v3.1.c | 14 -------------- drivers/net/ipa/reg/ipa_reg-v3.5.1.c | 14 -------------- drivers/net/ipa/reg/ipa_reg-v4.11.c | 14 -------------- drivers/net/ipa/reg/ipa_reg-v4.5.c | 14 -------------- drivers/net/ipa/reg/ipa_reg-v4.7.c | 14 -------------- drivers/net/ipa/reg/ipa_reg-v4.9.c | 14 -------------- 6 files changed, 84 deletions(-) diff --git a/drivers/net/ipa/reg/ipa_reg-v3.1.c b/drivers/net/ipa/reg/ipa_reg-v3.1.c index 648dbfe1fce3a..df20f9194efb8 100644 --- a/drivers/net/ipa/reg/ipa_reg-v3.1.c +++ b/drivers/net/ipa/reg/ipa_reg-v3.1.c @@ -76,19 +76,6 @@ static const u32 reg_qsb_max_reads_fmask[] = { REG_FIELDS(QSB_MAX_READS, qsb_max_reads, 0x00000078); -static const u32 reg_filt_rout_hash_en_fmask[] = { - [IPV6_ROUTER_HASH] = BIT(0), - /* Bits 1-3 reserved */ - [IPV6_FILTER_HASH] = BIT(4), - /* Bits 5-7 reserved */ - [IPV4_ROUTER_HASH] = BIT(8), - /* Bits 9-11 reserved */ - [IPV4_FILTER_HASH] = BIT(12), - /* Bits 13-31 reserved */ -}; - -REG_FIELDS(FILT_ROUT_HASH_EN, filt_rout_hash_en, 0x000008c); - static const u32 reg_filt_rout_hash_flush_fmask[] = { [IPV6_ROUTER_HASH] = BIT(0), /* Bits 1-3 reserved */ @@ -403,7 +390,6 @@ static const struct reg *reg_array[] = { [SHARED_MEM_SIZE] = ®_shared_mem_size, [QSB_MAX_WRITES] = ®_qsb_max_writes, [QSB_MAX_READS] = ®_qsb_max_reads, - [FILT_ROUT_HASH_EN] = ®_filt_rout_hash_en, [FILT_ROUT_HASH_FLUSH] = ®_filt_rout_hash_flush, [STATE_AGGR_ACTIVE] = ®_state_aggr_active, [IPA_BCR] = ®_ipa_bcr, diff --git a/drivers/net/ipa/reg/ipa_reg-v3.5.1.c b/drivers/net/ipa/reg/ipa_reg-v3.5.1.c index 78b1bf60cd024..1f8c0457529e1 100644 --- a/drivers/net/ipa/reg/ipa_reg-v3.5.1.c +++ b/drivers/net/ipa/reg/ipa_reg-v3.5.1.c @@ -81,19 +81,6 @@ static const u32 reg_qsb_max_reads_fmask[] = { REG_FIELDS(QSB_MAX_READS, qsb_max_reads, 0x00000078); -static const u32 reg_filt_rout_hash_en_fmask[] = { - [IPV6_ROUTER_HASH] = BIT(0), - /* Bits 1-3 reserved */ - [IPV6_FILTER_HASH] = BIT(4), - /* Bits 5-7 reserved */ - [IPV4_ROUTER_HASH] = BIT(8), - /* Bits 9-11 reserved */ - [IPV4_FILTER_HASH] = BIT(12), - /* Bits 13-31 reserved */ -}; - -REG_FIELDS(FILT_ROUT_HASH_EN, filt_rout_hash_en, 0x000008c); - static const u32 reg_filt_rout_hash_flush_fmask[] = { [IPV6_ROUTER_HASH] = BIT(0), /* Bits 1-3 reserved */ @@ -414,7 +401,6 @@ static const struct reg *reg_array[] = { [SHARED_MEM_SIZE] = ®_shared_mem_size, [QSB_MAX_WRITES] = ®_qsb_max_writes, [QSB_MAX_READS] = ®_qsb_max_reads, - [FILT_ROUT_HASH_EN] = ®_filt_rout_hash_en, [FILT_ROUT_HASH_FLUSH] = ®_filt_rout_hash_flush, [STATE_AGGR_ACTIVE] = ®_state_aggr_active, [IPA_BCR] = ®_ipa_bcr, diff --git a/drivers/net/ipa/reg/ipa_reg-v4.11.c b/drivers/net/ipa/reg/ipa_reg-v4.11.c index 29e71cce4a843..ba21a6c655c88 100644 --- a/drivers/net/ipa/reg/ipa_reg-v4.11.c +++ b/drivers/net/ipa/reg/ipa_reg-v4.11.c @@ -113,19 +113,6 @@ static const u32 reg_qsb_max_reads_fmask[] = { REG_FIELDS(QSB_MAX_READS, qsb_max_reads, 0x00000078); -static const u32 reg_filt_rout_hash_en_fmask[] = { - [IPV6_ROUTER_HASH] = BIT(0), - /* Bits 1-3 reserved */ - [IPV6_FILTER_HASH] = BIT(4), - /* Bits 5-7 reserved */ - [IPV4_ROUTER_HASH] = BIT(8), - /* Bits 9-11 reserved */ - [IPV4_FILTER_HASH] = BIT(12), - /* Bits 13-31 reserved */ -}; - -REG_FIELDS(FILT_ROUT_HASH_EN, filt_rout_hash_en, 0x0000148); - static const u32 reg_filt_rout_hash_flush_fmask[] = { [IPV6_ROUTER_HASH] = BIT(0), /* Bits 1-3 reserved */ @@ -470,7 +457,6 @@ static const struct reg *reg_array[] = { [SHARED_MEM_SIZE] = ®_shared_mem_size, [QSB_MAX_WRITES] = ®_qsb_max_writes, [QSB_MAX_READS] = ®_qsb_max_reads, - [FILT_ROUT_HASH_EN] = ®_filt_rout_hash_en, [FILT_ROUT_HASH_FLUSH] = ®_filt_rout_hash_flush, [STATE_AGGR_ACTIVE] = ®_state_aggr_active, [LOCAL_PKT_PROC_CNTXT] = ®_local_pkt_proc_cntxt, diff --git a/drivers/net/ipa/reg/ipa_reg-v4.5.c b/drivers/net/ipa/reg/ipa_reg-v4.5.c index 1c58f78851c21..90fd749b43eba 100644 --- a/drivers/net/ipa/reg/ipa_reg-v4.5.c +++ b/drivers/net/ipa/reg/ipa_reg-v4.5.c @@ -107,19 +107,6 @@ static const u32 reg_qsb_max_reads_fmask[] = { REG_FIELDS(QSB_MAX_READS, qsb_max_reads, 0x00000078); -static const u32 reg_filt_rout_hash_en_fmask[] = { - [IPV6_ROUTER_HASH] = BIT(0), - /* Bits 1-3 reserved */ - [IPV6_FILTER_HASH] = BIT(4), - /* Bits 5-7 reserved */ - [IPV4_ROUTER_HASH] = BIT(8), - /* Bits 9-11 reserved */ - [IPV4_FILTER_HASH] = BIT(12), - /* Bits 13-31 reserved */ -}; - -REG_FIELDS(FILT_ROUT_HASH_EN, filt_rout_hash_en, 0x0000148); - static const u32 reg_filt_rout_hash_flush_fmask[] = { [IPV6_ROUTER_HASH] = BIT(0), /* Bits 1-3 reserved */ @@ -489,7 +476,6 @@ static const struct reg *reg_array[] = { [SHARED_MEM_SIZE] = ®_shared_mem_size, [QSB_MAX_WRITES] = ®_qsb_max_writes, [QSB_MAX_READS] = ®_qsb_max_reads, - [FILT_ROUT_HASH_EN] = ®_filt_rout_hash_en, [FILT_ROUT_HASH_FLUSH] = ®_filt_rout_hash_flush, [STATE_AGGR_ACTIVE] = ®_state_aggr_active, [LOCAL_PKT_PROC_CNTXT] = ®_local_pkt_proc_cntxt, diff --git a/drivers/net/ipa/reg/ipa_reg-v4.7.c b/drivers/net/ipa/reg/ipa_reg-v4.7.c index 731824fce1d4a..ebae61d10eadb 100644 --- a/drivers/net/ipa/reg/ipa_reg-v4.7.c +++ b/drivers/net/ipa/reg/ipa_reg-v4.7.c @@ -107,19 +107,6 @@ static const u32 reg_qsb_max_reads_fmask[] = { REG_FIELDS(QSB_MAX_READS, qsb_max_reads, 0x00000078); -static const u32 reg_filt_rout_hash_en_fmask[] = { - [IPV6_ROUTER_HASH] = BIT(0), - /* Bits 1-3 reserved */ - [IPV6_FILTER_HASH] = BIT(4), - /* Bits 5-7 reserved */ - [IPV4_ROUTER_HASH] = BIT(8), - /* Bits 9-11 reserved */ - [IPV4_FILTER_HASH] = BIT(12), - /* Bits 13-31 reserved */ -}; - -REG_FIELDS(FILT_ROUT_HASH_EN, filt_rout_hash_en, 0x0000148); - static const u32 reg_filt_rout_hash_flush_fmask[] = { [IPV6_ROUTER_HASH] = BIT(0), /* Bits 1-3 reserved */ @@ -462,7 +449,6 @@ static const struct reg *reg_array[] = { [SHARED_MEM_SIZE] = ®_shared_mem_size, [QSB_MAX_WRITES] = ®_qsb_max_writes, [QSB_MAX_READS] = ®_qsb_max_reads, - [FILT_ROUT_HASH_EN] = ®_filt_rout_hash_en, [FILT_ROUT_HASH_FLUSH] = ®_filt_rout_hash_flush, [STATE_AGGR_ACTIVE] = ®_state_aggr_active, [LOCAL_PKT_PROC_CNTXT] = ®_local_pkt_proc_cntxt, diff --git a/drivers/net/ipa/reg/ipa_reg-v4.9.c b/drivers/net/ipa/reg/ipa_reg-v4.9.c index 01f87b5290e01..f488f68603d07 100644 --- a/drivers/net/ipa/reg/ipa_reg-v4.9.c +++ b/drivers/net/ipa/reg/ipa_reg-v4.9.c @@ -112,19 +112,6 @@ static const u32 reg_qsb_max_reads_fmask[] = { REG_FIELDS(QSB_MAX_READS, qsb_max_reads, 0x00000078); -static const u32 reg_filt_rout_hash_en_fmask[] = { - [IPV6_ROUTER_HASH] = BIT(0), - /* Bits 1-3 reserved */ - [IPV6_FILTER_HASH] = BIT(4), - /* Bits 5-7 reserved */ - [IPV4_ROUTER_HASH] = BIT(8), - /* Bits 9-11 reserved */ - [IPV4_FILTER_HASH] = BIT(12), - /* Bits 13-31 reserved */ -}; - -REG_FIELDS(FILT_ROUT_HASH_EN, filt_rout_hash_en, 0x0000148); - static const u32 reg_filt_rout_hash_flush_fmask[] = { [IPV6_ROUTER_HASH] = BIT(0), /* Bits 1-3 reserved */ @@ -467,7 +454,6 @@ static const struct reg *reg_array[] = { [SHARED_MEM_SIZE] = ®_shared_mem_size, [QSB_MAX_WRITES] = ®_qsb_max_writes, [QSB_MAX_READS] = ®_qsb_max_reads, - [FILT_ROUT_HASH_EN] = ®_filt_rout_hash_en, [FILT_ROUT_HASH_FLUSH] = ®_filt_rout_hash_flush, [STATE_AGGR_ACTIVE] = ®_state_aggr_active, [LOCAL_PKT_PROC_CNTXT] = ®_local_pkt_proc_cntxt, From patchwork Thu Apr 18 20:47:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13635435 Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7EFF19DF44 for ; Thu, 18 Apr 2024 20:47:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473265; cv=none; b=iZ10KmcktUa/K4Ccgw9pqjehQxd+VWlDQ6eaAVcmdug/UFZoQNtN2xbDUJkzisc2zu++ugiWbrAbnUvCa2S3VPS9NVBzIo4onU4ITpjgDsysDwgYGMkgYW0lFgF85/Vu7/ybMwnLfMSkKEQHK49SXNfnXAFwToimc67Qu4WPc3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473265; c=relaxed/simple; bh=/O26O0SPwaQndb7Gk11BnaA079JRAE9KvwG8Uy+fgkI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=g1QscAvH7QurKZDCMarA3sqhRJqi3EWpG+Mp8hL6Iwf7CyOUWUrnycyzIbwnjQbF/pXN2VJjynKbCAD3tSxGkXpo0fLrQ029fdLDQ+WmAJ/S3ZDUENL9SgtNjQPJ6X1SZHf/uQWVRaJEkbyI4XrfjLV2ZffTKEIW3uTDRs0009U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ZYjQt/ct; arc=none smtp.client-ip=209.85.166.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZYjQt/ct" Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7d5facf3161so47996839f.1 for ; Thu, 18 Apr 2024 13:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713473262; x=1714078062; darn=vger.kernel.org; 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=H3Jy4pWunk3gIi2kTc2gXOgQDTDQJh8keviaOUz7uIE=; b=ZYjQt/ct3cSn6dvp1SKUcDXcgH2FKAR52Q3W2nIGlJJGgaTvC/4zZFVFT2etV6rday O5mKZshbjyXK9iXvziVoRcdPICnO38fguID/IFrxhMRrtK603J+pUvfajz3BXmE2UlqE 1T6pi4HzGsjrprgJBxGgUqc7PnRb0Rzvv0FDNATLKqny6+sZUl+eZzhE5IRZLjbQuRm/ 1mnYhWBVDFhyQzarDCAoP29U/nR+xl/E2HVPstkqsVIFmAGa6MayucaK+p8+dFfJZjsO xbl0+Lqqt1DMFHytNbr1JoIickSFBT5IjubMu8NEHI3RXlAJYWz1EUczTZHVt4+OEf6j E9HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713473262; x=1714078062; 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=H3Jy4pWunk3gIi2kTc2gXOgQDTDQJh8keviaOUz7uIE=; b=aQ4yZ/twJ7YNn2mD4iWIG4iTZs1ADUevY8guAb73m6o5sDGpRCvopzlUOVG8pG3WgU NPeL0SAosOGPgXyhIj/EzNuRfnA8JEFYUKiJdbL7cZD0jWuRdTrROAneEhTej1o9xnV4 8hZKzyXW6jEzbcLKmN8AmkRLypdS1WjnUt5dw3H9FOoRGj3vdF7QDF5H03hvIpvlly9B xujmWF0q7x/Y7RQEl9Vf9XdK8AMuu5bvsIydQBGkc9hmkFV1YQGYNXMTpJBOVt9u3jId 9RoYlH3+rk5Ok7AsrD0JFauDLWg0pedJexrM4emjBuwA7b29zKt08PhkvzzHZ3SojcuM 6gmw== X-Forwarded-Encrypted: i=1; AJvYcCUURfOKBjn9JZqPbPtRXmGxtze23fZ7YcFroI/R8lMdcmvTnG6booT96oJzOTbFvBgQSoOPXRqnKgvztIdVcK1cI2PBXcoxAF4B1cdkZw== X-Gm-Message-State: AOJu0YxiIRYZVEqEJMMhloy8onHAtWwdMVmaitRxfuDCwnd1tEd4WMv/ 4Ni330RbSWLKXtABolE1JKWrJXYwwkKWgro8volx9xb2B/dBx9WwV4nSrOSyPC0= X-Google-Smtp-Source: AGHT+IG8BLSKKt4Z+OUV/Ccbn8w8o09vBKQ7lL5VpQxMYtcdH5yIUGgB0k1msp2eDPQ+0DIyHdZwIw== X-Received: by 2002:a5e:8b04:0:b0:7da:1911:8a9f with SMTP id g4-20020a5e8b04000000b007da19118a9fmr468131iok.4.1713473262075; Thu, 18 Apr 2024 13:47:42 -0700 (PDT) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id r6-20020a056638300600b00484948cb8f5sm626998jak.91.2024.04.18.13.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 13:47:41 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@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-next 5/8] net: ipa: make ipa_table_hash_support() a real function Date: Thu, 18 Apr 2024 15:47:26 -0500 Message-Id: <20240418204729.1952353-6-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240418204729.1952353-1-elder@linaro.org> References: <20240418204729.1952353-1-elder@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 With the exception of ipa_table_hash_support(), nothing defined in "ipa_table.h" requires the full definition of the IPA structure. Change that function to be a "real" function rather than an inline, to avoid requring the IPA structure to be defined. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_table.c | 8 +++++++- drivers/net/ipa/ipa_table.h | 7 ++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/net/ipa/ipa_table.c b/drivers/net/ipa/ipa_table.c index a24ac11b8893d..9b4bb6d3f152a 100644 --- a/drivers/net/ipa/ipa_table.c +++ b/drivers/net/ipa/ipa_table.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. - * Copyright (C) 2018-2023 Linaro Ltd. + * Copyright (C) 2018-2024 Linaro Ltd. */ #include @@ -161,6 +161,12 @@ ipa_table_mem(struct ipa *ipa, bool filter, bool hashed, bool ipv6) return ipa_mem_find(ipa, mem_id); } +/* Return true if hashed tables are supported */ +bool ipa_table_hash_support(struct ipa *ipa) +{ + return ipa->version != IPA_VERSION_4_2; +} + bool ipa_filtered_valid(struct ipa *ipa, u64 filtered) { struct device *dev = ipa->dev; diff --git a/drivers/net/ipa/ipa_table.h b/drivers/net/ipa/ipa_table.h index 7cc951904bb48..16d4d15df9e9c 100644 --- a/drivers/net/ipa/ipa_table.h +++ b/drivers/net/ipa/ipa_table.h @@ -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-2024 Linaro Ltd. */ #ifndef _IPA_TABLE_H_ #define _IPA_TABLE_H_ @@ -23,10 +23,7 @@ bool ipa_filtered_valid(struct ipa *ipa, u64 filtered); * ipa_table_hash_support() - Return true if hashed tables are supported * @ipa: IPA pointer */ -static inline bool ipa_table_hash_support(struct ipa *ipa) -{ - return ipa->version != IPA_VERSION_4_2; -} +bool ipa_table_hash_support(struct ipa *ipa); /** * ipa_table_reset() - Reset filter and route tables entries to "none" From patchwork Thu Apr 18 20:47:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13635436 Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23DAB19DF73 for ; Thu, 18 Apr 2024 20:47:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473266; cv=none; b=BhSR3zsbUs40Z9ZDxgCcW9GAplGJbL5iRu4U05BH+YD8y6TnRE8dD8R1RBAK3iDMU1iOV2U5hTPbNCLar1rCd1KEGs1Uvkab9QTF8LQNZPUAP+hWgpvgjSB9aLVRuUvlGfp9+C+kYwU/7OhznVcK+son32cd91bLHxncgazLDGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473266; c=relaxed/simple; bh=XyYpi71wJ0gs3n01rlT/IbyAJXkfH9+nq2GSfnQ1k/w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DMmPenvEOKPG3KEz0KszB9V0J0Jwi1doIVUhIln6nQWBY7zuP3/zaS0JKF53cxE5hHMCN0kwyDjR4c/jmfl55465WIa2Kht15FO48P7sUniy7BIeruTIzelZg8IWjVMvA56xcxaYRM8Yw/xCU2DIem0NzoQKSe3nDjFnc/gTUrw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ZZPLlPP+; arc=none smtp.client-ip=209.85.166.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZZPLlPP+" Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7d6a772af5bso45224139f.1 for ; Thu, 18 Apr 2024 13:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713473263; x=1714078063; darn=vger.kernel.org; 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=fi0Ji6XcxTq7nWZptSfD6FmyaTvUSY/Oz6qXD8maVXs=; b=ZZPLlPP+4XDZ7PF63LsFgJPul7de2gSxgeQkiiEHeEcL5yRoY+BERT55BVILhV2In9 IpXomHHSleFX90PDxkK/L9hOD8CuR9OhUhCfs8c8oLk1yCcjLPJR1P4xiUTavlICFe7y nRsk/wpWEw8HrrB0hNEFiKo2SF8o6WMAOovfG2dGBUNxSrtLIGN7CcG8bX17nkc7YYLa 0c3cFr6J3ImAVT+t1Q1N164q8SGIqfKa/LlyxASKIijsvuC6shtmJYQo6eYMgKxdKrHU clLABJ8NAdQ0NmkZzmUErd/B1B+FQzKmbaYowY/8N2dkpDbIr8AkMsSx/w65N0KUxZnj 3d5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713473263; x=1714078063; 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=fi0Ji6XcxTq7nWZptSfD6FmyaTvUSY/Oz6qXD8maVXs=; b=iOIbRDzRUzfwR4RMSS01gqzzzHMhqLVKKKRrFlrwHvQITGhJhYvRS2UrkGeYLBRNhE Z9h2UtIDRQ69CT1j7Q0eD97zTHoDkb+qk7IjfJ8yDFOHiW2a1go3Cra6rhfa6TpijRgN 2NG2shNlm3iABR3iLBkyNFTgITmOeGHbu9M0pIlCuQyXIoVhVfp9nkX389iWA9yP7te+ gk6V1fbo0uyl+PWFAuJNAhiZ/r5VkKYJLj0lyNaUueXI3tORhmecRIsjENJQZp9kzPx0 PrhtvdJsU2DzGGD6U1d/uS22PGMris5Qk5wYjUjLJUEAUy1IQMJpqOxwNm2KX22LcZzS xVhw== X-Forwarded-Encrypted: i=1; AJvYcCUzM19SuU0nTnXPB5MhmmeujaD9hvJy+RVET0BFrkKB56vJuTLS/5megXf2QSuakgnomwLV6WShvSO+PnNhZ3TSVBDsuvi1p81JRwcXqA== X-Gm-Message-State: AOJu0YxSMIUKUfphhxF13n1TGdfOLD4YCQ7ScCjm/uSMszrYOc8Iek5D EStF63bEAJ6p2e2jn7iSUwqYmux2YzE61PWjaE6NXZI8w9VtkMrwNT5tmo3DQcs= X-Google-Smtp-Source: AGHT+IETNjFLF3X+Ku5v+Xs/f3tk1jQTaxypjSebgt5O2xuGJvzOB8jqRXYV5pbnShahTZbeDUMiWA== X-Received: by 2002:a05:6602:4a86:b0:7da:1885:50b5 with SMTP id ej6-20020a0566024a8600b007da188550b5mr378319iob.9.1713473263316; Thu, 18 Apr 2024 13:47:43 -0700 (PDT) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id r6-20020a056638300600b00484948cb8f5sm626998jak.91.2024.04.18.13.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 13:47:42 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@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-next 6/8] net: ipa: fix two bogus argument names Date: Thu, 18 Apr 2024 15:47:27 -0500 Message-Id: <20240418204729.1952353-7-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240418204729.1952353-1-elder@linaro.org> References: <20240418204729.1952353-1-elder@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In "ipa_endpoint.h", two function declarations have bogus argument names. Fix these. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ipa/ipa_endpoint.h b/drivers/net/ipa/ipa_endpoint.h index 3ad2e802040aa..b431e4e462114 100644 --- a/drivers/net/ipa/ipa_endpoint.h +++ b/drivers/net/ipa/ipa_endpoint.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. - * Copyright (C) 2019-2023 Linaro Ltd. + * Copyright (C) 2019-2024 Linaro Ltd. */ #ifndef _IPA_ENDPOINT_H_ #define _IPA_ENDPOINT_H_ @@ -199,9 +199,9 @@ int ipa_endpoint_init(struct ipa *ipa, u32 count, const struct ipa_gsi_endpoint_data *data); void ipa_endpoint_exit(struct ipa *ipa); -void ipa_endpoint_trans_complete(struct ipa_endpoint *ipa, +void ipa_endpoint_trans_complete(struct ipa_endpoint *endpoint, struct gsi_trans *trans); -void ipa_endpoint_trans_release(struct ipa_endpoint *ipa, +void ipa_endpoint_trans_release(struct ipa_endpoint *endpoint, struct gsi_trans *trans); #endif /* _IPA_ENDPOINT_H_ */ From patchwork Thu Apr 18 20:47:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13635438 Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76A7C1A0AFC for ; Thu, 18 Apr 2024 20:47:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473268; cv=none; b=iGMqIX6n/Lvl2V8nlG5jiRPATyIp+Du3lVV0LseMnWO5G//KK1Ff+a/nmpNNGhfO1SmkscGg8Vva4+jnIjraS5Q+RFq+bZuhef8VspEMtBG0j6P3WgiX0Efjaycab7Dpl0VgZbTIQqCzY3w0wcwhF32M1YPIINb4KYR5cDA08z0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473268; c=relaxed/simple; bh=EM+PQeT/+Ayv+DqVTXJ6eeqpjOeHpKwRxGVuenJZOr8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Wo0R9kFgHoSQ2673UhjRmZvOGsYifzu7AEFiF6Z/XVytjr7GVcAErOjWw7i80WNnZNRxL6UTrmtlAk+fYEQHO8yn3e5pM3QtR070KR74aoRIM4XmhFAfjKcLtrzPTdtxdKcF5+oYw9aZk6wNIY++IeVLsglp6K2NJJ3oqwIIpM8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=V7ImgRe7; arc=none smtp.client-ip=209.85.160.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="V7ImgRe7" Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-234db9dde9bso654843fac.1 for ; Thu, 18 Apr 2024 13:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713473264; x=1714078064; darn=vger.kernel.org; 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=NOsLWHf1aG7QjlwAYhzu9K+FfSOj8nw2eYMqyFikvmc=; b=V7ImgRe7jkpHOts93G+lm8ZfO9vtJki+bHJ0OYnS501S6N72QFl2VAqL0oZk92QG3q m02rMzaHK9lln9LRB+LTNpKjMZM8eEUfyD2J1i88LyKH7kHzLT25MnE9nQFjXSSa0nNA LZCG0xLUPXsSPUL7eoiKlZgCVixeEm3fhiN/bh+NLnpt4pdDafK0fLfYLL0RSWF9ZqPN Tt2ff0T86NtzDvaqQ3/zBxJpzMMar+O82fDKHWqoBt3Ak9Odhwa0bcnlHrzZSbNbBHWH WrtxPOv+FVFLhMoupMyksg6vgMYsANQq0WHtaV62EczENhL4tIsGr+Tu4JF1S1Hg7+ji dq9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713473264; x=1714078064; 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=NOsLWHf1aG7QjlwAYhzu9K+FfSOj8nw2eYMqyFikvmc=; b=AWQ9sC6FaX+px353vYVZVi2pdpr09u5aBbhlyxobRdUZEr7h8IcgjIM9tVbjEVqw1L UhzOwUTXlpHmCLYs0WyEZ/uOrYQB2YbwqTVgA+ie86aeFRTaqr1fOGgYfmHLL6kmvM9P YkEmWHlXhh4ZQyOP0pIy6sZNNszh5irmmutF78bgtD6wrNs2UhWJuKAgb6RwlzS1m0wW ePeFlT7yxdCQocXwoK3OoJ4haJOOCqs24EMJx03jUO9m3TjA0VEDf0CejMtbfbjcUHLZ 2YTH7rkCUZIGVQsGqKI08yf6tGl5J9LUNuqO+MruUmjkaUwfhEu00tmFC5lDtH+oCHOk AqhQ== X-Forwarded-Encrypted: i=1; AJvYcCUJ9VwYsvR3fmF5Dbj2gNmIuPcCJNNNCKwY7SivNSejgxkDJlZnpo4egE5u3YjHNiyEhf7CqymMqkdXhIUbVFIRbkCPM52kQ6fKZgbwQw== X-Gm-Message-State: AOJu0YyqiHAvF4rLDIQn3bGXsqr41Ss7J8dmRteJCwZW47sBqeOCFcLo Woto7Fm5F3MDY2pFjuGQJKKCEygAwGrjgX43LHTJog0lCHnuJQ0LPYRbrwSsoQQ= X-Google-Smtp-Source: AGHT+IHgblJ9h1CLqLo4U6C2hS5Ih8NHrIzQTKnvXZ8o0ZznahnKl3ojygI4TwopwZYSah+zGVzmBw== X-Received: by 2002:a05:6870:d886:b0:22e:e1e5:b8d with SMTP id oe6-20020a056870d88600b0022ee1e50b8dmr240440oac.51.1713473264566; Thu, 18 Apr 2024 13:47:44 -0700 (PDT) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id r6-20020a056638300600b00484948cb8f5sm626998jak.91.2024.04.18.13.47.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 13:47:44 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@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-next 7/8] net: ipa: fix two minor ipa_cmd problems Date: Thu, 18 Apr 2024 15:47:28 -0500 Message-Id: <20240418204729.1952353-8-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240418204729.1952353-1-elder@linaro.org> References: <20240418204729.1952353-1-elder@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In "ipa_cmd.h", ipa_cmd_data_valid() is declared, but that function does not exist. So delete that declaration. Also, for some reason ipa_cmd_init() never gets called. It isn't really critical--it just validates that some memory offsets and a size can be represented in some register fields, and they won't fail with current data. Regardless, call the function in ipa_probe(). Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_cmd.h | 8 -------- drivers/net/ipa/ipa_main.c | 4 ++++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/ipa/ipa_cmd.h b/drivers/net/ipa/ipa_cmd.h index e2cf1c2b0ef24..100a4e1133b5e 100644 --- a/drivers/net/ipa/ipa_cmd.h +++ b/drivers/net/ipa/ipa_cmd.h @@ -57,14 +57,6 @@ enum ipa_cmd_opcode { bool ipa_cmd_table_init_valid(struct ipa *ipa, const struct ipa_mem *mem, bool route); -/** - * ipa_cmd_data_valid() - Validate command-realted configuration is valid - * @ipa: - IPA pointer - * - * Return: true if assumptions required for command are valid - */ -bool ipa_cmd_data_valid(struct ipa *ipa); - /** * ipa_cmd_pool_init() - initialize command channel pools * @channel: AP->IPA command TX GSI channel pointer diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 59e7abb4a0d19..04dc0540ff7fb 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -866,6 +866,10 @@ static int ipa_probe(struct platform_device *pdev) if (ret) goto err_reg_exit; + ret = ipa_cmd_init(ipa); + if (ret) + goto err_mem_exit; + ret = gsi_init(&ipa->gsi, pdev, ipa->version, data->endpoint_count, data->endpoint_data); if (ret) From patchwork Thu Apr 18 20:47:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13635437 Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 951581A0B1F for ; Thu, 18 Apr 2024 20:47:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473268; cv=none; b=kO/5uhXxFvOogWP2IprgyZLu2TxJfUXbAOj8VyuB5yToBlCPyAuqsahBzR8k/HnVapDdM8p+HKZO9wJQbTHmMyXXB2u1jjyzyOnab5OJ8PI1rsqy8Mmfk2PULcDtd0pKs79hqSnRyS4mLsTdqhwBVN6zuC56kCq4I766UsUJj/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713473268; c=relaxed/simple; bh=P1dc1JdSs8SCHe62moGR5pSmeoHdNRxNzu0oI8BnvGo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tj3AqgEYKFiQ1oJEI7dBrAmTPB6eHREC22tM1c3cgSlUREYuKAuMM9caXcUgBE9t/GNyMwAFMXvOnUW6zVMM5KHKlMHxQ20Q0UsRHLat7kfZcIlyWb/HqaFsC7lAnsPkkxUjS8lvLoJyMT3u7sxRMfFUD/V/iF4PfYTKcIHoU44= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=oc3ASbev; arc=none smtp.client-ip=209.85.166.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oc3ASbev" Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-36b2fcd1fb6so4400685ab.3 for ; Thu, 18 Apr 2024 13:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713473266; x=1714078066; darn=vger.kernel.org; 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=iKHcTSaA5S2jqYA/kqtWjCsThpLVi1n0vQMddOFHVfU=; b=oc3ASbevYkdVqld9rh52QgXpyn232nnKU0kqzb2+xNesGHeym/dAMg8WYIYs3MAN4q hCvRryK38paWF3fDX0vlG9KhO5dGjORoT0JBIPM4FdPlDWQ9Ups+VZt/D+utC16yRKB7 O+99lMHdUyFpNstdA4ZlzbEkRPbZzP+wBu+Hn6Kv/93bvyL7/QNtcS6P6qNgwcf1HQsE NcxZ0FDTRD6Qx6Z2gHSquf19CEcgSzqhWsn9UhhxH+XNPe7B+qZl9UBbsJCmUQ/aqUrR kRPCWT+anA1nnJwttW4zRppdZ/5CTaHDQAL83Zqru2MDMMc0ieRMK0FNTB3Cbt9U+mjt tdAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713473266; x=1714078066; 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=iKHcTSaA5S2jqYA/kqtWjCsThpLVi1n0vQMddOFHVfU=; b=uEPtujbNwUTgKLvdVA9sxHIk/J1u6VFtq/7qRiiSzDWBIsq9fzGPloNjiVV4WEMcgQ M+bHhgqWHZ5tCjElUi/EHF61rSyvwQLqdx8mEvkmj/OIvI3+8lCCtL93dPFHZHf30YqM o3vA4uS1i1XUkV53c+zO9JvCVITjTEtr+WBQqwR8fq+2v/tqRgPZh9kdxbZBKKr0Jd8M 1lUqJ9l49B9vKlwS7wVFUG+wgto91JQ6Hagg5JJ43nN5oW3gbYO3hBloqJHGFjQL/rCC VSt6yPVrHYCW6NMKVPOYIYIM47Xns0xbhhGxA8bht7jfYjLz2ENhLub3q6kdQB5gkXtR jqQw== X-Forwarded-Encrypted: i=1; AJvYcCXFWnOwUblZ653pFZKR5b6uPn1eWTcnjRtLtOiGf+vRpjVY9pwwxC9X9b7QmM87at5xRyLzkQaiPs6T48P4MdsiBJVTD93lTd2VcqnSsQ== X-Gm-Message-State: AOJu0YxBUm3XNTf+j8YBp+XjpStDHlXAbXbOxCgkfm2xiY0ESHIN0Q9e wBoZvsDemPC2dLO4C7q/+dTgE4K+Ph94VjvC9ijgYksSeKPNxC8aqj8/IKGZ9a8= X-Google-Smtp-Source: AGHT+IEBmjMeQWQ1C1xMXu/cVMj/XUA9qRCtQq3gRTTd6N+Ui+CHA1A/6ETWP2Hc8qGzhlX60JhUcQ== X-Received: by 2002:a05:6e02:13aa:b0:36b:2b56:12 with SMTP id h10-20020a056e0213aa00b0036b2b560012mr379844ilo.7.1713473265848; Thu, 18 Apr 2024 13:47:45 -0700 (PDT) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id r6-20020a056638300600b00484948cb8f5sm626998jak.91.2024.04.18.13.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 13:47:45 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@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-next 8/8] net: ipa: kill ipa_version_supported() Date: Thu, 18 Apr 2024 15:47:29 -0500 Message-Id: <20240418204729.1952353-9-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240418204729.1952353-1-elder@linaro.org> References: <20240418204729.1952353-1-elder@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The only place ipa_version_supported() is called is in the probe function. The version comes from the match data. Rather than checking the version validity separately, just consider anything that has match data to be supported. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_main.c | 5 ----- drivers/net/ipa/ipa_version.h | 18 ------------------ 2 files changed, 23 deletions(-) diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 04dc0540ff7fb..08ec3581d1d27 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -811,11 +811,6 @@ static int ipa_probe(struct platform_device *pdev) return -ENODEV; } - if (!ipa_version_supported(data->version)) { - dev_err(dev, "unsupported IPA version %u\n", data->version); - return -EINVAL; - } - if (!data->modem_route_count) { dev_err(dev, "modem_route_count cannot be zero\n"); return -EINVAL; diff --git a/drivers/net/ipa/ipa_version.h b/drivers/net/ipa/ipa_version.h index 38150345b607e..ae3396314acaf 100644 --- a/drivers/net/ipa/ipa_version.h +++ b/drivers/net/ipa/ipa_version.h @@ -45,24 +45,6 @@ enum ipa_version { IPA_VERSION_COUNT, /* Last; not a version */ }; -static inline bool ipa_version_supported(enum ipa_version version) -{ - switch (version) { - case IPA_VERSION_3_1: - case IPA_VERSION_3_5_1: - case IPA_VERSION_4_2: - case IPA_VERSION_4_5: - case IPA_VERSION_4_7: - case IPA_VERSION_4_9: - case IPA_VERSION_4_11: - case IPA_VERSION_5_0: - case IPA_VERSION_5_5: - return true; - default: - return false; - } -} - /* Execution environment IDs */ enum gsi_ee_id { GSI_EE_AP = 0x0,