Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp733728rdb; Sat, 6 Jan 2024 07:01:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGc4zCM0AEPN7T3W+SrK8W2ihtHAlTri6D0lP1YZHJFuNr2HeTqpQsWgvHwaOxu7kaWW2wu X-Received: by 2002:a05:6808:61a:b0:3bb:d760:3799 with SMTP id y26-20020a056808061a00b003bbd7603799mr1204182oih.38.1704553285565; Sat, 06 Jan 2024 07:01:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704553285; cv=none; d=google.com; s=arc-20160816; b=Fr8LzH68dqXBhk5iGixftwdNpPXSobVEBkp+gUVBrbC5vDlYRuKWCJiNSZ6gXdvNaJ qIUnV89gCGlWk2Aa8kRBqfNQyKDGp2el0IOAwzGWTTRgzNn+LMEgs0kNtcchwZq+LYCX pWoaER9VNMKLCiLE5TCgFQqtXArbbtYt7pPQNBj9QBS9Qu92roY3wxrDWSYaNftYswwR efeUWnKTSwh0uJJbxOJzjECb+MeztYdq0EBT2CpFwA/384oPPx62D3Czi4u7NtRGzhtR gFk+o4yk9LPlajZ95gqkKkQDXXTiF8XAuB8smAJSssvXtyis1mtOuhSu9a2DxXh8VDsF GATA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=skoV/MYNvEJ7Q4zca+8v7GcUrjuUMIoeHzDPlkaXyPY=; fh=lz+bL5nSWc48NS9NUFSsqa/UutHRDZmTYcHZRjz2cLE=; b=XzXpaCJFQk6/v9YI+da93bTd7MVAeQhiDbJ7NT6IARbtjYri1q9SFP3RTEv65cy3mZ yX1Qk5eDNKdkbeIy+L57+lJ6opsungOY5IcG56JmRwb0nfNmP//TJbft5q20YzJPEg5v 6ukGs/zl0oeI7HUn7oo9xYZgh73iYO3lgq5EUq4xs3mAuTwaPmdgpTW1rwFwSf2fzMfY NI3yyuIVzsbTE7o2uRNgYWCqszthFfUuTo53SWU4DDWBpWpX3QOkpEiX+KgdL8kXImLg vEqmc7la/q0f8+F9p07LnuVHN13UYCwwLK9BgymAU/9ysugqRTB73EmQ/tmTjS3TUfLA bC/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=pSMwvwgc; spf=pass (google.com: domain of linux-kernel+bounces-18613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18613-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w4-20020a0ce104000000b0067ef2e4e420si4171997qvk.37.2024.01.06.07.01.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 07:01:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=pSMwvwgc; spf=pass (google.com: domain of linux-kernel+bounces-18613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18613-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 522DC1C2110C for ; Sat, 6 Jan 2024 15:01:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F675848D; Sat, 6 Jan 2024 15:01:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arinc9.com header.i=@arinc9.com header.b="pSMwvwgc" X-Original-To: linux-kernel@vger.kernel.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DBD479EC; Sat, 6 Jan 2024 15:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arinc9.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arinc9.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 567EF60002; Sat, 6 Jan 2024 15:00:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1704553261; 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=skoV/MYNvEJ7Q4zca+8v7GcUrjuUMIoeHzDPlkaXyPY=; b=pSMwvwgcVeeUxycO6OHaK+SCwICC7DmsXLDD+dHVpiqvO0ehxBcQ5/MPqdsrxBg/NXWYMM LWoCT1PqXQ24WS2lXN2D5dqv2Vqjli/duePWnVZeanTB3qG0b76eiJlmonD8EHlv7rkxSJ Xh7FC1AtuLcuVZBtJgSYMqofRC9mW3j09DgkAQqE9zR2KePRaDbzjry3Vda0HQw94rQSO5 soUQPqFEhdcHl+p2Wme3AP/3ba68cDNQHbbCAMWx1yO35E66jANw6LaREYVSA5xcIZU9rM o1AtHTvKj1UeMjIKlfQRGy4cYpC/AlkfK4WYg8jDYiwdEc42jrmIs/P6U0zWGw== Message-ID: Date: Sat, 6 Jan 2024 18:00:53 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v2 6/7] net: dsa: mt7530: do not set priv->p5_interface on mt7530_setup_port5() Content-Language: en-US To: Vladimir Oltean Cc: Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , Frank Wunderlich , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20231227044347.107291-1-arinc.unal@arinc9.com> <20231227044347.107291-7-arinc.unal@arinc9.com> <20240104154241.rxjins4mi5zkbhia@skbuf> From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= In-Reply-To: <20240104154241.rxjins4mi5zkbhia@skbuf> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-Sasl: arinc.unal@arinc9.com On 4.01.2024 18:42, Vladimir Oltean wrote: > On Wed, Dec 27, 2023 at 07:43:46AM +0300, Arınç ÜNAL wrote: >> priv->p5_interface and priv->p6_interface are for use on the MT7531 switch. >> They prevent the CPU ports of MT7531 to be configured again. They are >> useless for MT7530. Therefore, remove setting priv->p5_interface for >> MT7530. >> >> Signed-off-by: Arınç ÜNAL >> --- > > What makes priv->p5_interface and priv->p6_interface useless for MT7530 > as you say? This code in mt753x_phylink_mac_config() seems executed > regardless of switch family: > > case 5: > if (priv->p5_interface == state->interface) > break; > > if (mt753x_mac_config(ds, port, mode, state) < 0) > goto unsupported; > > if (priv->p5_intf_sel != P5_DISABLED) > priv->p5_interface = state->interface; > break; > case 6: > if (priv->p6_interface == state->interface) > break; > > mt753x_pad_setup(ds, state); > > if (mt753x_mac_config(ds, port, mode, state) < 0) > goto unsupported; > > priv->p6_interface = state->interface; > break; This is also useless for non-MT7531 switches in the sense that it unnecessarily prevents port 5 and 6 from being reconfigured. There's nothing wrong with configuring them multiple times. These are the remains of before phylink was implemented on this driver so the thought of changing phy_interface_t on the fly was non existent. At that time, it was probably made to apply to all switch models for convenience, as port 5 and 6 are CPU ports so they're highly likely to be fixed links. The reason I don't deal with this code block now is because I will get rid of priv->p5_interface and priv->p6_interface when I also get rid of priv->info->cpu_port_config() with a later patch. Arınç