Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp211916pxx; Wed, 28 Oct 2020 02:59:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMohIt98YiME291Z2asQum5VdnJyI3jmvwTUApAYTEdnyu/qSOQJGXrevSnJJ3QQ05fL/b X-Received: by 2002:a50:ab07:: with SMTP id s7mr6745152edc.287.1603879148332; Wed, 28 Oct 2020 02:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603879148; cv=none; d=google.com; s=arc-20160816; b=YmdgMAwhWtjtdEFbbO+cJmkzFy4gf2QNUuUGFMvhKZovskxwhDimel3h4gvCBYym9Y W81+bMe3g5RtLRWFrPSbGaseLgw3Z6iPYbNvBlIj0UgOuMHxomCIEH77NgXsN+ich6vF vBm19pDlrmZhh4QSHJfwhcN4AW3NvbPt0l7g2TaKXyY+ZN6ZWU7zjFt1pR5EZzKMeNMQ N+AidnHDvLS15IHfDUhGpZF30716VeNU8Ku3rwwjr2OqsKSD4T8Qs9TmawQgWpRpq+Bx nijFzfJvxp6xE3TtIbq6dHr6XHrURnDTH5c8/AVMnB/nObgMKL/4TpiVLXp+SQnT4FSQ AD/g== 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=NLD6XEBdMmLp2ZX6kdaPKrUSnGUtHrtHJQ8tdzVLOus=; b=vWuo1YN6XTJpJwv6l5dEuTWHlbXQgBYkpxPjoADcjAKqXbNTuJ+1mzMn4v4lVRyXRh iYnkuo6MBi5DytEIi5H+QgmTwY11Ub4zVpks4K+kHryUs3La5mM6jA/rJqnETLrveTfl GjoBg6VrFzMyX1Izoq29eUg4SKkE5Kpg44Z3MgvoAZ7e7pUeyj0gol8Wk43+Y2uR6Zif wraMpk1WA45IR4Jl4vT+CC3koL+aDGZHB9syUvIXM4QaucxJkgCvcMuTy3aSfZMhLhKz 8NPZ0s0P1Kf8VHnHx/aju1hAMpy2ykF6pZkumtLy2CbfJhC6oxmKEMmQujDxs9Z6MW6g xJmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rdudtSih; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si2664388eds.99.2020.10.28.02.58.46; Wed, 28 Oct 2020 02:59:08 -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; dkim=pass header.i=@kernel.org header.s=default header.b=rdudtSih; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759372AbgJ0O3h (ORCPT + 99 others); Tue, 27 Oct 2020 10:29:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:56194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2896873AbgJ0O3c (ORCPT ); Tue, 27 Oct 2020 10:29:32 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 74C2E20780; Tue, 27 Oct 2020 14:29:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808972; bh=tULIUWg7B1YAOLBcOrrNpuzvW9BE7hWcS42Al0xnG6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rdudtSihF8K4dwDEujhDjPMq08vvYzYKFbvtZ4oxiQQvIHHMP/mJjCYy+Bayvf/So uC3SuI37gfPj7B+Oexk2UUjbTuYFfVKVUKo992zcc5/vPuWvm7kzN/dDIVP40kX/60 VZ+py0gvxR5IBGN2/Jmy1J5tbdePKiAIfc1M5gnc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dylan Hung , Joel Stanley , Jakub Kicinski Subject: [PATCH 5.4 029/408] net: ftgmac100: Fix Aspeed ast2600 TX hang issue Date: Tue, 27 Oct 2020 14:49:27 +0100 Message-Id: <20201027135456.416277333@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dylan Hung [ Upstream commit 137d23cea1c044b2d4853ac71bc68126b25fdbb2 ] 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. Fixes: 39bfab8844a0 ("net: ftgmac100: Add support for DT phy-handle property") Signed-off-by: Dylan Hung Reviewed-by: Joel Stanley Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/faraday/ftgmac100.c | 5 +++++ drivers/net/ethernet/faraday/ftgmac100.h | 8 ++++++++ 2 files changed, 13 insertions(+) --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1807,6 +1807,11 @@ static int ftgmac100_probe(struct platfo 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); --- a/drivers/net/ethernet/faraday/ftgmac100.h +++ b/drivers/net/ethernet/faraday/ftgmac100.h @@ -170,6 +170,14 @@ #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 */ #define FTGMAC100_PHYCR_MDC_CYCTHR_MASK 0x3f