All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Tom Li <tomli@tomli.me>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
	Linux Fbdev development list <linux-fbdev@vger.kernel.org>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Teddy Wang <teddy.wang@siliconmotion.com>
Subject: Re: Is it possible to reset graphics controller on reboot in a framebuffer driver?
Date: Fri, 8 Mar 2019 10:13:58 +0100	[thread overview]
Message-ID: <CAMuHMdVnkdrUTL_3UaoaOondGxCB_FpEYOTDmLeh1C0W5j0-Hw@mail.gmail.com> (raw)
In-Reply-To: <20190307213759.GA14798@localhost.localdomain>

Hi Tom,

On Thu, Mar 7, 2019 at 10:38 PM Tom Li <tomli@tomli.me> 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 <jani.nikula@linux.intel.com> 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

WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Tom Li <tomli@tomli.me>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
	Linux Fbdev development list <linux-fbdev@vger.kernel.org>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Teddy Wang <teddy.wang@siliconmotion.com>
Subject: Re: Is it possible to reset graphics controller on reboot in a framebuffer driver?
Date: Fri, 08 Mar 2019 09:13:58 +0000	[thread overview]
Message-ID: <CAMuHMdVnkdrUTL_3UaoaOondGxCB_FpEYOTDmLeh1C0W5j0-Hw@mail.gmail.com> (raw)
In-Reply-To: <20190307213759.GA14798@localhost.localdomain>

Hi Tom,

On Thu, Mar 7, 2019 at 10:38 PM Tom Li <tomli@tomli.me> 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 <jani.nikula@linux.intel.com> 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

  reply	other threads:[~2019-03-08  9:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07  5:16 Is it possible to reset graphics controller on reboot in a framebuffer driver? Tom Li
2019-03-07  5:16 ` Tom Li
2019-03-07  8:58 ` Jani Nikula
2019-03-07  9:00   ` Jani Nikula
2019-03-07  9:00   ` Jani Nikula
2019-03-07  9:39   ` Geert Uytterhoeven
2019-03-07  9:39     ` Geert Uytterhoeven
2019-03-07  9:39     ` Geert Uytterhoeven
2019-03-07 21:38     ` Tom Li
2019-03-07 21:38       ` Tom Li
2019-03-08  9:13       ` Geert Uytterhoeven [this message]
2019-03-08  9:13         ` Geert Uytterhoeven
2019-03-08 10:35         ` Tom Li
2019-03-08 10:35           ` Tom Li
2019-03-12  9:19           ` Tom Li
2019-03-12  9:19             ` Tom Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdVnkdrUTL_3UaoaOondGxCB_FpEYOTDmLeh1C0W5j0-Hw@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=teddy.wang@siliconmotion.com \
    --cc=tomli@tomli.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.