Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2158285ybm; Thu, 23 May 2019 12:18:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2nwwFbIMwrQV2cvFIvKzo6wOa498SrnV5rK5pTZ6JuZLR+MrB/WNm/lJmGTzxtLuqIV19 X-Received: by 2002:a62:e303:: with SMTP id g3mr105581554pfh.220.1558639125279; Thu, 23 May 2019 12:18:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558639125; cv=none; d=google.com; s=arc-20160816; b=UI9Z9wJGy8D0qR2xUO3lxhwwxqpK/aTTew0bx7HqemcI6iKDQxRvO+O6EWrU0h/Ua0 wczgJR4jeNiGeBGhPQOZmxaTcryHVL78W3jurkC/UxzUKwUfdYVtPXuqkcJROuSQ4BEK 2pUOwAiq2IxNItmdWxvACHlofvvRawySQ1SXV9Jgr/eanp0mcSZ9mPW2qII1ealRvd3O 2ppU9NSCk2K7/uNZDYOAxxekXGjAwY9MINAcJBsBMIT4zFXAHmQ5CNn9P23Cmb7y9RrA BTtoszIYrYgHyH3GU9JoXmA2LR9apcJS2EEc9k+ZvHIC1XJ5VHOlpPgIg11wFUeuA28d Mo3A== 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=vypxQiN3X8mh+J/s5xl4Hd78qxSOkFPsKXwculinUAA43le2w+JNdgcDCB2P6Pzuwb mFNjQzWnyc9a15qrd1oqxcAYYjAAGpZ59+pVHMHD5UdQ53n/+B7TOx415lXlqEXLoVgm 5kDLMT7CzuCiCVQ1njIGpIKMkTrEu7m/u07Pl7+Fp5BGXAWLZ26chlVnAi8Z4Bi1LpV8 ESGiNcz9A20Ou/jzeLNY/sYUhM1dDW7XczTbjvnp4ayDXugm/2fiDwiOlHNRqasHB2UM ZlF35HGtZ/Ws7HiEOaid313xB2aQrXrkokcohtoPdw3c9se1+8Gtg0Z+wtO7Xo6XEhGp AupA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wKXqi7TT; 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 m15si305784pfh.46.2019.05.23.12.18.25; Thu, 23 May 2019 12:18:45 -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=wKXqi7TT; 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 S2389290AbfEWTQz (ORCPT + 99 others); Thu, 23 May 2019 15:16:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:51808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387916AbfEWTQy (ORCPT ); Thu, 23 May 2019 15:16:54 -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 3A0F7217D9; Thu, 23 May 2019 19:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558639013; bh=oheSv95oFkn+VVV3lf9Ovz2363O9f+rCEsKN1nvHhuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wKXqi7TTzZt2S3QmBOF4pI6TEeZr2tO+Hho85WdidU7vTp6U5MD0AjWhQoqyKncjr XpdmAtotGb/kIQAYmidOBK5dbVxp7Gvs00lqsukhVzIJwXwR4z/KjviC/kWbKU2QMN GX9bx0jqpre14IcaSFoNzOO0C6iFQpxyn4R9RViw= 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.19 064/114] fbdev: sm712fb: fix white screen of death on reboot, dont set CR3B-CR3F Date: Thu, 23 May 2019 21:06:03 +0200 Message-Id: <20190523181737.398060692@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181731.372074275@linuxfoundation.org> References: <20190523181731.372074275@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++)