Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3546799pxu; Mon, 19 Oct 2020 15:07:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKO+rP39iF20IbRSpWoWimcdDM9u9I6Yhx4stEmaq0kiElKdXMx0eXnpjFMDkRGrfSXvmy X-Received: by 2002:a50:fc0d:: with SMTP id i13mr2003001edr.122.1603145233159; Mon, 19 Oct 2020 15:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603145233; cv=none; d=google.com; s=arc-20160816; b=l9nVU+3qNra2r9+j2jHD1F9AM7L/I4nMSz/qEr7VzrZB26/4Zgqff+LEoedzv1pgip YcuD+RAZS/aG0vnXaSaBy0MaML2MNdxwUVTAwWcvYIy+/QGQU3dKoqNipgnBPrZgQIjC oTBYDVFG4QeLezYbHmfvQszgJ+xhJN0i/wq6m3qBENoiBOkM9DNOb8zVPHxBmPXXROL2 dTl/pDXlMpFaTQ7sqnNJyt/W4re3ny6NBLhQwq5+YbS+X/TvLxdL/Bpah5eTRQoS8A50 Z7w7dd9veMtQmx775J8hkEE8iefLNF38b+2zM9FLYM1bpxRqNT16FV0dpED4lMcmgaxJ 64vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=6RxIBGB3u7NgiBYgHN98/V/ATHyXhuI8DZSP2yxHZOc=; b=qLq8D8YmEvnnvFQ7JkOcWMGFQjvEAnHgAIQAZqXFGPIJQ/PlkBQypvOyNHbH1GgQ9E 8APD/yIn8GRck5C5nC8OiYugLGyb6agcm3ziRTmogcbLvzddE70c8JQsXL/bKqm2weFF mUIUX57G+XIIjeK/ht4viPh3u305eYvVwIbU+LpHWcBS5tFuPvRwKbnOSVoGFqrRWmIV lG8+/QK9UYSi81D6lZW7A9rJDCrtPRywSeb5Lay/HrpO27KvhOpiQ9JHfT4rfA1A/PlM PD+2UiIMJgQlE+vSukGPy3BrrLzvYDuYYeqWpeG8hpx7Y225FK57hfIcjGIgOI5JGfDO 0m0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x23si909905eju.401.2020.10.19.15.06.38; Mon, 19 Oct 2020 15:07:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729790AbgJSI5k (ORCPT + 99 others); Mon, 19 Oct 2020 04:57:40 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:65321 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729784AbgJSI5j (ORCPT ); Mon, 19 Oct 2020 04:57:39 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 09J8spsl046773; Mon, 19 Oct 2020 16:54:51 +0800 (GMT-8) (envelope-from dylan_hung@aspeedtech.com) Received: from localhost.localdomain (192.168.10.9) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 19 Oct 2020 16:57:27 +0800 From: Dylan Hung To: , , , , , , CC: , Joel Stanley Subject: [PATCH 2/4] ftgmac100: Fix missing-poll issue Date: Mon, 19 Oct 2020 16:57:15 +0800 Message-ID: <20201019085717.32413-3-dylan_hung@aspeedtech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201019085717.32413-1-dylan_hung@aspeedtech.com> References: <20201019085717.32413-1-dylan_hung@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.10.9] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 09J8spsl046773 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org the tx-poll command may advance the tx descriptor due the HW design. By adding a pseudo read and proper memory barrier, we can ensure all the data are ready before TX poll command. Fixes: 52c0cae87465 ("ftgmac100: Remove tx descriptor accessors") Signed-off-by: Dylan Hung Signed-off-by: Joel Stanley --- drivers/net/ethernet/faraday/ftgmac100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 7cacbe4aecb7..810bda80f138 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -814,8 +814,8 @@ static netdev_tx_t ftgmac100_hard_start_xmit(struct sk_buff *skb, * before setting the OWN bit on the first descriptor. */ dma_wmb(); - first->txdes0 = cpu_to_le32(f_ctl_stat); - + WRITE_ONCE(first->txdes0, cpu_to_le32(f_ctl_stat)); + READ_ONCE(first->txdes0); /* Update next TX pointer */ priv->tx_pointer = pointer; -- 2.17.1