Re: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-27 Thread Arnd Bergmann
On Wednesday 27 April 2016 10:16:40 Anup Patel wrote: > It is really interesting to see the evolution of MDIO bus: > > 1. Traditionally, MDIO controller used to be part of each ethernet controller > itself so each ethernet controller used to have it's own 2 wire MDIO bus > > 2. Next, we saw SoC

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-26 Thread Anup Patel
On Wed, Apr 27, 2016 at 1:11 AM, Andrew Lunn wrote: > On Tue, Apr 26, 2016 at 09:24:34PM +0200, Arnd Bergmann wrote: >> On Tuesday 26 April 2016 20:23:35 Andrew Lunn wrote: >> > > A more complex problem would be having a PHY driver for a device >> > > that can be either an ethernet phy or some oth

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-26 Thread Andrew Lunn
On Tue, Apr 26, 2016 at 09:24:34PM +0200, Arnd Bergmann wrote: > On Tuesday 26 April 2016 20:23:35 Andrew Lunn wrote: > > > A more complex problem would be having a PHY driver for a device > > > that can be either an ethernet phy or some other phy. > > > > I doubt that ever happens. You can have u

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-26 Thread Arnd Bergmann
On Tuesday 26 April 2016 20:23:35 Andrew Lunn wrote: > > A more complex problem would be having a PHY driver for a device > > that can be either an ethernet phy or some other phy. > > I doubt that ever happens. You can have up to 32 different devices on > an MDIO bus. Since an Ethernet PHY and a "

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-26 Thread Andrew Lunn
> A more complex problem would be having a PHY driver for a device > that can be either an ethernet phy or some other phy. I doubt that ever happens. You can have up to 32 different devices on an MDIO bus. Since an Ethernet PHY and a "some other sort of PHY" are completely different things, why wo

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-26 Thread Arnd Bergmann
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 n

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-26 Thread Andrew Lunn
> 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 don't actually see this shared bus being an issue, once the mux

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-26 Thread Florian Fainelli
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. Ho

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-26 Thread David Miller
From: Andrew Lunn Date: Tue, 26 Apr 2016 14:13:35 +0200 > On Tue, Apr 26, 2016 at 02:03:27PM +0530, Pramod Kumar wrote: >> As you can see from above points, trying to re-use Linux Ethernet MDIO mux >> framework for non-Ethernet PHYs is not the right way. > > And as i pointed out, all your argume

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-26 Thread Andrew Lunn
On Tue, Apr 26, 2016 at 02:03:27PM +0530, Pramod Kumar wrote: > Hi Andrew, > > Thanks for reviewing. I really appreciate your effort it. > > I am already aware of MDIO mux framework but did not see it fit for our > use case due to below limitations: > > 1. Current MDIO mux framework is Ethernet

RE: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-26 Thread Pramod Kumar
Yamada; Chen-Yu Tsai; > Mark Rutland; devicet...@vger.kernel.org; Pawel Moll; Arnd Bergmann; Suzuki > K Poulose; netdev@vger.kernel.org; Punit Agrawal; linux- > ker...@vger.kernel.org; BCM Kernel Feedback; linux-arm- > ker...@lists.infradead.org; Anup Patel > Subject: Re: [PATCH 1/6] bus: Add shared

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-25 Thread Andrew Lunn
Hi Pramod I took a closer look. I don't see why the current MDIO code should not be used, rather than adding a new framework. What you need for your Non Ethernet PHYs is that they are somehow probed. The current MDIO code will do that, based on the compatible string. An mdio device gets passed a

RE: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-24 Thread Pramod Kumar
infradead.org; linux- > ker...@vger.kernel.org; netdev@vger.kernel.org; anup.pa...@broadcom.com > Subject: Re: [PATCH 1/6] bus: Add shared MDIO bus framework > > From: Pramod Kumar > Date: Thu, 21 Apr 2016 14:48:38 +0530 > > > +struct shared_mdio_maste

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-24 Thread David Miller
From: Pramod Kumar Date: Thu, 21 Apr 2016 14:48:38 +0530 > +struct shared_mdio_master *shared_mdio_alloc_master(struct device *parent, > + struct device_node *node) > +{ > + int ret = 0; > + struct shared_mdio_master *master; Always order l

[PATCH 1/6] bus: Add shared MDIO bus framework

2016-04-21 Thread Pramod Kumar
Add a common shared MDIO bus framework for sharing single (or few) MDIO bus across IO subsystems such as SATA, PCIe, USB, and Ethernet. The IO specific PHY drivers will register to common shared MDIO bus as shared MDIO drivers and access the MDIO bus only using shared MDIO APIs. Signed-off-by: Pr