replace large udelay by mdelay
Subsystems (5)
cover replace large udelay by mdelay
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(-)
Signature · 1 line
1.7.9.5
PATCH 1/2 SCSI: nsp32: replace large udelay by mdelay
ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. This affects distro kernels mostly.
--- drivers/scsi/nsp32.c | 2 +- drivers/scsi/nsp32.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/nsp32.c +1 -1
@@ -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 */
drivers/scsi/nsp32.h +1 -1
@@ -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) */
Signature · 1 line
1.7.9.5
Re: [PATCH 1/2] SCSI: nsp32: replace large udelay by mdelay
Looks like Arndt already send a fix for this. Sorry for the noise.
Am Mittwoch, 22. Mai 2013, 21:48:41 schrieb Marc Dietrich:
Quoted 40 lines
ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. This affects distro kernels mostly.
Cc GOTO Masanori <[email protected]>Cc YOKOTA Hiroshi <[email protected]>Cc "James E.J. Bottomley" <[email protected]>Signed-off-by Marc Dietrich <[email protected]>--- drivers/scsi/nsp32.c | 2 +- drivers/scsi/nsp32.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/scsi/nsp32.c +1
-1@@ -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 */ drivers/scsi/nsp32.h +1
-1@@ -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) */
Re: [PATCH 1/2] SCSI: nsp32: replace large udelay by mdelay
James,
Am Mittwoch, 22. Mai 2013, 22:33:18 schrieb Marc Dietrich:
Quoted 1 line
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/
Quoted 54 lines
Am Mittwoch, 22. Mai 2013, 21:48:41 schrieb Marc Dietrich:
Quoted 53 lines
ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. This affects distro kernels mostly.
Cc GOTO Masanori <[email protected]>Cc YOKOTA Hiroshi <[email protected]>Cc "James E.J. Bottomley" <[email protected]>Signed-off-by Marc Dietrich <[email protected]>---
drivers/scsi/nsp32.c | 2 +- drivers/scsi/nsp32.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/scsi/nsp32.c +1
-1@@ -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 );drivers/scsi/nsp32.c +0
-0nsp32_write1 (base,SCSI_BUS_CONTROL ,0 );for (i =0 ; i <5 ; i++) { intrdat =nsp32_read2 (base,IRQ_STATUS );/* dummy read */ drivers/scsi/nsp32.h +1
-1@@ -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 drivers/scsi/nsp32.h +0
-0minimum is 25us) */ #define SEL_TIMEOUT_TIME 10000/* 250ms defined in SCSI specification (25.6us/1unit) */
PATCH 2/2 nouveau: replace large udelay by mdelay
In reply to Marc DietrichARM has a maximum of 2000 usec delay. Use mdelay for larger delays. This affects distro kernels mostly.
--- drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c +2 -1
@@ -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 );
Signature · 1 line
1.7.9.5
Re: [PATCH 2/2] nouveau: replace large udelay by mdelay
Quoted 15 lines · Marc Dietrich
ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. This affects distro kernels mostly.
Cc David Airlie <[email protected]>Cc Ben Skeggs <[email protected]>Signed-off-by Marc Dietrich <[email protected]>--- drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c +0
-0
drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c nv50_dac_sense(struct nv50_disp_priv *priv, int or, u32 loadval) · line 55
Quoted 6 lines
drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c +2
-1@@ -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
Re: [PATCH 2/2] nouveau: replace large udelay by mdelay
In reply to Marc DietrichLooks like Arndt already send a fix for this. Sorry for the noise.
Am Mittwoch, 22. Mai 2013, 21:48:42 schrieb Marc Dietrich:
Quoted 25 lines
ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. This affects distro kernels mostly.
Cc David Airlie <[email protected]>Cc Ben Skeggs <[email protected]>Signed-off-by Marc Dietrich <[email protected]>--- drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.cindex d0817d9..ed7415e 100644drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c +2
-1@@ -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 );
Re: [PATCH 2/2] nouveau: replace large udelay by mdelay
In reply to Marc DietrichHi 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:
Quoted 25 lines
ARM has a maximum of 2000 usec delay. Use mdelay for larger delays. This affects distro kernels mostly.
Cc David Airlie <[email protected]>Cc Ben Skeggs <[email protected]>Signed-off-by Marc Dietrich <[email protected]>--- drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.cindex d0817d9..ed7415e 100644drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c +2
-1@@ -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 );