Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2154063ybm; Thu, 23 May 2019 12:15:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEvV4OJO4u5+uHADL/atemNWZQCrLfAzSRf1m5WP2W/RmwIb5JJW27e964J7R4hC0pSLdR X-Received: by 2002:a62:3145:: with SMTP id x66mr80904016pfx.223.1558638899915; Thu, 23 May 2019 12:14:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558638899; cv=none; d=google.com; s=arc-20160816; b=zTWHgXNkRu5bbulZdN9l1YrOrhWCbxUmxsDeoyxil9ICPMqa4jPyiLNzch5koec5Hk KrXX8JjzNDoXt2pQjm9VcbB4HtM/yNu3Dw8HJ8ncX61FXuWmrcqn0Fi2nMAr6BJsKp9f 0AHtJfe0F7ARVToBylwtoUiwuStMGtJmdtomupqcZ1c2FEWZMI/FWwl2utVN3wwcrw13 i8ful9WoOJe6ZEWJNEhKnLIa9fEO33nqHNdIlu1BNK3Ayi0RAo53Zjw7m/jtI4abBAW8 3SwgViVNhsU5+esDEXqpskj6DU2gQq6SFAS9+Ej0guPuOe+RJ+6x0mJHTxH7Jhf3bE8U zIKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OAWTJa+NnuiSTbt1o3uqa4clJMmjo1JIlXUtpyeKzgA=; b=ljqK25wlA8lzeOdYWg3iXO9OJ36h/98zNzVC8xtCGTAlB74ioBKHI6zYp8xKOD5dn4 4tojEmDZJPm69BUbvYEzEX8652Y7KJlxC26qI3HtSHiTpCy5fsU9NIb/wE/GW+j56zmp Jbo2DPeohEhArQos5226MGcfCAarClOI/SKh0XY+iPN5FS3zxo8Rw0daupNB7xtlk6jq QEAo8e4/gtxMMbEMY88lOesjjiMAVL5BAfTKUPlXSJvM/6QxAur6LBbJw5pqG9n5TwAl pE0VM+Nf1X/Nhq6VJeXytiXGN/62DZVk2KHLRf65JKlYM+VjkwSJWu0lrLzfmpm8t0e4 azjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dfrVJo9B; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si614353plv.102.2019.05.23.12.14.44; Thu, 23 May 2019 12:14:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dfrVJo9B; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387866AbfEWTM6 (ORCPT + 99 others); Thu, 23 May 2019 15:12:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:46720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731947AbfEWTMz (ORCPT ); Thu, 23 May 2019 15:12:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 70B3E20863; Thu, 23 May 2019 19:12:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638774; bh=oheSv95oFkn+VVV3lf9Ovz2363O9f+rCEsKN1nvHhuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dfrVJo9BgDxCH/1+ByE0tt9MH17fIxjLLNwIFSN3gGNLRjsFd3VNauuy7Gx7y5lsE SLhVOKJbtpifXvuqDkXEyEhGphFSb1KntSgD66XL5/t1RgCkW+FeEGa9vBcyRz1gg9 qOQM4ylR+ehQ0myQ/zUzOoUiMssG1Gd+UEqiXO5c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yifeng Li , Sudip Mukherjee , Teddy Wang , Bartlomiej Zolnierkiewicz Subject: [PATCH 4.14 43/77] fbdev: sm712fb: fix white screen of death on reboot, dont set CR3B-CR3F Date: Thu, 23 May 2019 21:06:01 +0200 Message-Id: <20190523181726.086206319@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181719.982121681@linuxfoundation.org> References: <20190523181719.982121681@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yifeng Li commit 8069053880e0ee3a75fd6d7e0a30293265fe3de4 upstream. On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), rebooting with sm712fb framebuffer driver would cause a white screen of death on the next POST, presumably the proper timings for the LCD panel was not reprogrammed properly by the BIOS. Experiments showed a few CRTC Scratch Registers, including CRT3D, CRT3E and CRT3F may be used internally by BIOS as some flags. CRT3B is a hardware testing register, we shouldn't mess with it. CRT3C has blanking signal and line compare control, which is not needed for this driver. Stop writing to CR3B-CR3F (a.k.a CRT3B-CRT3F) registers. Even if these registers don't have side-effect on other systems, writing to them is also highly questionable. Signed-off-by: Yifeng Li Tested-by: Sudip Mukherjee Cc: Teddy Wang Cc: # v4.4+ Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/sm712fb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/video/fbdev/sm712fb.c +++ b/drivers/video/fbdev/sm712fb.c @@ -1173,8 +1173,12 @@ static void sm7xx_set_timing(struct smtc smtc_crtcw(i, vgamode[j].init_cr00_cr18[i]); /* init CRTC register CR30 - CR4D */ - for (i = 0; i < SIZE_CR30_CR4D; i++) + for (i = 0; i < SIZE_CR30_CR4D; i++) { + if ((i + 0x30) >= 0x3B && (i + 0x30) <= 0x3F) + /* side-effect, don't write to CR3B-CR3F */ + continue; smtc_crtcw(i + 0x30, vgamode[j].init_cr30_cr4d[i]); + } /* init CRTC register CR90 - CRA7 */ for (i = 0; i < SIZE_CR90_CRA7; i++)