Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2490583rwb; Mon, 3 Oct 2022 01:12:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4WDWS2CozwBbvSLwl2pcVB3Jh/hg78B+ROkuBDDrFGULRc+pd/nbeJASAMGJU2wHxqLPlj X-Received: by 2002:a17:902:d4ce:b0:178:1e39:3218 with SMTP id o14-20020a170902d4ce00b001781e393218mr20904968plg.144.1664784720348; Mon, 03 Oct 2022 01:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664784720; cv=none; d=google.com; s=arc-20160816; b=NKVIZceoUD9lddSXsg2Sde8j2bn396CH7xNQCl3zwR2K6FIjdmsevG+/21zVH7LPSb SCyx9lm5ZUMxGzuXhQEiGfe2l3oaX65KiaOixqEDA2K8P0uWbTaLHo14oeZtdA68eRVF ObXrPP1Al8u9xSmQE28BlQHTR1nMjBWv282+haLCnd6lQ7ys2+QmTg0BtWt/Q+zt0CSp qYvPcwAEskzxspS2iPI3XXKiNTtFJjM22Z9/h/hP/cqSSuFAEX2VjWAO5iuAjpXwwLOp VXOg7iDj0BIulRZdRRuV+NHupjwlVrQXxqn5nwhOiu1ZdPOOljRzFRxnz0oey8yXGwAF CfEw== 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=Yj2fcSmK/x0HO1ZTi0Y8p8Jgz6UZ+aEFm+zrKtp0EWE=; b=KmWSORdCS+dt1l186YXubdGCbUGSITMoiNuM1CYDPZHYAPj++IHTgIiRFsLoxu5V4d IhBm1mtJ68JcjEMMfrDeHMgbh8uhDzN3qOB74p1imlut9wGB4Dh6+bj7ruQxLPxk7W2l /SmY4H1gXxa6wmfjzXsS97LHv2tSyr3G01ZDfPIinBIxjPfx46mHYPEliPup3HaANMw/ FgZ+dm5382StRfCENOj2SJaDnwVIztXyZeATrtxUFqKJQuVSBN67bK2TWOSWPgBSSWil ikJ4Fbu1WKKCQe/EAjSzEA5lNTA25n/mO0FSggBQoFZIGcqhmGHcsxq3kIvvsdBeXnLh UXaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uVyDSnE7; 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 nv1-20020a17090b1b4100b0020038eb8b5asi11342477pjb.21.2022.10.03.01.11.49; Mon, 03 Oct 2022 01:12:00 -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=uVyDSnE7; 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 S231768AbiJCHjp (ORCPT + 99 others); Mon, 3 Oct 2022 03:39:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231793AbiJCHhm (ORCPT ); Mon, 3 Oct 2022 03:37:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0920154649; Mon, 3 Oct 2022 00:23:11 -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 37BAAB80E85; Mon, 3 Oct 2022 07:21:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A10E4C433C1; Mon, 3 Oct 2022 07:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664781661; bh=SXCxvVuaMeRLrHxiHT/NZ3sj9W/iwTfupDt23uSko7M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uVyDSnE7WE8qEZc54N3XTQCb5uXUcLFtHesBAdKmQgOVUE9RCl5u6ZaTyUn09r227 Aocuym1ZvgicJB4M7fLqI5OjsOeebwK7HZSOVce0d3EGy/H+gvOSKeX4H9xNFgARgw TbPl9IlLzb9rbCmN3hmfcOjmuK1Ap5vYmW+IENTc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Couzens , Jakub Kicinski Subject: [PATCH 5.10 18/52] net: mt7531: only do PLL once after the reset Date: Mon, 3 Oct 2022 09:11:25 +0200 Message-Id: <20221003070719.267908476@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221003070718.687440096@linuxfoundation.org> References: <20221003070718.687440096@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 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: Alexander Couzens commit 42bc4fafe359ed6b73602b7a2dba0dd99588f8ce upstream. Move the PLL init of the switch out of the pad configuration of the port 6 (usally cpu port). Fix a unidirectional 100 mbit limitation on 1 gbit or 2.5 gbit links for outbound traffic on port 5 or port 6. Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch") Cc: stable@vger.kernel.org Signed-off-by: Alexander Couzens Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/mt7530.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -502,14 +502,19 @@ static bool mt7531_dual_sgmii_supported( static int mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface) { - struct mt7530_priv *priv = ds->priv; + return 0; +} + +static void +mt7531_pll_setup(struct mt7530_priv *priv) +{ u32 top_sig; u32 hwstrap; u32 xtal; u32 val; if (mt7531_dual_sgmii_supported(priv)) - return 0; + return; val = mt7530_read(priv, MT7531_CREV); top_sig = mt7530_read(priv, MT7531_TOP_SIG_SR); @@ -588,8 +593,6 @@ mt7531_pad_setup(struct dsa_switch *ds, val |= EN_COREPLL; mt7530_write(priv, MT7531_PLLGP_EN, val); usleep_range(25, 35); - - return 0; } static void @@ -1731,6 +1734,8 @@ mt7531_setup(struct dsa_switch *ds) SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST | SYS_CTRL_REG_RST); + mt7531_pll_setup(priv); + if (mt7531_dual_sgmii_supported(priv)) { priv->p5_intf_sel = P5_INTF_SEL_GMAC5_SGMII; @@ -2281,8 +2286,6 @@ mt7531_cpu_port_config(struct dsa_switch case 6: interface = PHY_INTERFACE_MODE_2500BASEX; - mt7531_pad_setup(ds, interface); - priv->p6_interface = interface; break; default: