Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752286AbcDZRym (ORCPT ); Tue, 26 Apr 2016 13:54:42 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:50910 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750843AbcDZRyk (ORCPT ); Tue, 26 Apr 2016 13:54:40 -0400 From: Arnd Bergmann To: Florian Fainelli Cc: Andrew Lunn , Pramod Kumar , Rob Herring , Catalin Marinas , Will Deacon , Masahiro Yamada , Chen-Yu Tsai , Mark Rutland , devicetree@vger.kernel.org, Pawel Moll , Suzuki K Poulose , netdev@vger.kernel.org, Punit Agrawal , linux-kernel@vger.kernel.org, BCM Kernel Feedback , linux-arm-kernel@lists.infradead.org, Anup Patel , Kishon Vijay Abraham I Subject: Re: [PATCH 1/6] bus: Add shared MDIO bus framework Date: Tue, 26 Apr 2016 19:53:39 +0200 Message-ID: <5167289.0a4LBoWhyX@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <571FA3F6.7000903@gmail.com> References: <1461230323-27891-1-git-send-email-pramod.kumar@broadcom.com> <20160426121335.GC11668@lunn.ch> <571FA3F6.7000903@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:AjMlmqFlgzKO+J+zjOKz/8Yh4HGZptEsQIvcijfmHMkG0Vbl7wY 0pG854Bk+tD9q4aTZtQTmDwtM6HCCdgFznPo1JEcGFN7dR1n/6Q9cXhdUt9Ffh42ToivFQQ rmRMV4JPljPSuviTqT9uM+VYJ1ZqvagQBdE9nzgUDMkTqvChTu3q8kI9ZA/5GWJumILsFVq sADQSikdc9vKd/SyYrBlQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:9YQxGYJwRBQ=:5iImgw3DT9JwH8QoWqWb7P G47gLlJ3FMW7FrcV6i54i1ND32wy5FQG8bYsWd+fWOAndfSadVGfW+DYxIhS+pnFsX+ds452U TcWYwxg9xiKCBNiryx5s8NWCITcHHsCq8vHJKAxD1W239PKaPbYgbQR2g/M4SAZHclcf6QeY8 ZJaOyhDXelLHZ5Fq4wsT4WInn7hAT3N9uibpfJzGtEUQT35B17iBse+eisTbuHVz2coDJr13f skTMARypfDRnxpsC11NIQ24Z6ZGfdqSYD3yYaqcLnPNxNN/qsfPR9TKTgaSO4u1dREyMAtm8Y qycI+SJqyPNNEyqim41haFTIjeuoKg7GbMzDV1MY+9y8St50xc+gi62ay95hcVcD8MoClvtKz 3NLWk4jTJA5KYScYATpTmnvc/ga4PX4925LH4iYNFFoUGorJOGx7pMeYbP+R6jKS5X2reR5we q9vOwq29sY+WMst6I0dScm6LLbAKPPxT+JjJMJPIzdWeBiEz2wgzq77l+ihbAny405KHB0kwU Y0nOaNqj5YnO64fkALPuvaD0Fi4Q3X4enNfuecZ5oBXU+BXx4192RuJ0cksXU1nx3KCsG9q9H RwiavbVWzI+fTrylkuxFi5oDG09he5nZzSbgAMmw3a8R+8MKE1Q2j33rxLw5qQppG2LddJQbr 9MZkH/nfxhgRdSfkyL5Uxjlk25MVQnjXI2Y97Vd4rkuQu8uZqdAl+cSILNmbMFyFQwBXCWAn5 eR92kz9rHibZB08Q Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1878 Lines: 41 On Tuesday 26 April 2016 10:23:02 Florian Fainelli wrote: > On 26/04/16 05:13, Andrew Lunn wrote: > >> 4. Apart from these, by using MDIO mux framework we are making our > >> non-ethernet PHYs dependent on Linux network drivers which is not > >> acceptable. What if some product line does not need network subsystem at > >> all? > > > > This is your only valid point. However, does Broadcom have a product > > line which does not include networking? Is not Broadcom a network SoC > > vendor? > > But even with that, there is no reason why we could not decouple the > PHYLIB MDIO framework from PHYLIB and make it available as a more > standalone subsystem which can be utilized when you have a mix of MDIO > devices like here. [adding Kishon Vijay Abraham] We should also consider how this fits in with drivers/phy/, which is the generic framework for all PHY devices that are not for ethernet. The most straightforward way that you mention would be to allow generic PHY devices to be probed on an MIO bus or mux. This should just work using mdio_module_driver(), as Andrew already explained. A more complex problem would be having a PHY driver for a device that can be either an ethernet phy or some other phy. With today's frameworks that would require two separate drivers, one in drivers/phy and one in drivers/net/phy/. If that turns out to be a common problem, we might want to come up with a way to nest one on top of the other, or merge two two device structures (struct phy_device and struct phy). > I am not clear on how common a shared MDIO bus is on other SoCs, but the > other Broadcom SoCs I am familiar with have dedicated MDIO buses > instances per type of PHY (PCIe, BUSB, Ethernet), thus making the split > a ton easier. I think most commonly, the other PHYs are not on MDIO at all, but are integrated inside of the SoC as an MMIO based device. Arnd