diff mbox

[03/15] drm/nouveau: use mdelay instead of large udelay constants

Message ID 1370038972-2318779-4-git-send-email-arnd@arndb.de (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann May 31, 2013, 10:22 p.m. UTC
ARM cannot handle udelay for more than 2 miliseconds, so we
should use mdelay instead for those.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Roy Spliet May 31, 2013, 10:30 p.m. UTC | #1
You probably want to patch up mclk_wait in nva3_pm.c as well for now 
(until this code is ported to HWSQ or PDAEMON), even though it's not 
used by a lot of people.

Op 01-06-13 00:22, Arnd Bergmann schreef:
> ARM cannot handle udelay for more than 2 miliseconds, so we
> should use mdelay instead for those.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: dri-devel@lists.freedesktop.org
> ---
>   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);
Aaro Koskinen May 31, 2013, 11:34 p.m. UTC | #2
Hi,

On Sat, Jun 01, 2013 at 12:22:40AM +0200, Arnd Bergmann wrote:
> ARM cannot handle udelay for more than 2 miliseconds, so we
                                           ^^^^

                                 There's l missing here.

> should use mdelay instead for those.

Could this be handled inside ARM udelay() instead? Probably most of the
delay values are compile-time constants.

A.
diff mbox

Patch

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);