Skip to content

Commit

Permalink
block/ps3: fix slow VRAM IO
Browse files Browse the repository at this point in the history
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 <xhide@rd.scei.sony.co.jp>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-by: Jim Paris <jim@jtan.com>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Hideyuki Sasaki authored and Jens Axboe committed Nov 4, 2009
1 parent e00ef79 commit f21121c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/block/ps3vram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit f21121c

Please sign in to comment.