From patchwork Fri Apr 19 15:17:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13636491 Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (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 E5BB112F592 for ; Fri, 19 Apr 2024 15:18:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539889; cv=none; b=USGqblW3+sNlkOCR54Wp4IbtI5G2foF8homchchjIYZd2X76rZvos6xtBOBEHQ+22X5qtEyKcqVplpH61ATqdYkCmeUglntBM4UTGPY4Er4MQQF7aL9R+2NnizCMQZn+SFo1m69TqNxp0Ly8OZsX5IFEm+ADTrISaO0aqCyoJ9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539889; c=relaxed/simple; bh=fD4GtJkND5n3skuzOjX/NHgWkIf/VxMqfAgE+7qbH6A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nvfsY0XliumY4+xYJp7zNY+mrvqZWD6iZv6wHDHdQs56YcfI/kleKNNr7Y4wQrY80SgjsBIRdKFXhvqsKNmWpSYlEz2VhMcJaYdF7jSfJwRjgHLaS37++q8FNxzn9QQjHxwLKeiFT/Bjb3FvEa9rtw6AiT8P9HNjPnJ4SZwBwVw= 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=PpElE5Nx; arc=none smtp.client-ip=209.85.166.53 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="PpElE5Nx" Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-7d5e4097a9aso77908939f.3 for ; Fri, 19 Apr 2024 08:18:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713539885; x=1714144685; 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=ozWFvCz/JSLWpvmqAUWIX5N+6wqlehvl2PgyPqAmf3Y=; b=PpElE5NxiDJcZR4OOvs5nu5/wF89pl4vwR75fkFv4T+er+HfAvvrX9fwAD7CJ93ALV Z2uguRnOU8eQgzfN1ea0rqdJWm6IoYdwBkZHOQXyKi86iDoQ9n7DhSztABi+RiQ5oBoh /bdzKio6xCE9/h/T2T7kbNi3HG8m4CXkEDtoYPOEBS1Na5basepfGJTvqUlrkHaAVA3f 5nSX7nBhESOL5I9bYezGRyv0dCy5RzAdV09IW82oTh3Vgr0rxHdUEgcY4n0DHYCDVkCw EVmA1bD05rCGMy5ONiDYISGCty+Js2Sz5PjGviBFfoJwOw1zwiEHAHkCXOK7RcFah8z9 yA2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713539885; x=1714144685; 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=ozWFvCz/JSLWpvmqAUWIX5N+6wqlehvl2PgyPqAmf3Y=; b=Tz/ypuhwIWA9maSwVPJ+dmUbo3j/PpcrZefNpocxByn/oDvhKqLMsGIRY9htEvHqIi lDHxHIRlnXfKfmf2gjqG1fjuGEUNlSw/T0EL4tqvj9wuhfUZQlkanKqHnyGySKe1IxU3 4sw7x9XP19QGXXdsMnR4ORwspEQQ3kL8cOpMvkQ/nJ15b8psKpGBbk1RORw5MQsehjM+ jk6hU5T50ZCQBT8jmA/AAhoPRdNjqPvA0nWuyiaLC2fysW/83NnoK4IBlEHKapJuUs4S 0XNJDJuaZNq4fuDlxNTgm+VN3JfS0IUGpFaTin6BGf7knLtFw2Xp9t3aboQbt/rjnVqf gG+w== X-Forwarded-Encrypted: i=1; AJvYcCV5Yu8QeuahlfPFnovoZvUJ3Gp4IOQdVlJ57LCF2YPrFemty1pGITxrUKxnLJeWuyUj3Sq7hBwrwruOMWKibixjD37tjqqvHuKX7xDNyg== X-Gm-Message-State: AOJu0YwgAXq9EzdlXykCabwD/q3+anqxqbufqMEJRXVYbJ2LXafwhJiU nzRAx6h+y4fWblaK+vq4xAk715PU1nCnaTp8sasaN2uxmaCNrlUyCsdD9KS2YMI= X-Google-Smtp-Source: AGHT+IEoLoAQWS9gMBMZDr7ok+++sYe7DskbfxC7uwOH1LqCCmAzw/fyNZQHJP1MEjnS2s9+s5izXg== X-Received: by 2002:a6b:ed0e:0:b0:7d5:f78f:ab0c with SMTP id n14-20020a6bed0e000000b007d5f78fab0cmr2950857iog.20.1713539885132; Fri, 19 Apr 2024 08:18:05 -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 lc8-20020a056638958800b00484e9c7014bsm116126jab.153.2024.04.19.08.18.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:18:04 -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 v2 1/8] net: ipa: maintain bitmap of suspend-enabled endpoints Date: Fri, 19 Apr 2024 10:17:53 -0500 Message-Id: <20240419151800.2168903-2-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240419151800.2168903-1-elder@linaro.org> References: <20240419151800.2168903-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 --- 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 4d472f4b0002e..18036e9cd161f 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 Fri Apr 19 15:17:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13636490 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 F0B1512F59B for ; Fri, 19 Apr 2024 15:18:06 +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=1713539888; cv=none; b=fXMRyG3r0xrSUedchIRDZ6xlC75IbPP8g/0gWXDfM5LCK5DdAnrDX51GOqKcB/Ys23u31aqfqzCZX5KW98wctKBh9SzQbRSUba1a7GcULNZRXgIBj2cqhFhirXE5DA8fWN592vCxlqyF098iT4Lnpsf7PwZ3I4uiq1uQCTncr9Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539888; c=relaxed/simple; bh=e14D7TKpEvZf5OnwvIcuBGe61+yGxis+fUvADt/aWF8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=D/7BvTuhFbCY1yAzNZacVsCNDPA22cuHd02375sn+3YOkv/508pc7FLQN1/xNTaE6TFi3WPDvJkY0lBytVR2JcKMmyw5fBiQIpM35VPhYCMYV1oQFbmrBuVtONbwsMo6X0arIM1JUxXPlKopWbNlRkGStQcKX325FfaXWgSyaWI= 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=DkeoN7vB; 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="DkeoN7vB" Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7d6bc8d4535so81013639f.2 for ; Fri, 19 Apr 2024 08:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713539886; x=1714144686; 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=r1/gGz9kpYbLFaH+UuJD8Tkj5MFD/GFitlOxG2qqSIA=; b=DkeoN7vBIArbqwo5yn5aa+wB11wkFXPKDN6Wur1K2Zk0iJFcQ9jraGQgq1VPAMZAUd CGyu/2R4yY+pbEQnTJRMU/xRoTEzegwxL95PSzJNkhCjbf8PxR/O5gWP8XxHx3iYeuzV crV7IysD6L7iZ/SaQIvZbJ8ioinZ8XrHP2AZLR5RKrVlkt6F6PNf22f2atWsUit7JmNt V3AyEMuiL4M9Gc5jS22XWvANxPJG4bi20RU9ZasNXhaqz78a6FUHBBGE9wtyihno9bvg AW32otsPUocuv0AmvwojygcX5pOW3wackxw7lr6EV7AP9+YZBkLbYTNBbjHAamUBsJtS dpxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713539886; x=1714144686; 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=r1/gGz9kpYbLFaH+UuJD8Tkj5MFD/GFitlOxG2qqSIA=; b=g+vVRhktJBpCc9TMFM24TCrfgLFlswnk8bV0US1KCWrSalWoRMeZq83YbR8Ne6ddHt OcXy74b0UeS4KA67pIlQQTAeGVn2A1lKB/v7aP6i84vMb6L9IRMedEjOK4yLazYdGwe1 3hOiuq/VSir6H9i24+uReorqV5iBe37lnKKwrcqqLZRJG9lbvD19r/dmcsv5B9euawHh 8VE1VWIUaRF/zw9zuiRQnK4c4gGXmwzoASCbb30E9o4TT+WdHCXDmaIOQOBZYP5jz2LX V2O3PHIS1BVG8a5sazWKS2VzlSNxTbzVz9GrZYOWYCIlWoqBKWXt3TQRt/y+wij/0uTs 7LEg== X-Forwarded-Encrypted: i=1; AJvYcCU3nyBES9vyxCffqz+SfZ8iGdZoVl9BMFmAdvlHRdJDJh/7/T5zpDs/R09J65Wpi5UPVfFWfUUGIVYZtt3J9h3cyl/Zhb+UIEt7iOpDTg== X-Gm-Message-State: AOJu0YywGNLpFM1y0IWptffrd1KyYdOgGWf1e9E25y8C3yT84SZChPZV ZGuH6byRgDBjCUQRT3hThYPNqdjMolH/u3l1bvfxioqbKgi+lfxxl7PpYJfH0K0= X-Google-Smtp-Source: AGHT+IGmMBrA8dMR9MNSQF58KLAm84ynEVXwhg/TqwiDztGgWaBhEIIt+WXVFFaf50zLl0b9PEK4AA== X-Received: by 2002:a05:6602:4a86:b0:7da:1885:50b5 with SMTP id ej6-20020a0566024a8600b007da188550b5mr2631577iob.9.1713539886236; Fri, 19 Apr 2024 08:18:06 -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 lc8-20020a056638958800b00484e9c7014bsm116126jab.153.2024.04.19.08.18.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:18:05 -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 v2 2/8] net: ipa: only enable the SUSPEND IPA interrupt when needed Date: Fri, 19 Apr 2024 10:17:54 -0500 Message-Id: <20240419151800.2168903-3-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240419151800.2168903-1-elder@linaro.org> References: <20240419151800.2168903-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 18036e9cd161f..2ef640f9197c7 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 3a7049923c381..1a413061472d8 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 Fri Apr 19 15:17:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13636492 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 1C9A312FF74 for ; Fri, 19 Apr 2024 15:18:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539890; cv=none; b=UJMEjY9DXuvPZM6lsYaKz5owTV9eJr6ZuhcEAD/gjnq/GhEfuQ57ifOBxayHGu1ODOQDh7wtaUC0u3CuuNqSC3KGb2w9NvZO8KhGPLV5L0p34Y1QKwZTjj9vOwirHi/K/BGISQPHHhmUCT222xwaLIC5CbHBPz0sb/8WD3VTB2Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539890; c=relaxed/simple; bh=Q0E7FhXIRDhGAblpeieYVhQkwbjvfK6IuTNLIIQZVUY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EgJRVL31CVSD2RnVG9AwbffFjW0MnhoUs4liuQg+ozpLi1ItG9Q1Wu97idx4wYK44lKY2RGsWRAtBSl6iZ+5T4Er9M/v01GVwIP6TegtwEg6sJ533L7lnbFOq36TkJP/9wAY9QiBc5kSZcEVe3ZDBpbtI8rKGDyOxJr7cJciAWo= 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=zs4XPMpR; arc=none smtp.client-ip=209.85.166.41 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="zs4XPMpR" Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7d9f35fcd2eso85228539f.2 for ; Fri, 19 Apr 2024 08:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713539887; x=1714144687; 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=fHMnYNBF3duo4/+KlP8bC20trtUqzEZR9+R77ODU+ms=; b=zs4XPMpRES3TNyK+j9+QHQTgL+NJShzfWixar8oc/Nzf3mZ8uKQvG6E/kZEY4u4IOO IajvXiPrBbc8T6ituCkQjP0raFR7nD8GJ0vdpfZRo5eDfvgfInct1m/Usnbv9Yo89aCs ZGzBEhoPYlHdfw02udGGlJo2ETffqxAyHHqepWsQzmC6v4e9+Xi7pyK2BJ3ycoQ5m7Hh /TRlrYInI0DLXiTet/5NzEz931+/q44n464D35PW+JgPEmgUURP0K4CqKcoRJ7OQsFAG eVV7rueNix9HwHMXdS6NGraHLiMKB/kihBo1tNQNqKsAhbBCHhP59hIJJhLBvlDG2g7V yrSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713539887; x=1714144687; 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=fHMnYNBF3duo4/+KlP8bC20trtUqzEZR9+R77ODU+ms=; b=QUavGLzediud/VlEOUBuzIRupxnkaFB6QBcFtRzt4qCzXBCWjEOmYy2kivLw89ZoAA bW8kdsu2PFNKdKnyzOjTfEHknI4dXEDFu3DUQ6vefx222QM/94i5UTTdhrR42fmCsus9 r0tYKK2wh3h0Te+DfuEwkxsXEL4riflBDDj4TICgDxT2TfvP6OoplUR2m/kI6a/Q81NK 9NnF4HdLyA08DFmPcaiu1jAUQBE6KKLvG0TQBedLWvS2uD4OhDhDaVPbzVTEjN88kpyZ +M98u2BnF9RVvtqPCK8i4EotQEhfwGEHlMD8Je1hanba+uYqe+bWAWd50CvEPJD45aAy QFuA== X-Forwarded-Encrypted: i=1; AJvYcCX7fI35yOCMqnsV3yZy37zSo0yRgLuBB47k//dULfABFYmCd9Zq7Cjr551E7Jb7S5sMF1SzZJt3FZ6Oy6Zcj5nDWytCvvOn2v65wO+qjg== X-Gm-Message-State: AOJu0YxWWrmKXcElLkSpwLHpFQrdtN9l9vs79oxMUzzTQF0r2FElF5m3 478q+zIgxyrW4TBiPYweK8LKVv8gkQtytHfX782qCoD7JZte0vDXjoYX1vFvvuE= X-Google-Smtp-Source: AGHT+IF7GPcHIRyDVCOIwyo6NIzltkE/fTfp0QyP4PY6C2+tHxBzXNvbfCeSsFlZBX8lhUSM7W80YA== X-Received: by 2002:a05:6602:1d52:b0:7d9:6474:812e with SMTP id hi18-20020a0566021d5200b007d96474812emr3076780iob.2.1713539887321; Fri, 19 Apr 2024 08:18:07 -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 lc8-20020a056638958800b00484e9c7014bsm116126jab.153.2024.04.19.08.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:18:07 -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 v2 3/8] net: ipa: call device_init_wakeup() earlier Date: Fri, 19 Apr 2024 10:17:55 -0500 Message-Id: <20240419151800.2168903-4-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240419151800.2168903-1-elder@linaro.org> References: <20240419151800.2168903-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 2ef640f9197c7..245a069970556 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 6523878c0d7f6..b13a59f27106d 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -119,10 +119,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 @@ -169,8 +165,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; @@ -195,7 +189,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 1a413061472d8..65fd14da0f86f 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 3ffaa0687caa8..a83524a61c28b 100644 --- a/drivers/net/ipa/ipa_power.h +++ b/drivers/net/ipa/ipa_power.h @@ -31,20 +31,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 Fri Apr 19 15:17:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13636493 Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (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 3F1851304BD for ; Fri, 19 Apr 2024 15:18:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539891; cv=none; b=ukGMcH8o4mIpsusdNVl/C51EF4qWd3ARqZvoQrmgfM4LEJPXNfQ51ob1+G1PLammLIx6LGgrNYkc9Jy3usSlKqHSacTAIHoPUcQ3QSKT10tJ54FGb1d0qw7kqx8IsOvXqvU+L7TEUfnLqzLyVY8Hvza14m5lAWA2ot91JJCTp98= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539891; c=relaxed/simple; bh=oB096HyNcXkj+8OW4Cvuw9utWZDB5OfhuhFopOEo+XU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=neTWPzQaNL1A4XN+49Qp4DT7Ydd5sIK0D2dm6EtaivQV591RFpz49+cvIqJSnQhQd589Y+83AQZL9Y1jYCmWtAGIw55TJA9FhYTQoi7jxkt6S4+2cW3V5Kyav81CPLRJ5moJ+vwm5Sw+rFNhcDIeH36Y+vtT2k7L9xOfHVtDb98= 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=vcqrhD6B; arc=none smtp.client-ip=209.85.166.51 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="vcqrhD6B" Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7da3ec3e044so54826039f.2 for ; Fri, 19 Apr 2024 08:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713539888; x=1714144688; 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=KW+xodU0leEhVx50ESvAxH61dvrN0r6GXKBXbX3qcpk=; b=vcqrhD6BA9b8Mo1yqcCoBriSKlStkiODJW9Yv7YU5iOrVfSzs2+UgA8DAha7gNCTPG 9JQJIsnIZ4bDXO8tIfiZiR7hn6ZSFDgYAqxMzmli6KLgacE2kmysiPsmKxfMrWJTWZQz 0wWJViVjNclzFLS1DFEnwt0gHeZn3Vx0fXsGjfdpfCkSw+876bNI2XYZhgeGykFzv5ZM JV4vxpwQmbT2FQagAB2U0aDlEUm26ueB7vJXO4+suXwRP54OKUgd+mujj6/kLnmSJ01H hLx+1I7N7+w1+cRHDAeJMg676wgPCL+MqY1wW2VUjx1juskIVfrHx6pymiB422s8MwhB WMeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713539888; x=1714144688; 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=KW+xodU0leEhVx50ESvAxH61dvrN0r6GXKBXbX3qcpk=; b=nvQ8eXPAbsEuv4X6CS7OFn9q9bxP7/HHqOl/HmT7Urvul13Y2nJs87AFBjf7zqXPu2 FW9kPHelhjkGsXyAYOoqTd/SUy6YJCjMihcxkcJqOn629NO7bKr6T/JCzBDNyUUVxpzd vJxf6PYrlNoL/QF+uohJU33FtJn/pPC+so5cr11pirgMiRF12Dd0iPEf98sywWS5a1HF ku/riUcoosujQ4H6varntIS3kGQAsC58xngzH93bgDpcojiAufNmSseb13DHNfFBD4rz JDRzWZnyBM5G1ZRSHEiN1UXaEhWSvLI/oecmHr3gBDJ63hUwC5IMIwPsxX0T0fLMnBv5 taRg== X-Forwarded-Encrypted: i=1; AJvYcCVHUvRLZ8n5vbY805YC7I4wsJTNVs7tLIHaBG3alCDfOHvI4ds6ESzGWt3rGNUSlsap9+V9+mp4oz5c6zsS/6aAxEdvYTji5a+rOxnX3A== X-Gm-Message-State: AOJu0YwkITj8Td9I4JxyBcG5PT0oTtvoIfwStf30Lq0DzxMRkmKmMZPy uNxc75/jlOIidZqB/Ns6PNtTLUfHlS8BuPJjq96/wB2jmhXke0tXeWFXYPfjWfI= X-Google-Smtp-Source: AGHT+IG+dQS0s8hDk+7SovzXn0ZCvGbkZQQZ2v0B2TFNw4W36id+MfFXUHuGZlHqxwI/1RglHK6trw== X-Received: by 2002:a5d:8995:0:b0:7d0:d84d:9e13 with SMTP id m21-20020a5d8995000000b007d0d84d9e13mr2743043iol.19.1713539888393; Fri, 19 Apr 2024 08:18:08 -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 lc8-20020a056638958800b00484e9c7014bsm116126jab.153.2024.04.19.08.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:18:08 -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 v2 4/8] net: ipa: remove unneeded FILT_ROUT_HASH_EN definitions Date: Fri, 19 Apr 2024 10:17:56 -0500 Message-Id: <20240419151800.2168903-5-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240419151800.2168903-1-elder@linaro.org> References: <20240419151800.2168903-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 63a44dce88353..a891037015836 100644 --- a/drivers/net/ipa/reg/ipa_reg-v3.1.c +++ b/drivers/net/ipa/reg/ipa_reg-v3.1.c @@ -78,19 +78,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 */ @@ -405,7 +392,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 4a7b6d92207de..c81c48ec51f90 100644 --- a/drivers/net/ipa/reg/ipa_reg-v3.5.1.c +++ b/drivers/net/ipa/reg/ipa_reg-v3.5.1.c @@ -83,19 +83,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 */ @@ -416,7 +403,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 257eaff9436e5..18bddc32c9318 100644 --- a/drivers/net/ipa/reg/ipa_reg-v4.11.c +++ b/drivers/net/ipa/reg/ipa_reg-v4.11.c @@ -115,19 +115,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 */ @@ -472,7 +459,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 dc396344d868a..8494731efdd3b 100644 --- a/drivers/net/ipa/reg/ipa_reg-v4.5.c +++ b/drivers/net/ipa/reg/ipa_reg-v4.5.c @@ -109,19 +109,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 */ @@ -491,7 +478,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 37a2e466e4755..2c161cf691935 100644 --- a/drivers/net/ipa/reg/ipa_reg-v4.7.c +++ b/drivers/net/ipa/reg/ipa_reg-v4.7.c @@ -109,19 +109,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 */ @@ -464,7 +451,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 09755d700784e..fa6fd312e4867 100644 --- a/drivers/net/ipa/reg/ipa_reg-v4.9.c +++ b/drivers/net/ipa/reg/ipa_reg-v4.9.c @@ -114,19 +114,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 */ @@ -469,7 +456,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 Fri Apr 19 15:17:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13636494 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (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 68706130AEF for ; Fri, 19 Apr 2024 15:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539892; cv=none; b=pxPmAov7t8j9kQzhdAFo23njJ08QrTCH413Gh165Z4vQGg9XBI3Q+067y9lC5q8xsL/OpbInOm2gt6dIuDR3NeUzV+kuXg2KecIiTjeSOOTB8reDnwTrVzx3nrMy0P2sbslq6c3Q7LOsN8wvjBDtrDazWcGE4RzMI2mzGRgPa20= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539892; c=relaxed/simple; bh=mgG51iYBDDFdQeIEUv5d3iCvX4AlEHh4+4ja42oAgYE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZvE3Wl181O4wX98Wjw/93bfw+0wpIe4J5A/JaefoJ7MlRnzsBF29nFE24O0LxHkdPmSWH/VYVBfeD3t9leDxqAmLPJRhXbSDEmjW0h4s1FB579wTTyriLANrb9t24sQC/KjSbLCENYhCFlCboTeiOa4wGtL3ot2MqXn02rDWnP0= 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=zm2w4PNo; arc=none smtp.client-ip=209.85.166.46 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="zm2w4PNo" Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7d622edf790so80338939f.1 for ; Fri, 19 Apr 2024 08:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713539889; x=1714144689; 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=BfCN4tlBj+RpqK9tOiyo6f0tvsgy7nTKe81fkNY9Se8=; b=zm2w4PNooR42TiMCwEYKQTbZj8yz0Mc7TI2DTm+6HzdKP5CcQ2tO85RyJ7FxXC6g5a ZCcKfcJc+Oz8P2zuuxf3Fj7IEYzwoDMLeROw9dGUHr2HpVKH/P/vCi1R1CkqrwRldIoE lB33OXq2P2DYGeCZr2tpqqr9coyNY84J7WohWXTgFsH8gw7HvSpwPnBMYM3VcfaaHkuJ uQP2iFDNDtIb4/nAKl6yH3GGVoA+/TfV0fh1KginmlVCsyhX3DFaSOnInxnmYvoL0iRP 9gdaiaqyDkqiGXy9lNFSTq4VASSuKGkmo6i0rPuk6ulUs01bRB4582b9lVCLf93bXdLD 1CTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713539889; x=1714144689; 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=BfCN4tlBj+RpqK9tOiyo6f0tvsgy7nTKe81fkNY9Se8=; b=FMt6A6AmnlS1G7WUOIbRgM1sDOpP6F5OD1Ya1WplFjkxwO9gUuQvBfwecwY952vfg4 GzsdEMYpvP3FQWUAskaGMbKndvmzzfMJEBst0XVHJJa+0/1AEeQSbhw6bUN09XlYNmXw +PRpJftTWuf1qzmxxoERVbrafj7Z49nog1imXmr/d5vJ0LedeQM3fJa5Sh5kmWyRvh9s r22UQzPj2KF7Nm42+QJyJb8lGF/z64I2ouUfMBNerXsLVccA+eUq0oG/zCKf77G4p72e qEakB9Ezq3ERFQNHytmF6J4JyzWQpUegcUXEqMqE6oQCtWkLBZ+Z4zgC5q7aPi6SlNfr hXng== X-Forwarded-Encrypted: i=1; AJvYcCUcfxNhKBST5t7AzPzFVZk7ReeWi+QR4h8iBY7gC8cYbabUzq+ZP6t5Yd36go4mxcsOIvjT0ulHmuT9lbBLCfjDjP2A+4Cfkjc8z0FYQQ== X-Gm-Message-State: AOJu0YzZyNB0ONJMWNzhx+InD7hG9DBkD7GB3o36qUjc4Jd+SqtN5p6M fcvLLCp2PlPdRrBzzUg45JJAh3E12bZIUdctXnKbQm4kiDivqzpebJ6xvp+W5qU= X-Google-Smtp-Source: AGHT+IFzvpR/FxtDaUoycVyCQ0DALrphK+JAM+rF9e/T3ecb+xze3a7ALLi+77hxZ7f3BlMDFxC8Rw== X-Received: by 2002:a5e:9910:0:b0:7d5:df5e:506 with SMTP id t16-20020a5e9910000000b007d5df5e0506mr2970977ioj.9.1713539889593; Fri, 19 Apr 2024 08:18:09 -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 lc8-20020a056638958800b00484e9c7014bsm116126jab.153.2024.04.19.08.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:18:09 -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 v2 5/8] net: ipa: make ipa_table_hash_support() a real function Date: Fri, 19 Apr 2024 10:17:57 -0500 Message-Id: <20240419151800.2168903-6-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240419151800.2168903-1-elder@linaro.org> References: <20240419151800.2168903-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 45eb24be78a2e..4e4a3f8aa8e84 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 @@ -158,6 +158,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 Fri Apr 19 15:17:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13636495 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (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 97BF0131188 for ; Fri, 19 Apr 2024 15:18:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539893; cv=none; b=YFB+3ZVNKz1W5TsPdJfJCT5OeEvZtZuuMEdZPKtStYiZtN/DG652XCHli6FTESxVf7hDcLKXImq03xz1AE+vmRtz/DTc/Zkx2aDTnYAqzn2yMxQrvcIuihz+knBar+XpPwc94Rx7tjwHYoW/ltoWZLqOSO7MJpUqpsAV8t4YJ+o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539893; c=relaxed/simple; bh=erv4VXroO0M21slKGUyDFXCqBxmjZSFL8Sl5lqDo4rY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IBKEtJbT0lZAKCSZDB22/7099sOo6Z1RICPwWcGX25/wG7WDgKE+nBYMdM80o6JL21yTlNSAqb2Xah6cJJ4eF/+gU4q2WRziyte9wWKIyImjuiA3TJOehkgny7nSZVtLPxOpbe3ixzCeHGJbdlfjxLa+UnW3zMyBqV87QGbHcVw= 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=kl1XPb4v; arc=none smtp.client-ip=209.85.166.46 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="kl1XPb4v" Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7da382f57a5so63518039f.1 for ; Fri, 19 Apr 2024 08:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713539891; x=1714144691; 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=lwnKPG2Aybimx/N3MD6w+czRD9+BNJvZbpMTIj3AUuA=; b=kl1XPb4vePOvoPx1YiVC+9UC8u+4l4xrn6Sx5P1ftQO0m5EEojo9VrGyRKIsEFgUvh 4JcPSsgto1PdAFu9Uh/Q+FBTLgkYj57op+6b6FnRKuah/uqrDBQL9AQJJ8SjX9M+P2i5 u2gXoCDixfRrjDCEei0VU1+D2Mmgdmy1bD5Am9qI2j9htoEvWTcmpbTiI14xoFoJ2suY DxJIYD1GI5I8/ODdJQJFfWo9WCu7gCijYqErXZ4nG/s3dmRVbCy1Jzw5ACoMpp6l7tfN rnU2yyd0ZbMU3kYygaETXuOr/HR5qfRdAmWQtEHCcSm+vFDPC1On3UpvnSl4wZv9Bevo sKZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713539891; x=1714144691; 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=lwnKPG2Aybimx/N3MD6w+czRD9+BNJvZbpMTIj3AUuA=; b=Scrymqz6nemlFlN/iNLrT5MEeDV1ryrAH5mbNSqVI7ROeB8nhF2SsH2IFXD+K8blfz j6+b8ytzy/ph4ioD7vVHasH7dQ56FYpAR4Dg0sNRucyRyErt0FVP/ytWLy5MIWZ/4oVZ Ei6VZ6nYPVJdHn9M28nocMznnebc4PAQAhMweDju7INaYifH1quwKD40NFfOWxpFRiOO iAaijL7BEbSyh0vMFg57frDbBpzSuBCthTdTKcJ9Kgs4szs3rg99Ni/Gdh1IxmwudfvX VvjiHkjX7jNiN7E87PSyL9v5g3qNIWubW1CQiAmBk7csSbSkscYLBXjjUjBjB8teNs6q AFrg== X-Forwarded-Encrypted: i=1; AJvYcCU8nTrm0ZpD1fhV4HBIgrVJ+bYtz4B30aFlQBdCLn51M7ZFMh+zGAPzBYwpbexIawrKsxAiGZA4cFQs0M4sq8umOolKeCH/9E1IjNNVOA== X-Gm-Message-State: AOJu0YznWNgpAtyxHzd8tEm3fpMRKNzMz07b1MqolLpslCwOVoJiqiyC r9yBnkz6mQ++wJqmvsszfT4tN+SOQD0Zah/L4MsXOUNYv9VP97xVa44GH+ENnXk= X-Google-Smtp-Source: AGHT+IE9uu6ak6BSrNZjfqIaY8j4SEnqF00T+KY3FChxz87UgQ+A6nXOPiLVnowpl6k8ZRP6dhGsAQ== X-Received: by 2002:a6b:6c0e:0:b0:7d5:d60b:c425 with SMTP id a14-20020a6b6c0e000000b007d5d60bc425mr2679541ioh.19.1713539890773; Fri, 19 Apr 2024 08:18:10 -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 lc8-20020a056638958800b00484e9c7014bsm116126jab.153.2024.04.19.08.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:18:10 -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 v2 6/8] net: ipa: fix two bogus argument names Date: Fri, 19 Apr 2024 10:17:58 -0500 Message-Id: <20240419151800.2168903-7-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240419151800.2168903-1-elder@linaro.org> References: <20240419151800.2168903-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 328b90dfd1695..e7d8ae6c6f6a6 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 Fri Apr 19 15:17:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13636496 Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (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 A76D5131BBE for ; Fri, 19 Apr 2024 15:18:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539894; cv=none; b=DqII0fhjLZRxJcCQ27ZpuKmv/F7T4NlfkcYvj3yDwCmS4+zmU23L6sZK6SefXJZAdKh0AFSgSqJl+wfhR27978FLw2he+w7Ljr5azr9XWP/Qgdn2ZnYRpTV9S92Kmuas5+RU6fkzU/Ed7dlFEN/c6io3a9gQlYVsrJm2PqbQTYY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539894; c=relaxed/simple; bh=29UQTRms78NT9PmEmVPmwD7BlBFzDdceaYcGgV2Ra8M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CJVMsSH6Pt7t/lNwovpdtLafxTDadMTk3aODiC0+eMAXLTpUm6ZmOge6AGvsbCjSlw741ep8YxXP9/AXiQCV4UzHw6N3ASryzJ9x5jSHDVDMM3n+ubTDaIwduZ5jBaUYkfyoELNWUsKyRjR8uGU/X9DbLFeqXabAzh2R2Tk39d0= 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=JY2mHB5c; arc=none smtp.client-ip=209.85.166.50 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="JY2mHB5c" Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-7d65e76c9b9so84776539f.0 for ; Fri, 19 Apr 2024 08:18:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713539892; x=1714144692; 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=RNVrYLH0wb76uVIxxR6dH2jv6p++X/8Jk5CCf1uTdzw=; b=JY2mHB5ceKbhrSDbuj1c+3GB1u3p/0i4hG7ILO46BaeJvwf8F63OVdNCvby5/s6Z2K 5mDIwS3AIlJkDhldG8cq1ugu/ADL+pMtuqTLHfUvDv0xkGZvRZCGFGXjcJ3bDjPL7g7a TFadgwnc2JidoRAmpr0KFV7NsLQe229vBYKXMdyFLSvjsj5oj0tiWDFTA9KMGmmJRqK3 4WganPDT0AI0Y+wSi2+nBbuBzksDfs3+oOZW7kENk0KaOmGPxpdkuScpJLko4je/hUAP xERZRC0zBM/PplXQhpmR5ucFTXl3xFO6DK3F5dDSeUTqpuVxi5EBizTCBLyCA2Hi23M1 OsUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713539892; x=1714144692; 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=RNVrYLH0wb76uVIxxR6dH2jv6p++X/8Jk5CCf1uTdzw=; b=hE2TPZqBu5RY5nxtUqr+LaYt5BJt8iaglt9cigYfDebwqumdKvpTWKV58LuBP7/CpN LPLkvaqtQ0qsT3IKbTFd4g8AYa2eU3WEkxdyQmpIk3NgPIXim5j6Y3RMv8BH6eVvW8mJ ujWJQVzVK7BcJK0Udj53ZhfPJwYXo6Exsc1eJK7OTejPycsO+egdsKe8qkv2TzmVdwoi 9ShSgzf5CzKu7yQOZsyyMduuYc/UXfjAphlunf8x3lTZ5d2M5QSgSqp7OqoIY9MxImAH ixMIjXriCFRTH3QjkPRKo0GKmBpefYdvGS0VqSeAtzA2Wh5SLrArFRaSjC4Eou39Js9g ZSxw== X-Forwarded-Encrypted: i=1; AJvYcCVRy3KGVdz6/pxAg5Vvv3cULI8QsGRhH2ogxadhcB6nd91T0QpSeDpYJwEjDoTMLITTbH6QaNQnaPrzJK694uI1jxfibGZpzvhaS/VboQ== X-Gm-Message-State: AOJu0YyLSWK0uLTcoHQAiJOw/FBtXu6LQsD3lCoeUtUee5ebMUC+lmJF IdP5wUN6JiH8b1QpsjQwUey0Gdy0nustdObvF5yOS24d67tkBK0OwfVu/ZPFvoU= X-Google-Smtp-Source: AGHT+IFigKq8yuqDrNndjHBMbYyQIQ1Pnj1JL8I9PBudmiqEMtVw+in69/DdYxB8/vTe9aRyxy+MRg== X-Received: by 2002:a5d:8995:0:b0:7d0:d84d:9e13 with SMTP id m21-20020a5d8995000000b007d0d84d9e13mr2743219iol.19.1713539891870; Fri, 19 Apr 2024 08:18:11 -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 lc8-20020a056638958800b00484e9c7014bsm116126jab.153.2024.04.19.08.18.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:18:11 -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 v2 7/8] net: ipa: fix two minor ipa_cmd problems Date: Fri, 19 Apr 2024 10:17:59 -0500 Message-Id: <20240419151800.2168903-8-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240419151800.2168903-1-elder@linaro.org> References: <20240419151800.2168903-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 5824bb131ebab..2077fdbade99c 100644 --- a/drivers/net/ipa/ipa_cmd.h +++ b/drivers/net/ipa/ipa_cmd.h @@ -53,14 +53,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 b13a59f27106d..6a0fec873cddf 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -865,6 +865,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 Fri Apr 19 15:18:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13636497 Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (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 B4B231327E4 for ; Fri, 19 Apr 2024 15:18:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539895; cv=none; b=Wuceh/poT8J504DW2O9o4RFKaew7MPDSfjzE57i6HMDHNpfxPF3TQ6isXMs/iGfVrdobfxXlIhpUN9iSrXkp1zZiFzVGW+J654Qib6ZLvgjy40cSGMmdFZwOz6498AFrIJqF8uvpgH9LvuP3n7hxm24f2vtMlsIGs0o/NKy8m+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539895; c=relaxed/simple; bh=YisC0o7NBuOn0cgVONhypNsd+DSyG4nGqdGcgmtrUzg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CMUtI0KL0caW1GUjAy0+V+cect40CyAK5oRvDCAMbABLeN1FppiTL44ShhODW9a1X7uZSb9USr4BLfEtVuqpiJJLlJw4PWtjSiTEx6FmNsz/q4eAmZUbRoZEqu6mTmHS8zgnEFtnMY24LWJxm3gqyZ9tFIug9IMtHus6JPuqi9E= 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=eOZPd+Qg; arc=none smtp.client-ip=209.85.166.47 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="eOZPd+Qg" Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7c7f3f66d17so80492339f.0 for ; Fri, 19 Apr 2024 08:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713539893; x=1714144693; 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=ki95sU34hn/iZbtQLEcQxjo1Z3fzAhmDa03BSf1KS14=; b=eOZPd+Qg1J/5Xy29wNO8G1/cwD83KSjW2rlMZWrxrQ9wZwqVkoGZdMV8YMv+jwgVMK Z+YVJCezkZFHwEro5l8ICB99ad9uyawFZas60BZoRn15K5okbzBL87yUdsr9ZFKAVoRd 5W8Jq8D3PXVkkoFMfGPmASwgzQyueXCapRDL+M3IvOE0xwW4HgRr7BRk59vU73Z9bF7c 2iWt7v5zysi+n55HFhLwThgt0vrQqQ1/fsJKRRgVtY7QvNzv5CE4JvdkfwmorGHN1WPQ BswRgxHdUpBA5hOpJWdE+DZcUPAvT7g8xQZumWu/UAvKg2qvRAbjEmf34G/QhkYoYC96 wJXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713539893; x=1714144693; 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=ki95sU34hn/iZbtQLEcQxjo1Z3fzAhmDa03BSf1KS14=; b=wtnS3F3+pYzPrSGgY3w38xL3T1SPEPgrh/8/kb4zZ8fjnt8aHz4GLZKe6GT81mUoAv iXJg9JUMegETQBLKLef0CwiZ3OuP8mIlma56tbhl4umitcY7UusjAlEJCFwNgz3JTY0h ePLZfY2jozSw5rUjFA7+Koe0QhqEN4YJuPHCovCepQRHVR+ueOUZikCo8JFrVSyH1ezR fKDOhZTppCSj/6tUDzO/OYos8nLoBmT72ftIeUhz98i9kShANCuCmi1hWbEriK2S20Zh eaRtm/ZCcN8vIBNANlni5dnKV2xdAuH3z4lwWkRqufuGmu2oI6CN+LPtWHcPt2eFwM3z e2mA== X-Forwarded-Encrypted: i=1; AJvYcCWPMUSuwMWXBF/qtoaZf/+TvoQEUGy46pULobogQ6MEL8HjTL6ivJn28QiauFM/f32j4YbgnoMfxZS/AYC2t2moY4ML83Ep3PUVnasCXA== X-Gm-Message-State: AOJu0YwN9xowDkPuRROVcSt3CSvUvOXB56yFztl+xYyegqndhDbV8puK l0439UPyuq+MrcBCmo671bpanVl1PIL7JMi5z3flAv8AkLDinrBRZHnb7bSjZHNqUMwWBLyCv03 1 X-Google-Smtp-Source: AGHT+IELxfc7N5E6oEEqqJYaRLhd0NyK8sD8JOzWpxuh38rFalVcKuxOZJ5AihG+/A9vUu1KqCtQpw== X-Received: by 2002:a5e:8302:0:b0:7da:3757:8c3e with SMTP id x2-20020a5e8302000000b007da37578c3emr3384592iom.15.1713539893004; Fri, 19 Apr 2024 08:18:13 -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 lc8-20020a056638958800b00484e9c7014bsm116126jab.153.2024.04.19.08.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:18:12 -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 v2 8/8] net: ipa: kill ipa_version_supported() Date: Fri, 19 Apr 2024 10:18:00 -0500 Message-Id: <20240419151800.2168903-9-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240419151800.2168903-1-elder@linaro.org> References: <20240419151800.2168903-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 6a0fec873cddf..5f3dd5a2dcf46 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -810,11 +810,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 156388e90a141..38c47f51a50c9 100644 --- a/drivers/net/ipa/ipa_version.h +++ b/drivers/net/ipa/ipa_version.h @@ -47,24 +47,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,