Re: [PATCH net-next] net: dsa: mv88e6xxx: assert SMI lock

2015-10-30 Thread Vivien Didelot
On Oct. Friday 30 (44) 10:01 PM, Andrew Lunn wrote: > > > > static int _mv88e6xxx_reg_read(struct dsa_switch *ds, int addr, int > > > > reg) > > > > { > > > > - struct mii_bus *bus = dsa_host_dev_to_mii_bus(ds->master_dev); > > > > + struct mii_bus *bus; > > > > int ret; > >

Re: [PATCH net-next] net: dsa: mv88e6xxx: assert SMI lock

2015-10-30 Thread Andrew Lunn
> > > static int _mv88e6xxx_reg_read(struct dsa_switch *ds, int addr, int reg) > > > { > > > - struct mii_bus *bus = dsa_host_dev_to_mii_bus(ds->master_dev); > > > + struct mii_bus *bus; > > > int ret; > > > > > > + assert_smi_lock(ds); > > > + > > > + bus = dsa_host_dev_to_mii_bus(ds->master

Re: [PATCH net-next] net: dsa: mv88e6xxx: assert SMI lock

2015-10-30 Thread Vivien Didelot
Hi Andrew, On Oct. Friday 30 (44) 09:41 PM, Andrew Lunn wrote: > On Fri, Oct 30, 2015 at 04:35:42PM -0400, Vivien Didelot wrote: > > It's easy to forget to lock the smi_mutex before calling the low-level > > _mv88e6xxx_reg_{read,write}, so add a assert_smi_lock function in them. > > > > Signed-of

[PATCH net-next] net: dsa: mv88e6xxx: assert SMI lock

2015-10-30 Thread Vivien Didelot
It's easy to forget to lock the smi_mutex before calling the low-level _mv88e6xxx_reg_{read,write}, so add a assert_smi_lock function in them. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) di

Re: [PATCH net-next] net: dsa: mv88e6xxx: assert SMI lock

2015-10-30 Thread Andrew Lunn
On Fri, Oct 30, 2015 at 04:35:42PM -0400, Vivien Didelot wrote: > It's easy to forget to lock the smi_mutex before calling the low-level > _mv88e6xxx_reg_{read,write}, so add a assert_smi_lock function in them. > > Signed-off-by: Vivien Didelot > --- > drivers/net/dsa/mv88e6xxx.c | 31 ++