From patchwork Fri Mar 1 12:07:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 10835027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DC841390 for ; Fri, 1 Mar 2019 12:08:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37F0F2EFA7 for ; Fri, 1 Mar 2019 12:08:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 360552EFB1; Fri, 1 Mar 2019 12:08:09 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 21BC62EFA7 for ; Fri, 1 Mar 2019 12:08:07 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E499D850; Fri, 1 Mar 2019 13:07:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E499D850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1551442085; bh=q8/oviFBuM2YzL4xZlTa8WXE0V81eKQNZaaxBdrhVMk=; h=To:From:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=ZdvHdTaf3ebT3Y+F8m4A3wcZf+M5pp9JtxoURUqvkCGQqJc+ZfSkwPTAgENmZMLNp MQSXucGsch3kEmDn1jA9RPYI8ElkJxzGsA6AVHPSuDdU7V530Zqq7zTOHmzC80/04Q oTX418op4X7/jo7V8eHGAoEKBEqSC2ZrHTarygJg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 43AE3F896B8; Fri, 1 Mar 2019 13:07:14 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4051DF896DF; Fri, 1 Mar 2019 13:07:12 +0100 (CET) Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1360DF896B8 for ; Fri, 1 Mar 2019 13:07:08 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1360DF896B8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="n1CZpt3K" Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 01 Mar 2019 04:07:15 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Fri, 01 Mar 2019 04:07:06 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Fri, 01 Mar 2019 04:07:06 -0800 Received: from [10.21.132.148] (10.124.1.5) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 1 Mar 2019 12:07:03 +0000 To: Mark Brown , Curtis Malainey , linux-tegra , Linux Kernel Mailing List , "alsa-devel@alsa-project.org" From: Jon Hunter Message-ID: Date: Fri, 1 Mar 2019 12:07:02 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL101.nvidia.com (172.20.187.10) Content-Language: en-US DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1551442035; bh=7wKq9d+Skb4EVsQ2Ggh7jucL0Vmi8f4T1ANYNVgzSnE=; h=X-PGP-Universal:To:From:Subject:Message-ID:Date:User-Agent: MIME-Version:X-Originating-IP:X-ClientProxiedBy:Content-Type: Content-Language:Content-Transfer-Encoding; b=n1CZpt3KmqG6pA+7VH8fjtFOxGwwdUHGbOSzfUIji2s6GpAq69eLMU+H8qWVYwN0d U13zxqh1OEWU3D2rnJNK0S68rM232dt8c9zMlIeqN08RTMCrDecIzY090LCbr+akPm TNXJQDbt4hFivirTs87E9clhgw4oCCVA7Noy8nOsmR2/8uBQBWI0BCslubMg8JSj2u LeWdmqYQ/a1be6+4P2Bruyza0lRCBLroyjmOS8hf0avcfDHFDp5nYKyfgUL49dr8jp O5Y5cA8YcTB5QfHTwcmbYtnkmamm2FweXo9KY8vUy28t5UCweQgSnkA5t7a2yMaR7U DbPptX24RYqag== Subject: [alsa-devel] Regression: ASoC: soc-core: clear platform pointers on error X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi Mark, Curtis, I am seeing a regression on -next where the soundcard on one of our Tegra boards fails to initialise following a probe deferral. The bisect points to the commit 78a24e10cd94420f1b4e2dc5923ae7109e2aaba1 ('ASoC: soc-core: clear platform pointers on error') and reverting this on top of -next fixes the problem. Looking at the bootlog from the failure I see ... tegra-snd-wm8903 sound: ASoC: failed to init link WM8903 tegra-snd-wm8903 sound: snd_soc_register_card failed (-517) tegra30-i2s 70080400.i2s: DMA channels sourced from device 70080000.ahub tegra-snd-wm8903 sound: ASoC: Both platform name/of_node are set for WM8903 tegra-snd-wm8903 sound: ASoC: failed to init link WM8903 tegra-snd-wm8903 sound: snd_soc_register_card failed (-22) tegra-snd-wm8903: probe of sound failed with error -22 With the above change I see soc_cleanup_platform() is ever being called when the probe is deferred and hence leads to the failure. Note that the initial failure, "ASoC: failed to init link WM8903" occurs very early in snd_soc_register_card() when initialising the prelinks. The following fixes it, but I have not scrutinised the code to see if there are other exit points that we need to handle. Cheers Jon diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 93d316d5bf8e..6f66beb0c3ae 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2797,6 +2797,7 @@ int snd_soc_register_card(struct snd_soc_card *card) ret = soc_init_dai_link(card, link); if (ret) { + soc_cleanup_platform(card); dev_err(card->dev, "ASoC: failed to init link %s\n", link->name); mutex_unlock(&client_mutex);