From patchwork Thu Dec 1 05:53:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Miao X-Patchwork-Id: 5415 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 4F69E23E19 for ; Thu, 1 Dec 2011 05:53:34 +0000 (UTC) Received: from mail-lpp01m010-f52.google.com (mail-lpp01m010-f52.google.com [209.85.215.52]) by fiordland.canonical.com (Postfix) with ESMTP id 2DB9DA1826A for ; Thu, 1 Dec 2011 05:53:34 +0000 (UTC) Received: by laah2 with SMTP id h2so787929laa.11 for ; Wed, 30 Nov 2011 21:53:33 -0800 (PST) Received: by 10.152.144.136 with SMTP id sm8mr3500114lab.33.1322718813865; Wed, 30 Nov 2011 21:53:33 -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.152.41.198 with SMTP id h6cs48465lal; Wed, 30 Nov 2011 21:53:32 -0800 (PST) Received: by 10.52.97.34 with SMTP id dx2mr4912312vdb.3.1322718810765; Wed, 30 Nov 2011 21:53:30 -0800 (PST) Received: from mail-vx0-f178.google.com (mail-vx0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id ka1si1184156vcb.91.2011.11.30.21.53.30 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Nov 2011 21:53:30 -0800 (PST) Received-SPF: pass (google.com: domain of eric.y.miao@gmail.com designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of eric.y.miao@gmail.com designates 209.85.220.178 as permitted sender) smtp.mail=eric.y.miao@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by vcbfo11 with SMTP id fo11so1366030vcb.37 for ; Wed, 30 Nov 2011 21:53:30 -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=SJq1l9nJYevT95pr2yVb9ZPDHnJde3f/90gITSBR9YI=; b=hCogXVhnwnIYf74B3O4qiiHhtrfyk+be+JbWLFuvXx+gISkcjHJs84S1wGaExx+wKB Y0n1Y8iGyhwjEgPGqRaxaBvtRAaWB20t6r1D3cbtI4KjvOUpZg6yZTAMfZvDD3QCfPLE D5OgRw1y81n4xWkXCCOOHCV2R9pUBNmS7cfT0= Received: by 10.52.30.130 with SMTP id s2mr4830003vdh.55.1322718810243; Wed, 30 Nov 2011 21:53:30 -0800 (PST) MIME-Version: 1.0 Sender: eric.y.miao@gmail.com Received: by 10.52.67.201 with HTTP; Wed, 30 Nov 2011 21:53:09 -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: Thu, 1 Dec 2011 13:53:09 +0800 X-Google-Sender-Auth: fH0tUUnU7FVb1El2-jTb90jSAN0 Message-ID: Subject: [PATCH] ASoC: skip resume of soc-audio devices without codecs To: patches@linaro.org 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