Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1244932rdb; Fri, 16 Feb 2024 09:23:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVKRvo+hiaXFKork3+KZqPw3gFaOFry0T1ZYDusG9rXHvo/9dFrpCPX9dSXPg1M7DmagknPph2FyAGrEM6+1h2Tykp5j0KYorxPd99shg== X-Google-Smtp-Source: AGHT+IHxxlYA56utbh5nTZpW1Xrz85uL9QWtebxzc93kOHxGY2SZjnBD/kmIz0HfEtUvMyGqbLZ/ X-Received: by 2002:a05:6402:ca3:b0:563:d32f:544a with SMTP id cn3-20020a0564020ca300b00563d32f544amr2799221edb.1.1708104223834; Fri, 16 Feb 2024 09:23:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708104223; cv=pass; d=google.com; s=arc-20160816; b=QyN5J3VJ3Z5c+HX65dzL2teEPv66GWfeIWQYjsETbvOCuzzT8kgzBfvxXV14cUjLBl FIfaLHGB1NnoypPw43dhe227WsBQhMo8sYVIx/zDS6rqT4AOtUszFWkwJq8WhUWNQa+N q6E12cAzP9i0hdFfe8sW/1sOgyLcRpLeVSDrGyG1NVxikHTTtSb6TYVN2gz5qCRRt9W9 4nR0E8uZJ6ieA35VdRb5E+l48QxfAWJPZ29pz28kDpiopiunCYsm6iJzvXiN6YOwjw17 Vd2DRCHOnbA1EzAkIPDDxcHWt3zGc0r/uFtyWJeL7yKLcKXMSPFKeCP4IvGfFSV5obVJ fRgQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=RimLjOdN8rzQMpG0ae9IdH673ga5rpJ5Vs6DdQd0/gQ=; fh=ue7fAi/c2DEGZXJbqh1uMdvPBpe946Vr7KYefl96h+E=; b=VwWjyCvWLMrorVHGlsCoIBoa9lS9IqO8fYBO9kEFNMA66jEC9NSUkviB3MxXs5vk+H qilINtN77W0xDKAVorzLR3dF89Eqj2G3lcqBOFzR6l2acJ0QGGudAnZIB2Y8YLM6PdyW v5ntfkYwhL0PqzwtVbgb4qzGNcWKKBbevMXnzTNBVPEniN6Fnufnq1JjetLx0AlndiiC 5FCuHlbWk/zmGLgSo7urqygW9wfPu6vuCAZ8Y7EdeMPLyOzx3VQ00bhAXuUelxl1l0xs IuuIKWF1JlhhVF+tacuJuBURrETlS/4HlTlePNe4UttAIBJbPsPACrE80Y8TNBlbf2oq 7cdQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=BzmQcEEM; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com); spf=pass (google.com: domain of linux-kernel+bounces-69066-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69066-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a59-20020a509ec1000000b005638bb1c69csi142559edf.374.2024.02.16.09.23.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:23:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69066-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=BzmQcEEM; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com); spf=pass (google.com: domain of linux-kernel+bounces-69066-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69066-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 587851F29E7D for ; Fri, 16 Feb 2024 17:23:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5996131E3D; Fri, 16 Feb 2024 17:23:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arinc9.com header.i=@arinc9.com header.b="BzmQcEEM" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 44402130E4F; Fri, 16 Feb 2024 17:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708104201; cv=none; b=DWKsacoi7av8G1TGffLxuRkMBxIcq+glo+gJp0Qn+eELO3vMkDq8BxO+6WOyl4bMEH1/JyCVKd/WoDsmacwVl2Ur/FAkaUsrIFjc9/qlLHmW5cBa2lgJjCkzjF9bAPZZL/7tuNnUmQNahU++rJe7m+YUqBS/ShLJ9xNqQCp9jvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708104201; c=relaxed/simple; bh=C+UdeynDOGq0mrHveglMdaqWxl9GfAv8DWBDN7EsUJw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XTn+zH+nrUVip97RaLYkjcQh/8D+v7wQvAhlK0aLNWE99+nXZ3AHpZHxBnVuaDtsdr5EGtsjEytrTM4rMsLMblYKL0J8W5iq/ZJ0wUFn3Dcp/VjGyUU+GB2reClMo6ozqIEhlsmkyLalN5Ts8EjUaEA8gY4MbceoGvDx30A+gsY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arinc9.com; spf=pass smtp.mailfrom=arinc9.com; dkim=pass (2048-bit key) header.d=arinc9.com header.i=@arinc9.com header.b=BzmQcEEM; arc=none smtp.client-ip=217.70.183.200 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 1304B2000E; Fri, 16 Feb 2024 17:23:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1708104189; 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=RimLjOdN8rzQMpG0ae9IdH673ga5rpJ5Vs6DdQd0/gQ=; b=BzmQcEEMGCl+P5qGARHIVL1y4ADNuv8bQFuLLYUM4/lqqGfcpNFu8HWyOQ2A2GzE8/tujf UdWhRocg/l4UUe5et5gtQBAgVrF+9ZwquMbxcE3A9fXfYokgnN2lO5n7jn9cmkJkNt5Bfj Z3XEQF/p7R0XqIXTdm/O19LvG6YZkAXU8wtvI50pIW6S6P4He/7ayaQRFdsujG4PnqNC1w 9yDN2fWfqEQMQ/6KvImzgcEwtU9GeYgWcau+2qsYZVfxPvi2xhBRpBoHq+PWUgOF++yFwO Mnt+zGFq4nDdn50+Gz6cOWfWNFE4Uj3bgAALObqxxiPVojQVFESnzXTA+GzbSg== Message-ID: Date: Fri, 16 Feb 2024 20:23:01 +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 netnext 8/8] net: dsa: mt7530: simplify link operations and force link down on all ports To: "Russell King (Oracle)" Cc: Daniel Golle , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, Bartel Eerdekens , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20240208-for-netnext-mt7530-improvements-3-v1-0-d7c1cfd502ca@arinc9.com> <20240208-for-netnext-mt7530-improvements-3-v1-8-d7c1cfd502ca@arinc9.com> Content-Language: en-US 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 On 16.02.2024 18:43, Russell King (Oracle) wrote: > On Thu, Feb 08, 2024 at 08:51:36AM +0300, Arınç ÜNAL via B4 Relay wrote: >> From: Arınç ÜNAL >> >> Currently, the link operations for switch MACs are scattered across >> port_enable, port_disable, phylink_mac_config, phylink_mac_link_up, and >> phylink_mac_link_down. >> >> port_enable and port_disable clears the link settings. Move that to >> mt7530_setup() and mt7531_setup_common() which set up the switches. This >> way, the link settings are cleared on all ports at setup, and then only >> once with phylink_mac_link_down() when a link goes down. >> >> Enable force mode at setup to apply the force part of the link settings. >> This ensures that only active ports will have their link up. > > I think we may have a different interpretation of what phylink's > mac_link_down() and mac_link_up() are supposed to be doing here. > Of course, you have read the documentation of these methods so are > fully aware of what they're supposed to do. So you are aware that > when inband mode is being used, forcing the link down may be > counter-productive depending on how the hardware works. No, I haven't read the documentation [1] until your response here. My patch here doesn't touch mt753x_phylink_mac_link_down(), it is already the case with the driver that falls short of not forcing link down when inband mode is being used. That said, what I explain on the patch log does not properly describe the driver behaviour. This should explain it correctly: Enable force mode at setup to apply the force part of the link settings. This ensures that the ports that were never active will have their link down. I could, in the future, study this thoroughly to make the driver fully conform to the documentation. [1] https://docs.kernel.org/networking/kapi.html#phylink Arınç