Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4726265ybv; Mon, 17 Feb 2020 04:48:39 -0800 (PST) X-Google-Smtp-Source: APXvYqwQ7mqaMam24Zd/HZKTtX2XS5Mu6sb6HI2BTZdsWRQPeh9G3IwTtMJwVFfFnRI9ivQljc+U X-Received: by 2002:a05:6830:1e37:: with SMTP id t23mr12433968otr.16.1581943719791; Mon, 17 Feb 2020 04:48:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581943719; cv=none; d=google.com; s=arc-20160816; b=aStqFanr+TbTS0KtpAuKLcDUo9v9fmBZtc6jO56GstVcvuEF0gZ+W0R7EvtPzQ9fMi ItyeUeAVPG5qN4FH5Fd5OEYoJGq5NRnr2leF1vlsz5JobVLxgZRcdu1YDIYzTIrWAlMX YdNDGX9NM8wqDrbdfKwBXIBQvtdMGhIftd/A7OZTNq1hEhJT4q09Rcp3OsCGQp3NJC42 AkN74ubnwTXEeBUXoektowj3km87zoAxeq4jMMIr917LeWe6TWhdtlxFcExXanX8LCrq VYvksKQ/jquxGS6UeN0G8QpZ8IYunTGBpaMqFyIRnWIlgTpXa3PdOKtBp7R67HdMV6Ut 4XcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=IZX0VHNQ04ovY+9mwNorEVDKkJSLIVpz2JzA6c2FtEE=; b=cWZkS+LOoaDPdl6X4edQle97BblsUVqqG/ZWP1MKb7iO9+l1ai5dQznM6QROOXbCOT jsHhKdjcohF5kuPmOasv3vwLZU5Rap+X00U9RKEg2Zgex6vbY4cfS5QdRKTptQzRqzp3 5gM77IvCpDte4kEHeJYJpDfaSQ/dh8PS+gI+QLjS9bZA8pFew0q3JgoOPc4K8Fl/voHe mrluzc9uAax+D3jnQHPAyCkA/7e7Xtfi0H2ugu4b1hocKI/iX2e8ZHQKYw6wsEpbdvMa FLHnj29ST7ovK866quQtCiI0sEQOo7X0uU46cISacLvGe/2Rj3E3siP3PpXO3FLO60db RIhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=gkQHlWIq; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h21si144530otk.196.2020.02.17.04.48.27; Mon, 17 Feb 2020 04:48:39 -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=@samsung.com header.s=mail20170921 header.b=gkQHlWIq; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbgBQMNk (ORCPT + 99 others); Mon, 17 Feb 2020 07:13:40 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:51004 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726710AbgBQMNj (ORCPT ); Mon, 17 Feb 2020 07:13:39 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200217121337euoutp02990e3d6ad7c80dc8c921dc69cfabbc1f~0L4UMRNqz1155611556euoutp022 for ; Mon, 17 Feb 2020 12:13:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200217121337euoutp02990e3d6ad7c80dc8c921dc69cfabbc1f~0L4UMRNqz1155611556euoutp022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1581941617; bh=IZX0VHNQ04ovY+9mwNorEVDKkJSLIVpz2JzA6c2FtEE=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=gkQHlWIqMdGE9/NyVIz2Cg9fOKCts1JMvwCJdspAr4ZNO9HgrQFZNU5dXmpSdAMP1 ibMPYBhjU0eMEUZTtqyZZux/Ot4xrQBVP1Rj6cUkKKFDwe5YsGqc64wIltgJs08kNX MH6FO8oT0/mcnkSKKc+oCZcUP7Pheu1dMjM0Z9CQ= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200217121337eucas1p26fe5dec8f86c1da7180857fbfbc6d3cc~0L4T3-87u0285802858eucas1p2n; Mon, 17 Feb 2020 12:13:37 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 4E.19.60698.1738A4E5; Mon, 17 Feb 2020 12:13:37 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200217121336eucas1p2deb35417f5c4646a89762fd6146c3cf9~0L4Thf2a82297222972eucas1p2X; Mon, 17 Feb 2020 12:13:36 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200217121336eusmtrp1db1d3a82d19d521918559f67c63759cc~0L4Tg4sHA0929309293eusmtrp1O; Mon, 17 Feb 2020 12:13:36 +0000 (GMT) X-AuditID: cbfec7f5-a0fff7000001ed1a-26-5e4a8371f76e Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 70.E2.07950.0738A4E5; Mon, 17 Feb 2020 12:13:36 +0000 (GMT) Received: from [106.120.51.15] (unknown [106.120.51.15]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200217121336eusmtip138080665b5ed946b60d82a82227e6c65~0L4TMNMMU0478804788eusmtip1N; Mon, 17 Feb 2020 12:13:36 +0000 (GMT) Subject: Re: Applied "ASoC: core: ensure component names are unique" to the asoc tree To: Mark Brown , Jerome Brunet Cc: alsa-devel@alsa-project.org, Liam Girdwood , linux-kernel@vger.kernel.org, linux-rpi-kernel From: Marek Szyprowski Message-ID: Date: Mon, 17 Feb 2020 13:13:34 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Transfer-Encoding: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFKsWRmVeSWpSXmKPExsWy7djP87qFzV5xBk9ecllcuXiIyWLqwyds Fm8eHWG2+Halg8ni8q45bBYTb29gd2Dz2PC5ic3j/Y1Wdo+ds+6ye2xa1cnmsXlJvcfnTXIB bFFcNimpOZllqUX6dglcGUc2VBZ8d6k4c+ocewPjF6suRk4OCQETiW23njF1MXJxCAmsYJT4 eWcWlPOFUeLAiTcsEM5nRokz266zw7Qc6X3ICpFYzijx/ONcZgjnLaPEorVbGUGqhAXCJZbv nQLUzsEhIuApceSWNEgNs8B8Romjn6eDTWITMJToetvFBmLzCthJzFk1ESzOIqAqcfXBQlYQ W1QgVmL2ysMsEDWCEidnPgGzOQWcJbbv2wBWzywgL9G8dTYzhC0ucevJfLAfJAQ2sUv0bn7K BHG2i8S2w7uhXhCWeHV8C5QtI3F6cg8LREMzo8TDc2vZIZweRonLTTMYIaqsJe6c+8UG8g6z gKbE+l36EGFHiUezmsC+lBDgk7jxVhDiCD6JSdumM0OEeSU62oQgqtUkZh1fB7f24IVLzBMY lWYheW0WkndmIXlnFsLeBYwsqxjFU0uLc9NTi43zUsv1ihNzi0vz0vWS83M3MQJT0Ol/x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DI9fyvPyEbQgSEXLSWSoveMfG1OST1NmLhT55HC2+t7j5n+O+Lq6THbqcZGWYP Fp9n69q58Yf6jUf2Dvv4JNXM9+lu/x8sc+yd3lGvw3PjA3K+xigm3aruWBWd+I+1xorhuRJL cUaioRZzUXEiAJoemR/OAgAA X-CMS-MailID: 20200217121336eucas1p2deb35417f5c4646a89762fd6146c3cf9 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200217121336eucas1p2deb35417f5c4646a89762fd6146c3cf9 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200217121336eucas1p2deb35417f5c4646a89762fd6146c3cf9 References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear All, On 14.02.2020 21:56, Mark Brown wrote: > The patch > > ASoC: core: ensure component names are unique > > has been applied to the asoc tree at > > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git > > All being well this means that it will be integrated into the linux-next > tree (usually sometime in the next 24 hours) and sent to Linus during > the next merge window (or sooner if it is a bug fix), however if > problems are discovered then the patch may be dropped or reverted. > > You may get further e-mails resulting from automated or manual testing > and review of the tree, please engage with people reporting problems and > send followup patches addressing any issues that are reported if needed. > > If any updates are required or you are submitting further changes they > should be sent as incremental updates against current git, existing > patches will not be replaced. > > Please add any relevant lists and maintainers to the CCs when replying > to this mail. > > Thanks, > Mark > > From b2354e4009a773c00054b964d937e1b81cb92078 Mon Sep 17 00:00:00 2001 > From: Jerome Brunet > Date: Fri, 14 Feb 2020 14:47:04 +0100 > Subject: [PATCH] ASoC: core: ensure component names are unique > > Make sure each ASoC component is registered with a unique name. > The component is derived from the device name. If a device registers more > than one component, the component names will be the same. > > This usually brings up a warning about the debugfs directory creation of > the component since directory already exists. > > In such case, start numbering the component of the device so the names > don't collide anymore. > > Signed-off-by: Jerome Brunet > Link: https://lore.kernel.org/r/20200214134704.342501-1-jbrunet@baylibre.com > Signed-off-by: Mark Brown This patch landed in today's linux-next and I've noticed that it breaks registration of VC4 DRM driver on Raspberry Pi3 boards (I've compiled kernel from bcm2835_defconfig): sysfs: cannot create duplicate filename '/devices/platform/soc/3f902000.hdmi/dma:audio-rx' CPU: 0 PID: 67 Comm: kworker/0:2 Tainted: G        W 5.6.0-rc2-next-20200217 #314 Hardware name: BCM2835 Workqueue: events deferred_probe_work_func Backtrace: [] (dump_backtrace) from [] (show_stack+0x20/0x24)  r7:eb73d5c0 r6:eb53a8f0 r5:eb73d5c0 r4:eb4d3000 [] (show_stack) from [] (dump_stack+0x20/0x28) [] (dump_stack) from [] (sysfs_warn_dup+0x60/0x74) [] (sysfs_warn_dup) from [] (sysfs_do_create_link_sd+0xa4/0xc0)  r7:eb73d5c0 r6:eb53a8f0 r5:eb6becb8 r4:ffffffef [] (sysfs_do_create_link_sd) from [] (sysfs_create_link+0x34/0x44)  r9:eb698c40 r8:c093e47c r7:00000000 r6:eb537e10 r5:eb6f9900 r4:eb537e10 [] (sysfs_create_link) from [] (dma_request_chan+0x1b8/0x208) [] (dma_request_chan) from [] (snd_dmaengine_pcm_register+0xf4/0x1bc)  r10:c0963460 r9:eb537e10 r8:c093e47c r7:00000000 r6:eb537e10 r5:eb6f9900  r4:c093e468 [] (snd_dmaengine_pcm_register) from [] (devm_snd_dmaengine_pcm_register+0x4c/0x84)  r10:eb715c4c r9:c093e3d4 r8:eb537e00 r7:00000000 r6:eb537e10 r5:eb7ca240  r4:c093e468 [] (devm_snd_dmaengine_pcm_register) from [] (vc4_hdmi_bind+0x3a8/0x590)  r7:eb537e10 r6:eb537e10 r5:eb715440 r4:eb715c40 [] (vc4_hdmi_bind) from [] (component_bind_all+0x128/0x238)  r10:eb7267c0 r9:00000008 r8:eb73f800 r7:00000018 r6:00000000 r5:eb7016c0  r4:eb6c9240 [] (component_bind_all) from [] (vc4_drm_bind+0xe4/0x17c)  r9:00000008 r8:eb6c88c0 r7:eb6a2840 r6:eb53b210 r5:00000000 r4:eb73f800 [] (vc4_drm_bind) from [] (try_to_bring_up_master+0x190/0x264)  r7:eb6a2840 r6:000000a8 r5:eb7267c0 r4:eb6c9240 [] (try_to_bring_up_master) from [] (__component_add+0x80/0x114)  r10:c0d57488 r9:00000012 r8:00000000 r7:eb6c9240 r6:c093e924 r5:c0d572f8  r4:eb7267c0 [] (__component_add) from [] (component_add+0x1c/0x20)  r7:c0d56f7c r6:c0d56f7c r5:eb534a10 r4:00000000 [] (component_add) from [] (vc4_vec_dev_probe+0x20/0x28) [] (vc4_vec_dev_probe) from [] (platform_drv_probe+0x58/0xa8) [] (platform_drv_probe) from [] (really_probe+0x1a8/0x428)  r7:c0d56f7c r6:00000000 r5:c0e579b8 r4:eb534a10 [] (really_probe) from [] (driver_probe_device+0x158/0x1ac)  r9:00000000 r8:00000001 r7:eb70fe9c r6:c0d56f7c r5:c0d56f7c r4:eb534a10 [] (driver_probe_device) from [] (__device_attach_driver+0xb0/0xf8)  r9:00000000 r8:00000001 r7:eb70fe9c r6:c0d56f7c r5:eb534a10 r4:00000001 [] (__device_attach_driver) from [] (bus_for_each_drv+0xa0/0xc8)  r7:c04a2990 r6:eb70fe9c r5:c0d04248 r4:00000000 [] (bus_for_each_drv) from [] (__device_attach+0xa4/0x158)  r7:eb534a54 r6:c0d04248 r5:c0d576a8 r4:eb534a10 [] (__device_attach) from [] (device_initial_probe+0x1c/0x20)  r8:eb9c7300 r7:00000000 r6:eb534a10 r5:c0d576a8 r4:eb534a10 [] (device_initial_probe) from [] (bus_probe_device+0x38/0x90) [] (bus_probe_device) from [] (deferred_probe_work_func+0x70/0xb0)  r7:00000000 r6:c0d57478 r5:c0d5746c r4:eb534a10 [] (deferred_probe_work_func) from [] (process_one_work+0x1a8/0x2ac)  r7:00000000 r6:c0d0c8a4 r5:c0d57484 r4:eb6ed880 [] (process_one_work) from [] (worker_thread+0x1f0/0x2e8)  r10:00000000 r9:c0d156e0 r8:c0d0c8b8 r7:c0d156e0 r6:c0d0c8a4 r5:eb6ed894  r4:eb6ed880 [] (worker_thread) from [] (kthread+0x120/0x130)  r10:00000000 r9:eb6f5018 r8:eb4e9e98 r7:c0136bec r6:eb6ed880 r5:eb6e6b40  r4:eb6f5000 r3:00000000 [] (kthread) from [] (ret_from_fork+0x14/0x2c) Exception stack(0xeb70ffb0 to 0xeb70fff8) ffa0:                                     00000000 00000000 00000000 00000000 ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ffe0: 00000000 00000000 00000000 00000000 00000013 00000000  r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c013b480 r4:eb6e6b40 vc4_hdmi 3f902000.hdmi: Cannot create DMA dma:audio-rx symlink vc4_hdmi 3f902000.hdmi: ASoC: CODEC DAI vc4-hdmi-hifi not registered vc4_hdmi 3f902000.hdmi: Could not register sound card: -517 vc4-drm soc:gpu: failed to bind 3f902000.hdmi (ops vc4_hdmi_ops): -517 vc4-drm soc:gpu: master bind failed: -517 Reverting this patch fixes vc4-drm driver registration and initialization. If I find some spare time I will debug this issue further, but it looks that it is somehow related to deferred probe. > --- > sound/soc/soc-core.c | 29 ++++++++++++++++++++++++++++- > 1 file changed, 28 insertions(+), 1 deletion(-) > > diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c > index 03b87427faa7..6a58a8f6e3c4 100644 > --- a/sound/soc/soc-core.c > +++ b/sound/soc/soc-core.c > @@ -2446,6 +2446,33 @@ static int snd_soc_register_dais(struct snd_soc_component *component, > return ret; > } > > +static char *snd_soc_component_unique_name(struct device *dev, > + struct snd_soc_component *component) > +{ > + struct snd_soc_component *pos; > + int count = 0; > + char *name, *unique; > + > + name = fmt_single_name(dev, &component->id); > + if (!name) > + return name; > + > + /* Count the number of components registred by the device */ > + for_each_component(pos) { > + if (dev == pos->dev) > + count++; > + } > + > + /* Keep naming as it is for the 1st component */ > + if (!count) > + return name; > + > + unique = devm_kasprintf(dev, GFP_KERNEL, "%s-%d", name, count); > + devm_kfree(dev, name); > + > + return unique; > +} > + > static int snd_soc_component_initialize(struct snd_soc_component *component, > const struct snd_soc_component_driver *driver, struct device *dev) > { > @@ -2454,7 +2481,7 @@ static int snd_soc_component_initialize(struct snd_soc_component *component, > INIT_LIST_HEAD(&component->card_list); > mutex_init(&component->io_mutex); > > - component->name = fmt_single_name(dev, &component->id); > + component->name = snd_soc_component_unique_name(dev, component); > if (!component->name) { > dev_err(dev, "ASoC: Failed to allocate name\n"); > return -ENOMEM; Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland