Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp136872yba; Mon, 1 Apr 2019 03:26:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwz+oqveecRSPbJjaoGwH1UM2C+zRTs5747JBWd4I7GwHxfz1rUIMtzzuF6aZTKqWunbj5Z X-Received: by 2002:a65:524a:: with SMTP id q10mr47932923pgp.224.1554114411134; Mon, 01 Apr 2019 03:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554114411; cv=none; d=google.com; s=arc-20160816; b=CNZ2wdRVFtjQJro2bHiTRVg+mEVCGf1dsTB5pvy0CjeRyRgBcOj6BcIpgfX6DuENX6 +Lkdi7x0BaYGc7mnXhQGFYcPN4lZu9xGtUSit6IRUSnBVWaICNsQdSGFwkOyTj+N4ZL2 Ef+EUg38uFkcLdH0+Ko+dunNq73fuSgUHXDbGkAjQd5RuLXhMhmlsLkkFQDz98K1v8pi R/onNco5h2nd7znJpZK/dwYt7f2BpF/D2IMY46Fo6v9g2B7BY854w8ua5O3OzS18vSFR Omhz6W8/hWBmC6Qm8vSdKpQM+qTtmSKTlTkPIV9QxFLQmoKR2dHjlAOQ1ksm+zIx0O2Z DChg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=ytkDSX0hUQw8yoTuJsx11zHuPM+//NwD90uPWmbtSBU=; b=MIbprdsoCUxEw0jYn6kAN9a28ZJ3X8RkoTd96NkGsbywrdPprs8Xqg00c2BynWv2Wq 6K0JmZaLDQwt8TcA1X7savD/zbwwjCqOwiV2klcVMdMiYtN6jeQaJHAKS0vfp/gWgOCh akCothP7GUPvKj+x0KLEg2Xm0EcZZT1u6foLkrob3+ryinMuBExOpd3eVzpkJNKQ+Ijg nftK1EUE/eQmRS95u4uMMn0QjLN+jlQvH7h8h1rBDdenrJaiEBn04zfHLSCRa914t2ys JFaXrpqp1pnA/A/N1Umu9QMJd95nJUg6giPr3JskNYb0OdJ6mGZ7az8Y0enE0pbTizOt 3GaQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si8567193pgv.248.2019.04.01.03.26.36; Mon, 01 Apr 2019 03:26:51 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726892AbfDAKZe (ORCPT + 99 others); Mon, 1 Apr 2019 06:25:34 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42475 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726568AbfDAKZe (ORCPT ); Mon, 1 Apr 2019 06:25:34 -0400 Received: by mail-wr1-f66.google.com with SMTP id g3so11247007wrx.9 for ; Mon, 01 Apr 2019 03:25:33 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ytkDSX0hUQw8yoTuJsx11zHuPM+//NwD90uPWmbtSBU=; b=nP2Pxcc/j3qHueQQFVvhibWlqcJv9Zp3hlWg6auURcVrl3hLyZPwpCU3HRKsQp6Sv4 pKbLQQRVPTYUxCPvjCl18MWONmtm8uPmHuBZA2IhPZudz+5vxKD+PPuJsYk+70T3TvP/ z8b9uP4Zzz34SfNs+o00buGBl6INFFnC5iNs/FAGixm4BQhce/34EmlRpe2x9jIx5pWO 8+03YBUikva7zSvi/jI/NQP10FCNA1JAoJHPoUWUgRCnNZTgdpu+/dqLT6se75S3PwXF R+7MOh4RML39oJljOUiXGc8UKyGDNKnLH0+qv4QZYaR3C8n7I4H+W88uMkNeX1ziOMFq ILzA== X-Gm-Message-State: APjAAAUCBL7GMPOQAAFD6+d5Y1SnVruxurW8kebsWjivcFwA87eMwO08 idtkG8yr8oQ1dWh+9NqCCK3Nxg== X-Received: by 2002:a5d:6a8a:: with SMTP id s10mr41972580wru.66.1554114332464; Mon, 01 Apr 2019 03:25:32 -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 r6sm8088496wrt.38.2019.04.01.03.25.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Apr 2019 03:25:31 -0700 (PDT) From: Matteo Croce To: x86@kernel.org, LKML , linux-sound@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH 3/4] bug: use the aural error reporting framework to report warnings Date: Mon, 1 Apr 2019 12:24:54 +0200 Message-Id: <20190401102456.11162-4-mcroce@redhat.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190401102456.11162-1-mcroce@redhat.com> References: <20190401102456.11162-1-mcroce@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the new aural error reporting framework to signal kernel bugs. Emit the sound at the end of the __warn(), so the WARN_* are all covered. If panic_on_warn is set, panic() will play its sound and never return, so there is no risk to emit two sounds or the wrong one. Signed-off-by: Matteo Croce --- kernel/panic.c | 18 ++++++++++++++++++ lib/Kconfig.debug | 10 ++++++++++ 2 files changed, 28 insertions(+) diff --git a/kernel/panic.c b/kernel/panic.c index 360578e092e7..b87c4403924d 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -81,6 +81,22 @@ static struct note panic_sound[] = { }; #endif +#ifdef CONFIG_AUDIBLE_WARN +static struct note warn_sound[] = { + { 440, 400 }, + { 440, 300 }, + { 440, 100 }, + { 440, 400 }, + { 523, 300 }, + { 494, 100 }, + { 494, 300 }, + { 440, 100 }, + { 440, 300 }, + { 440, 100 }, + { 440, 800 }, +}; +#endif + static long no_blink(int state) { return 0; @@ -609,6 +625,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint, /* Just a warning, don't kill lockdep. */ add_taint(taint, LOCKDEP_STILL_OK); + + play(warn_sound, ARRAY_SIZE(warn_sound)); } #ifdef WANT_WARN_ON_SLOWPATH diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index e5d187dfc74a..909c271d283b 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1007,6 +1007,16 @@ config AUDIBLE_PANIC the system buzzer and not via any soundcard. Not available on all platforms. +config AUDIBLE_WARN + bool "Aural warning" + select PLAY_LIB + default n + help + If you say Y here, warnings will play a sound just + after the stacktrace and registers dump. The sound is played via + the system buzzer and not via any soundcard. + Not available on all platforms. + config SCHED_DEBUG bool "Collect scheduler debugging info" depends on DEBUG_KERNEL && PROC_FS -- 2.20.1