Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp829355rwb; Mon, 26 Sep 2022 06:26:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7WsJGiNztEdTggk/Yye3yTh/Vhm/x6JtM4skbbRoZ6412Y4YmxOMEzAm4odyUd9iC2uhux X-Received: by 2002:a17:907:3daa:b0:782:1053:ccb5 with SMTP id he42-20020a1709073daa00b007821053ccb5mr17854339ejc.312.1664198791592; Mon, 26 Sep 2022 06:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664198791; cv=none; d=google.com; s=arc-20160816; b=TdNulEJ28a9RIyzleYeC0bDL2LvjMTfc27j1odyeB6SmpjG2BAkay5Rqia1wVwCy01 0Ouvl+Uh/VXKBEiXyK6mWF751YPVgGnPc5UkM+rcTHAR1lgFMJowldmd3vhaZxwpgVed 8xmO58NRw0DFQQIugrF2I1fkHBm/7a4/7+q8ebR0uL9qpyHOROnZyT3LQ1gbFy0KMpBn jbfl6Sd7c0J0pIIIVZwGTerhGoDBsa4E90pUcGlJThfHMf9n9Y5Dtu26ZbqYRND4tCsU MO0BaCOUJxRC+Plp3/MP71tUX5vdn3tuaqBpsnjsHbHFznmI4cBy47izQlu75ysWnEiW hIkw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=P8Tui10QUqlSdPoJlwS80D8zvJEXNJmbQTm2m6CcCPc=; b=nUx1Sm04gu6voXK9l+8ogJS7gTQnJGZM2GOVTpPaT+S1J3W1kbWJ0Qu4j9U31CvU/9 jUIyClScAvPwfb+yYrrUGrDtr8J9qHohfls8F9Xj0yhX7idI8iXOfFwxgOmRVgqbr9fZ myl3ia9TT11e3lFfceWv4r3WTAmbkjzITvBAPhYD0XTRy8LESUwRr1jpfqsPt95PO9IE XHemgIHJV36sdGCyPg9vhfkAwgqgUuBlwQJWN5uAx6hEbwuPCF93QD3x645EJ72/obKi KEKzn0HbTIBR/fh5p/JDnb9c8SjiZc09+NjE6rmPogv0OIXm83kS8DPmFBUylT++54i2 4QYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Siaseete; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wt1-20020a170906ee8100b0073d866e5d4dsi18311611ejb.98.2022.09.26.06.26.04; Mon, 26 Sep 2022 06:26:31 -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=@linuxfoundation.org header.s=korg header.b=Siaseete; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238600AbiIZLrx (ORCPT + 99 others); Mon, 26 Sep 2022 07:47:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238989AbiIZLp0 (ORCPT ); Mon, 26 Sep 2022 07:45:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29E7D7330B; Mon, 26 Sep 2022 03:47:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F208B60A37; Mon, 26 Sep 2022 10:45:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD466C433C1; Mon, 26 Sep 2022 10:45:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664189159; bh=19KlRLI+ImLM1gK/lv/gMMi8YiwPQlSzvAQZM4tGZNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Siaseete7FaqQhVZvO/Fb9m49qFTwHZHMwJkLc6OYJqCLI5ZrGLKE8ikgNqdfhv3z e0w3HNyvUjgOp2nIXmmOJ5l+jYT1LvXfIU+kQRZhv9JtuPYqeFfUsl8Rjo0hweSc13 wODS0PFU+C9uQdxR1pGjaLUUyBfWiW90mgMCVxqc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brett Creeley , Norbert Zulinski , Mateusz Palczewski , Konrad Jankowski , Tony Nguyen , Sasha Levin Subject: [PATCH 5.19 092/207] iavf: Fix cached head and tail value for iavf_get_tx_pending Date: Mon, 26 Sep 2022 12:11:21 +0200 Message-Id: <20220926100810.715575081@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 From: Brett Creeley [ Upstream commit 809f23c0423a43266e47a7dc67e95b5cb4d1cbfc ] The underlying hardware may or may not allow reading of the head or tail registers and it really makes no difference if we use the software cached values. So, always used the software cached values. Fixes: 9c6c12595b73 ("i40e: Detection and recovery of TX queue hung logic moved to service_task from tx_timeout") Signed-off-by: Brett Creeley Co-developed-by: Norbert Zulinski Signed-off-by: Norbert Zulinski Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/iavf/iavf_txrx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c index 06d18797d25a..4c3f3f419110 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c +++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c @@ -114,8 +114,11 @@ u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw) { u32 head, tail; + /* underlying hardware might not allow access and/or always return + * 0 for the head/tail registers so just use the cached values + */ head = ring->next_to_clean; - tail = readl(ring->tail); + tail = ring->next_to_use; if (head != tail) return (head < tail) ? -- 2.35.1