From f21121cde6e617b90cd03ce083652ca543004dc2 Mon Sep 17 00:00:00 2001 From: Hideyuki Sasaki Date: Wed, 4 Nov 2009 09:09:28 +0100 Subject: [PATCH] block/ps3: fix slow VRAM IO The current PS3 VRAM driver uses msleep() to wait for completion of RSX DMA transfers between system memory and VRAM. Depending on the system timing, the processing delay and overhead of this msleep() call can significantly impact VRAM driver IO. To avoid the condition, add a short duration (200 usec max) udelay() polling loop before entering the msleep() polling loop. Signed-off-by: Hideyuki Sasaki Signed-off-by: Geoff Levand Acked-by: Jim Paris Cc: Geert Uytterhoeven Signed-off-by: Jens Axboe --- drivers/block/ps3vram.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c index 3bb7c47c869f..1fb6c3135fc8 100644 --- a/drivers/block/ps3vram.c +++ b/drivers/block/ps3vram.c @@ -123,7 +123,15 @@ static int ps3vram_notifier_wait(struct ps3_system_bus_device *dev, { struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev); u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER); - unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms); + unsigned long timeout; + + for (timeout = 20; timeout; timeout--) { + if (!notify[3]) + return 0; + udelay(10); + } + + timeout = jiffies + msecs_to_jiffies(timeout_ms); do { if (!notify[3]) -- 2.20.1