Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1195519rdb; Sat, 18 Nov 2023 06:44:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvqogqDiJ3AV1ylSV1Gq0sVLmldJkPwS+KZWkcAYnE5L/JLx1BzegGUtfMB+o5Lfh2gr7x X-Received: by 2002:a05:6a20:72a3:b0:186:1781:d660 with SMTP id o35-20020a056a2072a300b001861781d660mr3128260pzk.6.1700318694735; Sat, 18 Nov 2023 06:44:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700318694; cv=none; d=google.com; s=arc-20160816; b=YZtPVqesh63hLqBLby+UlPAtrk+MGjaJV+FH8/E7q1TIU00o9z1282Tv4GRmb/tRBf BWHKDgJ3mmu7EpWCDuDPGnuIZmJLJrdIfY0wAmhXaG4SJJtsWdwRWwY0rjwZOyusAqd2 SAHSoTwxYSz5kXLp+DZWcPvST9Z++cs9wOkQtWaEidYhbvkEuzSgQWVJczGwgO8/Vsd4 llXtbkMMUkrrXCcQuz6ehYdyum1c7bZXS6JKDY5P8KnZ9EMBhog3l5MJb0RC3379Z2Ma lxB09bB9bsoXb7i4QC8bVowhUGPR0c2C1rgSODrZHB71b3x7eKQCmq0wXqggql797pIE KSqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=BWif9T1uf7HThDO5AN5Tn13q/oRG7kK3WKpLPyN52rk=; fh=Fyl4MhUCJ4e8ZZ3/mXDcga+oBOLRy7tO85qbzX3PS/Q=; b=CnCq0KGWVgEpjZyklzyUQJRhlghs0Ev56Ad1Mr5feSFtY6TfMDyLajUD7DnGhgy/W9 ggX5eCHK6GxjQZgnC2FUYR4tGp3mxde8zA94ug6sjY/TcH6dyDRL4wYXOCN5uu+5Y2qI 4TQ1SQqKsh0oOQNMVVkdkh/G7zL6RgnUesRnc0AQKGnmH3fOrd1Nj9d8fkFaucEG0rdR a4DGGXNCk2ILLQFRO1tQRLj8p/PIWFg4XvDYqMu7AmUltqhErNc0K3FVTDAcNB6XlaKN Ey/BgaUAVUDQ9y8WvfFbk2fsVtI/4EhYUUv7x8AYOH1Uyzt+pcSq6qqFcoKBZ65UhEn9 LEgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=WKmuJVew; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id w10-20020a63d74a000000b005be03f0da78si4294255pgi.157.2023.11.18.06.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 06:44:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=WKmuJVew; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3AEDF8057E76; Sat, 18 Nov 2023 06:44:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229691AbjKROmA (ORCPT + 99 others); Sat, 18 Nov 2023 09:42:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbjKROl7 (ORCPT ); Sat, 18 Nov 2023 09:41:59 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6848EC0; Sat, 18 Nov 2023 06:41:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BWif9T1uf7HThDO5AN5Tn13q/oRG7kK3WKpLPyN52rk=; b=WKmuJVew0chv9ZFu5D4yDig157 GdzZINfc3nPhLcjC9vnRZ2Imq69zX8hLPkaumIdVh4gT/Af4Pc0+bDdUyMSolFYTnMfFtHegFpAeD G8uxxxPM1KCrCmXy3DFlK9zkz28c9WXXe2N7SU8o4OseUXX18PbQTeOdOllqGTg6N6ZGfqRVrL7Ql 1jPL8PC3QrLg4Gfd3NFlEDIA7mpGLBKig8k792jvBI34NwbD/znoRRyIjTezPj2cpPq7Hh9ni1hyC BeFmfKPK034Awbfaq8bel4uNvJjqNixec7tkiNBSvH1M/NFNSPBuvY4iLP5R6KDZroLtnsqkjPLUB DN2DYQ6Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:52758) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r4MVz-0003mj-2L; Sat, 18 Nov 2023 14:41:43 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1r4MVz-0001Dw-Ap; Sat, 18 Nov 2023 14:41:43 +0000 Date: Sat, 18 Nov 2023 14:41:43 +0000 From: "Russell King (Oracle)" To: =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= Cc: Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Frank Wunderlich , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com Subject: Re: [PATCH net-next 05/15] net: dsa: mt7530: improve code path for setting up port 5 Message-ID: References: <20231118123205.266819-1-arinc.unal@arinc9.com> <20231118123205.266819-6-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231118123205.266819-6-arinc.unal@arinc9.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 18 Nov 2023 06:44:52 -0800 (PST) On Sat, Nov 18, 2023 at 03:31:55PM +0300, Arınç ÜNAL wrote: > There're two code paths for setting up port 5: > > mt7530_setup() > -> mt7530_setup_port5() > > mt753x_phylink_mac_config() > -> mt753x_mac_config() > -> mt7530_mac_config() > -> mt7530_setup_port5() > > Currently mt7530_setup_port5() from mt7530_setup() always runs. If port 5 > is used as a CPU, DSA, or user port, mt7530_setup_port5() from > mt753x_phylink_mac_config() won't run. That is because priv->p5_interface > set on mt7530_setup_port5() will match state->interface on > mt753x_phylink_mac_config() which will stop running mt7530_setup_port5() > again. > > Therefore, mt7530_setup_port5() will never run from > mt753x_phylink_mac_config(). > > Address this by not running mt7530_setup_port5() from mt7530_setup() if > port 5 is used as a CPU, DSA, or user port. This driver isn't in the > dsa_switches_apply_workarounds[] array so phylink will always be present. > > For the cases of PHY muxing or the port being disabled, call > mt7530_setup_port5() from mt7530_setup(). mt7530_setup_port5() from > mt753x_phylink_mac_config() won't run when port 5 is disabled or used for > PHY muxing as port 5 won't be defined on the devicetree. ... and this should state why this needs to happen - in other words, the commit message should state why is it critical that port 5 is always setup. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!