Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp459869pxu; Wed, 14 Oct 2020 05:56:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaBWtYjLfFZvkL66n8ekDDfw4rRdLoeQOJC3qWmw9JoMsiKDXwAjoRkXxiKkFiiJzuTa/Y X-Received: by 2002:a50:d483:: with SMTP id s3mr5293277edi.173.1602680212463; Wed, 14 Oct 2020 05:56:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602680212; cv=none; d=google.com; s=arc-20160816; b=kfYQExDLuuBzgJdyo0iTWvmFwEmHJ0KAgSR4W3Vb9D9u2Xb0H+0qDCvH+Uquqia2vb Me4bmpTowm+uhllZ0YrF6223tvglcxluqVoMt20jM9bXzUsUALl6njaSEHTEOGZ54PC5 cnNJLsG/1qz1NmLS856AMC7bUOnSGYq48mu8CP6J9635YN99AYnQXO4VSJ3VR/UqCHGm UF72l6AmMY7IEJo2o3yN1f+zew5abL7rUAXFcPfLxUg+Cfw2WS0xhYfzZKJjK++CRqZp CCd0sVMdxPUmP09HPd/Lq6c3BaYyBBoEUD8gF7X+C6qmnss/yc7phU7Xkir84ER68Ljq CM/A== 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=1PvVorXeJUgK9J5IJt88LnedFu+TowOByh75K88g7io=; b=P8gyYdmILgDM/1gBulQXuRfgWiXnCz6jusTOtQJGyWVl9b2lTbq9JSnBOsj5Oo4eEr KmhIefGs1Pd01SNxnDfNXVYh5ba2h+CgGfK0vMP4xYTHxNNyUd0mDt60H2VX5i0VDQNf +rSmreIY/JpAGgg2CixqqMiXtVVcYIHRkrICpkBfu/wBhxojLNqneyLl7wcsLmx2031P hOrEvQehBxNnxSMT6Zxo58h0iN6C3qswXLgllfNoj1zoV0o18PSZLY0IOMNV4dpbHVYF N32zN/ZBh2Ewi+ceRxTjBdoWVc33Aqbzmz9eZZDRisKEcczXdhJIIhhBQBccw+7GMm6D JWpQ== 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 h24si2120820ejf.680.2020.10.14.05.56.30; Wed, 14 Oct 2020 05:56:52 -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 S1730353AbgJNGHQ (ORCPT + 99 others); Wed, 14 Oct 2020 02:07:16 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:40146 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725983AbgJNGHP (ORCPT ); Wed, 14 Oct 2020 02:07:15 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 09E64Qjt047726; Wed, 14 Oct 2020 14:04:26 +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; Wed, 14 Oct 2020 14:06:44 +0800 From: Dylan Hung To: , , , , , , CC: Subject: [PATCH 1/1] net: ftgmac100: Fix Aspeed ast2600 TX hang issue Date: Wed, 14 Oct 2020 14:06:32 +0800 Message-ID: <20201014060632.16085-2-dylan_hung@aspeedtech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201014060632.16085-1-dylan_hung@aspeedtech.com> References: <20201014060632.16085-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 09E64Qjt047726 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The new HW arbitration feature on Aspeed ast2600 will cause MAC TX to hang when handling scatter-gather DMA. Disable the problematic feature by setting MAC register 0x58 bit28 and bit27. Signed-off-by: Dylan Hung --- drivers/net/ethernet/faraday/ftgmac100.c | 5 +++++ drivers/net/ethernet/faraday/ftgmac100.h | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 87236206366f..00024dd41147 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1817,6 +1817,11 @@ static int ftgmac100_probe(struct platform_device *pdev) priv->rxdes0_edorr_mask = BIT(30); priv->txdes0_edotr_mask = BIT(30); priv->is_aspeed = true; + /* Disable ast2600 problematic HW arbitration */ + if (of_device_is_compatible(np, "aspeed,ast2600-mac")) { + iowrite32(FTGMAC100_TM_DEFAULT, + priv->base + FTGMAC100_OFFSET_TM); + } } else { priv->rxdes0_edorr_mask = BIT(15); priv->txdes0_edotr_mask = BIT(15); diff --git a/drivers/net/ethernet/faraday/ftgmac100.h b/drivers/net/ethernet/faraday/ftgmac100.h index e5876a3fda91..63b3e02fab16 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.h +++ b/drivers/net/ethernet/faraday/ftgmac100.h @@ -169,6 +169,14 @@ #define FTGMAC100_MACCR_FAST_MODE (1 << 19) #define FTGMAC100_MACCR_SW_RST (1 << 31) +/* + * test mode control register + */ +#define FTGMAC100_TM_RQ_TX_VALID_DIS (1 << 28) +#define FTGMAC100_TM_RQ_RR_IDLE_PREV (1 << 27) +#define FTGMAC100_TM_DEFAULT \ + (FTGMAC100_TM_RQ_TX_VALID_DIS | FTGMAC100_TM_RQ_RR_IDLE_PREV) + /* * PHY control register */ -- 2.17.1