Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3114329pxb; Mon, 18 Apr 2022 16:18:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+MdSNzwDUkbu8UAE+pV+YS4PKHnn3rfLLT6R1/IGlmFbWFLgMD1AlFecz+blAdHLPQSmL X-Received: by 2002:a05:6a00:2442:b0:4fd:8b00:d2f with SMTP id d2-20020a056a00244200b004fd8b000d2fmr14682699pfj.39.1650323920928; Mon, 18 Apr 2022 16:18:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650323920; cv=none; d=google.com; s=arc-20160816; b=xWjF9Uts1M5lKntbCYekkWABC8+2HDMiXvezso8o8hcRju/RV/SJDzhw6bhyPgQ5eT Hfx4vw5KNqBqeSAEtgLVUmien47JotjUTv3mtgkxTdfb9trxPuy4i6BzTLsyXe/ULPFT XSKsuF6Bdcbjz1VCRxNGTf7Ncz9zy8cdTXP4QJZSmTFQ8YEg9vQUYJAh9Nup4N1ar8Vl xWHqzZDi36nU0LDXxBK0YVqLzYiLk/5zteny8aqpf6G07j0Qhu3k+zwat0liRtJMsVta BX5i1K4a53Byua7bMnrmla7ynbhxUpYshp9DEzg39YKjX0eUjX1nf4uVHTckzltp504e FQyw== 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=hpdpS1jcfe1Txxj151ivc1/pLTDj84TRRign2ux9+Ro=; b=ymKPTZqnIt6Nygj9x9XDWDHn+BjwNE8LXPAlxOeuQVTEDhFyZGm/qO/T/yQC6mUgoU LIScePfNTjBX+7ymeFsxZ+R4BmZWGXxsJJ8O0joEicXigCRv5dQ5ZtK0PNtHy+FG/h3F jAlLbHmIZW/Jj/qHt1ONjO4lTmtHaDyNKsIdYyqs++IScalExgBcxMwsdp+Hb4tszQpK az1eoB6OZt1bGUAHnp6IS0x9WnplIRVAFNvB/uhhV9KHpZjxPuk6Bl8VCbcFJBrjU8f7 /dlkNRG2yRJI7ATE3dnc9iedUl13ZVOFHq5GYGah6TG9bZfGo3jb3HaBfE5bLKwljhBv mozw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eNPno7ta; 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 s6-20020a056a0008c600b004fa8832da6dsi11687980pfu.76.2022.04.18.16.18.25; Mon, 18 Apr 2022 16:18:40 -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=eNPno7ta; 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 S239391AbiDRMgh (ORCPT + 99 others); Mon, 18 Apr 2022 08:36:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238853AbiDRM0p (ORCPT ); Mon, 18 Apr 2022 08:26:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C39DA1C923; Mon, 18 Apr 2022 05:20:49 -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 ams.source.kernel.org (Postfix) with ESMTPS id 142EEB80ED7; Mon, 18 Apr 2022 12:20:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7502BC385A7; Mon, 18 Apr 2022 12:20:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284446; bh=nalTxQnhUJKqDr2j0DbblOwFjGxGPdimyiSX8khqBHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eNPno7taa5p0/XXeA2teky/ZTST9ofpyGfI6cC8zrW3EqS8DkXV5K2La134kKu45x 58q5Kf0EG2tLbhuUzZzubj9l/4PJ8mBgsBr+oY06ZjFg7oAJ4xA951gQ2EQBFHOdsa 8+Z39/MkGoso14zGbiTCJmAhnEQoCC5+67XUlj2k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dylan Hung , "David S. Miller" , Sasha Levin Subject: [PATCH 5.17 118/219] net: ftgmac100: access hardware register after clock ready Date: Mon, 18 Apr 2022 14:11:27 +0200 Message-Id: <20220418121210.202112283@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121203.462784814@linuxfoundation.org> References: <20220418121203.462784814@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 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,T_SCC_BODY_TEXT_LINE 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: Dylan Hung [ Upstream commit 3d2504524531990b32a0629cc984db44f399d161 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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.35.1