Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5353548imb; Thu, 7 Mar 2019 13:39:10 -0800 (PST) X-Google-Smtp-Source: APXvYqyw4atVyefZvLxJHE8z+YpT+uKEGCFf8Ew1DJQZzLXueOGsUyhO7bYMuQaxmCgmnhMxmypM X-Received: by 2002:a17:902:9008:: with SMTP id a8mr15201300plp.38.1551994750375; Thu, 07 Mar 2019 13:39:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551994750; cv=none; d=google.com; s=arc-20160816; b=lqGN8SMxycwWxsuvk/W5BGbFAkuVEbGGpY0KCDAQiReMXyAXkFmx96ERKOMDyFFRXX SXT4rcz4adBJ7oz9IYzkVtUVVb9uvMoGMemx65UBHUp/nAH7xXoaU1ylScf9Mhl5VAbN S7aYDxmqQrzTKJ9KoTGQq7EOV2yB+ghQZEvU7H6GXLPB9v4hZZfwO3abSxYBxtYlrAkG qvNMgshPV7dwOIdc3f/YDZYkPHH1FudUaJO1DpGiXTsQpnj/pIgQM52oazn6HAxGZXdN Ir4cGjR79ZzqYjthDVRWPjsacvkCK4gZnxQNW+rvrny8HIsbeErPLwoAlhyQ85WjbYFE iMsQ== 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=bfNu7NatgnrQQEH1C0AHFWrE/sYxI+RSwd8JLoc+aeA=; b=JjzUjjDufMXETmazLB6UPJIBmvFNP4hHdzoG8kgxkSwozntwQvNmD6eL59IesCYQfI KVGWIinX+xxlQLvFa3yUq8P+IjDktiujEwPsTRr4Wt1RAmXP9SMoIFayvYlz7/1WMiuY J2FLAjd7xEt3ovrxPBfL6+0z8y4OOHDGY9W0HPCy5nIhxk7m+8ajchcaDDc94cxDPYHE EQyHWLEXIQK0kE9kzxDKGIMBbHQnrZGiStEdb/EU8/iUhhJxfRDyUtof7VnX40ndZvCZ KFRiI7QwGvzRV4pi6Fid91zO9mb5NYaF2DRao3KjDggtnwXdeLfipgOj+ws3CT6ZXsIu imoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tomli.me header.s=1490979754 header.b=Gy+DBxv4; 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 b27si4585013pgb.366.2019.03.07.13.38.53; Thu, 07 Mar 2019 13:39:10 -0800 (PST) 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=Gy+DBxv4; 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 S1726711AbfCGViN (ORCPT + 99 others); Thu, 7 Mar 2019 16:38:13 -0500 Received: from tomli.me ([153.92.126.73]:48562 "EHLO tomli.me" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbfCGViM (ORCPT ); Thu, 7 Mar 2019 16:38:12 -0500 Received: from tomli.me (localhost [127.0.0.1]) by tomli.me (OpenSMTPD) with ESMTP id 41d596ab; Thu, 7 Mar 2019 21:38:10 +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:72f4:b31) by tomli.me (qpsmtpd/0.95) with ESMTPSA (DHE-RSA-CHACHA20-POLY1305 encrypted); Thu, 07 Mar 2019 21:38:09 +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=cy8GnP8uMbw3SBpS6/wU5liaYVMWHL72tzD+C3m1Buw=; b=Gy+DBxv4kE0F4TNyxVUnrktbrHl7ySfmK8awNUHIzwYh89x7Xch2nh66Ph93Kfza+9+h8HsAwkdM846rVd0FaHYe2pbHORBOxDUY73aV0iwSU1uqCLHWB30PVE+ko3atFihiONdym38N+4vIPb385JmorUM8Cb55osHk8Xqh/IwmRZCI+lAChz4kWOlYGNY9/NEjSeW2cTy9rvLPHrBBCaUNXavKrge6w6wSTrs1apqqjqcLnGJ+qFbiVXDFrYNNQ3g7OY8gmnTZJ+fYdyBtXCjRcZjTmNxQqJSEBKegmH/M+iDk5/159owBIY9MOzFLdZwFs9SIASyDvqycHeL1xA== Date: Fri, 8 Mar 2019 05:38:00 +0800 From: Tom Li To: Geert Uytterhoeven Cc: Jani Nikula , Linux Fbdev development list , DRI Development , Linux Kernel Mailing List , Bartlomiej Zolnierkiewicz , Sudip Mukherjee , Yifeng Li , Teddy Wang Subject: Re: Is it possible to reset graphics controller on reboot in a framebuffer driver? Message-ID: <20190307213759.GA14798@localhost.localdomain> References: <20190307051641.GA7012@localhost.localdomain> <871s3jm532.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, Mar 07, 2019 at 10:39:23AM +0100, Geert Uytterhoeven wrote: > On Thu, Mar 7, 2019 at 10:00 AM Jani Nikula wrote: > > It's possible to do this using a reboot notifier. I am not sure if there > > are better ways to achieve the same, but there's at least one example of > > using reboot notifiers to achieve the exact same goal. > > > > See drivers/video/fbdev/aty/atyfb_base.c, look for > > register_reboot_notifier(). > > Or a shutdown handler, which is more device-centric? > (cfr. "[3/4] fbdev: atafb: Fix broken frame buffer after kexec", > https://patchwork.kernel.org/patch/10814381/). > > Gr{oetje,eeting}s, Thanks, I knew reboot_notifier but I thought it feels "hacky" to use it in a device driver, shutdown() handler looks better. 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. Tom Li