From patchwork Tue Jun 30 12:44:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 192067 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3782006ilg; Tue, 30 Jun 2020 05:45:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzryeWXf2l5OpoNeThl/jqCRsqrfTrpGIo0/3ncW/F8n8TYND4ag6JTqpKgIgCG6B2sZyZQ X-Received: by 2002:a05:6402:306a:: with SMTP id bs10mr15157839edb.51.1593521101124; Tue, 30 Jun 2020 05:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593521101; cv=none; d=google.com; s=arc-20160816; b=Cue2IRdDpIztzKQS00CLnlCoRXFB9CWBISVfLMgYdrc6NGcjOcKgrHn/9RFtRxDU/V QdA1nP+D6m58AMc4TpRgJ12TGfaKBCBa/cYzO4tIS7bIm46JKDg8CVK3XS6jDF21GcVz /e5UZOGJpUBZq2qNwY/w8qpZrfiKvzjdq+v7O8QEy86FybxPjNULk6nF3geHPvzkVGUE UXm6rRFVqTvFW5TiitVPgt7khXuI7f+5bIsOnjvC0XLJ0NXQHjQErylhXYLRSQhcxMOD Ah0iXva93kNXF5nMM3GZV9DRUUR3Dt236p31pHvMNvLclKpidVQ+vbgxm1QP6ykxOJZH g8pw== 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=hhprUszVmOlah4/Ur36hFj2E6ek/4IJi+AwyXGta/Jg=; b=C/x9zWpU0cenQLPDarRXGDkTs6WZympNaMwHt2iM4WBzDr1cV8K5I9cisKD0I5xbIw faiF+xt8RPrMeUVM1j9cHL+SFX2p2n5hsvfunxoAm4wBiLmC3e8Z/OmHT2h2/mvhsorM 9mJWgMqvr4qUpXAau8YKcoeOJWc2oRRjFs26M/ENkPZf0SZUQYuRlKmJPjXWsyBL/xpg 2V1Qxo3tET9pjWiFNw8de+kEodvxp2WjQO86JFCHGmEOV2ID4idgT9YEpuzjEjjDQTOW thBSp2WbrrgG3SAxsPdoCddiYEHqPHyk5p+WPsrdmwlhwnYmFpMgxc0emjD6SgABn+c+ felA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KkXHJTeU; 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 v12si1647101eje.201.2020.06.30.05.45.00; Tue, 30 Jun 2020 05:45:01 -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=KkXHJTeU; 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 S2387890AbgF3MpA (ORCPT + 9 others); Tue, 30 Jun 2020 08:45:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387855AbgF3Mov (ORCPT ); Tue, 30 Jun 2020 08:44:51 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7F13C061755 for ; Tue, 30 Jun 2020 05:44:51 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id i4so20771472iov.11 for ; Tue, 30 Jun 2020 05:44:51 -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=hhprUszVmOlah4/Ur36hFj2E6ek/4IJi+AwyXGta/Jg=; b=KkXHJTeUKg/muI7mgvHgvdw0wHDkMhda+sgSpItV1HTVh8YztFciCNhoOjQKWdxzUb RMVDJrke3LdwacR2ltk3mQ0OlSf/j1AqcB3jIlm6404ZT9Heg4oq4QeMghI0Y9JH1yFr X97j/i2ZuE3dGuSaz3Jyz3AQSmzNzdUFS2mtYDKcvP4jlThSZRMq1vOX+UHU+vUwyn/7 /HSw5KsZL5AQUls3hoBL7q2dOeaTdPwEpqdmtnK8DCpDvwBPV96o8Hzz3/B9dFYd7o0G k1SBdVn17rh2y210NAK51W80Nmjdf0VA4aJjgdKYq+75o1r6JefIpzP5NwntSVNRWgag gytA== 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=hhprUszVmOlah4/Ur36hFj2E6ek/4IJi+AwyXGta/Jg=; b=PRrc/rmJG0fXNQU+Gm6rgtpVcZTx8cF4x5HTr/XuNlRRcGQUqcf1xbc65qyGGKZmdI AjW0LXD5HW5+KHeGPbqZC2xCO7elOBVCPpNWJJ5TGkJOrkf/J/VPgdx7z2rWv5/itDa5 6WLGdEkEueTHyv4LXz2+BDkByymCMMCT0I29MBv8yzdGvgWEoNYaS9FlX+iIahNN9bkT 2VKCOModL3ss/YB1d/lE/06s0oZkdSUFdOtEkMNeut86Nq6dTVAJ3zW1tg3tDe5qrYw8 x9+zKfEltGDTm9XYcyVRAgt7rGnrZYxlhtrGHw6mNsUuFPUAS6UjYtPK0lF/ux45z0Vr xdBQ== X-Gm-Message-State: AOAM533f20XFkqvjnuUSjxlY/utbnSUg06Qzbq/Pi2Wtsj3iaETn0iJZ jNo24zkO9AN0AZQ5SgkdPmXslg== X-Received: by 2002:a05:6602:2c8f:: with SMTP id i15mr21731390iow.45.1593521091047; Tue, 30 Jun 2020 05:44:51 -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 t83sm1697536ilb.47.2020.06.30.05.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 05:44:50 -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 v2 3/3] net: ipa: introduce ipa_cmd_tag_process() Date: Tue, 30 Jun 2020 07:44:44 -0500 Message-Id: <20200630124444.1240107-4-elder@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200630124444.1240107-1-elder@linaro.org> References: <20200630124444.1240107-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 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 --- v2: No change from v1. 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]); }