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: 1050121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nvidia.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nvidia.com header.i=@nvidia.com header.b="n1CZpt3K"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 449p7b53FDz9s3q for ; Fri, 1 Mar 2019 23:07:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727991AbfCAMHH (ORCPT ); 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-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== Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@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. 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);