Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1566118rdb; Sat, 2 Dec 2023 00:36:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+SfguCiVSAhsknyYxgsPupXF9TcUlS4qBolD4w1XaPGVwrteyFXu/okZzn+qPV1jpZMdT X-Received: by 2002:a05:6871:8aa:b0:1fa:e819:af8f with SMTP id r42-20020a05687108aa00b001fae819af8fmr1203402oaq.27.1701506215247; Sat, 02 Dec 2023 00:36:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701506215; cv=none; d=google.com; s=arc-20160816; b=MBXR14abQzdn0P3j4nXs0rKhfj0faK8Im0rEocrgeD3yprbPjhW+ynoIZ37+e5O1om tXqIp37PfAYXylN1LsoMqmAZkThgwZ9j09y3zvOxwMQfiOhzMWJSTveqTAMsRPkpBQPf MBNyy2dbMNwYIclWse1gL8mSpa1+U8lqtYlYJQCra3Vnet1RhTk3kH7YtIOsViE+k0xz 7m7WTAcYAyRofzRChY+xJd4lLR3YVDDvSdl+ktI5PiPbjDlZ0+TL648n52ZR6ZpaMdlr QYvZ00c3y4wOSVkHu4HLuxEtgRz9c3AXdnfwXxiJZnQZGk2BUVXXBL0fevruCBBMjEr/ aj1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=U2wLMvIIVt4NNTdGsFG3SPBRcTEOfz3PdLa/GlA7GzU=; fh=36eOmVBzPvbyNA3K3hrUShuUlCuu6eDRjhgELiPwakw=; b=Jc1jnutpModf6dkb+j+4lbDKsEM3XjdDoAtz05W+Zs63iXbTWfRl3W95+ehVl5I9mr 478uxL/N+JnSTgPBH4ps7b1Ei0A8VWgHCS5Ad++Mk02ZN1Z9WywjpsCkRMsXB3Tl0aVu wBRI/9M9IuSIXkLlb8S8eZGRkWbLtaVrgAQ3suhLcXUGKmZHP0ppJtezpO4v1Fgc1XGU NU4FzMbDPVyZm95m4wJdkNeRLm4i6S73myr6DJLQDDxyOwftDuyRII68h1q8GfnnvKnm h9otxz41HJ5CZV8qjLRuzpvZYYMEDrLZO6uzZR4QsgpzcY/qMhEmWt5F7MMV8xiu3JIq fGxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=pCSuWAI9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id dr1-20020a056a004a8100b006cb4d47e598si4421878pfb.141.2023.12.02.00.36.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 00:36:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=pCSuWAI9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id DACB6804ADA9; Sat, 2 Dec 2023 00:36:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229514AbjLBIgh (ORCPT + 99 others); Sat, 2 Dec 2023 03:36:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjLBIgg (ORCPT ); Sat, 2 Dec 2023 03:36:36 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0711C196; Sat, 2 Dec 2023 00:36:41 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 6476F240003; Sat, 2 Dec 2023 08:36:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1701506200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U2wLMvIIVt4NNTdGsFG3SPBRcTEOfz3PdLa/GlA7GzU=; b=pCSuWAI9D8zF/hQO2V4ig9tFsgd/ew1diFvWU/0pjWH64JXKoxcouGA+Mzja+/yl4zDoov dZF4PpQQKhIXp3LNwFSJGwiHwdRNE7yZs8buTVxP+k7oTs/212WKhDvPKSFzNsn0ALf0oL q68fPW3eq2W9Db7kqa7QDVT6YQPyFgz7AstIXWbpDUCmHorRjocpPgjfmee9962uKVqPfn R9v1QZxORbOLzp1WoB71qxsDqJeFLkW2OYmpzw/YWXZvhxXoOBJ1PX/7dW+/B1ZIpoY+Jv mpVGOWeakcUTBSIRkNJA/4MjvH1fKxC0GmD4coHpvGPYI5Tb00JUT2hfNN4H+A== Message-ID: <5e95a436-189f-412e-b409-89a003003292@arinc9.com> Date: Sat, 2 Dec 2023 11:36:03 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 05/15] net: dsa: mt7530: improve code path for setting up port 5 Content-Language: en-US To: "Russell King (Oracle)" 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 References: <20231118123205.266819-1-arinc.unal@arinc9.com> <20231118123205.266819-6-arinc.unal@arinc9.com> From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-Sasl: arinc.unal@arinc9.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 pete.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 (pete.vger.email [0.0.0.0]); Sat, 02 Dec 2023 00:36:53 -0800 (PST) On 18.11.2023 17:41, Russell King (Oracle) wrote: > 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. Actually, port 5 must not always be setup. With patch 7, I explain this while preventing mt7530_setup_port5() from running if port 5 is disabled. Arınç