From patchwork Thu Jun 8 14:17:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Peres X-Patchwork-Id: 9775591 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 374FC60393 for ; Thu, 8 Jun 2017 14:17:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2938E2855A for ; Thu, 8 Jun 2017 14:17:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DE2A28562; Thu, 8 Jun 2017 14:17:16 +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 B26322855A for ; Thu, 8 Jun 2017 14:17:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CE7E6E3DF; Thu, 8 Jun 2017 14:17:15 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 534EE6E3DF for ; Thu, 8 Jun 2017 14:17:14 +0000 (UTC) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2017 07:17:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,315,1493708400"; d="scan'208";a="112473737" Received: from linux.intel.com ([10.54.29.200]) by fmsmga006.fm.intel.com with ESMTP; 08 Jun 2017 07:17:13 -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 5570958059D; Thu, 8 Jun 2017 07:17:12 -0700 (PDT) From: Martin Peres To: intel-gfx@lists.freedesktop.org Date: Thu, 8 Jun 2017 17:17:01 +0300 Message-Id: <20170608141701.14849-1-martin.peres@linux.intel.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170608115029.25710-1-martin.peres@linux.intel.com> References: <20170608115029.25710-1-martin.peres@linux.intel.com> Subject: [Intel-gfx] [PATCH v2] 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 printf with a custom string Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101246 --- 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..58dda5a52638 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")) + printk("INTEL-GFX-CI-WARN: "); + if (spec->hp_automute_hook) spec->hp_automute_hook(codec, jack); else