mbox series

[0/4] Introduce the aural error reporting framework

Message ID 20190401102456.11162-1-mcroce@redhat.com (mailing list archive)
Headers show
Series Introduce the aural error reporting framework | expand

Message

Matteo Croce April 1, 2019, 10:24 a.m. UTC
The Linux kernel has had verbal error reporting since the beginning.
Different error conditions trigger different error messages, with
different severity: from a simple warning to the most feared kernel panic.

While this detailed error reporting is much helpful to developers or end
users, there are some cases in which it's impossible to notice that an
error happened.
The most common case is headless devices, such as home servers without an
attached display, or routers without an exposed serial port. Needless
to say, logging into the machine via SSH is not an option after such
a severe error.
In other cases the monitor might be attached, but the system is unable to
display the error, probably because there is an X server running and
the KMS switch fails. Or simply the user is visually impaired.

These are all cases when the aural errors framework comes to help. This
framework adds to the kernel a generic library to play sounds, which can
be used to report errors or generic events.

As the sound card driver could, and most probably will, become unusable
during a kernel crash, the sounds are played via the system buzzer which
has been around since the dawn of time.
The buzzer driver is simple, requires just a few register writes to work,
the hardware is extremely cheap and is already present on most machines.

The first patch introduces the framework functions, the other three make
use of it in, respectively, kernel panic, warning and oops.
The last patch, not to be merged, creates a procfs handler useful to test
the error reporting.

Matteo Croce (4):
  aural error reporting framework
  panic: use the aural error reporting framework to report panics
  bug: use the aural error reporting framework to report warnings
  oops: use the aural error reporting framework to report oopses

 arch/x86/lib/Makefile |  1 +
 arch/x86/lib/play.c   | 75 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/play.h  | 34 ++++++++++++++++++++
 kernel/panic.c        | 61 +++++++++++++++++++++++++++++++++++
 lib/Kconfig.debug     | 35 ++++++++++++++++++++
 5 files changed, 206 insertions(+)
 create mode 100644 arch/x86/lib/play.c
 create mode 100644 include/linux/play.h

Comments

Peter Zijlstra April 1, 2019, 11:03 a.m. UTC | #1
On Mon, Apr 01, 2019 at 12:24:51PM +0200, Matteo Croce wrote:
> The buzzer driver is simple, requires just a few register writes to work,
> the hardware is extremely cheap and is already present on most machines.

What, no morse-code register dumps?
Thomas Gleixner April 2, 2019, 8:49 a.m. UTC | #2
On Mon, 1 Apr 2019, Peter Zijlstra wrote:
> On Mon, Apr 01, 2019 at 12:24:51PM +0200, Matteo Croce wrote:
> > The buzzer driver is simple, requires just a few register writes to work,
> > the hardware is extremely cheap and is already present on most machines.
> 
> What, no morse-code register dumps?

Aside of that, where is the android-app to customize and decode the
melodies?

I surely want to have the music theme of 'Once Upon a Time in the West' on
kernel crashes.

Thanks,

	tglx
Matteo Croce April 2, 2019, 11:50 a.m. UTC | #3
On Tue, Apr 2, 2019 at 11:33 AM Thomas Gleixner <tglx@linutronix.de> wrote:
>
> On Mon, 1 Apr 2019, Peter Zijlstra wrote:
> > On Mon, Apr 01, 2019 at 12:24:51PM +0200, Matteo Croce wrote:
> > > The buzzer driver is simple, requires just a few register writes to work,
> > > the hardware is extremely cheap and is already present on most machines.
> >
> > What, no morse-code register dumps?
>
> Aside of that, where is the android-app to customize and decode the
> melodies?
>
> I surely want to have the music theme of 'Once Upon a Time in the West' on
> kernel crashes.
>
> Thanks,
>
>         tglx
>

Hi Thomas,

I'm a little rusty with Android programming, so I'll share the script
I use to convert notes to frequences.
With some awk magic it can turn notes into a C array, I hope that you
find it useful.

Bye,
Thomas Gleixner April 2, 2019, 1:21 p.m. UTC | #4
Matteo,

On Tue, 2 Apr 2019, Matteo Croce wrote:
> On Tue, Apr 2, 2019 at 11:33 AM Thomas Gleixner <tglx@linutronix.de> wrote:
> > Aside of that, where is the android-app to customize and decode the
> > melodies?
> >
> > I surely want to have the music theme of 'Once Upon a Time in the West' on
> > kernel crashes.
> 
> I'm a little rusty with Android programming, so I'll share the script
> I use to convert notes to frequences.
> With some awk magic it can turn notes into a C array, I hope that you
> find it useful.

That's great. Just a few nitpicks on the patches themself. You want to
change msleep() to mdelay() in order to avoid "Scheduling while atomic"
noise and you want to have global serialization because interleaving "La
Paloma" from CPU1 and "Once Upon a Time in the West" from CPU2 sounds
really horrible.

Thanks,

	tglx