Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp645359imb; Fri, 1 Mar 2019 10:04:29 -0800 (PST) X-Google-Smtp-Source: APXvYqwsnVofMlG1rXbIpY+sWX4un8uyGmsa6OK0feEiru7TWZTrL0NfHC/mQ1SMVMDaDYIV4Wzo X-Received: by 2002:a63:6c41:: with SMTP id h62mr5883406pgc.371.1551463469394; Fri, 01 Mar 2019 10:04:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551463469; cv=none; d=google.com; s=arc-20160816; b=igheA0Jt7jkhqHKKGNvnxh6q8E28/j6HbrNIRFb4Y6nE8eZ3rHkmFLgsYqKc5Sjk0t DjaANvcIboMI1GEJ/FYLmqBTavK49AwtUtyrXtE51F3Pwv7RV4CDn2ydzdn9kdraKt5g KZBzuvshiGQfivAoB0CXHDN30zo35gI5n8TEOqhjaW3vStE7JMAYN4DTcFY5t5OW1J5Q fNflJaossUEjqakWQKmEf3c5WckNkucES9RC1fqynU2KD2UH9nKSnIcMP4vF0fZKZKJc kix2KwtK7ln1eMwAHnxkImedf7btD7X0+5q1XXZFUbJs1q8QQ6Bpz6FDFJCd/uJUyClw FDKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YNzUlcboXEK2HdayycemQ+DLo43k1a8lwu4tdJryPoU=; b=A1ZxWqoFH98Yceyx6Vcn0ROD+ZvYJTBChx90CXUzo96B73uf7P0D/0dO2iBJtPoVw7 FkS0ZqEoyp/WIQNSwbvxC+ELK9NnlfjK9fJJXmUrIjkrcHfiljSwr4d1vG6Zio5vo6gy /p1Ym2QZETTng79Hqim6gv4n52K+7igJEXRiQygG0KUp+rrPUFGdCqe8UQmCCmBda2To clta1I6uV9/XSWQzlQCWULWyV6L+klbXNy34j/NrEw0UwrEbWXsXvsIwJW9Rnumj/iLh BhcybanEV6rOVvGMdKkkeDoUUupSDn4bk9u6wVHRupGbynchD5zTX+M1uMGCeRWAVlZe UZaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dSg0PDlA; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12si11369574pgf.184.2019.03.01.10.04.13; Fri, 01 Mar 2019 10:04: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=@google.com header.s=20161025 header.b=dSg0PDlA; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388032AbfCAR3M (ORCPT + 99 others); Fri, 1 Mar 2019 12:29:12 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:39054 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728149AbfCAR3L (ORCPT ); Fri, 1 Mar 2019 12:29:11 -0500 Received: by mail-ot1-f67.google.com with SMTP id e15so12059463otk.6 for ; Fri, 01 Mar 2019 09:29:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YNzUlcboXEK2HdayycemQ+DLo43k1a8lwu4tdJryPoU=; b=dSg0PDlA6P5MMQ+jekn5xwLDWY6ItKEvK1wPMYnY4EBnJyEMX/an5sY5bK/87i6CSx vfXBq7Nxb9CVPZhq386djlljxjvzghpGhYLYbOoWwQA680khCUK/uZ5ajOQKSTpvFK08 4X3NazcxzKi6I0+NPp3fOK0Vf5DtL2dZqtVQ2UPb0xalDZmYcd4vBW+ml2nAjtud27mT A3OKGdxj4lbj9s4ABuAjA/1Uq/pYgXf3NwYpqkL7T9outbOXOZW/JPNMeIWqn5E1d9qn 8SW1pHVYFtznPFXrPZb6UD5asm1+P0CaUQjB4JOSbUCdzuKfqS9wGw2nyMcF0jBPBLUi ry3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YNzUlcboXEK2HdayycemQ+DLo43k1a8lwu4tdJryPoU=; b=AkLMWuRPU6CE9odEederXyQu3ySD34IR1mCzZKiQ7AcqRrxzAnIwbgrysfnX5gpW9O kzyKYpE4yNXS48Jqbk8YMwGH/FTmKEUqOsqzIkKhvYj6VSyYdagtFdhJ9gD++PkDLOU+ jaRXRbo2SFRFFp71orpXV0JUwYbePVrG7EzndsWr/mwt+lhESIseaN9iCMBKgwqfZavE CwXCAvmUps+1vUiEIP10FS8BZWXhcdbQf/OyELKlhrnC9I2kGs5C7UMCN+DcW+I6R80S W++MD1jt2r/oOiQQ9oJIi9uM2VGA/tNId7yKi0XcXihFFElMPeKX99THIFF/ZsLwbsry SaXA== X-Gm-Message-State: APjAAAXOL9N4mkmWwBOO5XXZ61+2J2124P6gJlSA/xYIM5T0kQ3IpghN betMfTNfDThz9dekll/2fJmDUSpNCKDFs+LexIbxiQ== X-Received: by 2002:a9d:644c:: with SMTP id m12mr4136883otl.59.1551461350137; Fri, 01 Mar 2019 09:29:10 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Curtis Malainey Date: Fri, 1 Mar 2019 09:28:59 -0800 Message-ID: Subject: Re: Regression: ASoC: soc-core: clear platform pointers on error To: Jon Hunter Cc: Mark Brown , Curtis Malainey , linux-tegra , Linux Kernel Mailing List , "alsa-devel@alsa-project.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 1, 2019 at 4:07 AM Jon Hunter wrote: > > 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. > You are indeed correct. That should be there. I think I got confused when I was doing my initial debugging on our local 4.19 kernel as the cleanup code had changed when I was testing on -next and forgot to add this to my upstream patch and it wasn't caught in my testing. Thanks for catching this. I went back and looked and it appears that is the only call to soc_init_dai_link that is outside soc_instantiate_card and therefore not caught by the original patch's cleanup routine. Do you want to submit a patch and I'll add my signoff? > 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