Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp707388iog; Wed, 15 Jun 2022 10:29:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vuUIuL4V9dUnTQZbqlWje7zTVDfsyrXpa6sblwEjy3JYaN9pMC1rT6QHQQj8+N3SFgxk+V X-Received: by 2002:a65:6bc4:0:b0:3c2:2f7c:cc74 with SMTP id e4-20020a656bc4000000b003c22f7ccc74mr726986pgw.307.1655314179232; Wed, 15 Jun 2022 10:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655314179; cv=none; d=google.com; s=arc-20160816; b=xYFJ6kzMzF/gJj0fvo5OIYzMwIgpZBq7aYduV57pDszsJgy01TzSgGxALNuoxlI7pc M4YHYhWObbDjZ7hu0gEsox65zbIVSXgtcTZnX5yUr/zOQwIlAldeNRvcFTjtGZzK4kdN QL9GrUSs40Ju8SduePPpMf+pLXFxj9+WbE2FIGoRbCUnRmNo6OzhdmEh32QYsN6u4p6X HslIuclWAseDGmJu1bHFzCrDjgLdmT653ztaNULCRsE1ioSZn5Y0mPb75aqiqRWUyRx9 Jf52mHYxDOh+sSPPgRZnhb0c0OiH5wTD/mzfmOorNkYzqbMjX3P3FxHyjm+5BPwddYMs nexg== 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=lXZFWdvOk+2G/828a0TSiVe4aud+DVakeFtxO/uHdck=; b=Cw3EyeDVuqgxqXPdAii7X04cYP4S83EFj+m4QODnCt/06z/pLmukDXAcfUKVwU0Xhp 8GNYQoN4Zz08RQS8ytTms/t89k6Gehpw1HRh/pakEy49Fu9hYEPrOcMVG+hgdLb0nvei dgWKKYj78dfMEXdk/npNtr13wgZKAnxnIqbQP5qXFUPM5f8rzAfWqZaQe5UFPv7GEaP5 G4i2Ge/KKSfx1W0zq5sBjWQ47ImJe///TOAD26fJKjjC6yC7G7GuuWyFeXZjeQMFnNG4 7n/LmrSkvcQ8hnyoU5ng/A1Qz0Ig8IxYI3uUve0MHPmho72h8LG59UBzuA8D7POicekJ 5s5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iv9xOEKf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h7-20020a170902ac8700b001678ce9091bsi17120209plr.554.2022.06.15.10.29.27; Wed, 15 Jun 2022 10:29:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iv9xOEKf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S1356543AbiFORAC (ORCPT + 99 others); Wed, 15 Jun 2022 13:00:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349972AbiFOQ7j (ORCPT ); Wed, 15 Jun 2022 12:59:39 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 443083A5EE for ; Wed, 15 Jun 2022 09:59:38 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id u18so10936829plb.3 for ; Wed, 15 Jun 2022 09:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lXZFWdvOk+2G/828a0TSiVe4aud+DVakeFtxO/uHdck=; b=iv9xOEKfWjO+xONkID0kePbuHV8InQ7gwM9b2L6wEsEAJDtAltt/yo5Ws+yfSnBH4a Tx5BI4uXgSoikFpYmd+/rlOKS+6d5OSaXbMs2rhkPyPuta1xuakCFAU7IMqqeCfawnxY IibDIacKW9lS21Z5j/smVrdGzO4zKnKEWL8iNODcFpt6YYdf+u6iGwL0n5kOKWgGt7jJ CVDQItfDAdPeuI6dEiYk9LgyIg6MA687AvuXPvMRxaP+ACf5fSA0bZY0cQBXVJikwdZb d60hetq7XnXu3DV088QniY/W8QC6tfG7rlLR2M3WklRjSXdT1trRLqx/UK9eFIMld2u3 qilQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lXZFWdvOk+2G/828a0TSiVe4aud+DVakeFtxO/uHdck=; b=nKjvJM5X0MqEYn3wD5Gp7cq0W9akgSPdPlgVGCCaCYMitjzDpim7aOoANeR7XGiOtU 6KahVXvLS636Fa8tncjX9c62RBT1eRn04QmsF8q6bHrsBtYnKoJJB2XDR1tGi6ffWB34 UL4pO66JQcrM0hNEz6NqscQBLnOyGfnxxtpoJY6EZ+5eXhCGd8BcXVOc6POWGY5tM92z c7w/pzCB8G8bmykhCKIvBkcNRTfClA5p6lU2w/YAr0zuH6eCIErWDrm4Qf1xSLjBZnx0 lz+jym0X6LS2K1YskPAd4XFje5HTe9nUWqZdmnFl2p/R25L03RA4rI15X3dR9/2Nj20t e2ZA== X-Gm-Message-State: AJIora8p8W9zvw3VzmwdeKWVxWnQ6WJbF+ekqIEEJsJ+DsM8yW9/60mx u7icuk/zHmqVgUF/GH2Lx83U8g== X-Received: by 2002:a17:90b:3a87:b0:1e8:789d:c60 with SMTP id om7-20020a17090b3a8700b001e8789d0c60mr388274pjb.77.1655312377639; Wed, 15 Jun 2022 09:59:37 -0700 (PDT) Received: from localhost.localdomain ([192.77.111.2]) by smtp.gmail.com with ESMTPSA id s194-20020a6377cb000000b003fd1111d73csm10618513pgc.4.2022.06.15.09.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 09:59:37 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 4/5] net: ipa: call gsi_evt_ring_rx_update() unconditionally Date: Wed, 15 Jun 2022 11:59:28 -0500 Message-Id: <20220615165929.5924-5-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220615165929.5924-1-elder@linaro.org> References: <20220615165929.5924-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When an RX transaction completes, we update the trans->len field to contain the actual number of bytes received. This is done in a loop in gsi_evt_ring_rx_update(). Change that function so it checks the data transfer direction recorded in the transaction, and only updates trans->len for RX transfers. Then call it unconditionally. This means events for TX endpoints will run through the loop without otherwise doing anything, but this will change shortly. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 2c531ba1af2eb..d08f3e73d51fc 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -1392,7 +1392,8 @@ static void gsi_evt_ring_rx_update(struct gsi *gsi, u32 evt_ring_id, u32 index) if (!trans) return; - trans->len = __le16_to_cpu(event->len); + if (trans->direction == DMA_FROM_DEVICE) + trans->len = __le16_to_cpu(event->len); /* Move on to the next event and transaction */ if (--event_avail) @@ -1500,8 +1501,7 @@ static struct gsi_trans *gsi_channel_update(struct gsi_channel *channel) */ if (channel->toward_ipa) gsi_trans_tx_completed(trans); - else - gsi_evt_ring_rx_update(gsi, evt_ring_id, index); + gsi_evt_ring_rx_update(gsi, evt_ring_id, index); gsi_trans_move_complete(trans); -- 2.34.1