Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp201808imu; Tue, 8 Jan 2019 17:53:26 -0800 (PST) X-Google-Smtp-Source: ALg8bN5gxRpcy83Bffc6GU/YdA2xYHLM4I8SAPQSkhc3X4xwpWqppaOnMncIS9L3Lvz1PSarn8BF X-Received: by 2002:a63:cf48:: with SMTP id b8mr3717855pgj.17.1546998806069; Tue, 08 Jan 2019 17:53:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546998806; cv=none; d=google.com; s=arc-20160816; b=GbvpE8bdsfoVqCi99DtTQLOmJxyA36QBnL4h+IfnYmKpIZUf+r/9mEzMWyzHe7H4aF Xo0BFYagmAA1J12lEtz3Wo7DUkmpz/IxfH2YgJPSuq/iolhSLgM1TWDvpRrmdmDq8P5R 4sJ0RTp4Z+ChIOk7c5Nugt3l7AYl4H9KuqOCPMgIoqmPVuHCe7Xgy6yhq6/Mb2D13BHt 7l8sv3gwGbuKAWm7/WGxD0e7GnbFdfyDrle77ABBqYyMT7rgKsvV/rZ7TgyZkIQtwTmi 1Hum3paySjIoGLr28QZDqbqx+rGndJlnAk0eA5TUw1SatBh3C1KZ52WuFcvtKiJd3o/1 0tpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=pi/PPxcpRxr+QSJYE9U2j7ayx40ULeGXYTm6B0cbUi8=; b=gKAR29dZdFpb1xAGPyZ2/Ab2e26s6Z/nApoPqqaq4TT/7Y4+/QIUdTCEX94Tm9Q1vr xNZ1l1+nYuQ0zliEcjN/gwMS94BQSbMIPvYOf5vXByyGcvNt5sXjXc0Th4mR+WpmIvfc 1oUNAGBMQ8U3wJ9lqrxuWjvM+UqfCGQ3Aos9Y0PPYqIKwWgmVHusXDt+goxb08IMvvoB BIOWH7Et5iAqvbn223/QU/nbfsu4yfUBSmwAPKAJ0J+yEDnVZWPYH7R2HHNd8eSyz86+ KDfygb0L/ftPPjnP+psSMvvxxV9uOnhSXQV+F84tCSppEG/exGvxE9Jb61G9rX044aU7 UmAA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j22si23266665pfi.252.2019.01.08.17.53.10; Tue, 08 Jan 2019 17:53:26 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729463AbfAIBvv (ORCPT + 99 others); Tue, 8 Jan 2019 20:51:51 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:5521 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728593AbfAIBvv (ORCPT ); Tue, 8 Jan 2019 20:51:51 -0500 Date: 09 Jan 2019 10:51:48 +0900 X-IronPort-AV: E=Sophos;i="5.56,455,1539615600"; d="scan'208";a="4703053" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 09 Jan 2019 10:51:48 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id F3135419AC72; Wed, 9 Jan 2019 10:51:47 +0900 (JST) Message-ID: <87k1je38w7.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Jon Hunter Cc: Mark Brown , Liam Girdwood , , Matthias Reichl , , Marcel Ziswiler , Takashi Iwai , , Marcel Ziswiler Subject: Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement In-Reply-To: <865d2a3e-bf6b-1f30-1179-7e922c0d0641@nvidia.com> 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> <865d2a3e-bf6b-1f30-1179-7e922c0d0641@nvidia.com> User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jon Thank you for your help > > 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. OK, thanks. It *will* be static, but not yet. Thank you for your patch. I guess you worry about allocated memory leak when failed case ? It is using devm_kzalloc(), so all allocated memory will be automatically freed when card was detached. But indeed if driver gots -EPROBE_DEFER many times, it will allocate many unused platform. Here is the background of snd_soc_init_platform. Legacy dai_link was xxx_name/xxx_of_node style, but multi codec support starts to use snd_soc_dai_link_component style. OTOH Lars-Petter is thinking that current ALSA SoC is not good match for modern sound device. I guess, we need "multi xxx" support as 1st step for modern sound device. "multi codec" is already supported, "multi cpu" patch was posted, but not yet accepted (or rejected ??). "multi platform" is no plan (?). These want to use snd_soc_dai_link_component style, because it is nice for multi xxx support style, I think. I think no one is planing for "multi platform" so far, thus, I posted snd_soc_dai_link_component style for it. # Maybe it should have num_platform, too. # all driver will have .num_platform = 1, thus I didn't added. # maybe it was my fault... The reason why platform/codec is allocating/copying by snd_soc_init_xxx so far is that it is glue for xxx_name/xxx_of_node (legacy style) <-> snd_soc_init_platform (modern style). I want to which to modern style immediately and remove legacy style. But as you know, we have too many ALSA SoC drivers now. So, if I posted "switch legacy style to modern style" patch for each (= for codec, for platform, for cpu), it will be patch-bomb, and Lars-Petter/Mark don't like it. Thus, I'm waiting "multi CPU" support patch. If CPU/Codec/Platform can be snd_soc_init_platform style, then, we can switch to modern style for all drivers. Then, all driver will have *static* platform. # So, I guess if your driver can switch to use # snd_soc_init_platform style directly, your problem can gone ? > Mark If there is no plan for "multi CPU" so far, I can post snd_soc_dai_link_component style for CPU. and post switch modern style for all drivers. Then, this issue can be solved ? Best regards --- Kuninori Morimoto