From patchwork Fri Jun 3 10:00:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 846542 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p53APPWF009265 for ; Fri, 3 Jun 2011 10:26:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752888Ab1FCKBG (ORCPT ); Fri, 3 Jun 2011 06:01:06 -0400 Received: from na3sys009aog114.obsmtp.com ([74.125.149.211]:43537 "EHLO na3sys009aog114.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752215Ab1FCKBF (ORCPT ); Fri, 3 Jun 2011 06:01:05 -0400 Received: from mail-fx0-f48.google.com ([209.85.161.48]) (using TLSv1) by na3sys009aob114.postini.com ([74.125.148.12]) with SMTP ID DSNKTeiw3wIoxa1iULZ98OFNJN7/qzRVtZf4@postini.com; Fri, 03 Jun 2011 03:01:04 PDT Received: by fxm7 with SMTP id 7so2046162fxm.21 for ; Fri, 03 Jun 2011 03:01:02 -0700 (PDT) Received: by 10.223.13.69 with SMTP id b5mr1897219faa.140.1307095262497; Fri, 03 Jun 2011 03:01:02 -0700 (PDT) Received: from localhost.localdomain (a62-248-131-233.elisa-laajakaista.fi [62.248.131.233]) by mx.google.com with ESMTPS id b22sm445843fak.1.2011.06.03.03.01.00 (version=SSLv3 cipher=OTHER); Fri, 03 Jun 2011 03:01:01 -0700 (PDT) From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: b-cousson@ti.com, paul@pwsan.com, khilman@ti.com, Tomi Valkeinen Subject: [PATCH 02/27] OMAP: DSS2: Taal: Make driver more fault tolerant Date: Fri, 3 Jun 2011 13:00:12 +0300 Message-Id: <1307095237-14805-3-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1307095237-14805-1-git-send-email-tomi.valkeinen@ti.com> References: <1307095237-14805-1-git-send-email-tomi.valkeinen@ti.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Jun 2011 10:27:31 +0000 (UTC) If ULPS exit fails, and the following reset fails also, Taal driver was left in state where it thinks DSI is enabled while it really isn't, leading to crash. This patch checks the return value of taal_panel_reset, and if that fails, ulps_enabled is left true, causing the driver to retry ulps exit later. Also the return value of taal_wake_up is checked at taal_disable, and if wake up fails, we'll skip the power_off. This could leave the panel into a not-quite-valid state, but there's nothing we can do about it in that situation. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/displays/panel-taal.c | 33 ++++++++++++++++++---------- 1 files changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index fdd5d4ae..b82bcc1 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -504,14 +504,18 @@ static int taal_exit_ulps(struct omap_dss_device *dssdev) return 0; r = omapdss_dsi_display_enable(dssdev); - if (r) - goto err; + if (r) { + dev_err(&dssdev->dev, "failed to enable DSI\n"); + goto err1; + } omapdss_dsi_vc_enable_hs(dssdev, td->channel, true); r = _taal_enable_te(dssdev, true); - if (r) - goto err; + if (r) { + dev_err(&dssdev->dev, "failed to re-enable TE"); + goto err2; + } enable_irq(gpio_to_irq(panel_data->ext_te_gpio)); @@ -521,13 +525,15 @@ static int taal_exit_ulps(struct omap_dss_device *dssdev) return 0; -err: - dev_err(&dssdev->dev, "exit ULPS failed"); - r = taal_panel_reset(dssdev); - - enable_irq(gpio_to_irq(panel_data->ext_te_gpio)); - td->ulps_enabled = false; +err2: + dev_err(&dssdev->dev, "failed to exit ULPS"); + r = taal_panel_reset(dssdev); + if (!r) { + enable_irq(gpio_to_irq(panel_data->ext_te_gpio)); + td->ulps_enabled = false; + } +err1: taal_queue_ulps_work(dssdev); return r; @@ -1317,8 +1323,11 @@ static void taal_disable(struct omap_dss_device *dssdev) dsi_bus_lock(dssdev); if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { - taal_wake_up(dssdev); - taal_power_off(dssdev); + int r; + + r = taal_wake_up(dssdev); + if (!r) + taal_power_off(dssdev); } dsi_bus_unlock(dssdev);