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 X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD333C433E1 for ; Mon, 22 Jun 2020 13:40:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD53520738 for ; Mon, 22 Jun 2020 13:40:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728577AbgFVNj6 (ORCPT ); Mon, 22 Jun 2020 09:39:58 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:52158 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728212AbgFVNj6 (ORCPT ); Mon, 22 Jun 2020 09:39:58 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1jnMfk-001fUc-RW; Mon, 22 Jun 2020 15:39:40 +0200 Date: Mon, 22 Jun 2020 15:39:40 +0200 From: Andrew Lunn To: Bartosz Golaszewski Cc: Florian Fainelli , Heiner Kallweit , Russell King , "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 , Mark Brown , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, 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: <20200622133940.GL338481@lunn.ch> References: <20200622093744.13685-1-brgl@bgdev.pl> <20200622093744.13685-10-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200622093744.13685-10-brgl@bgdev.pl> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Mon, Jun 22, 2020 at 11:37:38AM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Currently the PHY ID is read without taking the PHY out of reset. This > can only work if no resets are defined. This change delays the ID read > until we're actually registering the PHY device - this is needed because > earlier (when creating the device) we don't have a struct device yet > with resets already configured. > > While we could use the of_ helpers for GPIO and resets, we will be adding > PHY regulator support layer on and there are no regulator APIs that work > without struct device. The PHY subsystem cannot be the first to run into this problem, that you need a device structure to make use of the regulator API, but you need the regulator API to probe the device. How do other subsystems work around this? Maybe it is time to add a lower level API to the regulator framework? Andrew