From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4342DC4167B for ; Wed, 6 Dec 2023 17:58:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To: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-Owner; bh=Zx9KxWGerx+W41aaC9quWG9vqgyz+cO6mq7WwjDjGZQ=; b=pJssbWaDo4wdD1 m37fZDaSR8fgCPo/ZXa9eBJZOMhC3MTtlGitGaua4umgNWBfyU/9TgzHEDZmEZ8RcW4xmQh/m+8h5 /wZ2Bwo+7mc6BLtU+s/XZsoQqg1A8xollbZiT4tbpyxeT7oplTN6mjaxG618VO8fbBSl3zF/sPRrh U7nwiXsYyTJVqHFsNJMc6t9tuvwbx5z0r/6B7xSEwJr1/obdSy6XZIrME5DC1ByDKnWRm3WrRuRC8 d2GiOsM0az0y290n4rpa7lQm2iY1pdIZ62JaKvJd1NVVwdFxKiHrgh0ImHWTJAC09zYvmxkOkaa1Z nYvUCuI/gkN2xPUMdI2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rAwAM-00AzKd-03; Wed, 06 Dec 2023 17:58:34 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rAwAI-00AzIC-0c; Wed, 06 Dec 2023 17:58:31 +0000 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-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=3ZZNNhGyoTwRHgS/bMWVfX3vw+ZZ4cEePiAqrrIcnwM=; b=0HbX49InVIrrypsWfM0ZmrDswH hUiEYIwZ/X0y6/g3n9MfR/Xe2G5AdEZwo+6WoFCG9muiQqjrdSwuIWlOmpA/dcAwSSIDNPabftXNo uUNE6oM3plQH/R0YwGvoVXykOm1A4uJeGpKeG2xQ6OpBt4v6vuNKuyUgCJLK2gEMd+nzY3h0O6rqU lVYOBys6d13VTBf1WTZRBZfPGgizzwR9LYBtitOMb3NgrraS95ziohm/QKnnBx5eXCTQ1NEWNAn6r jZStgPtTaO+kCOGSkHoMhAr3HpiHeQ3UkPTPRTIclBzQAngtVpzIr9Moie2tqITHv3pZ/w+4X8vqF 3QJptGVQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:56612) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rAw9w-0000E0-0u; Wed, 06 Dec 2023 17:58:08 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rAw9w-0002uo-Va; Wed, 06 Dec 2023 17:58:08 +0000 Date: Wed, 6 Dec 2023 17:58:08 +0000 From: "Russell King (Oracle)" To: Maxime Chevallier Cc: Daniel Golle , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , AngeloGioacchino Del Regno , Andrew Lunn , Heiner Kallweit , Alexander Couzens , Qingfang Deng , SkyLake Huang , Philipp Zabel , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org Subject: Re: [RFC PATCH v2 5/8] net: pcs: add driver for MediaTek USXGMII PCS Message-ID: References: <3cd8af5e44554c2db2d7898494ee813967206bd9.1701826319.git.daniel@makrotopia.org> <20231206105838.069ae288@device.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231206105838.069ae288@device.home> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231206_095830_231981_2FDF57CE X-CRM114-Status: GOOD ( 12.55 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Wed, Dec 06, 2023 at 10:58:38AM +0100, Maxime Chevallier wrote: > On Wed, 6 Dec 2023 01:44:38 +0000 > Daniel Golle wrote: > > + /* Read USXGMII link status */ > > + state->link = FIELD_GET(RG_PCS_RX_LINK_STATUS, > > + mtk_r32(mpcs, RG_PCS_RX_STATUS0)); > > + > > + /* Continuously repeat re-configuration sequence until link comes up */ > > + if (!state->link) { > > + mtk_usxgmii_pcs_config(pcs, mpcs->neg_mode, > > + state->interface, NULL, false); > > + return; > > .pcs_get_state() isn't called only for link state polling,but also when querying > the link state from ethtool, from phylink_ethtool_ksettings_get(). > > As mtk_usxgmii_pcs_config triggers a pcs reset and reconfiguration, won't this disrupt > the link ? Highly likely if there's a race, but note that mtk_usxgmii_pcs_config() only gets called if the link is *down*. I guess some IPs need a bit of kicking to work properly. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy