From patchwork Mon Dec 26 14:00:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Miao X-Patchwork-Id: 5980 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 25CFE23F72 for ; Mon, 26 Dec 2011 14:00:49 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 143FCA18461 for ; Mon, 26 Dec 2011 14:00:49 +0000 (UTC) Received: by eaac11 with SMTP id c11so9067650eaa.11 for ; Mon, 26 Dec 2011 06:00:49 -0800 (PST) Received: by 10.205.141.78 with SMTP id jd14mr6088672bkc.107.1324908048828; Mon, 26 Dec 2011 06:00:48 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs149616bkc; Mon, 26 Dec 2011 06:00:48 -0800 (PST) Received: by 10.52.90.164 with SMTP id bx4mr12099608vdb.128.1324908045860; Mon, 26 Dec 2011 06:00:45 -0800 (PST) Received: from mail-vw0-f50.google.com (mail-vw0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id ij10si10550435vdb.142.2011.12.26.06.00.45 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Dec 2011 06:00:45 -0800 (PST) Received-SPF: pass (google.com: domain of eric.y.miao@gmail.com designates 209.85.212.50 as permitted sender) client-ip=209.85.212.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of eric.y.miao@gmail.com designates 209.85.212.50 as permitted sender) smtp.mail=eric.y.miao@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by vbbey12 with SMTP id ey12so11390927vbb.37 for ; Mon, 26 Dec 2011 06:00:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; bh=UvH1dr12z77O7pyIHDxCo969TkbgWTOCkpHDdimlHVI=; b=Z+dy+TaX6T+J+ZFugkSOy0U4MxmP7PmOO2P7DyU4PqY3PSZXHXPzYo0P5YD0rZD+EX NgyHw8SB9EmRWokNaBY42Ioyt+U9BnQGZQjGVHg0O30OrA5QrF1EV8O4m8uQZh+dzHne DfUntZL5As76BtPGv2EDYuaQzfRflGbxZR8Wc= Received: by 10.52.94.227 with SMTP id df3mr13430531vdb.51.1324908045250; Mon, 26 Dec 2011 06:00:45 -0800 (PST) MIME-Version: 1.0 Sender: eric.y.miao@gmail.com Received: by 10.52.110.99 with HTTP; Mon, 26 Dec 2011 06:00:23 -0800 (PST) In-Reply-To: <1322059020-24305-1-git-send-email-eric.miao@linaro.org> References: <1322059020-24305-1-git-send-email-eric.miao@linaro.org> From: Eric Miao Date: Mon, 26 Dec 2011 22:00:23 +0800 X-Google-Sender-Auth: i_IdtPLiQLtxQr1nMjwlXCIO7YE Message-ID: Subject: Fwd: [PATCH] ASoC: skip resume of soc-audio devices without codecs To: patches@linaro.org ---------- Forwarded message ---------- From: Eric Miao Date: Wed, Nov 23, 2011 at 10:37 PM Subject: [PATCH] ASoC: skip resume of soc-audio devices without codecs To: Mark Brown Cc: linux-arm-kernel , Eric Miao There are cases where there is no working codec on the soc-audio devices, and snd_soc_suspend() will skip such device when suspending. Yet its counterpart snd_soc_resume() does not check this, causing complaints about spinlock lockup: [  176.726087] BUG: spinlock lockup on CPU#0, kworker/0:2/1067, d8ab82a8 [  176.732539] [<80014a14>] (unwind_backtrace+0x0/0xec) from [<805b3fc8>] (dump_stack+0x20/0x24) [  176.741082] [<805b3fc8>] (dump_stack+0x20/0x24) from [<80322208>] (do_raw_spin_lock+0x118/0x158) [  176.749882] [<80322208>] (do_raw_spin_lock+0x118/0x158) from [<805b7874>] (_raw_spin_lock_irqsave+0x5c/0x68) [  176.759723] [<805b7874>] (_raw_spin_lock_irqsave+0x5c/0x68) from [<8002a020>] (__wake_up+0x2c/0x5c) [  176.768781] [<8002a020>] (__wake_up+0x2c/0x5c) from [<804a6de8>] (soc_resume_deferred+0x3c/0x2b0) [  176.777666] [<804a6de8>] (soc_resume_deferred+0x3c/0x2b0) from [<8004ee20>] (process_one_work+0x2e8/0x50c) [  176.787334] [<8004ee20>] (process_one_work+0x2e8/0x50c) from [<8004fd08>] (worker_thread+0x1c8/0x2e0) [  176.796566] [<8004fd08>] (worker_thread+0x1c8/0x2e0) from [<80053ec8>] (kthread+0xa4/0xb0) [  176.804843] [<80053ec8>] (kthread+0xa4/0xb0) from [<8000ea70>] (kernel_thread_exit+0x0/0x8) Signed-off-by: Eric Miao ---  sound/soc/soc-core.c |    6 ++++++  1 files changed, 6 insertions(+), 0 deletions(-) -- 1.7.5.4 diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index a5d3685..a25fa63 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -709,6 +709,12 @@ int snd_soc_resume(struct device *dev)        struct snd_soc_card *card = dev_get_drvdata(dev);        int i, ac97_control = 0; +       /* If the initialization of this soc device failed, there is no codec +        * associated with it. Just bail out in this case. +        */ +       if (list_empty(&card->codec_dev_list)) +               return 0; +        /* AC97 devices might have other drivers hanging off them so         * need to resume immediately.  Other drivers don't have that         * problem and may take a substantial amount of time to resume