From patchwork Fri Jan 8 13:22:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 71779 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o08DMKBg013169 for ; Fri, 8 Jan 2010 13:22:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753105Ab0AHNWe (ORCPT ); Fri, 8 Jan 2010 08:22:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753076Ab0AHNWe (ORCPT ); Fri, 8 Jan 2010 08:22:34 -0500 Received: from smtp.nokia.com ([192.100.105.134]:57058 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753013Ab0AHNWc (ORCPT ); Fri, 8 Jan 2010 08:22:32 -0500 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o08DMU4Z006647; Fri, 8 Jan 2010 07:22:31 -0600 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 8 Jan 2010 15:22:26 +0200 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 8 Jan 2010 15:22:26 +0200 Received: from localhost.localdomain (esdhcp04146.research.nokia.com [172.21.41.46]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o08DM1QN024564; Fri, 8 Jan 2010 15:22:21 +0200 From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Tomi Valkeinen Subject: [PATCH 13/15] OMAP: DSS2: Make check-delay-loops consistent Date: Fri, 8 Jan 2010 15:22:47 +0200 Message-Id: <1262956969-1664-14-git-send-email-tomi.valkeinen@nokia.com> X-Mailer: git-send-email 1.6.5 In-Reply-To: <1262956969-1664-13-git-send-email-tomi.valkeinen@nokia.com> References: <1262956969-1664-1-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-2-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-3-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-4-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-5-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-6-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-7-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-8-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-9-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-10-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-11-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-12-git-send-email-tomi.valkeinen@nokia.com> <1262956969-1664-13-git-send-email-tomi.valkeinen@nokia.com> X-OriginalArrivalTime: 08 Jan 2010 13:22:27.0038 (UTC) FILETIME=[9F3137E0:01CA9065] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 2881d93..d964869 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -828,12 +828,12 @@ static int dsi_pll_power(enum dsi_pll_power_state state) /* PLL_PWR_STATUS */ while (FLD_GET(dsi_read_reg(DSI_CLK_CTRL), 29, 28) != state) { - udelay(1); - if (t++ > 1000) { + if (++t > 1000) { DSSERR("Failed to set DSI PLL power mode to %d\n", state); return -ENODEV; } + udelay(1); } return 0; @@ -1441,12 +1441,12 @@ static int dsi_complexio_power(enum dsi_complexio_power_state state) /* PWR_STATUS */ while (FLD_GET(dsi_read_reg(DSI_COMPLEXIO_CFG1), 26, 25) != state) { - udelay(1); - if (t++ > 1000) { + if (++t > 1000) { DSSERR("failed to set complexio power state to " "%d\n", state); return -ENODEV; } + udelay(1); } return 0; @@ -1646,10 +1646,10 @@ static void dsi_complexio_uninit(void) static int _dsi_wait_reset(void) { - int i = 0; + int t = 0; while (REG_GET(DSI_SYSSTATUS, 0, 0) == 0) { - if (i++ > 5) { + if (++t > 5) { DSSERR("soft reset failed\n"); return -ENODEV; } @@ -2707,7 +2707,6 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev, /* using fifo not empty */ /* TX_FIFO_NOT_EMPTY */ while (FLD_GET(dsi_read_reg(DSI_VC_CTRL(0)), 5, 5)) { - udelay(1); fifo_stalls++; if (fifo_stalls > 0xfffff) { DSSERR("fifo stalls overflow, pixels left %d\n", @@ -2715,6 +2714,7 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev, dsi_if_enable(0); return -EIO; } + udelay(1); } #elif 1 /* using fifo emptiness */ diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 9b05ee6..0a26b7d 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c @@ -467,14 +467,14 @@ static irqreturn_t dss_irq_handler_omap3(int irq, void *arg) static int _omap_dss_wait_reset(void) { - unsigned timeout = 1000; + int t = 0; while (REG_GET(DSS_SYSSTATUS, 0, 0) == 0) { - udelay(1); - if (!--timeout) { + if (++t > 1000) { DSSERR("soft reset failed\n"); return -ENODEV; } + udelay(1); } return 0;