Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-15 Thread Matthias Reichl
On Tue, Jan 15, 2019 at 03:26:42PM +, Jon Hunter wrote: > > On 14/01/2019 23:02, Mark Brown wrote: > > On Fri, Jan 11, 2019 at 09:15:42AM +, Jon Hunter wrote: > >> On 11/01/2019 08:51, Kuninori Morimoto wrote: > > > >>> So, can you agree about these ? > >>> 1) Add enough information/docum

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-15 Thread Jon Hunter
On 14/01/2019 23:02, Mark Brown wrote: > On Fri, Jan 11, 2019 at 09:15:42AM +, Jon Hunter wrote: >> On 11/01/2019 08:51, Kuninori Morimoto wrote: > >>> So, can you agree about these ? >>> 1) Add enough information/documentation about legacy/modern style and its >>> plan. >>> 2) Add dirty po

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-14 Thread Mark Brown
On Fri, Jan 11, 2019 at 09:15:42AM +, Jon Hunter wrote: > On 11/01/2019 08:51, Kuninori Morimoto wrote: > > So, can you agree about these ? > > 1) Add enough information/documentation about legacy/modern style and its > > plan. > > 2) Add dirty pointer fixup patch as workaround > > 3) switch

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-11 Thread Jon Hunter
On 11/01/2019 08:51, Kuninori Morimoto wrote: >>> Indeed there is such case so far, but my understanding is that current >>> driver should select "legacy style" or "modern style". >>> If driver setup it as "legacy", but access to "modern" member, >>> it is driver side bug, right ? >> >> Yes absol

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-11 Thread Kuninori Morimoto
Hi Jon > > Indeed there is such case so far, but my understanding is that current > > driver should select "legacy style" or "modern style". > > If driver setup it as "legacy", but access to "modern" member, > > it is driver side bug, right ? > > Yes absolutely it is a driver bug, but looking a

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-11 Thread Jon Hunter
On 11/01/2019 00:52, Kuninori Morimoto wrote: ... >> It is still fragile. Again the machine driver could have incorrectly set >> these 'allocated_platform/codecs' members as they are exposed to the >> machine driver. You have no way to determine if the machine driver is >> doing the correct thi

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-10 Thread Kuninori Morimoto
Hi Jon > Actually no. Looking at snd_soc_init_multicodec() it always allocates > memory if any of the 'legacy' codec members > (codec_name/codec_of_node/codec_dai_name) are populated. However, this > looks quite fragile to me and is susceptible to leaking memory if the > user/machine driver alre

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-10 Thread Jon Hunter
On 10/01/2019 01:16, Kuninori Morimoto wrote: ... > As I mentioned above, I think we have same issue on codec side too. Actually no. Looking at snd_soc_init_multicodec() it always allocates memory if any of the 'legacy' codec members (codec_name/codec_of_node/codec_dai_name) are populated. How

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-09 Thread Kuninori Morimoto
Hi Mark, Jon again > My posted quick-patch can solve "dirty pointer" issue, > but it can't solve "memory leak" issue. > This issue will be solved if all driver can switch to > modern style, but it needs more time. > Are these correct ? Sorry I was very confused. I think the issue is only "dirty

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-09 Thread Kuninori Morimoto
Hi Mark, Jon > No. Offline you had suggested using kmalloc and not devm_kzalloc and so > I was worried in that case about a memory leak. Right now I am only > concerned about an invalid pointer that is not being handled correctly. I'm sorry I was confused/misunderstood, kmalloc idea was wrong.

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-09 Thread Mark Brown
On Wed, Jan 09, 2019 at 02:11:58PM +, Jon Hunter wrote: > On 09/01/2019 12:53, Mark Brown wrote: > >> Yes that is an alternative and I can convert all the Tegra machine > >> drivers to use this now. However, that will not solve the problem for > >> non-Tegra devices and everyone will have to d

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-09 Thread Jon Hunter
On 09/01/2019 12:53, Mark Brown wrote: ... >> Yes that is an alternative and I can convert all the Tegra machine >> drivers to use this now. However, that will not solve the problem for >> non-Tegra devices and everyone will have to do this. > > We're going to have to go through another round

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-09 Thread Mark Brown
On Wed, Jan 09, 2019 at 11:03:44AM +, Jon Hunter wrote: > On 09/01/2019 01:51, Kuninori Morimoto wrote: > > "multi platform" is no plan (?). > I would like someone to explain what multi-platform means? Even if a > soundcard supports multiple platforms, there is only one platform you > are usi

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-09 Thread Jon Hunter
On 09/01/2019 01:51, Kuninori Morimoto wrote: > > 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

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-08 Thread Kuninori Morimoto
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 you

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-08 Thread Mark Brown
On Tue, Jan 08, 2019 at 03:48:27PM +, Jon Hunter wrote: > > 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. > To be specific, the following also

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-08 Thread Jon Hunter
On 08/01/2019 12:03, Jon Hunter wrote: > > 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

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-08 Thread Mark Brown
On Tue, Dec 18, 2018 at 06:40:40PM +0100, Matthias Reichl wrote: > On Sun, Oct 21, 2018 at 12:23:01PM +0100, Mark Brown wrote: > > On Fri, Oct 19, 2018 at 11:22:46AM +0100, Jon Hunter wrote: > > Indeed, this is a bit of a mess. We probably shouldn't be modifying the > > data that the drivers pass

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-08 Thread Jon Hunter
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

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-08 Thread Jon Hunter
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. >

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-07 Thread Kuninori Morimoto
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_compo

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2019-01-03 Thread Jon Hunter
Hi Mark, Kuninori On 18/12/2018 17:40, Matthias Reichl wrote: > Hi Mark, > > On Sun, Oct 21, 2018 at 12:23:01PM +0100, Mark Brown wrote: >> On Fri, Oct 19, 2018 at 11:22:46AM +0100, Jon Hunter wrote: >> >>> Looking at snd_soc_init_platform(), it seems that the platform pointer >>> can be allocate

Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2018-12-18 Thread Matthias Reichl
Hi Mark, On Sun, Oct 21, 2018 at 12:23:01PM +0100, Mark Brown wrote: > On Fri, Oct 19, 2018 at 11:22:46AM +0100, Jon Hunter wrote: > > > Looking at snd_soc_init_platform(), it seems that the platform pointer > > can be allocated by the machine driver and so if it is not allocated by > > the core,

Re: [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2018-10-21 Thread Mark Brown
On Fri, Oct 19, 2018 at 11:22:46AM +0100, Jon Hunter wrote: > Looking at snd_soc_init_platform(), it seems that the platform pointer > can be allocated by the machine driver and so if it is not allocated by > the core, then I don't think we should clear it here. Seems we need a > way to determine

Re: [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2018-10-19 Thread Jon Hunter
On 18/10/2018 12:18, Marcel Ziswiler wrote: > From: Marcel Ziswiler > > This fixes the following error as seen post commit daecf46ee0e5 > ("ASoC: soc-core: use snd_soc_dai_link_component for platform") on > Apalis TK1 after initial probe deferral: > > tegra-snd-sgtl5000 sound: ASoC: Both platf

[PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

2018-10-18 Thread Marcel Ziswiler
From: Marcel Ziswiler This fixes the following error as seen post commit daecf46ee0e5 ("ASoC: soc-core: use snd_soc_dai_link_component for platform") on Apalis TK1 after initial probe deferral: tegra-snd-sgtl5000 sound: ASoC: Both platform name/of_node are set for sgtl5000 tegra-snd-sgtl5000 so