From patchwork Thu Jul 2 11:25:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 192219 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1349041ilg; Thu, 2 Jul 2020 04:25:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycYjXwxDTjc2uMDKOVLApHaLCgYDOEoubg0bU/ybQ7FI3IKgwk+0nA7BfJnho0y+FdwF8v X-Received: by 2002:a17:906:c18d:: with SMTP id g13mr24494901ejz.239.1593689159570; Thu, 02 Jul 2020 04:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593689159; cv=none; d=google.com; s=arc-20160816; b=pc9htGGBHaagAFG25f1PppEFhk0v9b4CALz2H4sKOvawLLN4zNLea+u5+gKJrQ++yk nGY8ZgVc5akxtSSkdav0GuCPyTjvnoyvy/hbVtbuBJHZTOPShvmn284sUYRZrSgOtSJ/ FXhtG1C8kRwTU9UvZ0PRMpEim9WHVNT4bXYnNUxvQK49cmnqJuonMPtCwAXnJKVJekNS lW+hd/a+zkXygYvbKo2Rv+TjA3QKhUp8reDiEv9dVxo3942SlFeOOCDTal+l2xs7cYLB L+f904FmcGp/1sfXiJDxxlPerjF4FGutIbKG7CQmcw7egobEB0AzGJHAsqrf3eD6nvIn hzJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rR58cBjanAUUwIaKuqJhjnKAVxmgw030sKlpPy2ZOVM=; b=oNaqQfus/Vy6N1GVOM7Q6H5c6EEicKCG5r7i+5OwDXYz9f5YSD3RX+KEHBrwkz4vgQ GJOAzPSvDq9EDhlhiCxja9KJ9JCKWI1uaczWHjwpDme1h4ffBf+LEgiVTwSF8kfLanFm wWIowZdk344k2igTmarAzUafWx4OnQDq/xRuFoo1zd8sTcG7VN4FXcdgAhAfNz/sZu0j AUoaMX2PPsCzSwEKEJvFk7cZx+zzlpUNWnwKnCpvl8n94hzyJG56RXEozrkalKKGLNOv diOPcTWUH566cA7bCCVsWza92tSoAJEZVqJP4JeT8xkRzgQiRB7uqV273be8I7zR3OtQ Gp5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dJdvXMMg; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l15si5408625ejq.119.2020.07.02.04.25.59; Thu, 02 Jul 2020 04:25:59 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dJdvXMMg; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728778AbgGBLZ4 (ORCPT + 9 others); Thu, 2 Jul 2020 07:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728732AbgGBLZp (ORCPT ); Thu, 2 Jul 2020 07:25:45 -0400 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ED72C08C5DC for ; Thu, 2 Jul 2020 04:25:45 -0700 (PDT) Received: by mail-il1-x143.google.com with SMTP id a11so15622270ilk.0 for ; Thu, 02 Jul 2020 04:25:45 -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=rR58cBjanAUUwIaKuqJhjnKAVxmgw030sKlpPy2ZOVM=; b=dJdvXMMgpr8N4bUkWkmdBpT4XYQBJE+U6C0mgHD7bH0wNCQLXscuLv490ZHRWkOL/n sgyf9bMWAYV8RoF4fb1su+z7+g80GGo9BuGGWgO43WS+7Ol3Q9ffmMEUxb9F0xslVcS4 gQXeJS+SibKI+4p/h4LWXX1J1DhkqozTBXqu6NKVdoUvjRzg5mb7TicBkUiZl7+uaTYX Q98K0ViIPRPisdBzOTzxPUH9+b0rSaSpEjyIlN6ssnJ5vKobDk3QistVneJhbcjMH6UT gg3UoQ5rL5yWCE51BQV1VYmKJg6DeyqSIsN+D25zm0nDST+oMO/6GUBBQU0T0rLvwBTO T/sA== 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=rR58cBjanAUUwIaKuqJhjnKAVxmgw030sKlpPy2ZOVM=; b=Ts/iXOYtreiP0KvNGNQJrebdGJuhRaX90jSbKltzlLtH0K8dO8uXmpL2rJwm479U0e 7h6p8hTZxCtZeaXCzqxwdTC3mCGTSlOF1z0jXMXjcw3hvAkIVWoHFzdBPnislX3nhw+h Xwe2Knmg8vKQ4RMh6tLX7g++8iTOCQYSbTKgc2d/iowrhULNUWw8L5KtlQW4ykjvxq2q f+cux2kRXX9DoHKQhXAVnmR6oeTqKhdyQ53P/sbxm64YElcGEFzF9JSee9GmTLQu0xyI MWQkXpXS3wHV7ZuQxMCrlr8JqemjhhiO8P6m9U8HhkOHC6VyAYX7P/GM3C7G6HSwHARY puqg== X-Gm-Message-State: AOAM530pe5j5mzQs+luLYRUUSEWYwur0cetQh0XAvM6+hVtubDa15Q/N /r+dbR3jYEIDlLJRGSDttxNHMQ== X-Received: by 2002:a92:91c2:: with SMTP id e63mr11612997ill.64.1593689144910; Thu, 02 Jul 2020 04:25:44 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id c3sm4692842ilj.31.2020.07.02.04.25.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 04:25:44 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org 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/4] net: ipa: move version test inside ipa_endpoint_program_suspend() Date: Thu, 2 Jul 2020 06:25:36 -0500 Message-Id: <20200702112537.347994-4-elder@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200702112537.347994-1-elder@linaro.org> References: <20200702112537.347994-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 IPA version 4.0+ does not support endpoint suspend. Put a test at the top of ipa_endpoint_program_suspend() that returns immediately if suspend is not supported rather than making that check in the caller. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) -- 2.25.1 diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index d6ef5b8647bf..df4202794e69 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -378,6 +378,9 @@ ipa_endpoint_program_suspend(struct ipa_endpoint *endpoint, bool enable) { bool suspended; + if (endpoint->ipa->version != IPA_VERSION_3_5_1) + return enable; /* For IPA v4.0+, no change made */ + /* assert(!endpoint->toward_ipa); */ suspended = ipa_endpoint_init_ctrl(endpoint, enable); @@ -395,26 +398,22 @@ ipa_endpoint_program_suspend(struct ipa_endpoint *endpoint, bool 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 correctly on IPA v4.2 */ if (ipa->version == IPA_VERSION_4_2) return; - /* Only IPA v3.5.1 supports SUSPEND mode on RX endpoints */ - support_suspend = ipa->version == IPA_VERSION_3_5_1; - for (endpoint_id = 0; endpoint_id < IPA_ENDPOINT_MAX; endpoint_id++) { struct ipa_endpoint *endpoint = &ipa->endpoint[endpoint_id]; if (endpoint->ee_id != GSI_EE_MODEM) continue; - /* Set TX delay mode, or for IPA v3.5.1 RX suspend mode */ + /* Set TX delay mode or RX suspend mode */ if (endpoint->toward_ipa) ipa_endpoint_program_delay(endpoint, enable); - else if (support_suspend) + else (void)ipa_endpoint_program_suspend(endpoint, enable); } } @@ -1248,8 +1247,7 @@ static int ipa_endpoint_reset_rx_aggr(struct ipa_endpoint *endpoint) gsi_channel_reset(gsi, endpoint->channel_id, false); /* Make sure the channel isn't suspended */ - if (endpoint->ipa->version == IPA_VERSION_3_5_1) - suspended = ipa_endpoint_program_suspend(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); @@ -1340,8 +1338,7 @@ static void ipa_endpoint_program(struct ipa_endpoint *endpoint) ipa_endpoint_init_seq(endpoint); ipa_endpoint_init_mode(endpoint); } else { - if (endpoint->ipa->version == IPA_VERSION_3_5_1) - (void)ipa_endpoint_program_suspend(endpoint, false); + (void)ipa_endpoint_program_suspend(endpoint, false); ipa_endpoint_init_hdr_ext(endpoint); ipa_endpoint_init_aggr(endpoint); ipa_endpoint_init_hdr_metadata_mask(endpoint); @@ -1416,11 +1413,11 @@ void ipa_endpoint_suspend_one(struct ipa_endpoint *endpoint) if (!endpoint->toward_ipa) ipa_endpoint_replenish_disable(endpoint); + if (!endpoint->toward_ipa) + (void)ipa_endpoint_program_suspend(endpoint, true); + /* IPA v3.5.1 doesn't use channel stop for suspend */ stop_channel = endpoint->ipa->version != IPA_VERSION_3_5_1; - if (!endpoint->toward_ipa && !stop_channel) - (void)ipa_endpoint_program_suspend(endpoint, true); - ret = gsi_channel_suspend(gsi, endpoint->channel_id, stop_channel); if (ret) dev_err(dev, "error %d suspending channel %u\n", ret, @@ -1437,11 +1434,11 @@ void ipa_endpoint_resume_one(struct ipa_endpoint *endpoint) if (!(endpoint->ipa->enabled & BIT(endpoint->endpoint_id))) return; + if (!endpoint->toward_ipa) + (void)ipa_endpoint_program_suspend(endpoint, false); + /* 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) - (void)ipa_endpoint_program_suspend(endpoint, false); - ret = gsi_channel_resume(gsi, endpoint->channel_id, start_channel); if (ret) dev_err(dev, "error %d resuming channel %u\n", ret,