Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp764177imc; Sat, 16 Mar 2019 15:26:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOkKHKDNvPkljINU9i0eXThHKKMo9R17s0mMrK7Xfaa8+IIV1i4BoXT51ts75eglQoroyL X-Received: by 2002:a17:902:32b:: with SMTP id 40mr11413267pld.122.1552775177212; Sat, 16 Mar 2019 15:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552775177; cv=none; d=google.com; s=arc-20160816; b=nAeXodqUoADQhR8cHqO8XqBOnGXQL3KlzheIROuWiZLOXGJjHHgvpg1mWMCpPYIInU MCz5NrwwwicG/dcEXTwcDZQbnT6tLqbyEweU/+A0IAEXvOrxuYbIVCUGoPb9G+jjR5Mn oSC6JVDTLmFXAAGNz0k5gBSEsPL0e2M6s9TftdOQt9Kcr2C3Xtxa9M9SQz3gBKOYRROD o4IW2YYXA3ae290jmYVUlVraSjfLXYNQeIQsep2wMkKrKqrRwP4W3YiMjSQW07fygn9F UYGMMopg+hA0dYbXddWyX8W+yjlmVUgqNgsQjBmqUSWHi/uECh27psSOyeRgLv8e6uDi sddg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TQgANVR0YZwPvoQ13h1p8nkHXgFyUEXirahpipRICSQ=; b=0HFn8JMRRA9WAyHh8X3k++oiwzWrsBoQp2H0AhSIu+9l3KLMj9nibNbtW+cwezJC6s 6u2BUKLHVaarUqrtl0K4GE0pH5WCHAB11gSOMuJjDzbjFlygZ3cPjED5Aa02W7S98w0a iDUCic21BgynA0Fa1UNMJtFWyeE0CEWGavNKq8rBXdqaCD1AmBRj4kicHjyWrIoJOQav gMep5YOBv18RwtalRi+W6Z5s1Q7gmlI85eDyqvb2XoPisIa1EZccH9xbYn9sMOBuH6Wy 0URE88EuY3obJb6NZHkAYsnnKhR8YX4sQ55SimzNmETPjE5X9Tg3wbEdi5Wv/k8tIi43 MhJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tomli.me header.s=1490979754 header.b=dmrVyiud; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tomli.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e22si4974036pgv.317.2019.03.16.15.26.02; Sat, 16 Mar 2019 15:26:17 -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=@tomli.me header.s=1490979754 header.b=dmrVyiud; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tomli.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726971AbfCPWZY (ORCPT + 99 others); Sat, 16 Mar 2019 18:25:24 -0400 Received: from tomli.me ([153.92.126.73]:56126 "EHLO tomli.me" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbfCPWZY (ORCPT ); Sat, 16 Mar 2019 18:25:24 -0400 Received: from tomli.me (localhost [127.0.0.1]) by tomli.me (OpenSMTPD) with ESMTP id d0a56cb4; Sat, 16 Mar 2019 22:25:21 +0000 (UTC) X-HELO: localhost.lan Authentication-Results: tomli.me; auth=pass (login) smtp.auth=tomli Received: from Unknown (HELO localhost.lan) (2402:f000:1:1501:200:5efe:6fc7:8b2c) by tomli.me (qpsmtpd/0.95) with ESMTPSA (DHE-RSA-CHACHA20-POLY1305 encrypted); Sat, 16 Mar 2019 22:25:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tomli.me; h=from:to:cc:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=1490979754; bh=sdEYzi168v0ooyHOHjtL9/15xn+aib8VYH833HeR7gI=; b=dmrVyiudHdKSa8MFMwGG+09kG+rtclZmMdRbgOH9tQkSf9rsV577nvv7+IeJyvdNzm3HGACKEUZfIugQpVat77EVPLcjosMeHkoR7xjQug01UwyvBw3SDvy59Q6GJajLopJOAXbBA6oxscc0PHOSVXYe6egSYs9Z84wyw6HKD36gjtW0ILhNizee868RxgfHguFfpWybmnxl4uUxfbScgMEsceUm2qY0Qvh53e5vrnGHP3ult9SjaSUBFQ5OUTEoGsa/pKNXN4T1kUg2xQKyKpnH3BXbPP49Ph+hxc3ED3rppn8tzOlqces+hMBkLg42bYGlsaQEj1Up8i2/wlerLQ== From: Yifeng Li To: Sudip Mukherjee , Teddy Wang Cc: Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Yifeng Li , stable@vger.kernel.org Subject: [PATCH 1/8] fbdev: sm712fb: fix white screen of death on reboot, don't set CR3B-CR3F. Date: Sun, 17 Mar 2019 06:24:57 +0800 Message-Id: <20190316222504.27170-2-tomli@tomli.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190316222504.27170-1-tomli@tomli.me> References: <20190316222504.27170-1-tomli@tomli.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: stable@vger.kernel.org # v4.4+ --- drivers/video/fbdev/sm712fb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c index 502d0de2feec..d05379affa32 100644 --- a/drivers/video/fbdev/sm712fb.c +++ b/drivers/video/fbdev/sm712fb.c @@ -1171,8 +1171,12 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb) 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++) -- 2.20.1