All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block/ps3: Fix slow VRAM IO
@ 2009-10-19 19:58 Geoff Levand
  2009-10-19 20:03 ` Jim Paris
  2009-11-03  8:23 ` Andrew Morton
  0 siblings, 2 replies; 7+ messages in thread
From: Geoff Levand @ 2009-10-19 19:58 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Jim Paris, Cell Broadband Engine OSS Development,
	Geert Uytterhoeven, linux-kernel


From: Hideyuki Sasaki <Hideyuki_Sasaki@hq.scei.sony.co.jp>

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

 drivers/block/ps3vram.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -123,7 +123,15 @@ static int ps3vram_notifier_wait(struct 
 {
 	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])


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-11-28 22:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-19 19:58 [PATCH] block/ps3: Fix slow VRAM IO Geoff Levand
2009-10-19 20:03 ` Jim Paris
2009-11-03  8:23 ` Andrew Morton
2009-11-09  6:40   ` [Cbe-oss-dev] " Akira Tsukamoto
2009-11-13  2:03     ` Akira Tsukamoto
2009-11-13  7:20       ` Jens Axboe
2009-11-28 22:50     ` [Cbe-oss-dev] " Siarhei Siamashka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.