Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp436658imb; Fri, 1 Mar 2019 04:52:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IYoT33IjgQrUeHGm5jVSSgoAQOKdCRrLk91Jre6BWk2P4SfDbGyMDMuca3y5+rjzSzIqDfb X-Received: by 2002:a62:20d1:: with SMTP id m78mr5322683pfj.250.1551444749471; Fri, 01 Mar 2019 04:52:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551444749; cv=none; d=google.com; s=arc-20160816; b=Fr45/64nF6hV2tj2d4WjCBFdWyufbRC1xTk2vMIyms09FWooO+7joaPlhtvPgxYlor FFAG9oDOudRKzGwglFKwF5riaYfs0JM879dWzomQYHeET4gIukA6R2IY48GK/i0bnuBZ 2YTwtkDf1RCQx/k1tgqpFFVwc65AUJECClSbrxaQPID72raQsDzOL1e9z3oJdh/lYGk2 NOqL3LEHk7lx/fpoIer0KaxZKOIwk5ADi+TGDQX22KnLIOinXpMf9ooIBgVAhIytQG7c WY0kfkdNsxDVBVj+/uLBtVu52I7+KqSLENCFlAMjjVFC+W2scHs1J/q0EsWxviFA20EB s3LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:to; bh=7wKq9d+Skb4EVsQ2Ggh7jucL0Vmi8f4T1ANYNVgzSnE=; b=iftCdWIzVBpzewiEWbNsOYUA3zZaBgSmkt1V6c3r46ilDTDbS7g1JBZoknrQ5YiWY6 k+DtYoZ7KHU3BMzU0pyh+banMMovn2WpY7kRrchR6upx4Um/DtIhlhYcrPIPXHw31q6i v2FflF+ZJMOjNQM7R0RvtA4MzgRXf1gyVyD8+11pggCa4QUqh6w1CgNpVhPPmFkKsEvF mFxAI0AuCyN0y7EwoW/wON27Lhu1YRhectRkaLtu39r4nfsv2M5FryqxXh4XvfW21ypM rNLdAaW9/eXh+S3NVpTuLgbpRg9HABtbzl+gzWKkXQuc+rpizfy0oKuI1CcEFra01jXo oMGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=n1CZpt3K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e125si9995726pgc.201.2019.03.01.04.52.14; Fri, 01 Mar 2019 04:52:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=n1CZpt3K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388109AbfCAMHH (ORCPT + 99 others); Fri, 1 Mar 2019 07:07:07 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:1931 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727952AbfCAMHG (ORCPT ); Fri, 1 Mar 2019 07:07:06 -0500 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 Subject: Regression: ASoC: soc-core: clear platform pointers on error 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-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit 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== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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); Cheers Jon -- nvpublic