From patchwork Mon Jan 25 21:29:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 370242 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4367006jam; Mon, 25 Jan 2021 13:31:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhrNPLr5iC1fGuy+nLGhGi2HWHW5+Xc0EB0I4YX7RbF8bVOXFrmWRSYza2L5XhBSuT30Ek X-Received: by 2002:a17:906:5f9a:: with SMTP id a26mr1655501eju.87.1611610295170; Mon, 25 Jan 2021 13:31:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611610295; cv=none; d=google.com; s=arc-20160816; b=MsHzdsVQKSJI2hBcgsq+L+NvlpU5pnAxAtEw4aqGo2sjDenx3PhCQMwJgnCjh9RYWk LqXSb1wpUtLudgfZeeqiY+Zlbsmfrwtj8qya4Cu2RkjYXpM8X4FNGm58hGEuruVxrhIK nvbl3byffhuzt10S7zUNHwO3vastVZ+c+K0/fvOmWfb2Np76VHqlB+LTWhD5GEu2Yn2y A44lSXtmQoW6+dS+AmCGawgcPV/YMr9tc8yqUm7JAgg6/BCXjr6ZSracvFhjpjQw3aqG /sF3jcLjF2ZsOevDSRHrowfrbEeB+CY/EQX7UNGk1wFgPf+0xYseWf+Y9giAbeUE5/5Z XIww== 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=bpA/upsu89CV/0xE+30vpjNOpDpXxmzlzc0JEZZ3NucW2oZ4OXWrbOq5iCCsXuGUak 2rwJ2O6KI1OYtBSPM9Seq2JImzd3CueuZaiIZUjgNnecJIEorswCXAmMU6Nqd9fvHIdU JCd/6a12qlZVZLC6P0fk/Z3qSmkAhQzyVrQ9Snc4TpnClnmmmlhKahJxG7CwHXn2yjkz T5SHXHBkuQu8a6CBRlywTiNH0paUS5RVANGSATOs4khoqq1RkEIbzZbEQ3ogZyuCfP5Q +iDLJ6E4IAtfg7K9/h8TobvOeTnvC+ubhhxylJ+GyaJKbySsIvrXt4UONvtEloene2Jl 2jhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m++7MR8A; 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 lt6si6278948ejb.133.2021.01.25.13.31.35; Mon, 25 Jan 2021 13:31:35 -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=m++7MR8A; 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 S1732707AbhAYVbG (ORCPT + 7 others); Mon, 25 Jan 2021 16:31:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732666AbhAYVae (ORCPT ); Mon, 25 Jan 2021 16:30:34 -0500 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C166AC061756 for ; Mon, 25 Jan 2021 13:29:53 -0800 (PST) Received: by mail-io1-xd34.google.com with SMTP id y19so29620558iov.2 for ; Mon, 25 Jan 2021 13:29:53 -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=m++7MR8AdVlVxjDtEqVpeCbjIjDCZqRIERMyyZfZibpzbkWsZYCH/PuCok20O7a8C3 OfF/nw6IRs1/rlp7KVa1AnFExLJ5kFamjhhAbtglLMeTTq8tNo8s+7RZyWW1lY+YrAEu CUqEdJABVGfDWMymuOG9emDcX4CdHeuDWarvqz3sGB209rroawmlBBB41zdqFbPV0AG1 QJ2VPAgd+qx86p4l6rEFpP2rC1Fqqj0bn2F4lylPIfs5aICXOAOGHl91ovpyRZntTA8W ABkycQJ+CaSYuDTt/1l2JBk/fMYRt30otCHx8XQL10KGZc6qoGpsaEAtGkiDpK0obqLL 5W1Q== 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=dU4HxyEgeDqA0kG2j5UQdGUtoVWhApKFVxo68ixMxw6X2mmvz6tcu/h6/Mdfi0jcyB GCcL1C4Y7hgsi9rq/jjtkngKhFnWtB+K3hWiMwhSKQEqNnPlphlWIWsJeJbhJUY8zAqH WbN5ylihw3zt/iQfI5WGiJBa5aTB5KgJLqRLOuDDS/nk0vb3hoZwNeU8i+YnuyOZLbI+ r9dpSnL07KTarDH7HU1R0Oe6YzT2QxFyR+dvmvNb636VilqGNfw/eFOMJYDXAGXwTIaY ZuzmUiOzqFtIrQLdE2cHIXGL62Zu3AoWmoUn3Gnbjd7MBLECRFSXJPaLIFMvBg66k1i7 s+ww== X-Gm-Message-State: AOAM5321BOj28sGMAJAyij46xTd+7cr9UGkWS7Ez9J0qh6YryurI4PjE 2mSKjKM/U7XG+I8dGsKfVpvVBA== X-Received: by 2002:a05:6e02:20ca:: with SMTP id 10mr338512ilq.14.1611610193125; Mon, 25 Jan 2021 13:29:53 -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 o18sm11136241ioa.39.2021.01.25.13.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 13:29:52 -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 1/6] net: ipa: rename "tag status" symbols Date: Mon, 25 Jan 2021 15:29:42 -0600 Message-Id: <20210125212947.17097-2-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210125212947.17097-1-elder@linaro.org> References: <20210125212947.17097-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 Mon Jan 25 21:29:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 370243 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4429576jam; Mon, 25 Jan 2021 15:26:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJytsxDxf9sZ1YyQ68jPhOYQ6DXDOAdHfEw/L3yIdvF0mivYCCwSM0mZx6e1709tPZ7n/Nnw X-Received: by 2002:a17:906:804c:: with SMTP id x12mr1757203ejw.42.1611617197130; Mon, 25 Jan 2021 15:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611617197; cv=none; d=google.com; s=arc-20160816; b=FGj4AKmbMn5pWRdbBVVm2uandBdZBn+fUSSkn6dEafnfd+d9aUy2x5OAPeXDpDGF1b zCQeP2BeVbi38V1yXIykl39fqbSQxSK1hOdDM6kq2PPH+k/qSxEewKn2J5/b7CNY/qVt MQ8aaWoeLNvW0GkA2KYfmisFbcZ7IwTfDikpmyB2GKqlb6sWjjFWl4Gpbi9cTe3MlPgy VynQagzqbeYQzncHqyOWoNNQMTWnGsIXmxW0C7PacxOzgBNDLRi7CkPkHBY+Eu1ODSML VvuZGPIxeQR8DmtjTabP06Jmq4nAb3oKKntIsUfsXVZ6MhwlZmYqKVKz1KQh3bnl+2ub mqxQ== 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=X9oEoEeBxc8xho+gV+p6tCyvqZv3cLymMdYeUdf262+a62wYYPLnq71zKTKPM1qDiG R+fgoPw8Wf5/t1AaE2vXAwtQVAQdXAcNDnGezToyj1Y//TgVyGJJAU0yVm4WYodXeScX Y+yzHiyPX0JEjTo9qYOupJQvKKcYFlZX6ze9pjmpNc6FQgDPaoi046teCfR+64vbsMve PsW/PpDTf3gN7xrY4Az1uUPXDWsQz1GFeu4DWbHmmkSYC9eqr/jMRKqBKIPVLdxnRp6n InZUdKukawVGMMTWUosU97FVpdtIXriZuQb9dhIuxHyBaJ46qXH05gYyfhrdKCZEp00a 3xFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tTCfUMZu; 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 t3si7452102edw.266.2021.01.25.15.26.36; Mon, 25 Jan 2021 15:26:37 -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=tTCfUMZu; 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 S1731401AbhAYVcd (ORCPT + 7 others); Mon, 25 Jan 2021 16:32:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732710AbhAYVbH (ORCPT ); Mon, 25 Jan 2021 16:31:07 -0500 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2EF2C061786 for ; Mon, 25 Jan 2021 13:29:54 -0800 (PST) Received: by mail-io1-xd2f.google.com with SMTP id x21so29627826iog.10 for ; Mon, 25 Jan 2021 13:29:54 -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=tTCfUMZuXXOxBVYrRDGvhRwfEDPgDy4t6wA+C8pWcN4V0hyLN2U+IXN1LwoDs0qraT sx4+DVP5A9M7joq5aUbhqwZvVx2F83jyJkZbt2bzhJ+gXAatK3IxpfvmbLNQ+q/s1QN7 0fKSNRY/qKad7zA0P55n64XeTExtnnSUBhwO13w2N1NmvIU1Pz8j5b470s3px6sQZlRN 6XfrcxpUeTT2DMCF30FnMVXepqox6mQuqJWX78r48/FQWjKq456DyNAej71Ar3qIGMyg pvyg/2f/mya4+umdwOIcgfF5zcZDL4NSPNlVuO7F+VRlaGQidsza29hyL3hsC/T4HmW2 VfRA== 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=hQ2hYMtANsRuw+seQzL8loKxv0HHBkZ+B0EyotmNnP7HoCr+buMZ8XGKQwJYMWueUY bxP4Y6pKiZMPf5L49vZmiqg1gy9KA8+1JOynZY/2Ti6RCUVkLzfvH68jN+MUxKhurIQM 059qDMUcwzetJGsGYMZCXhGLkJHsINms6O8X00YzXF7FMslAqrdgfcXAlCHI+mgnMJeE jMP9TQ7bx/sEI0r46k52qeb7iQkxAGYe1wyh/JaGMamo1rXU0BwkaxEySCmG+xsmmJjl yeYq3sw5aCMB8OueLWg0zJoszoDMz9DjaTRRnPQg9X4GtkKpTUwuSNroUI1oO2XCjJKu QOMg== X-Gm-Message-State: AOAM531k+mFhNYO4sP2u6F9JEwXeKOWt6Yh66aDMuUg9vmvgfSvW6t0x xzSrzyGiMFZCe8TSnE7W4evCAA== X-Received: by 2002:a92:48ce:: with SMTP id j75mr2055154ilg.160.1611610194258; Mon, 25 Jan 2021 13:29:54 -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 o18sm11136241ioa.39.2021.01.25.13.29.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 13:29:53 -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 2/6] net: ipa: minor update to handling of packet with status Date: Mon, 25 Jan 2021 15:29:43 -0600 Message-Id: <20210125212947.17097-3-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210125212947.17097-1-elder@linaro.org> References: <20210125212947.17097-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 Mon Jan 25 21:29:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 370247 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4431279jam; Mon, 25 Jan 2021 15:30:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3zezgFciEXmwgAdc2hXROfgTUDGBM9YOJURiLJ2380LK8B1wzZUFDbHSs4nV/RFztgEiU X-Received: by 2002:aa7:c399:: with SMTP id k25mr2466964edq.305.1611617407361; Mon, 25 Jan 2021 15:30:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611617407; cv=none; d=google.com; s=arc-20160816; b=jv9GsWewK7NTibabYuxA72cksrHvwZrSEJW1g4Phu1T/ifHeyHzMvCa/nh3icJIog1 F4rQF0nV6scPi3xhGomz5JDjF/rXkcUOZuX6a5RsLLPFkIjuTVrMO7sotQrW+AMa2Rcw xqx6ym+N8NF/Mtej4xJnGMXgk3G2HwTj3uQlkB9KqdpqWXLAHd7MdXTldjPeS1JKsrJt 1JH5e4gmXJzXidbNMCAPAivxm7w+N8Xlh/0ed/Z7h9VRKdf3aVN4xoGqiH5SzVGduBmg 0VqilIdBP+h6pF6caHqv/8R+XrVT3eU6jwLlOzh2fnVEx3w4K+Z8qoCqRpIgmW3Si0mI ULhw== 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=U2sFIZtfJJ0QC3wGockY2PpSjOlVKhMWufupSAbCHfM=; b=KHyBRFAstiONpGHXg9C/Jvh677GGTnUO/cmmhuf9yZ1TlpjZGORQ2sKqvb3e1M4AZE MKO9hYe87Ixp9zNyZnS00faTXEyRUeUTFj/4nzIWanZo41+Nkb5QDlrFXW6FLIkjd6dm WjcSeSovwkuWhFWNT3TngU3KdDfotPv7OklFI58yqLnvVswqyGJG0fUHxpl3dXplOfD4 AKIZUMywmfJ6Xj2NBeMXmoXuHOg4dgbg6E3N8w4I8/SYsUax64fg7ZFJTLK9U/lsbCpX i3SzE7hjnnDofyQNLgm/Frkcb3PlKL96DRDAcDV8owWbF+0KI2JUJKYdJBR+jOPkAGak 3bdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HsoNMJjY; 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 bt21si7830768edb.569.2021.01.25.15.30.07; Mon, 25 Jan 2021 15:30:07 -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=HsoNMJjY; 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 S1732867AbhAYX2z (ORCPT + 7 others); Mon, 25 Jan 2021 18:28:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732615AbhAYVbO (ORCPT ); Mon, 25 Jan 2021 16:31:14 -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 E825EC06178A for ; Mon, 25 Jan 2021 13:29:55 -0800 (PST) Received: by mail-io1-xd2e.google.com with SMTP id y19so29620701iov.2 for ; Mon, 25 Jan 2021 13:29:55 -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=U2sFIZtfJJ0QC3wGockY2PpSjOlVKhMWufupSAbCHfM=; b=HsoNMJjY0ptFTHawJovVbdo1QvUvx9PhrtAZ6L6h1g1m6G7S9GFWrsTCw4kZGubZdn nIoQEdms4zJbAQFuqF1gpw50hs+7mRMH4LxVDmu/cKQU3VVeJWslp/V0LvM1mgrSKuy7 6WTPkeBsafEiAUh1wGI+RjTpGdtKe0D84QO3P/+Fn9LMhKVsxMKbk4S5tuZ8bQUy/Wu6 RRFxlMa4Pw4PuvzlrHUTaQvxP4exslRv5lqIuIiCKLRoSXZPru0MxRARMN8Kcl3VTMDj 9ghslcKvgaVZITssbx7OMA79nEJw9lJaCu0bQ6R8/PHuiEqxpQkZalFcN2S5hMX1YIjT z16A== 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=U2sFIZtfJJ0QC3wGockY2PpSjOlVKhMWufupSAbCHfM=; b=Lgv3xAYzwlYMJe4XcbKdMuL3pMIbqVR1LiYpvpLna4J9xge+BVoS4Ge+SGZzleCzHW OyC4xmhDmjsH9IY+7I7p501tsm3KJFVZ565nJmROcJ1ogCWDdxlsMgTStBPJBSZSql3s 4Pq+47MT2R9K8+P4VhFVNHvvyE5O3bkcUz0uuVtaZXN3eNeOXfRjqILQun5QYoLe4SCi /EMlLaq5ZvydJl3w6qXKpm1U78RpJX0p3XakMO1eZmv+bFcoNlOrBxri0oxbMiHyVLfZ zTJCNrPcAIx66vrK7iRHyL33fT4SCzaE060CsViB5Uh0oasvX0k0Q4mU90WXVw+PBmud aLwA== X-Gm-Message-State: AOAM531c37npk2r4UgVhSrnsYWJvWHFVtftazAbDMVTh6x+wqHQk83BQ v+bs723N0TrrccD/iVgOxfSpfQ== X-Received: by 2002:a05:6602:154e:: with SMTP id h14mr1952503iow.1.1611610195348; Mon, 25 Jan 2021 13:29:55 -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 o18sm11136241ioa.39.2021.01.25.13.29.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 13:29:54 -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 3/6] net: ipa: drop packet if status has valid tag Date: Mon, 25 Jan 2021 15:29:44 -0600 Message-Id: <20210125212947.17097-4-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210125212947.17097-1-elder@linaro.org> References: <20210125212947.17097-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 --- 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..f1764768f0602 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 !!(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 Mon Jan 25 21:29:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 370246 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4431267jam; Mon, 25 Jan 2021 15:30:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4ro9H9KRaboWmzMHL0xPkOGIbfVC8tp+tp1k6K4Bi7s55OISasMiGBuIX0MypvrJpgxwA X-Received: by 2002:a05:6402:1a57:: with SMTP id bf23mr2396563edb.183.1611617406467; Mon, 25 Jan 2021 15:30:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611617406; cv=none; d=google.com; s=arc-20160816; b=q4JRwHHgH/wiYqwbbeW02t8UxawxGT/5vp9RScSy40xkYnLMwxhIP4wIJ+64tXkI7J Tr/t+hdRdz/vdtkjVZPX4B0eK/w2csr79wCfKOel6yVhCBjvfVytt0vPif/b7NFx96CE jD5D1rO59pqZpq1uhAknTFUj/VwN8lTY/8I6Blm1tUwW/I4aSmAJTlGhQdV92ylQh5HX 8g3TA4Tvbep/VonopyZW7sc+mhYH4syTfVvap/c7WEXKaUfo29Yoxng04ebn1Q/F4O0n GDtW1oRu8lTd10ifYRCBUy4KajQ56Ages449qpiIFGjrNX7B8CVWWni/ceXBFDbZ9GIL clPw== 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=bETQihSoViQnYCs/1MkGcaLaZjmmD0arqKg/QkCXmJg=; b=IA4AT2sJIg19zLh0j2EMdUA86uWJ6KHmM5VyVmn/4U+4VrcyQeSES6yvf15JNqNL9z Iv5taXOFPvXmXdMtgYqAc73UzJaDA9DissFt7/Ej3RRrB2lVEoRKgjNxP8D/VTnu8sDt xY0Dstglxall1OvAfolBYYQXQXOiuF6MnleITnWP5eliSODS18B217foEnwYmQ+0RaH6 3OMvVa/J4jeolGfE8WRfVkn1BFiXP6lSibqHA2CKY4uiodeAviJSzFEAT+2ACmIAXZ/e VenBKd55x2BJ6eEijJrCZiSnCZ4aASLX0Xsyvi0dhTVx9QYIK0C/ZJzA7sgPWYC4pMIa waAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IUkYYNUN; 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 bt21si7830768edb.569.2021.01.25.15.30.06; Mon, 25 Jan 2021 15:30:06 -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=IUkYYNUN; 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 S1732846AbhAYX2k (ORCPT + 7 others); Mon, 25 Jan 2021 18:28:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732713AbhAYVbO (ORCPT ); Mon, 25 Jan 2021 16:31:14 -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 08D53C06178B for ; Mon, 25 Jan 2021 13:29:57 -0800 (PST) Received: by mail-io1-xd31.google.com with SMTP id e22so29607778iog.6 for ; Mon, 25 Jan 2021 13:29:57 -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=bETQihSoViQnYCs/1MkGcaLaZjmmD0arqKg/QkCXmJg=; b=IUkYYNUNHA44h9oE5wtFFNGRrb99rBzxIZnNRV9NIMpLL+npuo7h5iu7oOfzjdSPak 4LvHOrv9WJ0pRJM6DyZlTP1swiFDsNST9ro+oQdhqWVZ8KnUSvSU1mhwTDQwVTBv8cMK PDHNn9nIJrIC09nu/dXqv88oZ5RoKnRNg7QV87Pjt4OOSJfJW6PwonTx9DVWTNiinOEd anc6kVb+DqqJvC2yzTsSwTvDb4OAPfEx3zgbW/A0wSM3OnUggrNK1iDj802Cfy+Mhk7J d32NAnz7Gn+/2cJ3UOxBAYEwYo4B7eqSciUNrzWy2Gq7rSLmkGdUjlct0o91Eja9CHbK hBkA== 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=bETQihSoViQnYCs/1MkGcaLaZjmmD0arqKg/QkCXmJg=; b=HA/PJGt2EDNEq3Q2P1uI6IUHdKaRc+N9M05njt9cXHOYNhHtvdq2tlQg3a9kZhlQAU 75MjsG96SWE8m5wlJSEkrFGmiRh5AveAEVd7neh7uImhIjNYJLq2/PsthV1zhOhviCQp i5Rin1lGgSupgeT0XoOqmZz9niWJ9dHRMpA284H9iQ/n+jRDgzovBVG7mwaF66mY3b7W MjmERjIrdvs9hb6mSrLi7HlKRr2MaxZr/gvaRz3JmabaTbh40O3KrHA13nSb23gnXNQ3 AAOgS+ahZeCRiXBnz5AdpijxerLm/GnX0HSMHSp9sV+IbRP0AvCT5JcChJNLA362mmBw TwIA== X-Gm-Message-State: AOAM533V5Wmcpbqvhn683xKgm7yu3MvHeAl9xehafOx4qHsoGn00aElF dQqBRS94cWbQOZ2DQq+VWbBUdQ== X-Received: by 2002:a92:874d:: with SMTP id d13mr1983914ilm.270.1611610196359; Mon, 25 Jan 2021 13:29:56 -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 o18sm11136241ioa.39.2021.01.25.13.29.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 13:29:55 -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 4/6] net: ipa: signal when tag transfer completes Date: Mon, 25 Jan 2021 15:29:45 -0600 Message-Id: <20210125212947.17097-5-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210125212947.17097-1-elder@linaro.org> References: <20210125212947.17097-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 f1764768f0602..cef89325a3bb0 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 !!(status->mask & IPA_STATUS_MASK_TAG_VALID_FMASK); + struct ipa_endpoint *command_endpoint; + struct ipa *ipa = endpoint->ipa; + u32 endpoint_id; + + if (!(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 Mon Jan 25 21:29:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 370244 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4429601jam; Mon, 25 Jan 2021 15:26:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxIp3ZDapZwBpTolJXqcY6UiDK/bzQEyaRV2New6EVHYOmgNMSiax5zs/BnTkCjM6Ig5AV X-Received: by 2002:a17:906:30c4:: with SMTP id b4mr1774088ejb.456.1611617198751; Mon, 25 Jan 2021 15:26:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611617198; cv=none; d=google.com; s=arc-20160816; b=NiJo4y+DgMzw92471HOUUU23X2eOA7sCXEkoFMxnxuX/tJHI4VPdI01QuMcZ8imBta X/nKkRjLKTnuf+e+DoIRt3ETQBnuvju1GKYR6VgyiiLm6YYYXBRyrJ16I2c2P29xNrfP +1sjVCOoqfpSOvHcej/1TWn6K2Tu0RYobEBVVHbCsIKYAwm8LxDV9I/zfp8JJTRbFKLp qwyNKcGW/4OmM9QGxo6/CO9oPctrSV2b8gPzfpZmyuXkmyMBiya+pzWRqOhaG0b2abWB dIsHgUWq7yofkhuC8NAphhRO2xYnP6FA6TFDxiWjlAqOLnQzDrziTw2zZgyUz0dDZKbd nBDw== 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=nX1OUrq8ARrzoVS5bjBZU2O2p8sOc8vXuWDx36gkMM5YqvkJzGHBax7H6idYZgbmm4 D0tC45ASAdMVNbM05c8ZzUSl8jOq6uhK0FQjmWYa5+WNH0PmmyD1XSyozc+1hpY04Shh vbO7oPhznGPFLSkiLd9VPucU5qgEG0Lk2w1hvjMAieXTHsYlypv9d2cT8b7hehMO3g5W wLUGBAsYFHh8fQ+/uWl7JQNqlS6UjUpk2qGBxQzgejbU2GPM5xF772nKtb6Xw55MhsgJ GBot1C01ePvZHVUJLBlic0FlOpX5oMw1ePNmXzmR4Wy7GHLuRDE6zDMlIFXz5i6ii7Gi fHAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=osFJcjiG; 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 t3si7452102edw.266.2021.01.25.15.26.38; Mon, 25 Jan 2021 15:26:38 -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=osFJcjiG; 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 S1732735AbhAYX0c (ORCPT + 7 others); Mon, 25 Jan 2021 18:26:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732715AbhAYVbP (ORCPT ); Mon, 25 Jan 2021 16:31:15 -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 1F245C061793 for ; Mon, 25 Jan 2021 13:29:58 -0800 (PST) Received: by mail-io1-xd2e.google.com with SMTP id u17so29687344iow.1 for ; Mon, 25 Jan 2021 13:29:58 -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=osFJcjiG+Ez7FBpzfNES7O9KKeutX3LZXsqAW7kLdNt123+JY6264IQRdt/RBTwuGY C+7NlE0mfTalBI+ULID5XnwXYWNNFkWHu91x8BqoJOycmTAu9t+N3DFzWwDA2VGXgksl Y/RcmKnYd2krCIUrbVXtG3jSJrmLAV55hZuS7su4/YJmge98SdRAErEdVJ4nZNwvQVIa 2muIezqpp5PnTaCCrg30RkAXPmvXHdkFiQHmz7DQE83OtNAqBNWOa4if6S2lJGPowL7L QBNVlyGzKADRJAC9v7no0mOy+ydwLDAwj+K8uDuld0WcGabQ21m8BWOphXX5DrOd+vYR bROw== 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=susBTjewGEIvn+PQeqy0TqoqqwKrvvkWBub76ojUUGqc8Ta/Oi9kDjj+0EbPgV31yf etQH+tIu9syAfL9UI7ADMb0307kd44B3zGxe5mSa7hHRTvraLyv424hTlEsSLWpYXWVF 7M24VGH2U2TWCEpfn+0WLxJ+72Yv2ti5ZrhF9FYyfsi/exn3cJgWRDfXEC++vM9iMerr ICnTT3DqmhChQHYhTBttcq72rV4hLKTyNysJet5a9rsiTOU19LyQ5HtbjIsjdmbqFtvQ M7Xqn6dp+s5ydj3ROlvHQofoGkNAWbV28rUs1LGKKm3joI8GTzwWBcBgVmKChWR174XK Mzug== X-Gm-Message-State: AOAM532NRvL3XAXajN+w555P9L4+kOzsMwwzqODNUI4VtHnqO6zqKTts Jk/30QXAlpsQv9HznIE0IwjFxQ== X-Received: by 2002:a92:7d14:: with SMTP id y20mr1978742ilc.196.1611610197543; Mon, 25 Jan 2021 13:29:57 -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 o18sm11136241ioa.39.2021.01.25.13.29.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 13:29:57 -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 5/6] net: ipa: don't pass tag value to ipa_cmd_ip_tag_status_add() Date: Mon, 25 Jan 2021 15:29:46 -0600 Message-Id: <20210125212947.17097-6-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210125212947.17097-1-elder@linaro.org> References: <20210125212947.17097-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 Mon Jan 25 21:29:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 370245 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4429593jam; Mon, 25 Jan 2021 15:26:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtHcZpLDOpXMHYxwa/0bd00UWzu41kJ2Y5T9uge3/Bj10xm03JJmyYFDsat/wXDskbAQHL X-Received: by 2002:a17:907:9483:: with SMTP id dm3mr1762625ejc.120.1611617198356; Mon, 25 Jan 2021 15:26:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611617198; cv=none; d=google.com; s=arc-20160816; b=S4DkgzqITgWqRgh9v0IOhLlXypjA/IZujS0YVGEIXStr3KUiNYSpeFg+9UZ2RLKhlj OgR+drwz7FWkGAJ7n/bwSu8xcVHBsdMupHDnpFKUnnO43fpOiJQbPE/80vCAPD/W291L WyHEL57AptZtv57v6L4SiHTblVETzfkkMJRiFq6vinlmI2Slfq6kF5MaCp8MXT1w5w3U SVZCT89ybbrHs+APQT6bLPz0yUI/7wWyYdr7WyBrg7VDyHYQsQqgnzwzeLFnQ03+gIQD D1c58Ym9gRrroKPQlIx4Kn+D/HZCkD58xji3WwhF3lKcXUUhkwzezz5jbIL7sNdIpOoU Fp7w== 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=w9kuQ1Si8s2ZOWpk+AS4XT7V2Jtn7RkB1kM5n1ianHKcTJPicbLhoRG9qqXXOe6kHE qrfUqPakt1sUm8CQntfH20Dpirkp9EnmtaZZWJBpTX/Hz91NKH/a4gl8TgOniqaKsK9A l1E1nnvx6+16PZcIo0XfMP6UL9qLj+F7iteM7nNjsbsrDQVEqCQrFojn0IT8wouH8+HI k7qlpfKUzfJtxC1fTQrl8eaJny+ZCAa0swRNgpkH4xRR95fXimsW/QRxkQimUn9RpAIj GRFzejHKEg96uDg/Y1dPD0h48FNWsWJcWOi7ruciXzjI1JruqxQ4nZ3QzDIojdCB+SNu Ndcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uKrUBC6N; 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 t3si7452102edw.266.2021.01.25.15.26.38; Mon, 25 Jan 2021 15:26:38 -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=uKrUBC6N; 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 S1732458AbhAYX0R (ORCPT + 7 others); Mon, 25 Jan 2021 18:26:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732718AbhAYVbQ (ORCPT ); Mon, 25 Jan 2021 16:31:16 -0500 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32FE6C0617A7 for ; Mon, 25 Jan 2021 13:29:59 -0800 (PST) Received: by mail-io1-xd34.google.com with SMTP id q1so29610482ion.8 for ; Mon, 25 Jan 2021 13:29:59 -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=uKrUBC6NtBeeBE5pBcIlAHijHnMqgRB+8kn6DDkVpxUgdLA6xk38TqUQFJZCNE8Pbx fu57WVKL5YvDES5X1NDRvtC9src9XPPx/9olwnQtBvMOLvXyhl1ww4Do5ED9pPC+g7SC iPIdAv2NfLbOa+s7iCcSyCePnPNjAUqNDD224NwHcZtTEFDnLTkCd8syC4VPZSgMG9Ho 29a84K1IQQGEu3RO1BVJzAR6m4D+cTyZHK/dHYPKFXxoSq5awz55OzQdA87a9qHgSItc DdXi7Hg2Qsw0uKwL6ZX9P5Sn8XrJDw+9BN9DKum6Ueg7NJ/5ugGldHfSLjjRaSj8Y27j EUKQ== 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=YezSGb0RWKdEqWcQBiqpVIF0fyw4jYO5llFk+8aEbXQbFd6Q2bnsjv+Gql99l3Me/w dG2bf5UZ/Muog8eYUOOcbUSAEDqqMp5sIoAJ1ORdA7iKFivReFYFfndkgP6I0vMl+3xA VP1f2ahI8++yhOmKKnAmuzMqTGdEwLAFtXqivjxNHqxFDkKGAiZwawZw1w57OfDvMSsj yaDE1+GNeaNZ/3xhlR/zGbn8xy6f4w7f4FPP7jQXYOOboOehN/c4HMb7J+o27zJNr3B1 1qIqfoZmN7wiQTxejU+nNODRtZa5r1XVPHMchauGO+W8fXjoTkHVGvCIXT0nGw8KqGKU 8mxQ== X-Gm-Message-State: AOAM533DUx9Z5sAGGZ85EfKGaThrv6MWdq7D/2iO54nrWr9D3H91lVyc HMVFDC1dsZwNdcqR1ChieayhvA== X-Received: by 2002:a5d:8887:: with SMTP id d7mr1940535ioo.151.1611610198567; Mon, 25 Jan 2021 13:29:58 -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 o18sm11136241ioa.39.2021.01.25.13.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 13:29:58 -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 6/6] net: ipa: don't pass size to ipa_cmd_transfer_add() Date: Mon, 25 Jan 2021 15:29:47 -0600 Message-Id: <20210125212947.17097-7-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210125212947.17097-1-elder@linaro.org> References: <20210125212947.17097-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 */