* [PATCH 0/2] replace large udelay by mdelay @ 2013-05-22 19:48 Marc Dietrich 2013-05-22 19:48 ` [PATCH 1/2] SCSI: nsp32: " Marc Dietrich 2013-05-22 19:48 ` [PATCH 2/2] nouveau: " Marc Dietrich 0 siblings, 2 replies; 8+ messages in thread From: Marc Dietrich @ 2013-05-22 19:48 UTC (permalink / raw) To: linux-kernel bad_udelay is generated on distro kernels which often enable all kinds of drivers. ARM has a max udelay of 2000, so this patchset converts large udelays to mdelays. This may also be observed using all_modconfig. Marc Dietrich (2): SCSI: nsp32: replace large udelay by mdelay nouveau: replace large udelay by mdelay drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c | 3 ++- drivers/scsi/nsp32.c | 2 +- drivers/scsi/nsp32.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) -- 1.7.9.5 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] SCSI: nsp32: replace large udelay by mdelay 2013-05-22 19:48 [PATCH 0/2] replace large udelay by mdelay Marc Dietrich @ 2013-05-22 19:48 ` Marc Dietrich 2013-05-22 20:33 ` Marc Dietrich 2013-05-22 19:48 ` [PATCH 2/2] nouveau: " Marc Dietrich 1 sibling, 1 reply; 8+ messages in thread From: Marc Dietrich @ 2013-05-22 19:48 UTC (permalink / raw) To: linux-kernel Cc: GOTO Masanori, YOKOTA Hiroshi, James E.J. Bottomley, linux-scsi ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. This affects distro kernels mostly. Cc: GOTO Masanori <gotom@debian.or.jp> Cc: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp> Cc: "James E.J. Bottomley" <JBottomley@parallels.com> Cc: linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Marc Dietrich <marvin24@gmx.de> --- drivers/scsi/nsp32.c | 2 +- drivers/scsi/nsp32.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c index 1e3879d..e2f796f 100644 --- a/drivers/scsi/nsp32.c +++ b/drivers/scsi/nsp32.c @@ -2899,7 +2899,7 @@ static void nsp32_do_bus_reset(nsp32_hw_data *data) * reset SCSI bus */ nsp32_write1(base, SCSI_BUS_CONTROL, BUSCTL_RST); - udelay(RESET_HOLD_TIME); + mdelay(RESET_HOLD_TIME); nsp32_write1(base, SCSI_BUS_CONTROL, 0); for(i = 0; i < 5; i++) { intrdat = nsp32_read2(base, IRQ_STATUS); /* dummy read */ diff --git a/drivers/scsi/nsp32.h b/drivers/scsi/nsp32.h index c022182..b2b3dc6 100644 --- a/drivers/scsi/nsp32.h +++ b/drivers/scsi/nsp32.h @@ -605,7 +605,7 @@ typedef struct _nsp32_hw_data { /* * TIME definition */ -#define RESET_HOLD_TIME 10000 /* reset time in us (SCSI-2 says the +#define RESET_HOLD_TIME 10 /* reset time in ms (SCSI-2 says the minimum is 25us) */ #define SEL_TIMEOUT_TIME 10000 /* 250ms defined in SCSI specification (25.6us/1unit) */ -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] SCSI: nsp32: replace large udelay by mdelay 2013-05-22 19:48 ` [PATCH 1/2] SCSI: nsp32: " Marc Dietrich @ 2013-05-22 20:33 ` Marc Dietrich 2013-05-27 9:04 ` Marc Dietrich 0 siblings, 1 reply; 8+ messages in thread From: Marc Dietrich @ 2013-05-22 20:33 UTC (permalink / raw) To: linux-kernel Cc: GOTO Masanori, YOKOTA Hiroshi, James E.J. Bottomley, linux-scsi Looks like Arndt already send a fix for this. Sorry for the noise. Am Mittwoch, 22. Mai 2013, 21:48:41 schrieb Marc Dietrich: > ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. > This affects distro kernels mostly. > > Cc: GOTO Masanori <gotom@debian.or.jp> > Cc: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp> > Cc: "James E.J. Bottomley" <JBottomley@parallels.com> > Cc: linux-scsi@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Marc Dietrich <marvin24@gmx.de> > --- > drivers/scsi/nsp32.c | 2 +- > drivers/scsi/nsp32.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c > index 1e3879d..e2f796f 100644 > --- a/drivers/scsi/nsp32.c > +++ b/drivers/scsi/nsp32.c > @@ -2899,7 +2899,7 @@ static void nsp32_do_bus_reset(nsp32_hw_data *data) > * reset SCSI bus > */ > nsp32_write1(base, SCSI_BUS_CONTROL, BUSCTL_RST); > - udelay(RESET_HOLD_TIME); > + mdelay(RESET_HOLD_TIME); > nsp32_write1(base, SCSI_BUS_CONTROL, 0); > for(i = 0; i < 5; i++) { > intrdat = nsp32_read2(base, IRQ_STATUS); /* dummy read */ > diff --git a/drivers/scsi/nsp32.h b/drivers/scsi/nsp32.h > index c022182..b2b3dc6 100644 > --- a/drivers/scsi/nsp32.h > +++ b/drivers/scsi/nsp32.h > @@ -605,7 +605,7 @@ typedef struct _nsp32_hw_data { > /* > * TIME definition > */ > -#define RESET_HOLD_TIME 10000 /* reset time in us (SCSI-2 says the > +#define RESET_HOLD_TIME 10 /* reset time in ms (SCSI-2 says the > minimum is 25us) */ > #define SEL_TIMEOUT_TIME 10000 /* 250ms defined in SCSI specification > (25.6us/1unit) */ ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] SCSI: nsp32: replace large udelay by mdelay 2013-05-22 20:33 ` Marc Dietrich @ 2013-05-27 9:04 ` Marc Dietrich 0 siblings, 0 replies; 8+ messages in thread From: Marc Dietrich @ 2013-05-27 9:04 UTC (permalink / raw) To: linux-kernel Cc: GOTO Masanori, YOKOTA Hiroshi, James E.J. Bottomley, linux-scsi, Arnd Bergmann James, Am Mittwoch, 22. Mai 2013, 22:33:18 schrieb Marc Dietrich: > Looks like Arnd already send a fix for this. Sorry for the noise. are you going to pick up Arnd's patch [1] for scsi-stable (3.10) branch? Marc [1] https://patchwork.kernel.org/patch/2489251/ > Am Mittwoch, 22. Mai 2013, 21:48:41 schrieb Marc Dietrich: > > ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. > > This affects distro kernels mostly. > > > > Cc: GOTO Masanori <gotom@debian.or.jp> > > Cc: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp> > > Cc: "James E.J. Bottomley" <JBottomley@parallels.com> > > Cc: linux-scsi@vger.kernel.org > > Cc: linux-kernel@vger.kernel.org > > Signed-off-by: Marc Dietrich <marvin24@gmx.de> > > --- > > > > drivers/scsi/nsp32.c | 2 +- > > drivers/scsi/nsp32.h | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c > > index 1e3879d..e2f796f 100644 > > --- a/drivers/scsi/nsp32.c > > +++ b/drivers/scsi/nsp32.c > > @@ -2899,7 +2899,7 @@ static void nsp32_do_bus_reset(nsp32_hw_data *data) > > > > * reset SCSI bus > > */ > > > > nsp32_write1(base, SCSI_BUS_CONTROL, BUSCTL_RST); > > > > - udelay(RESET_HOLD_TIME); > > + mdelay(RESET_HOLD_TIME); > > > > nsp32_write1(base, SCSI_BUS_CONTROL, 0); > > for(i = 0; i < 5; i++) { > > > > intrdat = nsp32_read2(base, IRQ_STATUS); /* dummy read */ > > > > diff --git a/drivers/scsi/nsp32.h b/drivers/scsi/nsp32.h > > index c022182..b2b3dc6 100644 > > --- a/drivers/scsi/nsp32.h > > +++ b/drivers/scsi/nsp32.h > > @@ -605,7 +605,7 @@ typedef struct _nsp32_hw_data { > > > > /* > > > > * TIME definition > > */ > > > > -#define RESET_HOLD_TIME 10000 /* reset time in us (SCSI-2 says the > > +#define RESET_HOLD_TIME 10 /* reset time in ms (SCSI-2 says the > > > > minimum is 25us) */ > > > > #define SEL_TIMEOUT_TIME 10000 /* 250ms defined in SCSI specification > > > > (25.6us/1unit) */ ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] nouveau: replace large udelay by mdelay 2013-05-22 19:48 [PATCH 0/2] replace large udelay by mdelay Marc Dietrich 2013-05-22 19:48 ` [PATCH 1/2] SCSI: nsp32: " Marc Dietrich @ 2013-05-22 19:48 ` Marc Dietrich 2013-05-22 20:08 ` David Daney ` (2 more replies) 1 sibling, 3 replies; 8+ messages in thread From: Marc Dietrich @ 2013-05-22 19:48 UTC (permalink / raw) To: linux-kernel; +Cc: David Airlie, Ben Skeggs ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. This affects distro kernels mostly. Cc: David Airlie <airlied@linux.ie> Cc: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Marc Dietrich <marvin24@gmx.de> --- drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c index d0817d9..ed7415e 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c @@ -51,7 +51,8 @@ nv50_dac_sense(struct nv50_disp_priv *priv, int or, u32 loadval) const u32 doff = (or * 0x800); int load = -EINVAL; nv_wr32(priv, 0x61a00c + doff, 0x00100000 | loadval); - udelay(9500); + mdelay(9); + udelay(500); nv_wr32(priv, 0x61a00c + doff, 0x80000000); load = (nv_rd32(priv, 0x61a00c + doff) & 0x38000000) >> 27; nv_wr32(priv, 0x61a00c + doff, 0x00000000); -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] nouveau: replace large udelay by mdelay 2013-05-22 19:48 ` [PATCH 2/2] nouveau: " Marc Dietrich @ 2013-05-22 20:08 ` David Daney 2013-05-22 20:33 ` Marc Dietrich 2013-05-27 9:10 ` Marc Dietrich 2 siblings, 0 replies; 8+ messages in thread From: David Daney @ 2013-05-22 20:08 UTC (permalink / raw) To: Marc Dietrich; +Cc: linux-kernel, David Airlie, Ben Skeggs On 05/22/2013 12:48 PM, Marc Dietrich wrote: > ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. > This affects distro kernels mostly. > > Cc: David Airlie <airlied@linux.ie> > Cc: Ben Skeggs <bskeggs@redhat.com> > Signed-off-by: Marc Dietrich <marvin24@gmx.de> > --- > drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c > index d0817d9..ed7415e 100644 > --- a/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c > +++ b/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c > @@ -51,7 +51,8 @@ nv50_dac_sense(struct nv50_disp_priv *priv, int or, u32 loadval) > const u32 doff = (or * 0x800); > int load = -EINVAL; > nv_wr32(priv, 0x61a00c + doff, 0x00100000 | loadval); > - udelay(9500); > + mdelay(9); > + udelay(500); That looks very ugly. Can you just use 9 or 10 instead of adding on the extra 500uS? David Daney ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] nouveau: replace large udelay by mdelay 2013-05-22 19:48 ` [PATCH 2/2] nouveau: " Marc Dietrich 2013-05-22 20:08 ` David Daney @ 2013-05-22 20:33 ` Marc Dietrich 2013-05-27 9:10 ` Marc Dietrich 2 siblings, 0 replies; 8+ messages in thread From: Marc Dietrich @ 2013-05-22 20:33 UTC (permalink / raw) To: linux-kernel; +Cc: David Airlie, Ben Skeggs Looks like Arndt already send a fix for this. Sorry for the noise. Am Mittwoch, 22. Mai 2013, 21:48:42 schrieb Marc Dietrich: > ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. > This affects distro kernels mostly. > > Cc: David Airlie <airlied@linux.ie> > Cc: Ben Skeggs <bskeggs@redhat.com> > Signed-off-by: Marc Dietrich <marvin24@gmx.de> > --- > drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c > b/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c index d0817d9..ed7415e > 100644 > --- a/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c > +++ b/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c > @@ -51,7 +51,8 @@ nv50_dac_sense(struct nv50_disp_priv *priv, int or, u32 > loadval) const u32 doff = (or * 0x800); > int load = -EINVAL; > nv_wr32(priv, 0x61a00c + doff, 0x00100000 | loadval); > - udelay(9500); > + mdelay(9); > + udelay(500); > nv_wr32(priv, 0x61a00c + doff, 0x80000000); > load = (nv_rd32(priv, 0x61a00c + doff) & 0x38000000) >> 27; > nv_wr32(priv, 0x61a00c + doff, 0x00000000); ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] nouveau: replace large udelay by mdelay 2013-05-22 19:48 ` [PATCH 2/2] nouveau: " Marc Dietrich 2013-05-22 20:08 ` David Daney 2013-05-22 20:33 ` Marc Dietrich @ 2013-05-27 9:10 ` Marc Dietrich 2 siblings, 0 replies; 8+ messages in thread From: Marc Dietrich @ 2013-05-27 9:10 UTC (permalink / raw) To: Ben Skeggs; +Cc: David Airlie, linux-kernel, arnd Hi Ben, can you pick up Arnd's fix from https://patchwork.kernel.org/patch/2489141/ for your stable (3.10) branch? Marc Am Mittwoch, 22. Mai 2013, 21:48:42 schrieb Marc Dietrich: > ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. > This affects distro kernels mostly. > > Cc: David Airlie <airlied@linux.ie> > Cc: Ben Skeggs <bskeggs@redhat.com> > Signed-off-by: Marc Dietrich <marvin24@gmx.de> > --- > drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c > b/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c index d0817d9..ed7415e > 100644 > --- a/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c > +++ b/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c > @@ -51,7 +51,8 @@ nv50_dac_sense(struct nv50_disp_priv *priv, int or, u32 > loadval) const u32 doff = (or * 0x800); > int load = -EINVAL; > nv_wr32(priv, 0x61a00c + doff, 0x00100000 | loadval); > - udelay(9500); > + mdelay(9); > + udelay(500); > nv_wr32(priv, 0x61a00c + doff, 0x80000000); > load = (nv_rd32(priv, 0x61a00c + doff) & 0x38000000) >> 27; > nv_wr32(priv, 0x61a00c + doff, 0x00000000); ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-05-27 9:10 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-05-22 19:48 [PATCH 0/2] replace large udelay by mdelay Marc Dietrich 2013-05-22 19:48 ` [PATCH 1/2] SCSI: nsp32: " Marc Dietrich 2013-05-22 20:33 ` Marc Dietrich 2013-05-27 9:04 ` Marc Dietrich 2013-05-22 19:48 ` [PATCH 2/2] nouveau: " Marc Dietrich 2013-05-22 20:08 ` David Daney 2013-05-22 20:33 ` Marc Dietrich 2013-05-27 9:10 ` Marc Dietrich
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox