Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757405AbZJST6N (ORCPT ); Mon, 19 Oct 2009 15:58:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752089AbZJST6N (ORCPT ); Mon, 19 Oct 2009 15:58:13 -0400 Received: from tx2ehsobe003.messaging.microsoft.com ([65.55.88.13]:55757 "EHLO TX2EHSOBE005.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751211AbZJST6M (ORCPT ); Mon, 19 Oct 2009 15:58:12 -0400 X-SpamScore: 10 X-BigFish: VPS10(zza4b1ozz1202hzzed1kz2fh6bh66h) X-Spam-TCS-SCL: 5:0 X-FB-SS: 5, Message-ID: <4ADCC4E3.8060104@am.sony.com> Date: Mon, 19 Oct 2009 12:58:27 -0700 From: Geoff Levand User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: Jens Axboe CC: Jim Paris , Cell Broadband Engine OSS Development , Geert Uytterhoeven , linux-kernel@vger.kernel.org Subject: [PATCH] block/ps3: Fix slow VRAM IO X-Enigmail-Version: 0.96a Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 19 Oct 2009 19:58:07.0635 (UTC) FILETIME=[7A3B1630:01CA50F6] X-SEL-encryption-scan: scanned X-Reverse-DNS: mail8.fw-sd.sony.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1416 Lines: 44 From: Hideyuki Sasaki 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 --- 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]) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/