Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp137899yba; Mon, 1 Apr 2019 03:28:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxuwwIhYAXXt4esZbTOz91epyU1gqviAmv5sKI9Zf2Hf5a5BgWrv2N4F9QrAsM4i/RKeawG X-Received: by 2002:a17:902:9043:: with SMTP id w3mr63414876plz.101.1554114494533; Mon, 01 Apr 2019 03:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554114494; cv=none; d=google.com; s=arc-20160816; b=AtxntbRUWXojvmNOtt7Q1VzGCnUmlmiXW56D6uqCXXztxbcIjLjecCVs9EAwWf0FJB diDsIqkdJV25Yw2tsiQu1qDPdbosOZWcxw659q7+QApsZdO5vXY5uUesWXRGgoJsAcyh Fd6WJQH5W37mhGMJGj0FTdP97+fA+845o/TOb72C/U0N7XkdE25IZBErzVp/I34C1d+/ pzls2/ynyeRnlWvGIWM8I9Fa5BqkwWrqYP1yP90/DuiS09iwXXQsYEG8r0IG/CbUux0l 6kpQqc3rjwem+b9BBXi22rKMc7kycVsKJiZNLWA1zwJaJZohuoMjaI+oO4bqB+9xHmkh impQ== 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=bxKBcW26rWDzJ50nBBK2OmMkZ1pasv8tsZhbSDCEQtI=; b=sERkwUpRmyLB5XbkrcHhyTJlk5mGbq5Vo8Cu+2XagERl6NlPOLL8w0psCvqHJaoftQ 5iZGiIUxrDwBzX8u4RCBhixqTeV7oDbs8kj22Al8ydKaE53HIUUsn91NxXOrdlo3ddbT byirVZ7lvutqJgXa/OEL/RDh/CGXhIAUCVFMO0j//q6CSz7MQCOAEsLM3419gcf72bQM TDnTlLGO1PVmoIecR9N5qz/3+tYO9BWaYTHABnNJD7vNFQcAc2Rrew9Dgm3rrJPeRJ2s pndm0yGRmk00qlZ0bhbkip//NVElHiCa9MBf87l3EXQ9LDk/SJdaPNAgWuYmso6eFNNP SjEw== 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 k9si8739317pgc.156.2019.04.01.03.27.58; Mon, 01 Apr 2019 03:28:14 -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 S1726931AbfDAKZq (ORCPT + 99 others); Mon, 1 Apr 2019 06:25:46 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33331 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726183AbfDAKZp (ORCPT ); Mon, 1 Apr 2019 06:25:45 -0400 Received: by mail-wr1-f68.google.com with SMTP id q1so11285136wrp.0 for ; Mon, 01 Apr 2019 03:25:44 -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=bxKBcW26rWDzJ50nBBK2OmMkZ1pasv8tsZhbSDCEQtI=; b=nWmwR3Ir8Vs/WZFPq8WjPAQvtTVYUDI2iWRw/cNUBb1NIBwMp7lFV4bZ18IEqPjmHU 9Gr8XilagUvgxqYQWx8T4rddkh+2bneI4Oy8rz7LUXgj9TBYC99a81QQXy9i1RlH0oVV 7vYvWZGNHdlPUSD4KDawYCfYXlrwfSYJwgHNzGcQuzTDZlOPhl9l8qV0N6vAJCMKh3si 0o26QU9x44uZoClKlf879mQtJbGRi9GIFsyG0YKGuUoPuRZn/qpu5/HzBnIqkBGsFjGo Hy47VYUBmsnRDecYZQYNdcuq274/1mQEWWk147sd6m04kIIuYm/oEW4u7LsVhQ1U2jRl hFUw== X-Gm-Message-State: APjAAAWbVdNPwL8bwnr2d0yRsZRS6+RrloQjvyzbthyfJDIpBc4EgS0Q WdpxxepHk3MHwGfdW7og3rNaBg== X-Received: by 2002:adf:ef0b:: with SMTP id e11mr28715378wro.244.1554114343867; Mon, 01 Apr 2019 03:25:43 -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 q4sm11869071wrx.25.2019.04.01.03.25.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Apr 2019 03:25:43 -0700 (PDT) From: Matteo Croce To: x86@kernel.org, LKML , linux-sound@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH 4/4] oops: use the aural error reporting framework to report oopses Date: Mon, 1 Apr 2019 12:24:55 +0200 Message-Id: <20190401102456.11162-5-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 when reporting an oops. The sound is emitted at the end of oops_exit(), to avoid interfering with other oops actions, like stack dump. 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 b87c4403924d..ea34f93ce410 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -97,6 +97,23 @@ static struct note warn_sound[] = { }; #endif +#ifdef CONFIG_AUDIBLE_OOPS +static struct note oops_sound[] = { + { 494, 100 }, + { 698, 100 }, + { 0, 100 }, + { 698, 100 }, + { 698, 133 }, + { 659, 133 }, + { 587, 133 }, + { 523, 100 }, + { 330, 100 }, + { 262, 100 }, + { 330, 100 }, + { 262, 100 }, +}; +#endif + static long no_blink(int state) { return 0; @@ -575,6 +592,7 @@ void oops_exit(void) do_oops_enter_exit(); print_oops_end_marker(); kmsg_dump(KMSG_DUMP_OOPS); + play(oops_sound, ARRAY_SIZE(oops_sound)); } struct warn_args { diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 909c271d283b..74745ef386ce 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1017,6 +1017,16 @@ config AUDIBLE_WARN the system buzzer and not via any soundcard. Not available on all platforms. +config AUDIBLE_OOPS + bool "Aural oops" + select PLAY_LIB + default n + help + If you say Y here, oops 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