From patchwork Mon Jun 29 21:26:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 192017 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3239482ilg; Mon, 29 Jun 2020 14:26:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQ//0Bs+mCDzcolFOBSe5oWfA0SnEiVijSFurRiVd0IR39KOjuqVQLE7FjUIz7xYLENbx9 X-Received: by 2002:a05:6402:1c96:: with SMTP id cy22mr19235688edb.79.1593465996969; Mon, 29 Jun 2020 14:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593465996; cv=none; d=google.com; s=arc-20160816; b=tBEUuKDQc8OD0jnci0AC2U3qv1UhVw9IruQ46R/zJxn1SbV19twARD9J6JsbWIlSb7 kDKBSpM9OWqBbXXat277eOc9ogUetDjxq8yyJ3qPq3h58nTApAzZDH9gS/1nvQ0wTjgs VFFspsoRwYW+hM7tvcOQws6dnwkdPNbKY+E0qqDnfOiA79R/Vv4tBmwXkafP6lF5/fxN lPbLiJpRgGAlG4FscdPaK2Z2gYJ7R2fWjpBil5s9JYklcrOzM4WaIy0sFFL6EhcOVXq+ exTeJodU3JDbyUJCIVKhfpjpRqOAsGuMfejyG6JDICozmsK6+3YsCKcVDqjEHCOVywi0 D3ww== 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=GEehQF5Dq7lIZlTVWZjKtKY7k4OY7nbzWNuwJEp3uCA=; b=Baz/mok14s56WjRKXBuiwFLcGmYmfF+CdWbDQzTGb7fc9Hza94G81uK1iYDrQPXXXy WBgCA8orYU6O4AjAg4CDTEHngKSpULfaGYsjqHNqKsZj0cYi5PmnpbBkTpadiUpDU4T8 75+j2HM39L4T+M19b5vOA7n8RbAmIbGXavoARt0TBn1b0Nh50js1jallNSguT9CcY1PK RjC3gmGPVGKij64GJ0qdsPk8HpEeSsBLHn4Ji4y8CV8ShMdAF/MzHQaOJ9rZA9ls99Tk iCVdwdawVmEfjS3+rFe5oCFhaAu3fMP5/GdBM51KZwFS1B/DO4CDynyDyVXBspLyJYbS cktA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ln3G7483; 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 zp8si509409ejb.255.2020.06.29.14.26.36; Mon, 29 Jun 2020 14:26:36 -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=ln3G7483; 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 S2391006AbgF2V0c (ORCPT + 9 others); Mon, 29 Jun 2020 17:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729478AbgF2V03 (ORCPT ); Mon, 29 Jun 2020 17:26:29 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 171FCC061755 for ; Mon, 29 Jun 2020 14:26:29 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id f6so3176073ioj.5 for ; Mon, 29 Jun 2020 14:26:29 -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=GEehQF5Dq7lIZlTVWZjKtKY7k4OY7nbzWNuwJEp3uCA=; b=ln3G7483aQUSMwb9MRnm/mfwRP3UHJuE105pebnyrPDCjv3wJ4pCVD26yDO9MGgq5k JjOHnqka6eTMXuxzgLdfJTsujakPMVePod6/HmfOJ61u+hS+IDwOaDZF9BGst5Aax8C/ MfKpSn++e97BcIr5Fi/3kwaxO3cjW1Fj39y2DwgsifHxvtjIq7+Sg5Fb+QO54agRz9Ck FfN1QUpDzCD9MP+grFDi2NpElVVvO9WZMnXjTs9SOBJ9vrcBFicpqfxdtP9jSQxfgshY u7dQQHNmmdVfHy7EBpisqyh4qOF7S6cFAGIkVZQPezKT2j7GmC+f2Jj04WW8ALq6bFFh UjPw== 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=GEehQF5Dq7lIZlTVWZjKtKY7k4OY7nbzWNuwJEp3uCA=; b=cDPkmxtjWmsAqzHV0E44x8lW9XxxAWD0CzkV4vs2zFVYCHSvsNZCgnyNYvbaoGEVMP NCStMSbTfysSjnd1t31K7ehNNqkc2vV6DdxfuBNqUXMIfMQagqzc774rLguIHJFJ7Pnf VZAO1jMO+7IinvzZILMROgOBZcjHRvqB+0c/d/rUJqRqYzteTJpjixKGUccDBcHSInPZ Rn73w2OVaf4auus6/Ta8w5e8FNz2lhEE37ET+sxAORWU1buWYVnHgPO16h66rIIlH4AJ xxnahH4HnzLQKv7ToRzwaUDIU05P37MpovyW+XTYSm65WGJEa3+AG/nkUE5FiE5Pj4DS 3B7g== X-Gm-Message-State: AOAM530Wve9rsF6+a7pHekh6VUJv0wJuMsO1BQGPEFDcelwEoZMSCXvn wCdKgeeAzCsl4geT4MZqPAC6XQ== X-Received: by 2002:a02:83c3:: with SMTP id j3mr19486288jah.81.1593465988443; Mon, 29 Jun 2020 14:26:28 -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 j17sm589053ilq.7.2020.06.29.14.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 14:26:27 -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 3/3] net: ipa: introduce ipa_cmd_tag_process() Date: Mon, 29 Jun 2020 16:26:25 -0500 Message-Id: <20200629212625.1153600-1-elder@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629212038.1153054-1-elder@linaro.org> References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Create a new function ipa_cmd_tag_process() that simply allocates a transaction, adds a tag process command to it to clear the hardware pipeline, and commits the transaction. Call it in from ipa_endpoint_suspend(), after suspending the modem endpoints but before suspending the AP command TX and AP LAN RX endpoints (which are used by the tag sequence). Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_cmd.c | 15 +++++++++++++++ drivers/net/ipa/ipa_cmd.h | 8 ++++++++ drivers/net/ipa/ipa_endpoint.c | 2 ++ 3 files changed, 25 insertions(+) -- 2.25.1 diff --git a/drivers/net/ipa/ipa_cmd.c b/drivers/net/ipa/ipa_cmd.c index c9ab865e7290..d92dd3f09b73 100644 --- a/drivers/net/ipa/ipa_cmd.c +++ b/drivers/net/ipa/ipa_cmd.c @@ -586,6 +586,21 @@ u32 ipa_cmd_tag_process_count(void) return 4; } +void ipa_cmd_tag_process(struct ipa *ipa) +{ + u32 count = ipa_cmd_tag_process_count(); + struct gsi_trans *trans; + + trans = ipa_cmd_trans_alloc(ipa, count); + if (trans) { + ipa_cmd_tag_process_add(trans); + gsi_trans_commit_wait(trans); + } else { + dev_err(&ipa->pdev->dev, + "error allocating %u entry tag transaction\n", count); + } +} + static struct ipa_cmd_info * ipa_cmd_info_alloc(struct ipa_endpoint *endpoint, u32 tre_count) { diff --git a/drivers/net/ipa/ipa_cmd.h b/drivers/net/ipa/ipa_cmd.h index e440aa69c8b5..1a646e0264a0 100644 --- a/drivers/net/ipa/ipa_cmd.h +++ b/drivers/net/ipa/ipa_cmd.h @@ -171,6 +171,14 @@ void ipa_cmd_tag_process_add(struct gsi_trans *trans); */ u32 ipa_cmd_tag_process_count(void); +/** + * ipa_cmd_tag_process() - Perform a tag process + * + * @Return: The number of elements to allocate in a transaction + * to hold tag process commands + */ +void ipa_cmd_tag_process(struct ipa *ipa); + /** * ipa_cmd_trans_alloc() - Allocate a transaction for the command TX endpoint * @ipa: IPA pointer diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 9f50d0d11704..9e58e495d373 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1450,6 +1450,8 @@ void ipa_endpoint_suspend(struct ipa *ipa) if (ipa->modem_netdev) ipa_modem_suspend(ipa->modem_netdev); + ipa_cmd_tag_process(ipa); + ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]); ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]); }