Re: [PATCH 1/2] ASoC: fix pcm-creation regression

2017-07-17 Thread Johan Hovold
On Fri, Jul 14, 2017 at 03:35:46PM +0200, Linus Walleij wrote:
> On Wed, Jul 12, 2017 at 5:55 PM, Johan Hovold  wrote:
> 
> > This reverts commit 99b04f4c4051 ("ASoC: add Component level
> > pcm_new/pcm_free"), which started calling the pcm_new callback for every
> > component in a *card* when creating a new pcm, something which does not
> > seem to make any sense.
> >
> > This specifically led to memory leaks in systems with more than one
> > platform component and where DMA memory is allocated in the
> > platform-driver callback. For example, when both mcasp devices are being
> > used on an am335x board, DMA memory would be allocated twice for every
> > DAI link during probe.
> >
> > When CONFIG_SND_VERBOSE_PROCFS was set this fortunately also led to
> > warnings such as:
> >
> > WARNING: CPU: 0 PID: 565 at ../fs/proc/generic.c:346 
> > proc_register+0x110/0x154
> > proc_dir_entry 'sub0/prealloc' already registered
> >
> > Since there seems to be no users of the new component callbacks, and the
> > current implementation introduced a regression, let's revert the
> > offending commit for now.
> >
> > Fixes: 99b04f4c4051 ("ASoC: add Component level pcm_new/pcm_free")
> > Cc: stable  # 4.10
> > Cc: Kuninori Morimoto 
> > Cc: Brian Norris 
> > Signed-off-by: Johan Hovold 
> 
> I have repeatedly ran into this bug, thanks a *lot* for fixing it.
> It solves a problem not only on this old code but also in my
> development tree where I try to move the Ux500 audio to DT-only
> instantiation and this was a blocker that I just ran my head into
> the last month or two.
> 
> Reviewed-by: Linus Walleij 
> Tested-by: Linus Walleij 

Thanks for testing these, Linus.

Johan


Re: [PATCH 1/2] ASoC: fix pcm-creation regression

2017-07-17 Thread Johan Hovold
On Fri, Jul 14, 2017 at 03:35:46PM +0200, Linus Walleij wrote:
> On Wed, Jul 12, 2017 at 5:55 PM, Johan Hovold  wrote:
> 
> > This reverts commit 99b04f4c4051 ("ASoC: add Component level
> > pcm_new/pcm_free"), which started calling the pcm_new callback for every
> > component in a *card* when creating a new pcm, something which does not
> > seem to make any sense.
> >
> > This specifically led to memory leaks in systems with more than one
> > platform component and where DMA memory is allocated in the
> > platform-driver callback. For example, when both mcasp devices are being
> > used on an am335x board, DMA memory would be allocated twice for every
> > DAI link during probe.
> >
> > When CONFIG_SND_VERBOSE_PROCFS was set this fortunately also led to
> > warnings such as:
> >
> > WARNING: CPU: 0 PID: 565 at ../fs/proc/generic.c:346 
> > proc_register+0x110/0x154
> > proc_dir_entry 'sub0/prealloc' already registered
> >
> > Since there seems to be no users of the new component callbacks, and the
> > current implementation introduced a regression, let's revert the
> > offending commit for now.
> >
> > Fixes: 99b04f4c4051 ("ASoC: add Component level pcm_new/pcm_free")
> > Cc: stable  # 4.10
> > Cc: Kuninori Morimoto 
> > Cc: Brian Norris 
> > Signed-off-by: Johan Hovold 
> 
> I have repeatedly ran into this bug, thanks a *lot* for fixing it.
> It solves a problem not only on this old code but also in my
> development tree where I try to move the Ux500 audio to DT-only
> instantiation and this was a blocker that I just ran my head into
> the last month or two.
> 
> Reviewed-by: Linus Walleij 
> Tested-by: Linus Walleij 

Thanks for testing these, Linus.

Johan


Re: [PATCH 1/2] ASoC: fix pcm-creation regression

2017-07-14 Thread Linus Walleij
On Wed, Jul 12, 2017 at 5:55 PM, Johan Hovold  wrote:

> This reverts commit 99b04f4c4051 ("ASoC: add Component level
> pcm_new/pcm_free"), which started calling the pcm_new callback for every
> component in a *card* when creating a new pcm, something which does not
> seem to make any sense.
>
> This specifically led to memory leaks in systems with more than one
> platform component and where DMA memory is allocated in the
> platform-driver callback. For example, when both mcasp devices are being
> used on an am335x board, DMA memory would be allocated twice for every
> DAI link during probe.
>
> When CONFIG_SND_VERBOSE_PROCFS was set this fortunately also led to
> warnings such as:
>
> WARNING: CPU: 0 PID: 565 at ../fs/proc/generic.c:346 proc_register+0x110/0x154
> proc_dir_entry 'sub0/prealloc' already registered
>
> Since there seems to be no users of the new component callbacks, and the
> current implementation introduced a regression, let's revert the
> offending commit for now.
>
> Fixes: 99b04f4c4051 ("ASoC: add Component level pcm_new/pcm_free")
> Cc: stable  # 4.10
> Cc: Kuninori Morimoto 
> Cc: Brian Norris 
> Signed-off-by: Johan Hovold 

I have repeatedly ran into this bug, thanks a *lot* for fixing it.
It solves a problem not only on this old code but also in my
development tree where I try to move the Ux500 audio to DT-only
instantiation and this was a blocker that I just ran my head into
the last month or two.

Reviewed-by: Linus Walleij 
Tested-by: Linus Walleij 

Yours,
Linus Walleij


Re: [PATCH 1/2] ASoC: fix pcm-creation regression

2017-07-14 Thread Linus Walleij
On Wed, Jul 12, 2017 at 5:55 PM, Johan Hovold  wrote:

> This reverts commit 99b04f4c4051 ("ASoC: add Component level
> pcm_new/pcm_free"), which started calling the pcm_new callback for every
> component in a *card* when creating a new pcm, something which does not
> seem to make any sense.
>
> This specifically led to memory leaks in systems with more than one
> platform component and where DMA memory is allocated in the
> platform-driver callback. For example, when both mcasp devices are being
> used on an am335x board, DMA memory would be allocated twice for every
> DAI link during probe.
>
> When CONFIG_SND_VERBOSE_PROCFS was set this fortunately also led to
> warnings such as:
>
> WARNING: CPU: 0 PID: 565 at ../fs/proc/generic.c:346 proc_register+0x110/0x154
> proc_dir_entry 'sub0/prealloc' already registered
>
> Since there seems to be no users of the new component callbacks, and the
> current implementation introduced a regression, let's revert the
> offending commit for now.
>
> Fixes: 99b04f4c4051 ("ASoC: add Component level pcm_new/pcm_free")
> Cc: stable  # 4.10
> Cc: Kuninori Morimoto 
> Cc: Brian Norris 
> Signed-off-by: Johan Hovold 

I have repeatedly ran into this bug, thanks a *lot* for fixing it.
It solves a problem not only on this old code but also in my
development tree where I try to move the Ux500 audio to DT-only
instantiation and this was a blocker that I just ran my head into
the last month or two.

Reviewed-by: Linus Walleij 
Tested-by: Linus Walleij 

Yours,
Linus Walleij