Re: [PATCH net-next] dsa: mv88e6xxx: Timeout based on iterations

2016-08-18 Thread Andrew Lunn
> > static int mv88e6xxx_wait(struct mv88e6xxx_chip *chip, int addr, int reg, > > u16 mask) > > { > > - unsigned long timeout = jiffies + HZ / 10; > > + int i; > > > > - while (time_before(jiffies, timeout)) { > > + for (i = 0; i < 16; i++) { > > u16

Re: [PATCH net-next] dsa: mv88e6xxx: Timeout based on iterations

2016-08-17 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > The mv88e6xxx driver times out operations on the switch based on > looping until an elapsed wall clock time is reached. However, if > usleep_range() sleeps much longer than expected, it could timeout with > an error without actually checking to

[PATCH net-next] dsa: mv88e6xxx: Timeout based on iterations

2016-08-17 Thread Andrew Lunn
The mv88e6xxx driver times out operations on the switch based on looping until an elapsed wall clock time is reached. However, if usleep_range() sleeps much longer than expected, it could timeout with an error without actually checking to see if the devices has completed the operation. So replace