Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3074472rwb; Mon, 16 Jan 2023 03:26:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXszFXxYpT3SVNFqpJG4+COgRH5Qcr3JDUW9AEi+QOJaaS4kAfnxl4ozAde/Gdwei9pPltlr X-Received: by 2002:a05:6402:1381:b0:499:7cf3:a452 with SMTP id b1-20020a056402138100b004997cf3a452mr10729981edv.14.1673868376304; Mon, 16 Jan 2023 03:26:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673868376; cv=none; d=google.com; s=arc-20160816; b=WTUO552SBmSWEUIJih4YV2dJ6QcrfCbCHSK8I3KUdIEfJoksBgr1CTjGe9+xRBkUZZ zRpozMMPpVyWFAPAWsPhGfx40IhrERtqiuBB6b5zWAy3WPj9xeHauGz64sbG08xDXX8t E8hoPl3AfGEKeQEFNXPlHQmIjlgtEicAePIQkS1Aw6OocyR9lkJGtglnxXK/YVrxZKA/ maUi8ts/WbY7sMJRctput4tYcd2t4VEy2tGy+i3hFhG/In1fhx2dAQdBWuBg+tqqw1f0 H9333wyfJ9CaQe720xBjZetfslV5ZjjebwSdoQeqGE6KdEDK+7MJWuGgA6cERNYKJeS3 f+xg== 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=k75wwwhG7lUtWo3nfpU73+/Nhl6iDUNa31lHcKIVs6I=; b=C3uVZ+EzyDCAdFwiW5SwZDJYIQSqsRaCSNfgFlNPpzs9WNj9ioqfAvmmhJ7RVTzbT/ OhRkKuW07DU+ba3fklR7vVNmXzT1SjpOo08eWWwPI1Mbu16Ecv7fOsRqiy7wBWb9DzT/ 4BvMCYeaBht96yKTD+83nuc+Av8P5A+C8Yo5wgUXGtqPcL7rXTfx8x1mDNjaI5a+ysNZ k31qjjba4ayICBVFgE7nfi7239ngWS44pcieSjISmoVUORXpnJfmPw+G0ad8byY1XD/v nz3JPGM/EO0C1R/o7qIL4xZ2lEmMWraYcHTQg4bhTdDiv5iWyS5tiITA/l+UrbVB+RJL mXwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=0b8wCmI1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a056402090e00b0048721e1b62csi7493883edz.613.2023.01.16.03.26.03; Mon, 16 Jan 2023 03:26:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=0b8wCmI1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230477AbjAPKzq (ORCPT + 53 others); Mon, 16 Jan 2023 05:55:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230468AbjAPKyp (ORCPT ); Mon, 16 Jan 2023 05:54:45 -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 EBAF01F497; Mon, 16 Jan 2023 02:54:24 -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=k75wwwhG7lUtWo3nfpU73+/Nhl6iDUNa31lHcKIVs6I=; b=0b8wCmI1xBBrYgi464CipbnstD EbeaLU5wB9IDjqo4BMx4XIgPgnal3biWluBhl6ZNC8GgHbFI/F37jmCnX7+Shfd5olsSjLKXupfOA UAOv5qzzJd80SiC6acu4Zx+3cbrgGxfRqd36EKamZKikptdrAO5qDyMlwhepKObTsI70TTYQWJoIp 5gkREfy6L7OGeC6wGzNsUkXPpDLCd8Qw0TdIHG0/ZF6Nuclgxry59TZUmhcMm9ICSFLu22KxhzNBg jqS3AR/pL1Vjcrm+MrrTePUQBF/OhjvzqWPl+0raKXVRqL018WTY6b23F/3aORLuiYw1EX6Rp8wwh pLoksX5Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:36122) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pHN7j-0004es-V8; Mon, 16 Jan 2023 10:53:55 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pHN7e-0005ww-0n; Mon, 16 Jan 2023 10:53:50 +0000 Date: Mon, 16 Jan 2023 10:53:49 +0000 From: "Russell King (Oracle)" To: =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= Cc: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Geert Uytterhoeven , Magnus Damm , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Wong Vee Khee , Kurt Kanzenbach , Revanth Kumar Uppala , Tan Tee Min , Thomas Petazzoni , Herve Codina , =?iso-8859-1?Q?Miqu=E8l?= Raynal , Milan Stevanovic , Jimmy Lalande , Pascal Eberhard , Mohammad Athari Bin Ismail , Jon Hunter , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH net-next 3/6] net: stmmac: start phylink before setting up hardware Message-ID: References: <20230116103926.276869-1-clement.leger@bootlin.com> <20230116103926.276869-4-clement.leger@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230116103926.276869-4-clement.leger@bootlin.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 16, 2023 at 11:39:23AM +0100, Cl?ment L?ger wrote: > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > index f2247b8cf0a3..88c941003855 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > @@ -3818,6 +3818,12 @@ static int __stmmac_open(struct net_device *dev, > } > } > > + /* We need to setup the phy & PCS before accessing the stmmac registers > + * because in some cases (RZ/N1), if the stmmac IP is not clocked by the > + * PCS, hardware init will fail because it lacks a RGMII RX clock. > + */ > + phylink_start(priv->phylink); So what happens if you end up with the mac_link_up method being called at this point in the driver, before the hardware has been setup ? If you use a fixed-link, that's a real possibility. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!