Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-07 Thread Florian Fainelli
On 06/07/2016 12:11 PM, Vivien Didelot wrote: > Hi Andrew, > > Andrew Lunn writes: > With the legacy interface it is tricky. When would you call such a remove/tairdown function when using the old binding? >>> >>> That'd go in dsa_switch_destroy I guess, but it just

Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-07 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> > With the legacy interface it is tricky. When would you call such a >> > remove/tairdown function when using the old binding? >> >> That'd go in dsa_switch_destroy I guess, but it just covers the case >> where the whole DSA code is unloaded...

Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-07 Thread Andrew Lunn
> > With the legacy interface it is tricky. When would you call such a > > remove/tairdown function when using the old binding? > > That'd go in dsa_switch_destroy I guess, but it just covers the case > where the whole DSA code is unloaded... I don't think that helps you. It should not be

Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-07 Thread Vivien Didelot
Andrew Lunn writes: > On Tue, Jun 07, 2016 at 12:48:37PM -0400, Vivien Didelot wrote: >> Hi Florian, Andrew, >> >> Vivien Didelot writes: >> >> > Hum reviewing that again, I see that if one of the 2 subsequent calls to >> > request_irq

Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-07 Thread Andrew Lunn
On Tue, Jun 07, 2016 at 12:48:37PM -0400, Vivien Didelot wrote: > Hi Florian, Andrew, > > Vivien Didelot writes: > > > Hum reviewing that again, I see that if one of the 2 subsequent calls to > > request_irq fails, you end up with an unregistered MDIO bus. >

Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-07 Thread Vivien Didelot
Hi Florian, Andrew, Vivien Didelot writes: > Hum reviewing that again, I see that if one of the 2 subsequent calls to > request_irq fails, you end up with an unregistered MDIO bus. > > We have the same issue in the mv88e6xxx legacy probe code if dsa.c fails

Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-07 Thread Vivien Didelot
Hi Florian, Florian Fainelli writes: > static int bcm_sf2_sw_setup(struct dsa_switch *ds) > { > const char *reg_names[BCM_SF2_REGS_NUM] = BCM_SF2_REGS_NAME; > @@ -972,6 +1099,12 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds) > goto out_unmap; >

Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-07 Thread Vivien Didelot
Florian Fainelli writes: > +static int bcm_sf2_mdio_register(struct dsa_switch *ds) > +{ > + struct bcm_sf2_priv *priv = ds_to_priv(ds); > + struct device_node *dn; > + static int index; > + int err; > + > + /* Find our integratd MDIO bus node */

Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-06 Thread Andrew Lunn
On Mon, Jun 06, 2016 at 04:14:55PM -0700, Florian Fainelli wrote: > Register a slave MDIO bus which allows us to divert problematic > read/writes towards conflicting pseudo-PHY address (30). Do no longer > rely on DSA's slave_mii_bus, but instead provide our own implementation > which offers more

[PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus

2016-06-06 Thread Florian Fainelli
Register a slave MDIO bus which allows us to divert problematic read/writes towards conflicting pseudo-PHY address (30). Do no longer rely on DSA's slave_mii_bus, but instead provide our own implementation which offers more flexibility as to what to do, and when to register it. We need to