Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2346037rwr; Fri, 21 Apr 2023 07:43:28 -0700 (PDT) X-Google-Smtp-Source: AKy350b/wr/TIVOFP25mA1prJmnf4dLjACWOAUR+WMZPYLanwjjm+DddhlDp3Bt4TwmQ6HbaRD8y X-Received: by 2002:a17:902:f685:b0:1a9:4167:5db7 with SMTP id l5-20020a170902f68500b001a941675db7mr3968860plg.4.1682088208285; Fri, 21 Apr 2023 07:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682088208; cv=none; d=google.com; s=arc-20160816; b=p2F+CyRQiGLhXY6at3UzTf2SBKFeRqEKdAfgOxxDumKDVMjXnjn+jZEGBmEZdPKm2c 40H3V9JGLu9I2+tOjHMnHAZSGo0nWddagbQYW6EvArxNiIhWGK36OHHznBoTS7mL6fmB 6kKxfm3u4wAoJgvDTRH44Is9GxBbzwMRfWbBIFi3AXqTM0PMqwaVCixuODaZP19LxDTQ so4tltkniM/O4y0A5fVoUKKTcucpxWsXjIwwLELTPUVbOkb41g5SxKpV4MqZqepLc7f5 /HfWbyX+fu3c8obtcaQ4p71E6XgMuiQrpt65KgLS19OHP1PIUYLNuI2AK5sjv51c2I46 BBpA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JzoT/KmMIWGXd84HSAhqqXVj6Wxc4XH+Xw/4O9lmsTc=; b=vdAn4SQB1YwJF0CUFxVirnbkb0Z5sGK4LzxYZPv2Q7yRjSaR1hR5gwqfO/gspw/8bd q6WvI+oDXEd39beFpPm7IU+fip5UowMi8rIjoaKI2ktbpvOZxFzxLxju9Qqh5+aYQw/x R1KNOm2NCsGFflZeuckHk6EoEqZu8LewWMWqsi7oxeIytAVKHjMTFJVDx6Xm1/yS77e+ Y6P8moesBBWt9yqEmCE+s61GCb8ZY+2Enn+R+61bi7C5JcT4G1rsc3bIYrIqkEXC03bN A2AEfGFTJF4LVuxT3WIWQnr6eLK2UwS7J8/HXWqFsu2TvCnCW8x9B1/trfbWoSTTJ4oM 2wtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=g2RMVEYo; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t24-20020a17090a5d9800b00246f3cb3878si4452652pji.86.2023.04.21.07.43.16; Fri, 21 Apr 2023 07:43:28 -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=@gmail.com header.s=20221208 header.b=g2RMVEYo; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232995AbjDUOjo (ORCPT + 99 others); Fri, 21 Apr 2023 10:39:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232991AbjDUOjH (ORCPT ); Fri, 21 Apr 2023 10:39:07 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D708014F58; Fri, 21 Apr 2023 07:37:41 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-508418b6d59so3056896a12.3; Fri, 21 Apr 2023 07:37:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682087858; x=1684679858; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JzoT/KmMIWGXd84HSAhqqXVj6Wxc4XH+Xw/4O9lmsTc=; b=g2RMVEYoRmsDAMKPmJikqWI/qnDOB9DlBY+ZE8gvCNAJmL69pKinZmG5PGjxPlNaat FTWjOESJcCtRVa42iaqGgREtxXe/2zUwhh26Nt9+tH02uyx8hD8O190M+LojA7xrxD9y OD3L+gKvVz1qDjeAUNtKtbdHmXt10VXP+kq71avQ0r517UivyBICqRNbV03ElgqCMdjT d+1DNJdpNqtywk8N9ID7u+8gE0wt7JTY2osrVaBPH+G8uWrzChl9NB2CKIkgIi7vab4g ELXN93NH4I42ueYQhveL8CZc68I4fI96lU+FV5FMKNXb2u6ZOcEddkK8Qip8v4GEgB0Z pgcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682087858; x=1684679858; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JzoT/KmMIWGXd84HSAhqqXVj6Wxc4XH+Xw/4O9lmsTc=; b=cC5LoGK2CRmBcCxdU91F1xm1OAxG+7uJmjHBOWz82AvDJ5rV9cfR0VUzi9hPTf6G7Y xIlQDoyfsYRfZ+bm6McIN/3vlBzubyyi0YtuobTkglLKeLyPFEorN3gl2RXe/2SjfCJH toQHjhoIIGZwrBHXTJoqHjXosfrV++JpzY5/o8DAQdxEkg1FuBapYcAPQxIyMyaNT09e Ugxuv79e6JGc8vqTDFvIzO3KwhbVEeM6pVOPR1JUCq55yvPg2qunX34DnLVNMIA3fxkL ZZpr3oJ1XiDWoXaG7xy89HGhiHte8LeYKZxr00aFzz9D2HrlpvaMhqn2do5dFOzXMdPj CfPQ== X-Gm-Message-State: AAQBX9cOUBB0h+6u4bRCvhfK/IP8JXqQP9pYEMzy3UBfyVd+QVKAwwtv Cu2UC9d6jW4BJmoITBU1NU4= X-Received: by 2002:a17:906:cb94:b0:94a:826c:df57 with SMTP id mf20-20020a170906cb9400b0094a826cdf57mr2385888ejb.39.1682087858639; Fri, 21 Apr 2023 07:37:38 -0700 (PDT) Received: from arinc9-PC.lan ([149.91.1.15]) by smtp.gmail.com with ESMTPSA id q27-20020a170906361b00b0094e1026bc66sm2168244ejb.140.2023.04.21.07.37.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 07:37:38 -0700 (PDT) From: arinc9.unal@gmail.com X-Google-Original-From: arinc.unal@arinc9.com To: Sean Wang , Landen Chao , DENG Qingfang , Daniel Golle , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King Cc: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , Richard van Schagen , Richard van Schagen , Frank Wunderlich , erkin.bozoglu@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [RFC PATCH net-next 20/22] net: dsa: mt7530: force link-down on MACs before reset on MT7530 Date: Fri, 21 Apr 2023 17:36:46 +0300 Message-Id: <20230421143648.87889-21-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230421143648.87889-1-arinc.unal@arinc9.com> References: <20230421143648.87889-1-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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: Arınç ÜNAL Force link-down on all MACs before internal reset. Let's follow suit commit 728c2af6ad8c ("net: mt7531: ensure all MACs are powered down before reset"). Tested-by: Arınç ÜNAL Signed-off-by: Arınç ÜNAL --- drivers/net/dsa/mt7530.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index ac1e3c58aaac..8ece3d0d820c 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2203,6 +2203,10 @@ mt7530_setup(struct dsa_switch *ds) return -EINVAL; } + /* Force link-down on all MACs before internal reset */ + for (i = 0; i < MT7530_NUM_PORTS; i++) + mt7530_write(priv, MT7530_PMCR_P(i), PMCR_FORCE_LNK); + /* Reset the switch through internal reset */ mt7530_write(priv, MT7530_SYS_CTRL, SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST | -- 2.37.2