Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp789387pxb; Tue, 12 Apr 2022 13:30:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztGfyS9DjKDYaof5ol9UsnGgfnQCVfT3tHIpAZwq5qfWob1I+Ovk6w4z3e/i+AWBKNHQdM X-Received: by 2002:a17:902:a510:b0:156:6cf9:9a7c with SMTP id s16-20020a170902a51000b001566cf99a7cmr40031626plq.151.1649795433419; Tue, 12 Apr 2022 13:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649795433; cv=none; d=google.com; s=arc-20160816; b=xN54nK4Ot45+12eXCwL6l+Wc7ohFrbz6mcjnXK8KeFzVRXCqo8mFSuxiJdFTYgdT3f XGCqPYYGK3Qrm9cX46Vtg9vNfjHXOz2lvgLGp+fc/83a97MNe+Tdl2j7VV/FB+/W3zkT 4rYQFUF+EQZMboVdIFg9oGgJh5n/TFGdVgx1/qLPGybL+3CQCPVBAZRwwJraQ0KO4iq4 Uv4097LzPC1w0HJFusK7Zeyhro6ECHoT3HXsNYru5SGBMZNDIwWH6a26Et8iN4TMfWN5 wtVBVXlS+uTh0PasZblxNdic/OATBdvLjIGt6hGm/md1tMxKTQeJGDiS303XD+LPHqZ+ cnoQ== 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 :message-id:date:subject:cc:to:from; bh=i/dtMTOjrDLXZeHgps3U63s9Cpfjx+st2mCy7WuPlkQ=; b=MVk/ICgRbf+meCalr28dulMPx6IXMsT/0vfr9LkIJfzEbHuPaArFpFUtPWTTrNDe6D w340mRTZaspjFieQ54VbH7aOnDJ4qAZZF8U7O1UXhnv75bUlwHA9+rV+flnPVt1jeXNR 0TE4NWfGgUfGWXp6TXXI0lGVj2xgz1erqd/yBBTIGED57ojm1B1/e0KNg5dUoQazdIU8 yiEhShECTDT2krzJOKH2MZyCCj3YupMCTm5fegdXZNkgxURDWE8NHn8PnZqHMmerEQHW JIOTfTMc65P8rpA3a0XIOLF94Iv6s75DkjXS/UA6xbaKMS9h94qUKQyUY+4ojIJdiQoE 23jQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n5-20020a638f05000000b003824583a8efsi3603502pgd.440.2022.04.12.13.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 13:30:33 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E534E9BBB9; Tue, 12 Apr 2022 13:08:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243318AbiDLMb2 (ORCPT + 99 others); Tue, 12 Apr 2022 08:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231985AbiDLMaK (ORCPT ); Tue, 12 Apr 2022 08:30:10 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF6710FC0 for ; Tue, 12 Apr 2022 04:47:50 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 23CBZOhW055481; Tue, 12 Apr 2022 19:35:24 +0800 (GMT-8) (envelope-from dylan_hung@aspeedtech.com) Received: from DylanHung-PC.aspeed.com (192.168.2.216) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 12 Apr 2022 19:47:04 +0800 From: Dylan Hung To: , , , , , , , , , , CC: Subject: [PATCH] net: ftgmac100: access hardware register after clock ready Date: Tue, 12 Apr 2022 19:48:59 +0800 Message-ID: <20220412114859.18665-1-dylan_hung@aspeedtech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.2.216] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 23CBZOhW055481 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 AST2600 MAC register 0x58 is writable only when the MAC clock is enabled. Usually, the MAC clock is enabled by the bootloader so register 0x58 is set normally when the bootloader is involved. To make ast2600 ftgmac100 work without the bootloader, postpone the register write until the clock is ready. Fixes: 137d23cea1c0 ("net: ftgmac100: Fix Aspeed ast2600 TX hang issue") Signed-off-by: Dylan Hung --- drivers/net/ethernet/faraday/ftgmac100.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index d5356db7539a..caf48023f8ea 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1835,11 +1835,6 @@ 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); @@ -1911,6 +1906,11 @@ static int ftgmac100_probe(struct platform_device *pdev) err = ftgmac100_setup_clk(priv); if (err) goto err_phy_connect; + + /* Disable ast2600 problematic HW arbitration */ + if (of_device_is_compatible(np, "aspeed,ast2600-mac")) + iowrite32(FTGMAC100_TM_DEFAULT, + priv->base + FTGMAC100_OFFSET_TM); } /* Default ring sizes */ -- 2.25.1