Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1259791

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

From Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Newsgroups linux.kernel
Subject Re: [PATCH net-next] net: dsa: mv88e6xxx: assert SMI lock
Date 2015-10-30 22:20 +0100
Message-ID <qppfz-2sf-1@gated-at.bofh.it> (permalink)
References <qpoMx-22G-1@gated-at.bofh.it> <qpoMx-22G-3@gated-at.bofh.it> <qpoWe-25R-15@gated-at.bofh.it> <qpp5U-2oR-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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;
> > > >  
> > > > +	assert_smi_lock(ds);
> > > > +
> > > > +	bus = dsa_host_dev_to_mii_bus(ds->master_dev);
> > > 
> > > Is this change of when bus is assigned actually required?
> > 
> > No, but I found not necessary to issue this "mdio_bus" lookup if the
> > lock is not held (see net/dsa/dsa.c:555). Do you prefer not to do that?
> 
> You are optimising for an error condition. If this optimisation saves
> anything, it means we have a locking bug!

Very good point, I'll get rid of that then.

> As a separate patch, i would do this lookup once in a setup function
> and save it away in ps. We just need to watch out for the probe
> register accesses.

Yes, I already put that on a todo list ;-)

> > Also are you OK with removing all the "Must be called with..." comments,
> 
> Yes, it will become a lot more clear when the kernel outputs a stack dump!

Good, sending a v2 right away then.

Thanks,
-v
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH net-next] net: dsa: mv88e6xxx: assert SMI lock Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-30 21:50 +0100
  Re: [PATCH net-next] net: dsa: mv88e6xxx: assert SMI lock Andrew Lunn <andrew@lunn.ch> - 2015-10-30 21:50 +0100
    Re: [PATCH net-next] net: dsa: mv88e6xxx: assert SMI lock Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-30 22:00 +0100
      Re: [PATCH net-next] net: dsa: mv88e6xxx: assert SMI lock Andrew Lunn <andrew@lunn.ch> - 2015-10-30 22:10 +0100
        Re: [PATCH net-next] net: dsa: mv88e6xxx: assert SMI lock Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-30 22:20 +0100

csiph-web