Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5752300imb; Fri, 8 Mar 2019 01:16:25 -0800 (PST) X-Google-Smtp-Source: APXvYqw4Q1EiQ+m0k+IIRUv2HO0KNKvO162/BnE9g2Go+j2m0Ddf7fkEfrB4eH0SjcB1pm7HGckC X-Received: by 2002:a63:1155:: with SMTP id 21mr14794382pgr.96.1552036585014; Fri, 08 Mar 2019 01:16:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552036585; cv=none; d=google.com; s=arc-20160816; b=Kvzf9m6C8ISUlge/Qem9oxJq6poAzh3/l0hAogIUpRupV76KYOKpo96dOaXcTgm7Hi dUShICszFuXrQA9lMkVfCHQMigKKdBjowzF1rtv5cvkGwdbFX3lpEObb/ESySccJlwDQ bUKwllSGKsH8oNO7ZfGrjfkRcFPAGKpyEtu+44aP5K98CSRboUKb1Z/6ko5hjdkd+Clj IYeoLgevylV9kPtcz3zHS7u37UHcR8bIR69x8tarFEKxxmxCKKasqDkhYPRQJX+7GgPr NXUGiTKyFjFxdnsvB9BfK0wKl5KPzaF1OwU3haiwsLmsD2bw6sLZV0VWNem2VeFCEjV0 kT3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=9eTzoH/V7S05omP1ya/3X36AlsCFukZZfmqHw92DzTU=; b=hoKwVulXxM1WKrotJ/90MKWBfNbcea6jx3D4LXOqnQbWlxXL72KHRl+DEfkxVuR1vT B96AyptXoUPfOjdKHMNi3PtIrw0rK4qTscLCVXc24FEj8SKFgxr7jJgI8pf1MHtqLk4+ S9zLvO3Up055jG+2jRp2XrIs0XS+rjcwnhZl+l/Y9i/m7h0q1ILmNBFm0GJ/odnuHXrQ q/RPb6DPkrGqizLfECnD8JZ5bUfFh5rui/LjYnL3WXZlh97OrMe4RiL+ju+ohI0dO+Nf TOnwMKqEtJFC2XUqbKssoSGte4cRGSd0tx4K0F1XGoThNUpb3wRxaPaG33RaJZVefXf5 CVlA== ARC-Authentication-Results: i=1; mx.google.com; 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 k91si6794555pld.86.2019.03.08.01.16.09; Fri, 08 Mar 2019 01:16:24 -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; 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 S1726380AbfCHJOM (ORCPT + 99 others); Fri, 8 Mar 2019 04:14:12 -0500 Received: from mail-vs1-f67.google.com ([209.85.217.67]:44687 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725975AbfCHJOM (ORCPT ); Fri, 8 Mar 2019 04:14:12 -0500 Received: by mail-vs1-f67.google.com with SMTP id r201so6246481vsc.11; Fri, 08 Mar 2019 01:14:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9eTzoH/V7S05omP1ya/3X36AlsCFukZZfmqHw92DzTU=; b=oiQBcPFZaQkbwUqjAdFT1LRYksLVAJRZ/JsxozA5VbyVEwBdH/8WbAaen0khKMFDD+ k4RPZz9X6XfZTPONz61TLbgi8arEvu1l6zRYDrH/2xdT2utnZnLtAYsapVjHRuDYc9L5 N+bcMBehxM0FFdWmLlzHLTWkd4HDApp9OFNXNEM4BGeEcldGAu7mYEUwKWGMEIVAGUQe sSzWT5F1gf5Qoo86zvvdiXGAX8CTVZVO1mT3OBQuifEqh0KCdLSX761uX0wvAS0lRz4U nfF7GEFpmisKjFHj36RijjWstrh2QuYv4xsDuA1uWdW+sQemL3vUZcTLrl+3ZstPLbnz Z+Qg== X-Gm-Message-State: APjAAAU5bH8NC0UO86DjeL8wlUnU+Z5FaLv9EczoeXcex8KgslGyDpvz lwUR3hkK7Ukq8aOD3DrYiMMJZMNFp/grlIOSUGI= X-Received: by 2002:a67:fc9a:: with SMTP id x26mr9373095vsp.166.1552036451298; Fri, 08 Mar 2019 01:14:11 -0800 (PST) MIME-Version: 1.0 References: <20190307051641.GA7012@localhost.localdomain> <871s3jm532.fsf@intel.com> <20190307213759.GA14798@localhost.localdomain> In-Reply-To: <20190307213759.GA14798@localhost.localdomain> From: Geert Uytterhoeven Date: Fri, 8 Mar 2019 10:13:58 +0100 Message-ID: Subject: Re: Is it possible to reset graphics controller on reboot in a framebuffer driver? To: Tom Li Cc: Jani Nikula , Linux Fbdev development list , DRI Development , Linux Kernel Mailing List , Bartlomiej Zolnierkiewicz , Sudip Mukherjee , Teddy Wang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tom, On Thu, Mar 7, 2019 at 10:38 PM Tom Li wrote: > 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. 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. If the kernel just crashes, of course all of that doesn't happen. Is your graphics card reset when the reset button is pressed, or only on cold power on? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds