Re: [PATCH V2] net: stmmac: use msleep instead of udelay for gpio reset

2015-04-21 Thread Michael Trimarchi
Hi On Tue, Apr 21, 2015 at 08:31:34PM -0400, David Miller wrote: > From: Michael Trimarchi > Date: Wed, 22 Apr 2015 01:13:47 +0200 > > > Hi > > > > On Tue, Apr 21, 2015 at 05:35:40PM -0400, David Miller wrote: > >> From: Michael Trimarchi > >> Date: Tue, 21 Apr 2015 13:16:13 +0200 > >> > >> >

Re: [PATCH V2] net: stmmac: use msleep instead of udelay for gpio reset

2015-04-21 Thread David Miller
From: Michael Trimarchi Date: Wed, 22 Apr 2015 01:13:47 +0200 > Hi > > On Tue, Apr 21, 2015 at 05:35:40PM -0400, David Miller wrote: >> From: Michael Trimarchi >> Date: Tue, 21 Apr 2015 13:16:13 +0200 >> >> > - udelay(data->delays[0]); >> ... >> > + msleep(ma

Re: [PATCH V2] net: stmmac: use msleep instead of udelay for gpio reset

2015-04-21 Thread Michael Trimarchi
Hi On Tue, Apr 21, 2015 at 05:35:40PM -0400, David Miller wrote: > From: Michael Trimarchi > Date: Tue, 21 Apr 2015 13:16:13 +0200 > > > - udelay(data->delays[0]); > ... > > + msleep(max(1U, data->delays[0] / 1000)); > > That looks very ugly with that max()

Re: [PATCH V2] net: stmmac: use msleep instead of udelay for gpio reset

2015-04-21 Thread David Miller
From: Michael Trimarchi Date: Tue, 21 Apr 2015 13:16:13 +0200 > - udelay(data->delays[0]); ... > + msleep(max(1U, data->delays[0] / 1000)); That looks very ugly with that max() expression in there. Please find some clean way to get rid of it if you want

[PATCH V2] net: stmmac: use msleep instead of udelay for gpio reset

2015-04-21 Thread Michael Trimarchi
Reset delay values are expressed in microsecond but most of the time the delay is more then 2ms and up to 100ms. Use udelay is wrong for large sleep period. This function is not used in interrupt context according to the documentation. Cc: Fabio Estevam Signed-off-by: Michael Trimarchi --- Chan