Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4652837imu; Tue, 8 Jan 2019 04:05:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN5rQAq6axc4wOgt6NRZ0k5n5059XIfIA2xtIROX0OyqhcpeFIN6b6kvXFj9zrfWFXO3ZfmB X-Received: by 2002:a17:902:5a86:: with SMTP id r6mr1433757pli.301.1546949104846; Tue, 08 Jan 2019 04:05:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546949104; cv=none; d=google.com; s=arc-20160816; b=vGmaxfQJp2dB+dgO6LbaVjOX1BoWdPtWg+Hh9UHe1Aojqhw6G2eyKQyZXyJ5tesXg1 gCzlje6e4yOL5k3ccRpmPVClDS/af3YHm8LwAfG1JHeDXRYBtR2NJj494dPy0uHpgLie VJTXx3t1katE7Mv4T4CBvzWqZt0ZM0JpJHm5FhnVS331kn5T3N6Ns2DDjb9NwQJuyzCR pXgwBvdNjkDS90b8RI7R02GOjMufW6oO+BKED3MzT/JwgeVa0A/qMcZtZJhci5vVcgwL 51pSZpu7ZMdEcAKGxG+vpaIuWBfKAkbgWRZRyvI/lzvQ1HCecnwk1PXDm1jmKrLvkRpv z6bg== 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:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=0fi8se1lvqJsCh7ZIheBx8IitL/cp4bxgHeXLMfF95c=; b=VM26QeK6E8GNgztQlRHTmLLsvQHxZXT9cuMr4IwuwcgPfln4f4zV0MsF6V4dhAROdQ Zg9VXwPpZbWIkqyHlFeR6Qo4eNHIVRAUUqlsGgPJTBW1wrnTv9BkYR0Ozq379luCbKu2 KCGuMRY3g0hpBP2aGpoSaYRrJnExJay+Ubc52UFZr1cXU5Xo2ZZannMdSGGQe2/bRep4 LwyaHJFp8BwrTXCRG7yNWLfOijhMLm6JPGPZY4Kw7xLu+Y0WJSpLjohxZXIuXeVYgmoh /zU4X4FtnVRFsMK21pH+xpwK31oRL1lcQwusHxwPvfMa7K6SRpdtH9iM3wSOSmFisnvY bWOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=IJllqTI0; 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 m1si53611496pgm.194.2019.01.08.04.04.49; Tue, 08 Jan 2019 04:05:04 -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=IJllqTI0; 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 S1728859AbfAHMDa (ORCPT + 99 others); Tue, 8 Jan 2019 07:03:30 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:8269 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728573AbfAHMDa (ORCPT ); Tue, 8 Jan 2019 07:03:30 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 08 Jan 2019 04:03:13 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 08 Jan 2019 04:03:29 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 08 Jan 2019 04:03:29 -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.1395.4; Tue, 8 Jan 2019 12:03:27 +0000 Subject: Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement From: Jon Hunter To: Kuninori Morimoto CC: Mark Brown , Liam Girdwood , , Matthias Reichl , , Marcel Ziswiler , Takashi Iwai , , Marcel Ziswiler References: <20181018111829.27056-1-marcel@ziswiler.com> <20181018111829.27056-4-marcel@ziswiler.com> <20181021112301.GC8554@sirena.org.uk> <20181218174040.k7u26vnnoplllnwb@camel2.lan> <952471da-b355-6471-6c19-5120d6704f81@nvidia.com> <87lg3vuc7p.wl-kuninori.morimoto.gx@renesas.com> Message-ID: Date: Tue, 8 Jan 2019 12:03:25 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL108.nvidia.com (172.18.146.13) 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=1546948993; bh=0fi8se1lvqJsCh7ZIheBx8IitL/cp4bxgHeXLMfF95c=; h=X-PGP-Universal:Subject:From:To:CC:References:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=IJllqTI0fFwS8uw5zWYUFz8j34fz6MWzKgK1xWJIqEt3iR+DHT2X3/YMsK2aeqve8 V+KahORbxLUgii3wgijQTe94VPbXvHtnLlkLSevUVdBaFOz6ihntmh3sF2gqqZ9dDc OCH7TVAYrBo6AzeJdE41i7Yfqqw4t491FOPUl6qcpXKeUc/v2QSLokhVurAW/M9LLU QH2mwzbBs3fISCeVYKppylfyaaibvo8jemsgeLWuBJBfjnUP2aV4hMiCa1oo+w9NUf XB3yXZ3jRLNR/W8MuU88bCzIiwxd2jEg3kXbCbNPeuxJnjfWFa1+VhB60FEBFq4nQz R8Q1AK/Dt6C4w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/01/2019 10:50, Jon Hunter wrote: > Hi Kuninori, > > On 08/01/2019 02:25, Kuninori Morimoto wrote: >> >> Hi Jon >> >>> I have been looking at this again recently. I see this issue occurring >>> all the time when the sound drivers are built as kernel modules and >>> probing the sound card is deferred until the codec driver has been loaded. >>> >>> Commit daecf46ee0e5 ("ASoC: soc-core: use snd_soc_dai_link_component for >>> platform") appears to introduce the problem because now we allocate the >>> 'snd_soc_dai_link_component' structure for the platform we attempt to >>> register the soundcard but we never clear the freed pointer on failure. >>> Therefore, we only actually allocate it the first time. There is no easy >>> way to clear this pointer for the memory allocated because this is done >>> before the dai-links have been added to the list of dai-links for the >>> soundcard. >>> >>> I don't see an easy solution that will be 100% robust unless you do opt >>> for copying all the dai-link info from the platform (but this is >>> probably not a trivial fix). >>> >>> Do you envision a fix any time soon, or should we be updating all the >>> machine drivers to populate the platform snd_soc_dai_link_component so >>> that it is handled by the machine drivers are not the core? >> >> Thank you for pointing it. >> Indeed it is mess. >> I think coping info is nice idea, >> but it is not easy so far, and it uses much memory... >> >> I didn't test this, but can below patch solve your issue ? > > I will give it a try and let you know. Yes so this does workaround the problem. However, per my previous comments, I would like to explore whether it is necessary to allocate the platform link component or if it can be static. Cheers Jon -- nvpublic