From patchwork Tue Jan 26 18:56:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 370654 Delivered-To: patch@linaro.org Received: by 2002:a17:906:24d5:0:0:0:0 with SMTP id f21csp4793155ejb; Tue, 26 Jan 2021 15:17:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnRNBlvoI38JqODZmHmElv31VU1xuOg3KjrmxGkAvZs2ZSVAF3zJwLGPt03Y5kkMmlpZkR X-Received: by 2002:a17:906:7b84:: with SMTP id s4mr4843698ejo.520.1611703053312; Tue, 26 Jan 2021 15:17:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611703053; cv=none; d=google.com; s=arc-20160816; b=fuVAs9Q0CTbuDbRv+UTiwplMKrcLbKerXZigjBH9/0ABgF0YuZJX+pJAi+9XcWAoQk +8PL/QjgKoGFiy6Q/o8XcPt2FHkmTfBhxdv2gG2UKQMJQEgX/HNOJX9DWdYqMRngflxd 0Q530ifiEY7yrQQn1g7UvzPZ6PBlYdb15DNP5BlXYk1CvcMI2mZ8/1tTH8t2Zrsq5rr5 R2EG6zQ3cBCzc0JDlaVojq8/tlwpxRoOV7CwjPp0175h84JR6PzPvCobuI0PIpIexpUy C+pmvhOhDVEmEfTBKyQooOYBZTSCVdY7oLdmRh+RJMQ/vmJp9InxMTN2Kv4901+bFjb9 Stug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=f5b9KtQ7d1H/fGZmXHlccfFZMdiZGMJ/JFXTwWf9F8s=; b=u/N4sXjExoffxNwxMeUuufkvXJtR1I9sqvKET/K5MqVoj0iD8CZuqApkGSUBfMEhWQ vIVAYuYf+UPNF21Elpvs1mOYJ0gglWqx6gROxxGqjlBEdMKp+ypFxKjPWWXBZLO1kMKa pokjx2PpOlDq5vGgxlwAiZ3kY//BtPwtfiJRKQ8xHdVO60RcEgn1FZfZuwqZI1+Fc4l+ F58X/HxSqkN39MwnJeRO7g8f/lg3Gg1oJHNULNVTczz6GSmnFwqy3q58lrkM+GApQ1c/ 8JSy1HK5pFb2eIzfnCTK/HY0qmvsJh6Qg97GUvb4/ZxO0yGidp3aGDeeItJ/JkHS03as 1wfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SQiMsUM5; 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 t1si53616ejc.524.2021.01.26.15.17.33; Tue, 26 Jan 2021 15:17:33 -0800 (PST) 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=SQiMsUM5; 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 S1732324AbhAZXKd (ORCPT + 7 others); Tue, 26 Jan 2021 18:10:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731757AbhAZS5t (ORCPT ); Tue, 26 Jan 2021 13:57:49 -0500 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE046C0613D6 for ; Tue, 26 Jan 2021 10:57:08 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id h11so35678541ioh.11 for ; Tue, 26 Jan 2021 10:57:08 -0800 (PST) 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=f5b9KtQ7d1H/fGZmXHlccfFZMdiZGMJ/JFXTwWf9F8s=; b=SQiMsUM5JIXhmTm3jtoiBCRusm96VGeuMvXqKZWmLUfK0c77z/w8h4EuYJv4GlGpR7 MHGoSEkcClv9bX5yiMeXboUJDbsYc5SKoh5KJgBlKM4Y/83gZHWonLlJlQ8GoMw/CjrR xUdkZLtTcEdyyP128msMDrp0E6tpGBsxxasr/LcaBnU2NxmDMpOJmelMHDouCTcGoyVZ p2M1RQKSzahGqJ84gzomRM7qhraN7GJpFKt+g4jsJQcaFKCrRdnRTzEzO26/vcI+dHuA czmh5wAvftP+Lqj7HNALeV43fnsblLRUkx3LS61xZ+aZ5S7dXVG1ZM5K9arGXzUuLXGP Emyg== 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=f5b9KtQ7d1H/fGZmXHlccfFZMdiZGMJ/JFXTwWf9F8s=; b=lrfnWZuukyWKgox8NR7wC/QuzxZdwEz+h9bStIEv70D3lreqQp++GJ7D+qHjtl/saH QbktaZsdHA1uUugsHCV8Q5YRMwRs9TOkQHBUo2TOPeN3ZgMxSKvTrZIR8qr4EW9+LRZJ txob1G9UFGQZVOl0keddwaxStu08zDbc9Fdn1W5wUr19t+QYMbyEvwMmZhBc3pPdbiww PTlPvqemSkCWgcuq933mOoaspMtdA/mdiTfhva6v6T3FM3T29q2Fdt5E92C5TdeLT3ZQ j8Sfl5KISiJOFzvr9xwvnylUS7o6WWQfcz+53WodZdhKw9nvHgmuevwSJnpnL7Qmr08O z8eA== X-Gm-Message-State: AOAM532Nu0rXGVoDkWqQjFPM5HGgy7PMYKnKa2Hz9EKvlYMTkVJ4FdTX DW6Gu0Ft6+GgHKBiL4bK6c6bVQ== X-Received: by 2002:a05:6e02:1202:: with SMTP id a2mr5859544ilq.21.1611687428356; Tue, 26 Jan 2021 10:57:08 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id l14sm13060681ilh.58.2021.01.26.10.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 10:57:07 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: elder@kernel.org, evgreen@chromium.org, bjorn.andersson@linaro.org, cpratapa@codeaurora.org, subashab@codeaurora.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 1/6] net: ipa: rename "tag status" symbols Date: Tue, 26 Jan 2021 12:56:58 -0600 Message-Id: <20210126185703.29087-2-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210126185703.29087-1-elder@linaro.org> References: <20210126185703.29087-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There is a set of functions and symbols related to performing "tag_process" immediate commands to clear the IPA pipeline. The name is related to one of the commands issued when doing this, but it doesn't really convey the overall purpose of taking this action. The purpose is to take some steps to "clear out" the hardware pipeline, and to wait until that process completes, to ensure the IPA hardware is in a well-defined state. Rename these symbols to use "pipeline_clear" in their names instead. Add some comments to explain a bit more about what's going on. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_cmd.c | 26 ++++++++++++++++++-------- drivers/net/ipa/ipa_cmd.h | 17 +++++++---------- drivers/net/ipa/ipa_endpoint.c | 6 +++--- 3 files changed, 28 insertions(+), 21 deletions(-) -- 2.20.1 diff --git a/drivers/net/ipa/ipa_cmd.c b/drivers/net/ipa/ipa_cmd.c index 002e514485100..27630244512d8 100644 --- a/drivers/net/ipa/ipa_cmd.c +++ b/drivers/net/ipa/ipa_cmd.c @@ -567,33 +567,43 @@ static void ipa_cmd_transfer_add(struct gsi_trans *trans, u16 size) direction, opcode); } -void ipa_cmd_tag_process_add(struct gsi_trans *trans) +/* Add immediate commands to a transaction to clear the hardware pipeline */ +void ipa_cmd_pipeline_clear_add(struct gsi_trans *trans) { struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); struct ipa_endpoint *endpoint; - endpoint = ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]; - + /* Issue a no-op register write command (mask 0 means no write) */ ipa_cmd_register_write_add(trans, 0, 0, 0, true); + + /* Send a data packet through the IPA pipeline. The packet_init + * command says to send the next packet directly to the exception + * endpoint without any other IPA processing. The tag_status + * command requests that status be generated on completion of + * that transfer, and that it will contain the given tag value. + * Finally, the transfer command sends a small packet of data + * (instead of a command) using the command endpoint. + */ + endpoint = ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]; ipa_cmd_ip_packet_init_add(trans, endpoint->endpoint_id); ipa_cmd_ip_tag_status_add(trans, 0xcba987654321); ipa_cmd_transfer_add(trans, 4); } -/* Returns the number of commands required for the tag process */ -u32 ipa_cmd_tag_process_count(void) +/* Returns the number of commands required to clear the pipeline */ +u32 ipa_cmd_pipeline_clear_count(void) { return 4; } -void ipa_cmd_tag_process(struct ipa *ipa) +void ipa_cmd_pipeline_clear(struct ipa *ipa) { - u32 count = ipa_cmd_tag_process_count(); + u32 count = ipa_cmd_pipeline_clear_count(); struct gsi_trans *trans; trans = ipa_cmd_trans_alloc(ipa, count); if (trans) { - ipa_cmd_tag_process_add(trans); + ipa_cmd_pipeline_clear_add(trans); gsi_trans_commit_wait(trans); } else { dev_err(&ipa->pdev->dev, diff --git a/drivers/net/ipa/ipa_cmd.h b/drivers/net/ipa/ipa_cmd.h index 4ed09c486abc1..a41a58cc2c5ac 100644 --- a/drivers/net/ipa/ipa_cmd.h +++ b/drivers/net/ipa/ipa_cmd.h @@ -157,26 +157,23 @@ void ipa_cmd_dma_shared_mem_add(struct gsi_trans *trans, u32 offset, u16 size, dma_addr_t addr, bool toward_ipa); /** - * ipa_cmd_tag_process_add() - Add IPA tag process commands to a transaction + * ipa_cmd_pipeline_clear_add() - Add pipeline clear commands to a transaction * @trans: GSI transaction */ -void ipa_cmd_tag_process_add(struct gsi_trans *trans); +void ipa_cmd_pipeline_clear_add(struct gsi_trans *trans); /** - * ipa_cmd_tag_process_add_count() - Number of commands in a tag process + * ipa_cmd_pipeline_clear_count() - # commands required to clear pipeline * * Return: The number of elements to allocate in a transaction - * to hold tag process commands + * to hold commands to clear the pipeline */ -u32 ipa_cmd_tag_process_count(void); +u32 ipa_cmd_pipeline_clear_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 + * ipa_cmd_pipeline_clear() - Clear the hardware pipeline */ -void ipa_cmd_tag_process(struct ipa *ipa); +void ipa_cmd_pipeline_clear(struct ipa *ipa); /** * ipa_cmd_trans_alloc() - Allocate a transaction for the command TX endpoint diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 688a3dd40510a..39ae0dd4e0471 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -399,7 +399,7 @@ int ipa_endpoint_modem_exception_reset_all(struct ipa *ipa) * That won't happen, and we could be more precise, but this is fine * for now. We need to end the transaction with a "tag process." */ - count = hweight32(initialized) + ipa_cmd_tag_process_count(); + count = hweight32(initialized) + ipa_cmd_pipeline_clear_count(); trans = ipa_cmd_trans_alloc(ipa, count); if (!trans) { dev_err(&ipa->pdev->dev, @@ -428,7 +428,7 @@ int ipa_endpoint_modem_exception_reset_all(struct ipa *ipa) ipa_cmd_register_write_add(trans, offset, 0, ~0, false); } - ipa_cmd_tag_process_add(trans); + ipa_cmd_pipeline_clear_add(trans); /* XXX This should have a 1 second timeout */ gsi_trans_commit_wait(trans); @@ -1564,7 +1564,7 @@ void ipa_endpoint_suspend(struct ipa *ipa) if (ipa->modem_netdev) ipa_modem_suspend(ipa->modem_netdev); - ipa_cmd_tag_process(ipa); + ipa_cmd_pipeline_clear(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]); From patchwork Tue Jan 26 18:56:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 371493 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp107411jam; Wed, 27 Jan 2021 02:03:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0aU7CqVMPaZAIyPBk649fNqSoEsyIvfQ92bNvL5qcycgymXkkpgUX2F/n3MMAr+GTtmbI X-Received: by 2002:aa7:d651:: with SMTP id v17mr8405224edr.91.1611741804267; Wed, 27 Jan 2021 02:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611741804; cv=none; d=google.com; s=arc-20160816; b=SZWpc5l2h/9ifsdB5Lao1Bm5kqoutNxax81VMuTH6tBcKlhx5qyM85BT7noXJ1AZ4x 5Cepc/v1D/7udFLiNa7OR/j5AJZBxLtLkMtspM1E5lRfZetCJP0LWL6KuNUfEgmQDN0e vm+i/VFpFBuoAc7WyEtGzpq9RUvUuPIDeB8LzjEZLYIIHDjwSzC55zYAUtbX4CGIkR/O o0RqFzENRwP9AyUJhNeqoeMPBdKVc9DLjVr7FSv4HsDbrSvE/Wh9quo+IJK4Qpo1qyru 65IxWsSR1AOPMKv0pe/mbNdm+h1RG9jbFzr6gIPlBqe9unmjrg+gCOSutAQpXwZWyLvc MCxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JpZv+T7F3bf/GFAbswYSEjxp4C4JU0WA8H2GZ/JQhn0=; b=t0J7wochw3ulZp4Czk/zOyRRlHJqrSuGbe+2Kvv0ISez5rE/qFr+9wAzGuTc+qzlBr Xh3iuFzcbn8RzlbmGChs2BdhLw1kl/FQJsHU2nue9a1vlm/i36lIxIOyiawIiru6CxgL M2oXt4olp1FuJ7TtlZTCyC+b9ztlowUxMU/ByO0Cp+qaPnnSH2SYM84yEnUPSMUPQb6u rmpIkA5klVG6RIyFyVuXM4795bxPMIpWJ8aH/92rb7r6PPRBcCgFD/eVy2BU3CYom8ow UOrsnUh+ANLM9Re0TtKGg3EtA56cvsm6L33edSlQhNHpfZ4OJZtBq44jForA2wn/vtDs jyMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S8gh6Jjw; 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 p1si853376eds.205.2021.01.27.02.03.24; Wed, 27 Jan 2021 02:03:24 -0800 (PST) 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=S8gh6Jjw; 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 S316810AbhAZXKk (ORCPT + 7 others); Tue, 26 Jan 2021 18:10:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731834AbhAZS5u (ORCPT ); Tue, 26 Jan 2021 13:57:50 -0500 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23732C061786 for ; Tue, 26 Jan 2021 10:57:10 -0800 (PST) Received: by mail-io1-xd2e.google.com with SMTP id d13so35784219ioy.4 for ; Tue, 26 Jan 2021 10:57:10 -0800 (PST) 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=JpZv+T7F3bf/GFAbswYSEjxp4C4JU0WA8H2GZ/JQhn0=; b=S8gh6JjwnkIt4hEKTVwbdAvFLYkQsLiG2G7Hx9nAz8Cg+/0FottfVYSu6F2mju2eTK FNWeI/hjac9R+wFPa/K14hUxl2HJXtnRtUNsKUPFCiwoj8Z7sRDABYSxdvdxduacFbQ4 Ae54zsGSgORxvaNu/ijyC+qvVLSCEmzqEEjhIHuNByC0fThw5vJedyfXLG+Z5LhRK56K nM9JxhbmT4eAp4qWAjTj0GJ7McCTF23nPg3Vj9TksyUtPP4IUb5L3JZ5w765Ssx3prlY 1I/FnmkBfDySplKgZHkurGy0C+4JDPqWV8Kg5Yd7DExeTaJCbsNb0/hlYP82+i+FHJFj ST4w== 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=JpZv+T7F3bf/GFAbswYSEjxp4C4JU0WA8H2GZ/JQhn0=; b=MdaQ5178Mjz32OopDlSt8Su1neYIBCu7kAY9u82TfQekp1RtV7T25VvTLbBVsT2Hgr 6fsm/YHLt/VoTL2l7jhRHn128r7ST7xfUGV4oWZ5tizupwDnuGUkVrD0VKwJZTtvLnwb kwf4of1EZiIn6I4BpIXDeP265A65HUG8JA2dIFpbB3WxurpLnsNX2+OcfzBkkZoerL6/ T9XaP5xJV3qiJR3eSHNl3uDw8Yi647ip2vWUFvsdKm1VhCjW1GVYKN9hqjuxCCjp4EUd gWfsP4baE24U0okVEEItdtvkTsGTGvv4jg9B4sDGIpC/7ocTPWxCsj7MSNs/WGKb+xVD aZaw== X-Gm-Message-State: AOAM533x0Tu2kYnrIYk+wm1leER9Xw1lvftG6/87FJHA1HEWoDIte6HJ VmFFs51hBW+rA7I52yR2Lc88wQ== X-Received: by 2002:a05:6e02:1c2a:: with SMTP id m10mr5953238ilh.17.1611687429447; Tue, 26 Jan 2021 10:57:09 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id l14sm13060681ilh.58.2021.01.26.10.57.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 10:57:08 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: elder@kernel.org, evgreen@chromium.org, bjorn.andersson@linaro.org, cpratapa@codeaurora.org, subashab@codeaurora.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 2/6] net: ipa: minor update to handling of packet with status Date: Tue, 26 Jan 2021 12:56:59 -0600 Message-Id: <20210126185703.29087-3-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210126185703.29087-1-elder@linaro.org> References: <20210126185703.29087-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Rearrange some comments and assignments made when handling a packet that is received with status, aiming to improve understandability. Use DIV_ROUND_CLOSEST() to get a better per-packet true size estimate. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) -- 2.20.1 diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 39ae0dd4e0471..c5524215054c8 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1213,12 +1213,11 @@ static void ipa_endpoint_status_parse(struct ipa_endpoint *endpoint, continue; } - /* Compute the amount of buffer space consumed by the - * packet, including the status element. If the hardware - * is configured to pad packet data to an aligned boundary, - * account for that. And if checksum offload is is enabled - * a trailer containing computed checksum information will - * be appended. + /* Compute the amount of buffer space consumed by the packet, + * including the status element. If the hardware is configured + * to pad packet data to an aligned boundary, account for that. + * And if checksum offload is enabled a trailer containing + * computed checksum information will be appended. */ align = endpoint->data->rx.pad_align ? : 1; len = le16_to_cpu(status->pkt_len); @@ -1226,16 +1225,21 @@ static void ipa_endpoint_status_parse(struct ipa_endpoint *endpoint, if (endpoint->data->checksum) len += sizeof(struct rmnet_map_dl_csum_trailer); - /* Charge the new packet with a proportional fraction of - * the unused space in the original receive buffer. - * XXX Charge a proportion of the *whole* receive buffer? - */ if (!ipa_status_drop_packet(status)) { - u32 extra = unused * len / total_len; - void *data2 = data + sizeof(*status); - u32 len2 = le16_to_cpu(status->pkt_len); + void *data2; + u32 extra; + u32 len2; /* Client receives only packet data (no status) */ + data2 = data + sizeof(*status); + len2 = le16_to_cpu(status->pkt_len); + + /* Have the true size reflect the extra unused space in + * the original receive buffer. Distribute the "cost" + * proportionately across all aggregated packets in the + * buffer. + */ + extra = DIV_ROUND_CLOSEST(unused * len, total_len); ipa_endpoint_skb_copy(endpoint, data2, len2, extra); } From patchwork Tue Jan 26 18:57:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 370655 Delivered-To: patch@linaro.org Received: by 2002:a17:906:24d5:0:0:0:0 with SMTP id f21csp4793165ejb; Tue, 26 Jan 2021 15:17:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzvtrwprGPbrCIIFRQDTuZe7wQyKUP20f6jirrOiBP4/91d6mdjTdAz6gU59vlFXnGgh3d X-Received: by 2002:a17:906:c406:: with SMTP id u6mr4787509ejz.218.1611703054306; Tue, 26 Jan 2021 15:17:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611703054; cv=none; d=google.com; s=arc-20160816; b=yxGlHAXw/BSvIumiHJZt9wTxoLKEI5L5LUFBfBr65p8qTX2G9D0rehnm/WSc8iJ8Kp 3YpOiT8BR1FgRRov6gfe6OXmxu7Lak+N43tYHwGxY979WHA+6bdFy2U8bQb5BVcsuR8b W0PYUcn/G8VLlnvwjrMbvhNSa21FwbljKyAUmSvy/Z+Xf9yDN9Z3u4URqo6m4tTUA5OD IJZa7HLknqUSaOFS9fOqZdOHnm1gi/tSFZ8q2I1hLvNscQUOvOx/PgIoHWQ07NphlISx B5nL6u56RbblNxNRrXYbweIvE702BLzM2RFE7O55YyshSQp4fy2kvxyds92LTJRkzeXl 5Z/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=s57J/xOFhvFT/dyDrXRhATPPv+j4to5KF2lppSb4o8g=; b=n4qVgl55cG+qSnZUaPb32BgppQkwT0Fcd80MzY0Ajqfrz1WaC9WqRHtzwSyMjhqy1T ciG07AhEOTIx7JcJWQyoC4K7ci4Kzbnor6P12rMgE6ZxAC8fLr26F3M0D1a/N9dldFsX uTt2XZG0RJHpx+b8956GguVZSNRMj/ARJoEm3FfHghTQlWSphQ4Mw1gMCOo7DyWfrgcT DibGdF45npgxsokFFiPO7qJH0PiV4nj63ipT83xtxDAcHyi+tP0SoDUqxBBiUovxO4zr 9JoWn4qUo3hQhprJSpAtwhCFiN9pXlHm3f4ArYQCIRx7owuUeG9VLZPjQshFRaVe3SZt +2eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZXj3KnRJ; 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 t1si53616ejc.524.2021.01.26.15.17.34; Tue, 26 Jan 2021 15:17:34 -0800 (PST) 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=ZXj3KnRJ; 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 S1732374AbhAZXKn (ORCPT + 7 others); Tue, 26 Jan 2021 18:10:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732110AbhAZS5v (ORCPT ); Tue, 26 Jan 2021 13:57:51 -0500 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AECCC06178A for ; Tue, 26 Jan 2021 10:57:11 -0800 (PST) Received: by mail-io1-xd35.google.com with SMTP id u17so35865315iow.1 for ; Tue, 26 Jan 2021 10:57:11 -0800 (PST) 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=s57J/xOFhvFT/dyDrXRhATPPv+j4to5KF2lppSb4o8g=; b=ZXj3KnRJ+AZ2oQv2hFwmxefm0sC68as2h+Om3u7UOUUgj0xSGu2PBFrOC9ybY9B9mR PBPaXPHGoiLFeBvex0wWol7uYTm7gIylX0nMvNuT/KD2B9ASwddajdQdXGnogeQn7H0o LJhXxNVaxqlf/Oa7jbQeh+v7XbJQKhkHFKFNsYmfyfdMoxyOXfygun3EcLiJ8bN0Omk4 eEQQDAGwn+EiYR2WcQpTjk6kyCY1LFVcBJOkK/HQCZ+bXNwxXl7ZRpaQs/oVZrHL7AfD ln5AIFhgWcqUHcvUlmHIp1iWBG5h21bpCHNsXQq8T5eh8byKtqbS32V0gY+0O/phDR8M yzQA== 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=s57J/xOFhvFT/dyDrXRhATPPv+j4to5KF2lppSb4o8g=; b=SPEw4h0rXx5M8eB2/lSc2qiXw/1aSM2/iCUMHnDep+J8DwkSzhvQzdXPXLe56Ak+pL VnESj/gz0RLv3fLl+vDP/p/isiC4vHqqOevUxIDqO7E4Z9+7PaQwNdmwL/2v+b+oUDrr Dkr4Q0/rip8Qw6OxXw+g+M/FeqMI2/VlqSdNieu7XsaF5gGB231vAsipomwYO1NLsMDw 8NX5AOdoqwAlc0d+qfAHgI1DbRKg3ExbvnS9oJ7gLfJ2kNivudWCFZYXGaFj82AxRqU3 kOGJVeZTkAIUGcSnZ5OazvilrsfhlBFlxdgBvaZqN7i/2UDPLd908canCSMp5+UldyJo Cggg== X-Gm-Message-State: AOAM530qfsuXiOAgsHh55Hs6V1TY4aD9cz9qz0xukoyNfk9vB4eYNhcJ A75ptTWBjtIcDE1omHd8HgvX4g== X-Received: by 2002:a05:6638:3006:: with SMTP id r6mr6228829jak.72.1611687430604; Tue, 26 Jan 2021 10:57:10 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id l14sm13060681ilh.58.2021.01.26.10.57.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 10:57:10 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: elder@kernel.org, evgreen@chromium.org, bjorn.andersson@linaro.org, cpratapa@codeaurora.org, subashab@codeaurora.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 3/6] net: ipa: drop packet if status has valid tag Date: Tue, 26 Jan 2021 12:57:00 -0600 Message-Id: <20210126185703.29087-4-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210126185703.29087-1-elder@linaro.org> References: <20210126185703.29087-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Introduce ipa_endpoint_status_tag(), which returns true if received status indicates its tag field is valid. The endpoint parameter is not yet used. Call this from ipa_status_drop_packet(), and drop the packet if the status indicates the tag was valid. Pass the endpoint pointer to ipa_status_drop_packet(), and rename it ipa_endpoint_status_drop(). The endpoint will be used in the next patch. Signed-off-by: Alex Elder --- v2: Use le16_get_bits() to access the status mask tag field properly. drivers/net/ipa/ipa_endpoint.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index c5524215054c8..68970a3baa47a 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -69,8 +69,11 @@ struct ipa_status { }; /* Field masks for struct ipa_status structure fields */ +#define IPA_STATUS_MASK_TAG_VALID_FMASK GENMASK(4, 4) +#define IPA_STATUS_SRC_IDX_FMASK GENMASK(4, 0) #define IPA_STATUS_DST_IDX_FMASK GENMASK(4, 0) #define IPA_STATUS_FLAGS1_RT_RULE_ID_FMASK GENMASK(31, 22) +#define IPA_STATUS_FLAGS2_TAG_FMASK GENMASK_ULL(63, 16) #ifdef IPA_VALIDATE @@ -1172,11 +1175,22 @@ static bool ipa_endpoint_status_skip(struct ipa_endpoint *endpoint, return false; /* Don't skip this packet, process it */ } +static bool ipa_endpoint_status_tag(struct ipa_endpoint *endpoint, + const struct ipa_status *status) +{ + return !!le16_get_bits(status->mask, IPA_STATUS_MASK_TAG_VALID_FMASK); +} + /* Return whether the status indicates the packet should be dropped */ -static bool ipa_status_drop_packet(const struct ipa_status *status) +static bool ipa_endpoint_status_drop(struct ipa_endpoint *endpoint, + const struct ipa_status *status) { u32 val; + /* If the status indicates a tagged transfer, we'll drop the packet */ + if (ipa_endpoint_status_tag(endpoint, status)) + return true; + /* Deaggregation exceptions we drop; all other types we consume */ if (status->exception) return status->exception == IPA_STATUS_EXCEPTION_DEAGGR; @@ -1225,7 +1239,7 @@ static void ipa_endpoint_status_parse(struct ipa_endpoint *endpoint, if (endpoint->data->checksum) len += sizeof(struct rmnet_map_dl_csum_trailer); - if (!ipa_status_drop_packet(status)) { + if (!ipa_endpoint_status_drop(endpoint, status)) { void *data2; u32 extra; u32 len2; From patchwork Tue Jan 26 18:57:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 371487 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp60632jam; Wed, 27 Jan 2021 00:47:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgI4XBtb0KnFxPbOpu0ZGbYe2rxSYW8I9XlGUz49a6GBgjvDw4kHQhQy/yzf0lzxDm11/Y X-Received: by 2002:aa7:c2ce:: with SMTP id m14mr7745914edp.76.1611737271965; Wed, 27 Jan 2021 00:47:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611737271; cv=none; d=google.com; s=arc-20160816; b=FnNklLDMzaJk0FTCXcW2XipR0urdAKr6O1mtfTXPHRkAURoMY07TwGRqOe86GD6I7V ArfUfWYA2aTcqIwYw9GSRXZ74YpU99ZD3+iQwlniErjc0AfU2Yjx9wactwHGjIrc1wu8 fwetMgqDT6nmv6656hxeIkWQifW484JYQgx6rkQLZQosb+ty2kE9eXUpAs7O1NPpaCkx /N4U/eZG1aJJqjxZBOlOsohaEZIBiwk4OXlaCtQIgUne/IwiNoniJHCWzJT/jvaH/1xI uDi5/3/syu3wHEPbDKIsebiNFmAosFH345O8aF2hOCj2wNPJGljwOxD29f4+9ivFOXiY YhpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4obeX1NaiRltyNAJxhbtg4nhO/wV8qatGfACRFnTlEE=; b=KNNs8zxDQJQcnUhdHmK4nH44xM2gGO8FOPMf0QHaC7tbQe6Z4d6PojoErlVY/arWsV jZn0fakB2Kv/QcKDABRayl2tH5jUcWU0dRO3WUMQtlF1fOffXHrSjb83U4nwVsX+Ugeb 6A1PTsZYYMWKvlO5yhITsZ+s0xvVrxBVxVMLRTN6QP3THQA0gNVptHsmY8ElCgs6gIUc QVO5+wTkPUw9KVNQuHAsbfllPt9lP3uNGf/xPpKnYZ2Pg2Xz/S3GpZOLgifIK300iNuC atUO80K7ePBg+t1Q8uEw3eC4itS6h4gwKmnu9+d7b+wmDSKn2/iCYu86jJflhARhbcN9 gCJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yXhpmzCG; 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 n17si560285eji.245.2021.01.27.00.47.51; Wed, 27 Jan 2021 00:47:51 -0800 (PST) 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=yXhpmzCG; 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 S316825AbhAZXKs (ORCPT + 7 others); Tue, 26 Jan 2021 18:10:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732364AbhAZS5w (ORCPT ); Tue, 26 Jan 2021 13:57:52 -0500 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48AD2C061352 for ; Tue, 26 Jan 2021 10:57:12 -0800 (PST) Received: by mail-io1-xd31.google.com with SMTP id e22so35779095iog.6 for ; Tue, 26 Jan 2021 10:57:12 -0800 (PST) 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=4obeX1NaiRltyNAJxhbtg4nhO/wV8qatGfACRFnTlEE=; b=yXhpmzCGtOEPgfRAyDcrM0jJ+K9X6PmYt6SCqBm46i+zav4iGds/ZuuCt/7Gc+MXVv IIOkZdoPzmteZcXoyozJ8wuMqewn4EU5I3EtTRyj9NApKqxGG9uyJSid/jlaXQtScQoQ g+D6w4ncrZdRBN14SHAND1viZ7pEoyUpHLQlaS7MIH1bTlj0H34GxXJEUUR6nwBIjuOu nestJrfjVokNSMs1i1uAo8eTftqAkXC7cvyvm61JPWeEpqn1++ADc6d2vl+XEfSIF9zx MoeMUKalPq3LWU4rv8yQZoLiAQy9s4tCGx1Hvzzrq3MQGP9P+m4ZD2JF6HGg7Mk1Hxay wGaQ== 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=4obeX1NaiRltyNAJxhbtg4nhO/wV8qatGfACRFnTlEE=; b=rvC5mVDDTF8nR8HqyQbTt0+f6t12k1Zx/I7MGWU3y/K/Z4ckpe6tTR9qpDR8ncPw/Z SG0xX/GfGOCv+00UiW1b8VzA3R0LT9swWQDK4vFs2iwUTnrtlRrmH2kk3x1fP+oi2qO1 dym+tWiRJsK7mlwqhaFtyPJgtO7H3rwQ/cAyAqbXFwweUdXv62cCrYBFrIW2iYNSM2it BZWk+KMaehGOb1vzt80Io9E7JQ8UIBVMsFdAzScq1S8qMd8vHL/aL4Y8/xL3mcrWim5f VHugoQBcnQKtqHIdbr7l460Bd3few3AJcZFS4MxOIAE+Q7CZe1DtNe6FkzXm8RtTO438 J8yA== X-Gm-Message-State: AOAM530dODc6SaA6oCkX/J7zx86K+uF9A1TWoRk2euHgIBEkOOlSfMSs P80Af11sspf9Ub04jl8FRiC5bg== X-Received: by 2002:a92:ca81:: with SMTP id t1mr5590173ilo.139.1611687431668; Tue, 26 Jan 2021 10:57:11 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id l14sm13060681ilh.58.2021.01.26.10.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 10:57:11 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: elder@kernel.org, evgreen@chromium.org, bjorn.andersson@linaro.org, cpratapa@codeaurora.org, subashab@codeaurora.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 4/6] net: ipa: signal when tag transfer completes Date: Tue, 26 Jan 2021 12:57:01 -0600 Message-Id: <20210126185703.29087-5-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210126185703.29087-1-elder@linaro.org> References: <20210126185703.29087-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There are times, such as when the modem crashes, when we issue commands to clear the IPA hardware pipeline. These commands include a data transfer command that delivers a small packet directly to the default (AP<-LAN RX) endpoint. The places that do this wait for the transactions that contain these commands to complete, but the pipeline can't be assumed clear until the sent packet has been *received*. The small transfer will be delivered with a status structure, and that status will indicate its tag is valid. This is the only place we send a tagged packet, so we use the tag to determine when the pipeline clear packet has arrived. Add a completion to the IPA structure to to be used to signal the receipt of a pipeline clear packet. Create a new function ipa_cmd_pipeline_clear_wait() that will wait for that completion. Reinitialize the completion whenever pipeline clear commands are added to a transaction. Extend ipa_endpoint_status_tag() to check whether a packet whose status contains a valid tag was sent from the AP->command TX endpoint, and if so, signal the new IPA completion. Have all callers of ipa_cmd_pipeline_clear_add() wait for the pipeline clear indication after the transaction that clears the pipeline has completed. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa.h | 2 ++ drivers/net/ipa/ipa_cmd.c | 9 +++++++++ drivers/net/ipa/ipa_cmd.h | 7 +++++++ drivers/net/ipa/ipa_endpoint.c | 27 ++++++++++++++++++++++++++- drivers/net/ipa/ipa_main.c | 1 + 5 files changed, 45 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/net/ipa/ipa.h b/drivers/net/ipa/ipa.h index c6c6a7f6909c1..8020776313716 100644 --- a/drivers/net/ipa/ipa.h +++ b/drivers/net/ipa/ipa.h @@ -43,6 +43,7 @@ enum ipa_flag { * @flags: Boolean state flags * @version: IPA hardware version * @pdev: Platform device + * @completion: Used to signal pipeline clear transfer complete * @smp2p: SMP2P information * @clock: IPA clocking information * @table_addr: DMA address of filter/route table content @@ -82,6 +83,7 @@ struct ipa { DECLARE_BITMAP(flags, IPA_FLAG_COUNT); enum ipa_version version; struct platform_device *pdev; + struct completion completion; struct notifier_block nb; void *notifier; struct ipa_smp2p *smp2p; diff --git a/drivers/net/ipa/ipa_cmd.c b/drivers/net/ipa/ipa_cmd.c index 27630244512d8..7df0072bddcce 100644 --- a/drivers/net/ipa/ipa_cmd.c +++ b/drivers/net/ipa/ipa_cmd.c @@ -573,6 +573,9 @@ void ipa_cmd_pipeline_clear_add(struct gsi_trans *trans) struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); struct ipa_endpoint *endpoint; + /* This will complete when the transfer is received */ + reinit_completion(&ipa->completion); + /* Issue a no-op register write command (mask 0 means no write) */ ipa_cmd_register_write_add(trans, 0, 0, 0, true); @@ -596,6 +599,11 @@ u32 ipa_cmd_pipeline_clear_count(void) return 4; } +void ipa_cmd_pipeline_clear_wait(struct ipa *ipa) +{ + wait_for_completion(&ipa->completion); +} + void ipa_cmd_pipeline_clear(struct ipa *ipa) { u32 count = ipa_cmd_pipeline_clear_count(); @@ -605,6 +613,7 @@ void ipa_cmd_pipeline_clear(struct ipa *ipa) if (trans) { ipa_cmd_pipeline_clear_add(trans); gsi_trans_commit_wait(trans); + ipa_cmd_pipeline_clear_wait(ipa); } else { dev_err(&ipa->pdev->dev, "error allocating %u entry tag transaction\n", count); diff --git a/drivers/net/ipa/ipa_cmd.h b/drivers/net/ipa/ipa_cmd.h index a41a58cc2c5ac..6dd3d35cf315d 100644 --- a/drivers/net/ipa/ipa_cmd.h +++ b/drivers/net/ipa/ipa_cmd.h @@ -170,8 +170,15 @@ void ipa_cmd_pipeline_clear_add(struct gsi_trans *trans); */ u32 ipa_cmd_pipeline_clear_count(void); +/** + * ipa_cmd_pipeline_clear_wait() - Wait pipeline clear to complete + * @ipa: - IPA pointer + */ +void ipa_cmd_pipeline_clear_wait(struct ipa *ipa); + /** * ipa_cmd_pipeline_clear() - Clear the hardware pipeline + * @ipa: - IPA pointer */ void ipa_cmd_pipeline_clear(struct ipa *ipa); diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 68970a3baa47a..8313220d41e70 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -436,6 +436,8 @@ int ipa_endpoint_modem_exception_reset_all(struct ipa *ipa) /* XXX This should have a 1 second timeout */ gsi_trans_commit_wait(trans); + ipa_cmd_pipeline_clear_wait(ipa); + return 0; } @@ -1178,7 +1180,30 @@ static bool ipa_endpoint_status_skip(struct ipa_endpoint *endpoint, static bool ipa_endpoint_status_tag(struct ipa_endpoint *endpoint, const struct ipa_status *status) { - return !!le16_get_bits(status->mask, IPA_STATUS_MASK_TAG_VALID_FMASK); + struct ipa_endpoint *command_endpoint; + struct ipa *ipa = endpoint->ipa; + u32 endpoint_id; + + if (!le16_get_bits(status->mask, IPA_STATUS_MASK_TAG_VALID_FMASK)) + return false; /* No valid tag */ + + /* The status contains a valid tag. We know the packet was sent to + * this endpoint (already verified by ipa_endpoint_status_skip()). + * If the packet came from the AP->command TX endpoint we know + * this packet was sent as part of the pipeline clear process. + */ + endpoint_id = u8_get_bits(status->endp_src_idx, + IPA_STATUS_SRC_IDX_FMASK); + command_endpoint = ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]; + if (endpoint_id == command_endpoint->endpoint_id) { + complete(&ipa->completion); + } else { + dev_err(&ipa->pdev->dev, + "unexpected tagged packet from endpoint %u\n", + endpoint_id); + } + + return true; } /* Return whether the status indicates the packet should be dropped */ diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index ab0fd5cb49277..c10e7340b0318 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -831,6 +831,7 @@ static int ipa_probe(struct platform_device *pdev) dev_set_drvdata(dev, ipa); ipa->clock = clock; ipa->version = data->version; + init_completion(&ipa->completion); ret = ipa_reg_init(ipa); if (ret) From patchwork Tue Jan 26 18:57:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 371495 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp108870jam; Wed, 27 Jan 2021 02:05:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3FkSX/dZKUO0xn7EZQ6wu6epZJGYTxDMsb8Fs4D28x8oZE6MxpDVe1VPQ/b8Ce81NsRzr X-Received: by 2002:a05:6402:1701:: with SMTP id y1mr8061121edu.251.1611741919043; Wed, 27 Jan 2021 02:05:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611741919; cv=none; d=google.com; s=arc-20160816; b=jpPb11IQ0ggR5G4lAOfk1Gnf8MIJywLIuafkQE20kCauehQArCsMBEO2Twdmj6SdA7 0E1TDNZph1eOufd5c7/h4n9mXBZ3HobSO7m85a8ctPW+QQ0WanDrkOrZDejMu2GzfVl0 mRp2fN6aDtoSa52J5+y4qH3l9FrDqwVNnHS9Egbo3+eKSZfyBpn7/uhSTiXxnSktHzFc zJrbIQ9/0hwMha05jPgNHUitnkQu7yoQeKGY9duLgaDpI8Obg8I/43hYGFb9ZLpY1jFZ +CbwI0M87thf4MJCND/BAt2GOOGuYyC4WGgDZv9yHiulJx3zHULs97PAAb1SsD0bNa4h CU2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iqgjR1e4tTC1elH7UbXJeMsKuzidjS4eT9TJei8uecI=; b=Ibmrj2JqtReSmYTWpBNtMy/CK2+dvcWjlzjDHyLj4qBHztMGIXQFu7gUOqRvB9dmU/ e0lHeED0Va+CRVuUjkNH1I2YhpU1hjhEuXYaTqnUSct+ehFDxb/ZcHY/y4vV8Og8KV2M rIBgIryWy2168+AHybHMUi5zuMBwRhefLnmMK33QqZOCa6sH5vjDahBo7QzSJdOKEGdr IARZidD5cvGpwrE2NVoPWv0GNb3oLqDdBiWxzoUY9PdWazcRHrtcPcwCP0U/ijg0ImvG Rb5jS+kmhAHxSe7B9ilYEDgrNdMIe/dTH7XLfJ80FBXah0oO4uVzkt/KR6T0P0J90r1L VNqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k6QnN9TS; 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 lz7si633267ejb.725.2021.01.27.02.05.18; Wed, 27 Jan 2021 02:05:19 -0800 (PST) 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=k6QnN9TS; 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 S316763AbhAZXJj (ORCPT + 7 others); Tue, 26 Jan 2021 18:09:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730868AbhAZS5j (ORCPT ); Tue, 26 Jan 2021 13:57:39 -0500 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 617E2C061355 for ; Tue, 26 Jan 2021 10:57:13 -0800 (PST) Received: by mail-io1-xd33.google.com with SMTP id 16so5281727ioz.5 for ; Tue, 26 Jan 2021 10:57:13 -0800 (PST) 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=iqgjR1e4tTC1elH7UbXJeMsKuzidjS4eT9TJei8uecI=; b=k6QnN9TSLdyknJUo/KYu119xbTnkAKHFsG89MhiaiH7cADfUCdDx2RmvHNSQGiOJUT HyK7qPOSPeULD+c/Zng6bGm/0ECGpuISlA0dJwDytBc5DFssm5I956K9T5+YkV08nggU xV42BDDsryUg3USHphrzLIM5QcNrXu9ooZ/Z5uEJV+1IW4S1C/MsosebPB85a4+7BygL dsWv26EFyqGPzN4UXawp6Ova4xlTRgXSQYEn6VtsM4OjiZSEgfBxa9p1sfbRWSi9gHuu BRWjSvNa0PvTJcg1tbQmuTdG700420X6p4ORSKZcsPlCxAeIC/HUtgWFCCC4N+A6J0CB WV8w== 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=iqgjR1e4tTC1elH7UbXJeMsKuzidjS4eT9TJei8uecI=; b=h8iKUO2/EcvT7h2u0EGse+LSWbuFgRsDEdvbNnMGZvDm94rRrWDK3WUD5qKeb2Hri2 KEHfKzYNXqQGq2INtfi6V9Up+KgDzuCn0xOybjfoAXASdYYz2JN837s28X78zO0rfOSF 15ejokPLZ6WjsQXHUKeW9K1tcxQVA4T1GU8ksbM8sEsxq8UaU/4x3meUg7D1GtLzvun2 LLMNR3RbXZLC5VwHIXaCpdxfMH5e1SafPoHCEPAiXImeaBuJgxFPPQ8+wi5DMDibV4I7 ZPxbhFMMx1j/LHnVf65JSvj8mVKwrQuQvnq3sFxmfzqYR+02yn58ZIWelat0FyQnkdsT H9Vw== X-Gm-Message-State: AOAM531L/gwjlrAK+ie90LwtPl92TaQi4D1U4XJKPW4ehdO1cqxIHwSZ fHr1BTwXrEN6K27Az3DV3K1quw== X-Received: by 2002:a05:6e02:1c8c:: with SMTP id w12mr5569595ill.78.1611687432748; Tue, 26 Jan 2021 10:57:12 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id l14sm13060681ilh.58.2021.01.26.10.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 10:57:12 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: elder@kernel.org, evgreen@chromium.org, bjorn.andersson@linaro.org, cpratapa@codeaurora.org, subashab@codeaurora.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 5/6] net: ipa: don't pass tag value to ipa_cmd_ip_tag_status_add() Date: Tue, 26 Jan 2021 12:57:02 -0600 Message-Id: <20210126185703.29087-6-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210126185703.29087-1-elder@linaro.org> References: <20210126185703.29087-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We only send a tagged packet from the AP->command TX endpoint when we're clearing the hardware pipeline. And when we receive the tagged packet we don't care what the actual tag value is. Stop passing a tag value to ipa_cmd_ip_tag_status_add(), and just encode 0 as the tag sent. Fix the function that encodes the tag so it uses the proper byte ordering. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_cmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/drivers/net/ipa/ipa_cmd.c b/drivers/net/ipa/ipa_cmd.c index 7df0072bddcce..eb50e7437359a 100644 --- a/drivers/net/ipa/ipa_cmd.c +++ b/drivers/net/ipa/ipa_cmd.c @@ -529,7 +529,7 @@ void ipa_cmd_dma_shared_mem_add(struct gsi_trans *trans, u32 offset, u16 size, direction, opcode); } -static void ipa_cmd_ip_tag_status_add(struct gsi_trans *trans, u64 tag) +static void ipa_cmd_ip_tag_status_add(struct gsi_trans *trans) { struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); enum ipa_cmd_opcode opcode = IPA_CMD_IP_PACKET_TAG_STATUS; @@ -543,7 +543,7 @@ static void ipa_cmd_ip_tag_status_add(struct gsi_trans *trans, u64 tag) cmd_payload = ipa_cmd_payload_alloc(ipa, &payload_addr); payload = &cmd_payload->ip_packet_tag_status; - payload->tag = u64_encode_bits(tag, IP_PACKET_TAG_STATUS_TAG_FMASK); + payload->tag = le64_encode_bits(0, IP_PACKET_TAG_STATUS_TAG_FMASK); gsi_trans_cmd_add(trans, payload, sizeof(*payload), payload_addr, direction, opcode); @@ -583,13 +583,13 @@ void ipa_cmd_pipeline_clear_add(struct gsi_trans *trans) * command says to send the next packet directly to the exception * endpoint without any other IPA processing. The tag_status * command requests that status be generated on completion of - * that transfer, and that it will contain the given tag value. + * that transfer, and that it will be tagged with a value. * Finally, the transfer command sends a small packet of data * (instead of a command) using the command endpoint. */ endpoint = ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]; ipa_cmd_ip_packet_init_add(trans, endpoint->endpoint_id); - ipa_cmd_ip_tag_status_add(trans, 0xcba987654321); + ipa_cmd_ip_tag_status_add(trans); ipa_cmd_transfer_add(trans, 4); } From patchwork Tue Jan 26 18:57:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 371494 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp108822jam; Wed, 27 Jan 2021 02:05:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQwR1FOJeoYpb9vwWdXH200HTHSw4kUjK8zWVLS4k0CCeT7ulKQ2TgiD0tUiz6RYjUVy5Z X-Received: by 2002:a17:906:4f14:: with SMTP id t20mr6281004eju.55.1611741915798; Wed, 27 Jan 2021 02:05:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611741915; cv=none; d=google.com; s=arc-20160816; b=hC36MGLaOt29Z6D82r83ZeGEosh0281rQbOpqZyh3oR3Get7vaxaOUtojgCXqiXmi/ GIJTyd30ifOl6UMabaAjh1MAfxD/Wz+n6IGRQ5/Nv9epX4/EerE1ZaUkXuvx/BGBgYE6 XqdILlKkpnf/8/d83KSKk13zdhw+ELnG/qdejCp/bsx3d2S63vVSyPIIihO6PvCaiVFA lFka7hWHt0PfKAoo8doKQo2zJgBss/uu/+4ocjbZcyUcKvNnjdTq++H3I9jILf3SEzlZ 99Fhc5lIkc1lXUXjGwsiNhfJDLt+fuP3nJX5hNDrIA5gAju5kY5SuXBr5ZjVkjFlj8U9 7huw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4XCw/DKlPzbfEbK7Wq85mEUjWal6SYNVmWAVH0HVNQI=; b=vEqiltXAF8vazpZ9uvjbt4dPnMHLYsuT+F+9Sb42ZTpwa6bd0F9v+hmf3ugUprrrsP LRMP7Ldpys41lAur8qYGytfA/awI0wfFHAYASQMec31t5g1668tocYrfChxsmvbzDW8d d9AN8Vd2lHiyGLcXKKqjqZq2tthOiDr42ehWJUUbwYjfSls+l6PpcKmd+V0HZt/1TQnU M6l9hxBR7GSR4UjS9BYCIty2uDtgsUCSzvGU4kbjQ4USJ0mo/ft2PKO3L4Oas4642W0I 7o01OFGvyF86v/4SDGGTsGw0ByP+3b6GNlsAwRZINQHawIQiJJUef/2gjzqc/4rSefIN tLaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ttpVKqsc; 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 lz7si633267ejb.725.2021.01.27.02.05.15; Wed, 27 Jan 2021 02:05:15 -0800 (PST) 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=ttpVKqsc; 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 S316775AbhAZXJv (ORCPT + 7 others); Tue, 26 Jan 2021 18:09:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731451AbhAZS5j (ORCPT ); Tue, 26 Jan 2021 13:57:39 -0500 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EF8AC061356 for ; Tue, 26 Jan 2021 10:57:14 -0800 (PST) Received: by mail-io1-xd33.google.com with SMTP id z22so35766836ioh.9 for ; Tue, 26 Jan 2021 10:57:14 -0800 (PST) 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=4XCw/DKlPzbfEbK7Wq85mEUjWal6SYNVmWAVH0HVNQI=; b=ttpVKqscHXaGViXdvSusZvZERSWcJPWvYrFU9sZywNA8AMsbqBK3qqsXM+VmaQ0sAx 6pDXe50mX9MdwXdzf6HPA/JAeCOMg1wiI2BrTO10adpMmHAcSDrSsDFlyrcjTpQdhlMr kq6xvoIFeT4GX4IGY1llEZ4fW/aFINUcCcBaCCWM6L9v3VWnSa2L3YFGcN+ndos8iVwU jkGwlD+KXlet9d1CMy44S6GkaJS6lX4jaDKEO8SagXVkwNrm1xyhbgixjsMbtWd69td7 /ujPltyUdXWNCWqJ+U1d9Jst10Xm24X8NXzBGKvjnMbKx9O0SS0u4wPzJwENRRf5JOhQ i8FA== 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=4XCw/DKlPzbfEbK7Wq85mEUjWal6SYNVmWAVH0HVNQI=; b=sLF4+wFBK2aDzQLJjV1nsheOLH958QOc/izsVXwC3QkOMO4D4SFqam0qFNMqZeBOpZ SIRhXkzdqSmQpgSN72/sqXO5RHENp2uIQ7W3wbSRJaCE/bASX/G9/A3tWTZLTMa7DLr+ U4HILrP8tKHUN1bSnn8YjA1USy3LSSIhEUn74qrEZ65pXPgaM42oqj/KjFyQ+8AJmJIv oTZUf6XhJvPx9tZoulYoEcRvMQfaPnjYRlSMiUySxrc0VvfHCErZ8ILcB8BsC7DzguIQ 9TAKX4fF9zauYe2nR+a4FOy97bRnIZJuQVrCwbfw4GgCN8C/GaIJLtdrF4DNJvlYqprJ ds8Q== X-Gm-Message-State: AOAM533q/NhWKhb+yCqfllA/UvjiKEjh/1XK8FP5vdBv65q3zWPh5Bm3 GqX4pf8tpLjJZFHrnmr7fB8VtUWUt7Bt9g== X-Received: by 2002:a05:6e02:541:: with SMTP id i1mr5962831ils.295.1611687433855; Tue, 26 Jan 2021 10:57:13 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id l14sm13060681ilh.58.2021.01.26.10.57.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 10:57:13 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: elder@kernel.org, evgreen@chromium.org, bjorn.andersson@linaro.org, cpratapa@codeaurora.org, subashab@codeaurora.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 6/6] net: ipa: don't pass size to ipa_cmd_transfer_add() Date: Tue, 26 Jan 2021 12:57:03 -0600 Message-Id: <20210126185703.29087-7-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210126185703.29087-1-elder@linaro.org> References: <20210126185703.29087-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The only time we transfer data (rather than issuing a command) out of the AP->command TX endpoint is when we're clearing the hardware pipeline. All that's needed is a "small" data buffer, and its contents aren't even important. For convenience, we just transfer a command structure in this case (it's already mapped for DMA). The TRE is added to a transaction using ipa_cmd_ip_tag_status_add(), but we ignore the size value provided to that function. So just get rid of the size argument. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_cmd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/drivers/net/ipa/ipa_cmd.c b/drivers/net/ipa/ipa_cmd.c index eb50e7437359a..97b50fee60089 100644 --- a/drivers/net/ipa/ipa_cmd.c +++ b/drivers/net/ipa/ipa_cmd.c @@ -550,7 +550,7 @@ static void ipa_cmd_ip_tag_status_add(struct gsi_trans *trans) } /* Issue a small command TX data transfer */ -static void ipa_cmd_transfer_add(struct gsi_trans *trans, u16 size) +static void ipa_cmd_transfer_add(struct gsi_trans *trans) { struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); enum dma_data_direction direction = DMA_TO_DEVICE; @@ -558,8 +558,6 @@ static void ipa_cmd_transfer_add(struct gsi_trans *trans, u16 size) union ipa_cmd_payload *payload; dma_addr_t payload_addr; - /* assert(size <= sizeof(*payload)); */ - /* Just transfer a zero-filled payload structure */ payload = ipa_cmd_payload_alloc(ipa, &payload_addr); @@ -590,7 +588,7 @@ void ipa_cmd_pipeline_clear_add(struct gsi_trans *trans) endpoint = ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]; ipa_cmd_ip_packet_init_add(trans, endpoint->endpoint_id); ipa_cmd_ip_tag_status_add(trans); - ipa_cmd_transfer_add(trans, 4); + ipa_cmd_transfer_add(trans); } /* Returns the number of commands required to clear the pipeline */