Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1834666iob; Thu, 19 May 2022 16:14:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5uLrDjW3q1HxNroJp3UT5xK4NtXZ3iAYS8ndhfby5qOELSIqr9ZgCpvSKNSBnGpMJVUFH X-Received: by 2002:a17:90b:1c12:b0:1df:d7e9:2edd with SMTP id oc18-20020a17090b1c1200b001dfd7e92eddmr5835180pjb.35.1653002074360; Thu, 19 May 2022 16:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653002074; cv=none; d=google.com; s=arc-20160816; b=wzLGhQ9VPs3WZ8i+YkiK0bOsmsFgknXZoqCY2OBY5lN20+RD4A6oEFow+pQms9HEN/ klI2KpC2PoiFpJufrdSImNG86eILnX4cr0k/1oHc4gfRwmb887ukun5fGgYp6Wa5KbT9 mJpIJreaJX2nnUPt3t6+/oAw+TN1WcbF3eQjgmF0uQczvhjL4ZLbOQxlg89jnD4CLB87 R1rxg0xWGtGUGEji+VQ5Ase1XVdUBYu5BRTx+7ji5IF44tcnyTz2DecOdza6HiLR/gBM Gr87crsRZCbRXkrfu6FxAyvxQ3PXXG96swHpUKAkD2C56tWM/L803tSjGUOw4Rzb8Woo p5GA== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Dc2ke5NcQ5lIuFlKoA7A3ChISVicawrM3SfBe9e5al0=; b=0mcaZq8N4vwC0M+RbZ6bczSkf5B6IH/WBE5rNjroU1LgVWzr8kbu3vPMC2YuBa6Qb5 7rGIzSWCZ07XbzUbD/ejvLHKNA/HFqc60cuimjbeoFjcUkFLaiQUpeQbAMXpeRuATFdo f9+aL6dzegkXh2gHZpXfsHfv06qylV59faihMRYMU50Txn+dSOMHIsxWB48Pwcar3GdU M7DpOy4h0P6zDQtje5KUG5VNRY/c2DMV0YkVfUrWy7yvmZfzCCF+DlKE5sVak1bc2oF7 AVsVkTK4FrL4jC3CtOtE03as3jwzP4MuL0qi+A7tkUrm2KcSZoySadgFLvE+rEMF+gmw BO/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=tYaeLioJ; 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 n3-20020a170902d2c300b0015ec10f7e3bsi868396plc.82.2022.05.19.16.14.21; Thu, 19 May 2022 16:14:34 -0700 (PDT) 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=tYaeLioJ; 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 S240643AbiESPQY (ORCPT + 99 others); Thu, 19 May 2022 11:16:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234118AbiESPPx (ORCPT ); Thu, 19 May 2022 11:15:53 -0400 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 BD06AEBEA1; Thu, 19 May 2022 08:15:40 -0700 (PDT) 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=Dc2ke5NcQ5lIuFlKoA7A3ChISVicawrM3SfBe9e5al0=; b=tYaeLioJ6Vr4CMOiQCTASxyU0Q AdLcgN5gVnKse0kFX0Qz57VnRgcJ4bCIaxAdJfvKiQ8pUPhUtt19ebmo6wgBNcBSFKIxotA3Zr2pB eI2c2/fwtmhv57UI9F/GCFatDCNKcqAh32hPcIQKq7XmgeR1hBsJTJEY4G+OZGHwxCj98dtjpX03B 6bN7outbhnlpLTA5V4csr3OOH5P/jUWJNCFeySXO+yrBsyUIXMOM37GghUqLfsilrTJEUVuk1dHwr wYuYdB3X5eThTakugqrA57+ITmwi9DLEkRdbi96a1M1QJ8A0NQ4EjJ8XarX4StQ+EylGvrr6Rln+O OXEAA/8g==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:60776) 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 1nrhsF-000476-MW; Thu, 19 May 2022 16:15:36 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nrhsC-0006fR-Bo; Thu, 19 May 2022 16:15:32 +0100 Date: Thu, 19 May 2022 16:15:32 +0100 From: "Russell King (Oracle)" To: Vladimir Oltean Cc: Andrew Lunn , "netdev@vger.kernel.org" , Jakub Kicinski , "David S. Miller" , Paolo Abeni , Eric Dumazet , Florian Fainelli , Vivien Didelot , Vladimir Oltean , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Saravana Kannan , Greg Kroah-Hartman , "Rafael J. Wysocki" , Robin Murphy , Geert Uytterhoeven , Rob Herring , Frank Rowand , John Stultz , Alvin =?utf-8?B?4pS8w6FpcHJhZ2E=?= , Heiner Kallweit Subject: Re: [RFC PATCH net 0/2] Make phylink and DSA wait for PHY driver that defers probe Message-ID: References: <20220513233640.2518337-1-vladimir.oltean@nxp.com> <20220519145936.3ofmmnrehydba7t6@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220519145936.3ofmmnrehydba7t6@skbuf> 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, T_SCC_BODY_TEXT_LINE 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 Thu, May 19, 2022 at 02:59:36PM +0000, Vladimir Oltean wrote: > Hi Andrew, > > On Sat, May 14, 2022 at 02:23:51AM +0200, Andrew Lunn wrote: > > There is a very different approach, which might be simpler. > > > > We know polling will always work. And it should be possible to > > transition between polling and interrupt at any point, so long as the > > phylock is held. So if you get -EPROBE_DEFFER during probe, mark some > > state in phydev that there should be an irq, but it is not around yet. > > When the phy is started, and phylib starts polling, look for the state > > and try getting the IRQ again. If successful, swap to interrupts, if > > not, keep polling. Maybe after 60 seconds of polling and trying, give > > up trying to find the irq and stick with polling. > > That doesn't sound like something that I'd backport to stable kernels. > Letting the PHY driver dynamically switch from poll to IRQ mode risks > racing with phylink's workqueue, and generally speaking, phylink doesn't > seem to be built around the idea that "bool poll" can change after > phylink_start(). I think you're confused. Andrew is merely talking about phylib's polling, not phylink's. Phylink's polling is only ever used in two circumstances: 1. In fixed-link mode where we have an interruptless GPIO. 2. In in-band mode when the PCS specifies it needs to be polled. This is not used to poll ethernet PHYs - ethernet PHY polling is handled entirely by phylib itself. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!