From patchwork Fri Jun 9 10:57:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Peres X-Patchwork-Id: 9778059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0F2106034B for ; Fri, 9 Jun 2017 10:57:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00BC028548 for ; Fri, 9 Jun 2017 10:57:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9F7828607; Fri, 9 Jun 2017 10:57:55 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6ABC528548 for ; Fri, 9 Jun 2017 10:57:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B6CD36E5B6; Fri, 9 Jun 2017 10:57:54 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id E0C6A6E5B6 for ; Fri, 9 Jun 2017 10:57:53 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP; 09 Jun 2017 03:57:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.39,317,1493708400"; d="scan'208"; a="1139592451" Received: from linux.intel.com ([10.54.29.200]) by orsmga001.jf.intel.com with ESMTP; 09 Jun 2017 03:57:53 -0700 Received: from mperes_DESK.fi.intel.com (mperes_desk.fi.intel.com [10.237.72.154]) by linux.intel.com (Postfix) with ESMTP id A978E5803A3; Fri, 9 Jun 2017 03:57:51 -0700 (PDT) From: Martin Peres To: intel-gfx@lists.freedesktop.org Date: Fri, 9 Jun 2017 13:57:48 +0300 Message-Id: <20170609105748.30267-1-martin.peres@linux.intel.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170608141701.14849-1-martin.peres@linux.intel.com> References: <20170608141701.14849-1-martin.peres@linux.intel.com> Subject: [Intel-gfx] [PATCH v3] NOTFORUPSTREAM sound/hda: add debug information in call_hp_automute X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP I would like to send this patch to the core-for-CI branch, in order to verify the theory I exposed in fdo#101246. This patch also hides a potentially serious bug in the sound/hda driver, which may improve our chances of not being affected by bugs there. It may actually also fix some of the incompletes we see. v2: use WARN() instead of printk with a custom string v3: return if spec is NULL (was a typo from v2 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101246 --- Sorry, I fixed the typos introduced in the v2. Note to self: Do not send patches right before leaving for a meeting. sound/pci/hda/hda_generic.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 557ecfcad158..4ac24a4f2e70 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -4471,7 +4471,15 @@ EXPORT_SYMBOL_GPL(snd_hda_gen_mic_autoswitch); static void call_hp_automute(struct hda_codec *codec, struct hda_jack_callback *jack) { - struct hda_gen_spec *spec = codec->spec; + struct hda_gen_spec *spec; + + if (WARN(!codec, "call_hp_automute called with codec == NULL")) + return; + + spec = codec->spec; + if (WARN(!spec, "call_hp_automute called with codec->spec == NULL")) + return; + if (spec->hp_automute_hook) spec->hp_automute_hook(codec, jack); else