From patchwork Mon Apr 1 10:24:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matteo Croce X-Patchwork-Id: 10879615 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E21D913B5 for ; Mon, 1 Apr 2019 10:25:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6C4F28681 for ; Mon, 1 Apr 2019 10:25:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAB6728889; Mon, 1 Apr 2019 10:25:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25DC92846D for ; Mon, 1 Apr 2019 10:25:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725878AbfDAKZE (ORCPT ); Mon, 1 Apr 2019 06:25:04 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:38255 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbfDAKZA (ORCPT ); Mon, 1 Apr 2019 06:25:00 -0400 Received: by mail-wm1-f65.google.com with SMTP id w15so10712770wmc.3 for ; Mon, 01 Apr 2019 03:24:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=L75OSJxc8ptBxGUiwFEHQQdgwhTlCON2WMpoejyEGDs=; b=G4tX3N3/iV6T01/Ku31y9IX7wd1Ut9ftvrQNvllRC9xYATjOxCUUkveDnPD8Ik3VoB eM2k15FBc3yp2JMApXXDXU3ARS8KRmmosgdCqNN8UkIi+wDiC0Ua2Zr36ZPmdFbGg5lD c9thXP0c9Ab/oL1Mkh2R/fFqw4qxWdogKSJYpGKJ51G3MHHQB454ZZomVxTBUNi6TCu7 o0F56YX7cR9vV0DyBUswgrOqz+0aUlIhOAGsxUuspCjbg67ScaJKuhW78f30+MYTrDuQ L0thSu9fe1Z+4Fv5agk54YjncnvGRhUs6cRP4PYOdP4zKqYx4w+4XNCMeVdxUT8WjtFv qAZQ== X-Gm-Message-State: APjAAAWnZwcWQUva6GLP8OvMMmMAVXSg5fJWfrgpo7ME4w+ltJNB2qPB 9Hy4fhSdafYYDgtByd3c84FibQ== X-Google-Smtp-Source: APXvYqwirzMQIA9uQn7PQmigt7FHRG+LWAzOqq3oRCjLYjtj2Nr1jSx4PhBGXMeXOcohxMSLsPq7TA== X-Received: by 2002:a1c:4d02:: with SMTP id o2mr11964610wmh.134.1554114298084; Mon, 01 Apr 2019 03:24:58 -0700 (PDT) Received: from raver.teknoraver.net (net-93-70-69-135.cust.vodafonedsl.it. [93.70.69.135]) by smtp.gmail.com with ESMTPSA id h18sm14233602wrt.97.2019.04.01.03.24.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Apr 2019 03:24:57 -0700 (PDT) From: Matteo Croce To: x86@kernel.org, LKML , linux-sound@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH 0/4] Introduce the aural error reporting framework Date: Mon, 1 Apr 2019 12:24:51 +0200 Message-Id: <20190401102456.11162-1-mcroce@redhat.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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