Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp820525ybt; Wed, 24 Jun 2020 12:02:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJww8U7rZmAxmKsoOBaz9PKuuz8/eqYvOQn/lIOKDjZLs5iU/On2ddyMMj43b4SCHdr0oakN X-Received: by 2002:a17:906:cf91:: with SMTP id um17mr7718934ejb.168.1593025323625; Wed, 24 Jun 2020 12:02:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593025323; cv=none; d=google.com; s=arc-20160816; b=RRxj504lVYg+gTMMTdWjMnKh3Dr11YuFoU/5N7WU28rhy7H1khU4Jyy6Bi9E3UyjUO 7yUuqYquDSOnuN2OvPepGSZ6f0FXBbuw/5uOASxyAIV5NpJxfMQ7BVnjdssjezuYC94s CU2G2n+GoN6UalAXgjZ5jJ8k3BYGUz7eg2NpJGo+c9Xs2OUk8RuJbSihoomCcB70jyyP HfzURuHnHBTCSTbFJKAK/g1BsyJHSbFOHfgF2e8ap2fNVMjKskzCm4DelLGHjHVXktW9 /Q5qL2UAgN2IE0zImgkKVdKwod3kW5j7wTWjEiL+IVoLiJswrdnLiy2IbScGxjmdRpnu 4msQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=OH1adRq+m7N8/h1HnnnPKltHQr547P/Tkyp7aW8Xe7Y=; b=0ZuzFuj7QugdGqajwVapGFXI3lKWVF6rTnkCv1Of4vZND8RIgXkdv3I5WogfxcjDUh Lf61b1c3Uolp/GRI0WCz917UXp4DQ7T2tTbFJePV1XnejKm+3XzZ9p5KVJb6TCBXMiyQ ZNFU7LyYVkcvCLugQ1cpmJcNKwCiE32s0Aj5IWbXx0A87bBS5VQdkFo0eVteGNVC++1Q amUgksdxUi8IDgCLwgst4EPL91yrylBq+ZtCEC8maGzH5BNPYLdPQlNr/2a2iXCMe83M emgbIVmsDJ0i3MZ4pE9R4Y3y7sNGbzat/9vchd4yJo1dANBVR59J8tHFt47jq0PAsLPk ERYA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do13si16551611ejc.250.2020.06.24.12.01.40; Wed, 24 Jun 2020 12:02:03 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406213AbgFXTAH (ORCPT + 99 others); Wed, 24 Jun 2020 15:00:07 -0400 Received: from foss.arm.com ([217.140.110.172]:56106 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405469AbgFXTAG (ORCPT ); Wed, 24 Jun 2020 15:00:06 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AA3121F1; Wed, 24 Jun 2020 12:00:04 -0700 (PDT) Received: from [10.57.9.128] (unknown [10.57.9.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 470C13F71E; Wed, 24 Jun 2020 11:59:59 -0700 (PDT) Subject: Re: [PATCH 09/15] net: phy: delay PHY driver probe until PHY registration To: Russell King - ARM Linux admin , Florian Fainelli Cc: Andrew Lunn , Alexandre Belloni , devicetree , Vladimir Oltean , Linux Kernel Mailing List , Fabien Parent , Iyappan Subramanian , Quan Nguyen , Frank Rowand , Bartosz Golaszewski , Bartosz Golaszewski , Jakub Kicinski , Yisen Zhuang , Vivien Didelot , Tom Lendacky , Andrew Perepech , Stephane Le Provost , Keyur Chudgar , Jassi Brar , Claudiu Manoil , Rob Herring , "moderated list:ARM/Mediatek SoC..." , Matthias Brugger , Linux ARM , Salil Mehta , netdev , Ilias Apalodimas , Liam Girdwood , Microchip Linux Driver Support , Mark Brown , Philipp Zabel , Pedro Tsai , "David S . Miller" , Heiner Kallweit 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> <20200624165016.GA1551@shell.armlinux.org.uk> From: Robin Murphy Message-ID: <0c78a4ab-5aae-a45c-babd-e860c6cfc3c8@arm.com> Date: Wed, 24 Jun 2020 19:59:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200624165016.GA1551@shell.armlinux.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-06-24 17:50, Russell King - ARM Linux admin wrote: > 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? FWIW that would be ideal for solving an ordering a problem we have in the IOMMU subsystem too (which we currently sort-of-handle by deferring driver probe from dma_configure(), but it really needs to be done earlier and not depend on drivers being present at all). Robin.