From patchwork Thu Nov 22 12:49:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Lothar_Wa=C3=9Fmann?= X-Patchwork-Id: 1793031 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8DDE8DF24C for ; Fri, 23 Nov 2012 00:28:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752905Ab2KWA2K (ORCPT ); Thu, 22 Nov 2012 19:28:10 -0500 Received: from mail.karo-electronics.de ([81.173.242.67]:55575 "EHLO mail.karo-electronics.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752864Ab2KWA2K (ORCPT ); Thu, 22 Nov 2012 19:28:10 -0500 X-Greylist: delayed 16380 seconds by postgrey-1.27 at vger.kernel.org; Thu, 22 Nov 2012 19:28:10 EST From: =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= To: linux-arm-kernel@lists.infradead.org Cc: Shawn Guo , linux-fbdev@vger.kernel.org, Florian Tobias Schandinat , =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= Subject: [BUGFIX PATCH] video: mxsfb: fix crash when unblanking the display Date: Thu, 22 Nov 2012 13:49:14 +0100 Message-Id: <1353588555-13168-1-git-send-email-LW@KARO-electronics.de> X-Mailer: git-send-email 1.7.2.5 MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org The VDCTRL4 register does not provide the MXS SET/CLR/TOGGLE feature. The write in mxsfb_disable_controller() sets the data_cnt for the LCD DMA to 0 which obviously means the max. count for the LCD DMA and leads to overwriting arbitrary memory when the display is unblanked. Note: I already sent this patch in December 2011 but noone picked it up obviously. Signed-off-by: Lothar Waßmann Acked-by: Juergen Beisert Tested-by: Lauri Hintsala --- drivers/video/mxsfb.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index 49619b4..f2a49ef 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -369,7 +369,8 @@ static void mxsfb_disable_controller(struct fb_info *fb_info) loop--; } - writel(VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4 + REG_CLR); + reg = readl(host->base + LCDC_VDCTRL4); + writel(reg & ~VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4); clk_disable_unprepare(host->clk);