From patchwork Mon May 4 23:37:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1283129 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=a5y9l0J3; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49GK5m5dywz9sSs for ; Tue, 5 May 2020 09:37:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728369AbgEDXhZ (ORCPT ); Mon, 4 May 2020 19:37:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728192AbgEDXhV (ORCPT ); Mon, 4 May 2020 19:37:21 -0400 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91500C061A0E for ; Mon, 4 May 2020 16:37:20 -0700 (PDT) Received: by mail-qt1-x842.google.com with SMTP id l18so582004qtp.0 for ; Mon, 04 May 2020 16:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J11alJGda5HaqAUxfI/cdtT9wkZmopm5cF4QPolHp/c=; b=a5y9l0J3zaR2uSZcvyFzfQZKffiPpM6RMnsj8/sZhMqDK6pgE9026ML3pIjHZq584Q 6FlW7TWaxp1uc9NQGjfDVNA6PiG7zj3WZ6O2oj6BAl41IHF8QP+UWCmQhGjCtcaezfuV tZEFV2AN+gjtbxD41DDPdVJ5aSmPobkAP9V/XB7mJO06oy/y3H7SWewrX4qtcCWmSzYs KW66XBNj1rGvDjOfYhgdYUHi+kUYQqLzIRYga2cKlh4N0Rtr1E9RMFr9t7iBi7B7hpXl HA8rZfCRVH1qeSz2BINcXt7gNIQj6jgvc2ISokr0WdCJY8LChZVSwB6uvETjWAvpru3Z gulw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J11alJGda5HaqAUxfI/cdtT9wkZmopm5cF4QPolHp/c=; b=UOSHS0+Bpo+rrf6KnqJbCWGhAR22OaZNJ4RzN7Rkq/OqNVFzlfGCHcN811QwjIx5PR uClhnUwx0KDDkEg3/2Y7LFX5pbyiil49/md2DTX7bf1x82J3hI6tCfHl3Vnf3XnVXRIU FwzhJgff0zhjL/Iqtejy+BuEinRyu2zuTiSJClxhWFPE5MLWlN5vGcIzFM7E/rUyePhE sfScd/Vixxqj18nAZpnqrteOlicVAka9YgrjWkSiy3qzcrEAT/R8ssfLqrOq5FZ2NjOt jgTcCEa20y9To1JRAW55e3/U7nGQYmUA38EU+i0W17oo87pibPar9RjBg0tFbQLyrIZb McnA== X-Gm-Message-State: AGi0PuYOqyd/q6/lonAathOQApM2gqg8WlkEbWw/sgCm18e8WWkdVM37 xAnSnXECFM0rYMryhZuyHcZeDw== X-Google-Smtp-Source: APiQypLhwk6BWUyml3LuTvS3m1RTo8mByAb6bzwhBhE/9FMy8E00f1S2PfWWFO6KS9Otk0PZjnanBw== X-Received: by 2002:ac8:65d4:: with SMTP id t20mr26926qto.358.1588635439718; Mon, 04 May 2020 16:37:19 -0700 (PDT) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id x125sm494311qke.34.2020.05.04.16.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 16:37:19 -0700 (PDT) From: Alex Elder To: davem@davemloft.net Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/3] net: ipa: have ipa_endpoint_init_ctrl() return previous state Date: Mon, 4 May 2020 18:37:11 -0500 Message-Id: <20200504233713.16954-2-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200504233713.16954-1-elder@linaro.org> References: <20200504233713.16954-1-elder@linaro.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Change ipa_endpoint_init_ctrl() so it returns the previous state (whether suspend or delay mode was enabled) rather than indicating whether the request caused a change in state. This makes it easier to understand what's happening where called. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 6de03be28784..ad72adff653e 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -284,11 +284,12 @@ static struct gsi_trans *ipa_endpoint_trans_alloc(struct ipa_endpoint *endpoint, /* suspend_delay represents suspend for RX, delay for TX endpoints. * Note that suspend is not supported starting with IPA v4.0. */ -static int +static bool ipa_endpoint_init_ctrl(struct ipa_endpoint *endpoint, bool suspend_delay) { u32 offset = IPA_REG_ENDP_INIT_CTRL_N_OFFSET(endpoint->endpoint_id); struct ipa *ipa = endpoint->ipa; + bool state; u32 mask; u32 val; @@ -296,13 +297,14 @@ ipa_endpoint_init_ctrl(struct ipa_endpoint *endpoint, bool suspend_delay) mask = endpoint->toward_ipa ? ENDP_DELAY_FMASK : ENDP_SUSPEND_FMASK; val = ioread32(ipa->reg_virt + offset); - if (suspend_delay == !!(val & mask)) - return -EALREADY; /* Already set to desired state */ + /* Don't bother if it's already in the requested state */ + state = !!(val & mask); + if (suspend_delay != state) { + val ^= mask; + iowrite32(val, ipa->reg_virt + offset); + } - val ^= mask; - iowrite32(val, ipa->reg_virt + offset); - - return 0; + return state; } /* Enable or disable delay or suspend mode on all modem endpoints */ @@ -1164,8 +1166,7 @@ static int ipa_endpoint_reset_rx_aggr(struct ipa_endpoint *endpoint) /* Make sure the channel isn't suspended */ if (endpoint->ipa->version == IPA_VERSION_3_5_1) - if (!ipa_endpoint_init_ctrl(endpoint, false)) - endpoint_suspended = true; + endpoint_suspended = ipa_endpoint_init_ctrl(endpoint, false); /* Start channel and do a 1 byte read */ ret = gsi_channel_start(gsi, endpoint->channel_id); @@ -1318,21 +1319,20 @@ static void ipa_endpoint_program(struct ipa_endpoint *endpoint) if (endpoint->toward_ipa) { bool delay_mode = endpoint->data->tx.delay; - ret = ipa_endpoint_init_ctrl(endpoint, delay_mode); /* Endpoint is expected to not be in delay mode */ - if (!ret != delay_mode) { + if (ipa_endpoint_init_ctrl(endpoint, delay_mode)) dev_warn(dev, "TX endpoint %u was %sin delay mode\n", endpoint->endpoint_id, delay_mode ? "already " : ""); - } ipa_endpoint_init_hdr_ext(endpoint); ipa_endpoint_init_aggr(endpoint); ipa_endpoint_init_deaggr(endpoint); ipa_endpoint_init_seq(endpoint); } else { + /* Endpoint is expected to not be suspended */ if (endpoint->ipa->version == IPA_VERSION_3_5_1) { - if (!ipa_endpoint_init_ctrl(endpoint, false)) + if (ipa_endpoint_init_ctrl(endpoint, false)) dev_warn(dev, "RX endpoint %u was suspended\n", endpoint->endpoint_id); @@ -1471,7 +1471,7 @@ void ipa_endpoint_resume_one(struct ipa_endpoint *endpoint) /* IPA v3.5.1 doesn't use channel start for resume */ start_channel = endpoint->ipa->version != IPA_VERSION_3_5_1; if (!endpoint->toward_ipa && !start_channel) - WARN_ON(ipa_endpoint_init_ctrl(endpoint, false)); + WARN_ON(!ipa_endpoint_init_ctrl(endpoint, false)); ret = gsi_channel_resume(gsi, endpoint->channel_id, start_channel); if (ret) From patchwork Mon May 4 23:37:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1283128 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=E12Zl5rs; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49GK5g49RWz9sSs for ; Tue, 5 May 2020 09:37:27 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728387AbgEDXh0 (ORCPT ); Mon, 4 May 2020 19:37:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728336AbgEDXhW (ORCPT ); Mon, 4 May 2020 19:37:22 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7715EC061A41 for ; Mon, 4 May 2020 16:37:22 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id k12so562077qtm.4 for ; Mon, 04 May 2020 16:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+SVKEsIIeMIoq0nGWFOrPILES0nl3fNBl6idp0P/1Ps=; b=E12Zl5rs1mRKdlFDSASU1tgCY+SeIsOLtN7ovHj47a+ZyyGQIF66PyT0qFDSgakdvp 7k2Jd1MzK0s6JWerc6Ddu8x5QMo5Ldt1mItM7t1sI8Vhzdj2iLqKjD7qu8BsizJTjgRf N50yS8cDquc7OFGFpc4MhgfIRd+4m5XEMrMkv+cu1wbloUNEQ1yixeV8mn1+i2LBbLTP hXQIanuyvhqXHOgRGEEEaFwQjcWpjGoy1VYDO7kDXMPjSlXHO5fPtpCvzaQeiyPBk6ET widFwsXxvWSjbOFTL43UcTKdec7dPizHXs2a6YVK2p0ELrpMRBJ1M9zHAQNLC1Y6snBh Zk3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+SVKEsIIeMIoq0nGWFOrPILES0nl3fNBl6idp0P/1Ps=; b=W22l00D3ieOtoEtXZ9WRDGl1fD6tliIoqkwMyyaVgMDYCVQ9o2kORJ90PjvVHEiqPg Ib0P88zLumc2pkcIiltGnJHqQMm8n404WZFZPLErP1Uud7LnqR0S+MY7V+X1bGZjV9gj DyLfxFrBohxieEQxZnsg4O9KrxHuNFXpPlkB+/+GJa0aTeD8fdBnDzxjEJtIOhpIDwFj wUKzAeWPHElf+Cv6YMLXeY4GvoAuClPWx5MCsbuTAIb5u3Np7K8f5QnPnzfgg00GjdmH R/gPCA+K10W17XLzLO3F2QbC8EKeFQvniww8ue+mtt02624Fvg9w34/P6pafYjcgNOiY ySjw== X-Gm-Message-State: AGi0PuZGbgXe0TmSOlOUnOkpvcpyRQg6jLZzwFue3JYAsjmHiGO1sJ/L MpocEU0bR0wRw6zxRIp7aCGPDg== X-Google-Smtp-Source: APiQypJnW5ZwyFqr8n/awhxvGwG8XA52esUciJmhc+bO1jvWdIgr8hDfe2WTyJoPS28OP5JvaLXT6A== X-Received: by 2002:ac8:a02:: with SMTP id b2mr1870qti.95.1588635441007; Mon, 04 May 2020 16:37:21 -0700 (PDT) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id x125sm494311qke.34.2020.05.04.16.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 16:37:20 -0700 (PDT) From: Alex Elder To: davem@davemloft.net Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/3] net: ipa: introduce ipa_endpoint_program_suspend() Date: Mon, 4 May 2020 18:37:12 -0500 Message-Id: <20200504233713.16954-3-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200504233713.16954-1-elder@linaro.org> References: <20200504233713.16954-1-elder@linaro.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Create a new helper function that encapsulates enabling or disabling suspend on an RX endpoint. It returns the previous state of the endpoint (true means suspend mode was enabled). Create another function that handles enabling or disabling delay mode on a TX endpoint. Delay mode does not work correctly on IPA version 4.2, so we don't currently use it (and shouldn't). We only set delay mode in one case, and although we don't expect an endpoint to already be in delay mode, it doesn't really matter if it was. So the delay function doesn't return a value. Stop issuing warnings if the previous suspend or delay mode state differs from what is expected. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.c | 67 +++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index ad72adff653e..a830101b8edb 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -293,7 +293,14 @@ ipa_endpoint_init_ctrl(struct ipa_endpoint *endpoint, bool suspend_delay) u32 mask; u32 val; - /* assert(ipa->version == IPA_VERSION_3_5_1 */ + /* Suspend is not supported for IPA v4.0+. Delay doesn't work + * correctly on IPA v4.2. + * + * if (endpoint->toward_ipa) + * assert(ipa->version != IPA_VERSION_4.2); + * else + * assert(ipa->version == IPA_VERSION_3_5_1); + */ mask = endpoint->toward_ipa ? ENDP_DELAY_FMASK : ENDP_SUSPEND_FMASK; val = ioread32(ipa->reg_virt + offset); @@ -307,13 +314,31 @@ ipa_endpoint_init_ctrl(struct ipa_endpoint *endpoint, bool suspend_delay) return state; } +/* We currently don't care what the previous state was for delay mode */ +static void +ipa_endpoint_program_delay(struct ipa_endpoint *endpoint, bool enable) +{ + /* assert(endpoint->toward_ipa); */ + + (void)ipa_endpoint_init_ctrl(endpoint, enable); +} + +/* Returns previous suspend state (true means it was enabled) */ +static bool +ipa_endpoint_program_suspend(struct ipa_endpoint *endpoint, bool enable) +{ + /* assert(!endpoint->toward_ipa); */ + + return ipa_endpoint_init_ctrl(endpoint, enable); +} + /* Enable or disable delay or suspend mode on all modem endpoints */ void ipa_endpoint_modem_pause_all(struct ipa *ipa, bool enable) { bool support_suspend; u32 endpoint_id; - /* DELAY mode doesn't work right on IPA v4.2 */ + /* DELAY mode doesn't work correctly on IPA v4.2 */ if (ipa->version == IPA_VERSION_4_2) return; @@ -327,8 +352,10 @@ void ipa_endpoint_modem_pause_all(struct ipa *ipa, bool enable) continue; /* Set TX delay mode, or for IPA v3.5.1 RX suspend mode */ - if (endpoint->toward_ipa || support_suspend) - (void)ipa_endpoint_init_ctrl(endpoint, enable); + if (endpoint->toward_ipa) + ipa_endpoint_program_delay(endpoint, enable); + else if (support_suspend) + (void)ipa_endpoint_program_suspend(endpoint, enable); } } @@ -1135,8 +1162,8 @@ static int ipa_endpoint_reset_rx_aggr(struct ipa_endpoint *endpoint) { struct device *dev = &endpoint->ipa->pdev->dev; struct ipa *ipa = endpoint->ipa; - bool endpoint_suspended = false; struct gsi *gsi = &ipa->gsi; + bool suspended = false; dma_addr_t addr; bool db_enable; u32 retries; @@ -1166,7 +1193,7 @@ static int ipa_endpoint_reset_rx_aggr(struct ipa_endpoint *endpoint) /* Make sure the channel isn't suspended */ if (endpoint->ipa->version == IPA_VERSION_3_5_1) - endpoint_suspended = ipa_endpoint_init_ctrl(endpoint, false); + suspended = ipa_endpoint_program_suspend(endpoint, false); /* Start channel and do a 1 byte read */ ret = gsi_channel_start(gsi, endpoint->channel_id); @@ -1211,8 +1238,8 @@ static int ipa_endpoint_reset_rx_aggr(struct ipa_endpoint *endpoint) err_endpoint_stop: ipa_endpoint_stop(endpoint); out_suspend_again: - if (endpoint_suspended) - (void)ipa_endpoint_init_ctrl(endpoint, true); + if (suspended) + (void)ipa_endpoint_program_suspend(endpoint, true); dma_unmap_single(dev, addr, len, DMA_FROM_DEVICE); out_kfree: kfree(virt); @@ -1313,30 +1340,18 @@ int ipa_endpoint_stop(struct ipa_endpoint *endpoint) static void ipa_endpoint_program(struct ipa_endpoint *endpoint) { - struct device *dev = &endpoint->ipa->pdev->dev; - int ret; - if (endpoint->toward_ipa) { bool delay_mode = endpoint->data->tx.delay; - /* Endpoint is expected to not be in delay mode */ - if (ipa_endpoint_init_ctrl(endpoint, delay_mode)) - dev_warn(dev, - "TX endpoint %u was %sin delay mode\n", - endpoint->endpoint_id, - delay_mode ? "already " : ""); + if (endpoint->ipa->version != IPA_VERSION_4_2) + ipa_endpoint_program_delay(endpoint, delay_mode); ipa_endpoint_init_hdr_ext(endpoint); ipa_endpoint_init_aggr(endpoint); ipa_endpoint_init_deaggr(endpoint); ipa_endpoint_init_seq(endpoint); } else { - /* Endpoint is expected to not be suspended */ - if (endpoint->ipa->version == IPA_VERSION_3_5_1) { - if (ipa_endpoint_init_ctrl(endpoint, false)) - dev_warn(dev, - "RX endpoint %u was suspended\n", - endpoint->endpoint_id); - } + if (endpoint->ipa->version == IPA_VERSION_3_5_1) + (void)ipa_endpoint_program_suspend(endpoint, false); ipa_endpoint_init_hdr_ext(endpoint); ipa_endpoint_init_aggr(endpoint); } @@ -1448,7 +1463,7 @@ void ipa_endpoint_suspend_one(struct ipa_endpoint *endpoint) * aggregation frame, then simulating the arrival of such * an interrupt. */ - WARN_ON(ipa_endpoint_init_ctrl(endpoint, true)); + (void)ipa_endpoint_program_suspend(endpoint, true); ipa_endpoint_suspend_aggr(endpoint); } @@ -1471,7 +1486,7 @@ void ipa_endpoint_resume_one(struct ipa_endpoint *endpoint) /* IPA v3.5.1 doesn't use channel start for resume */ start_channel = endpoint->ipa->version != IPA_VERSION_3_5_1; if (!endpoint->toward_ipa && !start_channel) - WARN_ON(!ipa_endpoint_init_ctrl(endpoint, false)); + (void)ipa_endpoint_program_suspend(endpoint, false); ret = gsi_channel_resume(gsi, endpoint->channel_id, start_channel); if (ret) From patchwork Mon May 4 23:37:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1283130 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=yODIs6sx; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49GK5p3dr9z9sSs for ; Tue, 5 May 2020 09:37:34 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728419AbgEDXhd (ORCPT ); Mon, 4 May 2020 19:37:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728192AbgEDXhZ (ORCPT ); Mon, 4 May 2020 19:37:25 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1FE9C061A0E for ; Mon, 4 May 2020 16:37:23 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id j2so253080qtr.12 for ; Mon, 04 May 2020 16:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Sp4luMaF6IKbI/3fhMGnaHSP2UluU8wsl5sO/u1BVg8=; b=yODIs6sx85nyS1LAB3htJ85KxKopBPuE4uu/Ga7AS7Zu7KTuBIXYqhwu+/wPz2gC82 OIXJBsmQSRKc0G7LJCCCMKUqfQt3DZchu6NOJATTBVVOuDlWzdNsop76Pjqm6EHRm/uV MiUUEGlBieUZLJyBDh/gue+WiniyHgzx1i7RwChaw5UpgF6yewDFQ2rEJ3g/LgAGvf79 xpYqB5pV8rfXhm5BhAunCeY3zqV/B0ZDfzJuSH1473v5XJpqCugbfkpXuzpDwRNR9whF DKudliVGpCJUy0ZxScYNcsBbF7+k1ltnLqNa/+tHvzG9muCXJbssf0m4nHNJGl7md10q IqxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Sp4luMaF6IKbI/3fhMGnaHSP2UluU8wsl5sO/u1BVg8=; b=jy/zpU07BqHYd/99K7DVW7YGUflXVi9K2KhInJ6/bT47C2MFuWeXKr+o3AOBDbnxyf 6v6jCBPkJMLTz5h0/9b6cuPwBLksH5Z+WyCK6cPD55SRqD0M4r5X2gIqwz30Bbh87Vz8 phRIJEppuo4lARI1TpKJabHAV9qLxm620LlIgRocW54gavZNx2twtY1acWOMKd3P8mhG n5H8QUyF019QKLN7QjP+cT8PO9PqVF2tXx5r57qXKO5RCJrrSUZpbOaCXKKx7LIinYZa /Si0Z2BEkt+h3tdCg7qIDMHzgeMWHYDbz/Mgtz/q9ECl1BbWmLbz5R9MIdRzkVctSDYF LF1g== X-Gm-Message-State: AGi0PuZY2EWu+NV0V5J+TJPkqnwXXLz5yaxU0RqDlwkHslyXiWQGq1+j 9JYVyl6d3DF3x1o36GS4vR14XA== X-Google-Smtp-Source: APiQypK4Dfb2FAR2CSwLiWHXdfhVVee7mbYkoiVuuMUHAzuuzPxl4/tmD+Z8446kUGgatAEm6mHUlA== X-Received: by 2002:aed:2591:: with SMTP id x17mr188790qtc.76.1588635442816; Mon, 04 May 2020 16:37:22 -0700 (PDT) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id x125sm494311qke.34.2020.05.04.16.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 16:37:21 -0700 (PDT) From: Alex Elder To: davem@davemloft.net Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/3] net: ipa: remove endpoint delay mode feature Date: Mon, 4 May 2020 18:37:13 -0500 Message-Id: <20200504233713.16954-4-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200504233713.16954-1-elder@linaro.org> References: <20200504233713.16954-1-elder@linaro.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org A "delay mode" feature was put in place to work around a problem that was observed during development of the upstream IPA driver. It used TX endpoint "delay mode" in order to prevent transmitting packets toward the modem before it was ready. A race condition that would explain the problem has long since been fixed, and we have concluded that the "delay mode" feature is no longer required. So get rid of it. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_data-sdm845.c | 1 - drivers/net/ipa/ipa_data.h | 6 ------ drivers/net/ipa/ipa_endpoint.c | 4 +--- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/net/ipa/ipa_data-sdm845.c b/drivers/net/ipa/ipa_data-sdm845.c index f7ba85717edf..52d4b84e0dac 100644 --- a/drivers/net/ipa/ipa_data-sdm845.c +++ b/drivers/net/ipa/ipa_data-sdm845.c @@ -74,7 +74,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { .tx = { .status_endpoint = IPA_ENDPOINT_MODEM_AP_RX, - .delay = true, }, }, }, diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index 16dfd74717b1..7fc1058a5ca9 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -80,18 +80,12 @@ struct gsi_channel_data { /** * struct ipa_endpoint_tx_data - configuration data for TX endpoints * @status_endpoint: endpoint to which status elements are sent - * @delay: whether endpoint starts in delay mode - * - * Delay mode prevents a TX endpoint from transmitting anything, even if - * commands have been presented to the hardware. Once the endpoint exits - * delay mode, queued transfer commands are sent. * * The @status_endpoint is only valid if the endpoint's @status_enable * flag is set. */ struct ipa_endpoint_tx_data { enum ipa_endpoint_name status_endpoint; - bool delay; }; /** diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index a830101b8edb..8dc12ec18fc7 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1341,10 +1341,8 @@ int ipa_endpoint_stop(struct ipa_endpoint *endpoint) static void ipa_endpoint_program(struct ipa_endpoint *endpoint) { if (endpoint->toward_ipa) { - bool delay_mode = endpoint->data->tx.delay; - if (endpoint->ipa->version != IPA_VERSION_4_2) - ipa_endpoint_program_delay(endpoint, delay_mode); + ipa_endpoint_program_delay(endpoint, false); ipa_endpoint_init_hdr_ext(endpoint); ipa_endpoint_init_aggr(endpoint); ipa_endpoint_init_deaggr(endpoint);