From patchwork Wed Jan 14 13:56:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5631611 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D0426C058D for ; Wed, 14 Jan 2015 13:56:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 03893202FE for ; Wed, 14 Jan 2015 13:56:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3A02D20160 for ; Wed, 14 Jan 2015 13:56:56 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 25AEA2651AA; Wed, 14 Jan 2015 14:56:55 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id CA460265091; Wed, 14 Jan 2015 14:56:47 +0100 (CET) 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 C092126511F; Wed, 14 Jan 2015 14:56:45 +0100 (CET) Received: from mail-qg0-f53.google.com (mail-qg0-f53.google.com [209.85.192.53]) by alsa0.perex.cz (Postfix) with ESMTP id 86BB1265071 for ; Wed, 14 Jan 2015 14:56:38 +0100 (CET) Received: by mail-qg0-f53.google.com with SMTP id l89so6934793qgf.12 for ; Wed, 14 Jan 2015 05:56:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PmGy3tV2yLWaap16SagB1c82dLL4GJ2sO8NvHtaAeRo=; b=y10ethtHf2vsvgvDDwt+9F9O7GPkHZFIdAtWISy29gcUrtbniQI36X/S/NH7uku68I V/kDjLWVBRXgfyR7Kfems8jvQSeM06G7jl+BSLwsS+3eSo8+C8Fbhjjyu4rNcvtF/dyh 8+ujcwRDKbVTh0lztfRUAX4RLzjcSejGDEeRxnkfAFQ5Bsv0SS2R6lElcQJhjSzmwZ2i gQlf2DbrzpmbTFd1+6AfCGn1Rkup3kLjlllcG5L2br6Gk0/3BQ8Ug2ibzLHQNwhs2lf5 tVcVAPZlmhTBYDL/JbznKCB6khb9HxrTeNS9oJ3MRsU7ed3kAxkYe90uPCVAES6WsU18 BuOg== X-Received: by 10.140.81.166 with SMTP id f35mr6662064qgd.0.1421243797956; Wed, 14 Jan 2015 05:56:37 -0800 (PST) Received: from localhost.localdomain ([201.82.153.107]) by mx.google.com with ESMTPSA id 17sm20531215qgk.8.2015.01.14.05.56.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Jan 2015 05:56:37 -0800 (PST) From: Fabio Estevam To: broonie@kernel.org Date: Wed, 14 Jan 2015 11:56:22 -0200 Message-Id: <1421243782-26115-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: Fabio Estevam , alsa-devel@alsa-project.org, lars@metafoo.de, jiada_wang@mentor.com, nicoleotsuka@gmail.com, tiwai@suse.de Subject: [alsa-devel] [PATCH] ASoC: fsl: imx-wm8962: Set the card owner field 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 From: Fabio Estevam The following crash happens when trying to unload the snd_soc_imx_wm8962 module while playback is active: [ 208.666868] Unable to handle kernel paging request at virtc [ 208.674110] pgd = 80004000 [ 208.676867] [7f06541c] *pgd=4c334811, *pte=00000000, *ppte=00000000 [ 208.683211] Internal error: Oops: 80000007 [#1] SMP ARM [ 208.688445] Modules linked in: snd_soc_wm8962 snd_soc_fsl_ssi snd_soc_imx_audmux imx_pcm_fiq evbug] ... In order to avoid such problem, fill the card owner field as suggested by Lars-Peter Clausen: "But looking at the source it seems that this is a core feature of ALSA and at least for the card module itself it will do the ref-counting when a stream is started/stopped. And we even support setting the owner of a card in ASoC. It's just that pretty much no ASoC card driver bothers to set the owner field in the snd_soc_card struct. So this particular problem can be fixed by updating the imx-wm8962 driver to set the owner field." By doing as suggested, we no longer see the crash when attempting to unload the snd_soc_imx_wm8962 module while playback is active: $ modprobe -r snd_soc_imx_wm8962 modprobe: can't unload module snd_soc_imx_wm8962: Resource temporarily unavailable Reported-by: Jiada Wang Suggested-by: Lars-Peter Clausen Signed-off-by: Fabio Estevam --- sound/soc/fsl/imx-wm8962.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/imx-wm8962.c b/sound/soc/fsl/imx-wm8962.c index 4caacb0..cd146d4 100644 --- a/sound/soc/fsl/imx-wm8962.c +++ b/sound/soc/fsl/imx-wm8962.c @@ -257,6 +257,7 @@ static int imx_wm8962_probe(struct platform_device *pdev) if (ret) goto clk_fail; data->card.num_links = 1; + data->card.owner = THIS_MODULE; data->card.dai_link = &data->dai; data->card.dapm_widgets = imx_wm8962_dapm_widgets; data->card.num_dapm_widgets = ARRAY_SIZE(imx_wm8962_dapm_widgets);