Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp732266ybt; Wed, 24 Jun 2020 09:51:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8sFvUKLdnnOl8HQ21z3xKmIrQjTKGDrH+rzwcEaD7ComUVSoKMV4X/dNG7J+SBSem9435 X-Received: by 2002:a17:906:4116:: with SMTP id j22mr25502260ejk.303.1593017504336; Wed, 24 Jun 2020 09:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593017504; cv=none; d=google.com; s=arc-20160816; b=XalXG7EOJZDpe7kF26e570Y79C5JWKGySenx8Q4vOVNxv1mka44ukmRYHqdoX7Aw60 WO8KoC3dV6VCdv7lM7c9wta2gDqVsmQXJUdWryGhYbCahEYf4mbBdrdtdiuuA/sj0x+g scyKsjZY5X+OeqbFQpei+duXsW2nuRZZv8wy54FpcyEUapwxiMbM8eNKpcOt/8OS64T2 UHoJz+ykqO4t/hXqKDRRofVcqD16qRlzygI+vLl5tj01mna5orSrTqJfm9mlqPdJLRUf +ZxC0jy593L3y2ZDGJz9T/hUVS5kJacPbYhD8jwWDyGcXClbmdEhZqYFGvK/JJXRBGkL PWdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=u1F8tzMKngdxJFt6gQRkq7xv28jRUmanHyUKEBsVcpo=; b=p5vvzwBf60Ddi4BRo+VnyklNCfctssGLnxhytiqKJEw54Y1s0GdPopWt6wbNBr3Rdb gEcvKYaaWzvTr7PUgnMv4BHcdkY9HqvookuKa9LhR1dyDgfN6yTY0DpeIxcIHwwhgTxB QKMjWadg8MB14sggUcp++JxOwdZOLpVo3shC6SR0vFmKBYGlAB5qchgWpV2GopRne0C/ HrxuxjmoqrvTADKfJfMubp7aaECoWsH703uwh752bhEfpZ/ZR5kbRzK7yEX8ybMGe/V+ Veo8ojxnk+sBGCi4G5SG1M6uckygjXlaAkajeuvMnOFZCzYzzOEFXQ3uOL3x+TMda3T6 aSNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=ZGlh5RxW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y93si15420516edy.109.2020.06.24.09.51.19; Wed, 24 Jun 2020 09:51:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=ZGlh5RxW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2405158AbgFXQuy (ORCPT + 99 others); Wed, 24 Jun 2020 12:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404017AbgFXQux (ORCPT ); Wed, 24 Jun 2020 12:50: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 F0716C061573; Wed, 24 Jun 2020 09:50:52 -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=u1F8tzMKngdxJFt6gQRkq7xv28jRUmanHyUKEBsVcpo=; b=ZGlh5RxW4InxZ7Jr34mRSgpIP BC2ZXdwKmi/rqOnIyw8h6eqsHXyNX5FojKj6InS5slHvG3YMArCT54vpxpu/7MGSLfuaGmwGzbjv+ z/F3ILATxpDuv6PPr5chSvFdCgfo4Pi+HjIZ9EfUnKQ4q5mLqCx8/LNBM3Tl8h28x2JUtDhFCi5hl xP9NWxSApDu96csu/sWRtzkhfjU7KWm5HOnwDz4bM8JRzCxtv2hAmeo9GTJ1biToCaETwYv2b+9h9 Nb67L1V53qnsN8mxbjmrZqWHzVcqXEiI5d3te+Xn/oBrbQErI5XzcXyRpZ6S6nA1ckuLGZVIpMs+P fapGRzjCg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:59220) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jo8bQ-0003Ld-UJ; Wed, 24 Jun 2020 17:50:24 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jo8bI-00027P-9n; Wed, 24 Jun 2020 17:50:16 +0100 Date: Wed, 24 Jun 2020 17:50:16 +0100 From: Russell King - ARM Linux admin To: Florian Fainelli Cc: Bartosz Golaszewski , Mark Brown , Andrew Lunn , Heiner Kallweit , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , netdev , devicetree , Linux Kernel Mailing List , Linux ARM , "moderated list:ARM/Mediatek SoC..." , Fabien Parent , Stephane Le Provost , Pedro Tsai , Andrew Perepech , Bartosz Golaszewski Subject: Re: [PATCH 09/15] net: phy: delay PHY driver probe until PHY registration Message-ID: <20200624165016.GA1551@shell.armlinux.org.uk> References: <20200622093744.13685-1-brgl@bgdev.pl> <20200622093744.13685-10-brgl@bgdev.pl> <20200622133940.GL338481@lunn.ch> <20200622135106.GK4560@sirena.org.uk> <20200624094302.GA5472@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2020 at 09:06:28AM -0700, Florian Fainelli wrote: > On 6/24/2020 6:48 AM, Bartosz Golaszewski wrote: > > I didn't expect to open such a can of worms... > > > > This has evolved into several new concepts being proposed vs my > > use-case which is relatively simple. The former will probably take > > several months of development, reviews and discussions and it will > > block supporting the phy supply on pumpkin boards upstream. I would > > prefer not to redo what other MAC drivers do (phy-supply property on > > the MAC node, controlling it from the MAC driver itself) if we've > > already established it's wrong. > > You are not new to Linux development, so none of this should come as a > surprise to you. Your proposed solution has clearly short comings and is > a hack, especially around the PHY_ID_NONE business to get a phy_device > only then to have the real PHY device ID. You should also now that "I > need it now because my product deliverable depends on it" has never been > received as a valid argument to coerce people into accepting a solution > for which there are at review time known deficiencies to the proposed > approach. It /is/ a generic issue. The same problem exists for AMBA Primecell devices, and that code has an internal deferred device list that it manages. See drivers/amba/bus.c, amba_deferred_retry_func(), amba_device_try_add(), and amba_device_add(). As we see more devices gain this property, it needs to be addressed in a generic way, rather than coming up with multiple bus specific implementations. Maybe struct bus_type needs a method to do the preparation to add a device (such as reading IDs etc), which is called by device_add(). If that method returns -EPROBE_DEFER, the device gets added to a deferred list, which gets retried when drivers are successfully probed. Possible maybe? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!