Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1870755imc; Tue, 12 Mar 2019 02:20:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqyFed3Rl109pz+ELWWXzvTTYOp4gzjwSBr/HGItdSGakXTsMhvP34KGf8RA4AhMlP2zNe X-Received: by 2002:a17:902:20eb:: with SMTP id v40mr39027599plg.20.1552382438029; Tue, 12 Mar 2019 02:20:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552382438; cv=none; d=google.com; s=arc-20160816; b=ew2aLD2ub1Yt52ITKPQ2uLmJVxu9lAfBmrj5AbOA5amFtxC82CdGXvned33rmiZOTD ws6VM1PNVng+dpk2xlQexlmXbJgCa8oPBBHrjZ8kJcDlsVv9hYbPNLoVkahQVnJ5jc7n cLZF2gllUKXXyMVEVDxn2PB0AbdBxr/SuSWusrh2rZIjmvwWXPojosuCdovfd7yo8iRQ HXsMIgIok2JNGNh/uJ0eCtSC3OCgo4PFRctAVlmU7umeuBv4a+YIBR9ekKM1oghCIiYS DWzzxY6uXOf0RVsg/UJaegM8ANrvBcfChNEORz8onFNKPQNao6uhEhYk+tEEekaWF1ez YHtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UagXwfMzPRGYl2VY0/pjrvNjJlit+dDi0SN/bo+CQCc=; b=X6a+3kpe87AWi4FPE59zW+JFTkTU0PdK7VTde8n7NAC21To+YuxhtboXnSBR9MB3+z /8OkKWORLc3+ePW595lTun/fBn+NJH93DXCp9qrGicw4uHSb762CGmUW/g3mFisYNuHY 6SVkgeioh6Sc2IMYDaImH0iyLgke7MpNMBd9cgVuMSuXzkDywJVBU0UniLjeHIMTeF8a ogoPxX8Y97v7q4PrePJU4EBf+ccdB4utH25LxnHbv0rFCqqr8/sXut6cS8hWs1RZC3t3 fN/a4day1ijxFDXy2BTdP6NUF6vnUQgzlP+xyJcEWc6f4GepCROLXE023igdGBzDLgeB k3kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tomli.me header.s=1490979754 header.b=Jqbkbneh; 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 r17si7006733pgv.328.2019.03.12.02.20.22; Tue, 12 Mar 2019 02:20:38 -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=Jqbkbneh; 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 S1726325AbfCLJTq (ORCPT + 99 others); Tue, 12 Mar 2019 05:19:46 -0400 Received: from tomli.me ([153.92.126.73]:53228 "EHLO tomli.me" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbfCLJTp (ORCPT ); Tue, 12 Mar 2019 05:19:45 -0400 Received: from tomli.me (localhost [127.0.0.1]) by tomli.me (OpenSMTPD) with ESMTP id d07dabd9; Tue, 12 Mar 2019 09:19:42 +0000 (UTC) X-HELO: localhost.localdomain Authentication-Results: tomli.me; auth=pass (login) smtp.auth=tomli Received: from Unknown (HELO localhost.localdomain) (2402:f000:1:1501:200:5efe:3d33:ceae) by tomli.me (qpsmtpd/0.95) with ESMTPSA (DHE-RSA-CHACHA20-POLY1305 encrypted); Tue, 12 Mar 2019 09:19:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tomli.me; h=date:from:to:cc:subject:message-id:references:mime-version:content-type:in-reply-to; s=1490979754; bh=3+8mC/5CURHzM97+bVX0v3NzwZuZY+wkRKDQCW362qs=; b=Jqbkbnehg9WWi1ATvoduHo+bACPzl33AlVoiyD9QhKM8ubXvwRP4Ct9Z2ZGaghV5J9uPwRRGWcs86JS9WymTIkNCTYGLfEFw2kcsbd4sAZUskNqH6pE7W1eO4Ptayj0vXcIPKAJ04h0s0EBoGnvX0jGAXmnfB+tyUM6RBsoAQOC0AR1m3jDi2O6O0XxGQldo7cuxxrvhDdMB/tStzVbdwTbSdZqIHuj+suPfEAf7d6yCi/UKtz+DURCkv1zrR0lzP6fa7lpW2TEEkXQDcHIQMJjwqvBLtY3Lww8CxSoRW5UFZid/VgLZUSqybQrDMeIug5kCfQSGsnS7pGOcBL9EYQ== Date: Tue, 12 Mar 2019 17:19:32 +0800 From: Tom Li To: Geert Uytterhoeven Cc: Jani Nikula , Linux Fbdev development list , DRI Development , Linux Kernel Mailing List , Bartlomiej Zolnierkiewicz , Sudip Mukherjee , Teddy Wang Subject: Re: Is it possible to reset graphics controller on reboot in a framebuffer driver? Message-ID: <20190312091932.GA17859@localhost.localdomain> References: <20190307051641.GA7012@localhost.localdomain> <871s3jm532.fsf@intel.com> <20190307213759.GA14798@localhost.localdomain> <20190308103536.GA17258@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190308103536.GA17258@localhost.localdomain> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 08, 2019 at 06:35:36PM +0800, Tom Li wrote: > On Fri, Mar 08, 2019 at 10:13:58AM +0100, Geert Uytterhoeven wrote: > > On Thu, Mar 7, 2019 at 10:38 PM Tom Li wrote: > > > Nevertheless, does it mean there's no way to prevent it from happening if the > > > user issues a emergency reboot? Like an automatic reboot after a kernel panic, > > > or a SysRq-B reboot. > > > > If Linux performs a reboot, it calls the shutdown handlers. > > I think that includes reboot on panic, or SysRq-B, but I'd have to check to > > be 100% sure. > > Okay, glad to hear that. If it works for SysRq-B or panic reboot, I think > it would be enough. After all, hard kernel crashes are rare nowadays, and > most crashes are hard lockups. In case it happens, the user just presses > the power button to halt. As I suspected, emergency reboot via SysRq-B is a hard reboot and none of the reboot handler will be called. I've put a for (;;) {} loop in .shutdown(), the kernel would hang during a normal reboot, but a SysRq-B reboot will reset the machine immediately. Fortunately, I've found a way to stop trigger the bug in the driver, so no shutdown handler is needed anymore. Cheers, Tom Li