From patchwork Mon Jul 27 21:34:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "U. Artie Eoff" X-Patchwork-Id: 6876851 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6B4D19F358 for ; Mon, 27 Jul 2015 21:38:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A060E206EB for ; Mon, 27 Jul 2015 21:38:56 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 4415C20719 for ; Mon, 27 Jul 2015 21:38:55 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 00093260713; Mon, 27 Jul 2015 23:38:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id BB9362604E2; Mon, 27 Jul 2015 23:38:46 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 270482604EB; Mon, 27 Jul 2015 23:38:45 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by alsa0.perex.cz (Postfix) with ESMTP id DAAC42604CA for ; Mon, 27 Jul 2015 23:38:35 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 27 Jul 2015 14:35:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,557,1432623600"; d="scan'208";a="772356397" Received: from uartie-ird.jf.intel.com (HELO localhost.localdomain) ([10.7.199.67]) by orsmga002.jf.intel.com with ESMTP; 27 Jul 2015 14:35:27 -0700 From: "U. Artie Eoff" To: alsa-devel@alsa-project.org, tiwai@suse.de Date: Mon, 27 Jul 2015 14:34:53 -0700 Message-Id: <1438032894-8472-1-git-send-email-ullysses.a.eoff@intel.com> X-Mailer: git-send-email 1.9.3 Cc: libin.yang@intel.com, zhuo-hao.lee@intel.com, "U. Artie Eoff" Subject: [alsa-devel] [PATCH 1/2] ALSA: hda - skip runtime PM if async probe is not finished X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Crash can occur if runtime PM is triggered before the async probe finishes via the azx_firmware_cb when CONFIG_SND_HDA_PATCH_LOADER is defined. Don't execute PM ops if the async probe has not completed yet. The probe is finished when chip->running is true. Signed-off-by: U. Artie Eoff --- sound/pci/hda/hda_intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 735bdcb04ce8..b729b25a6ad6 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1023,7 +1023,7 @@ static int azx_runtime_idle(struct device *dev) chip = card->private_data; hda = container_of(chip, struct hda_intel, chip); - if (chip->disabled || hda->init_failed) + if (chip->disabled || hda->init_failed || !chip->running) return 0; if (!power_save_controller || !azx_has_pm_runtime(chip) ||