All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Jon Hunter <jonathanh@nvidia.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-tegra@vger.kernel.org, Matthias Reichl <hias@horus.com>,
	alsa-devel@alsa-project.org,
	Marcel Ziswiler <marcel.ziswiler@toradex.com>,
	Takashi Iwai <tiwai@suse.com>,
	linux-kernel@vger.kernel.org,
	Marcel Ziswiler <marcel@ziswiler.com>
Subject: Re: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement
Date: 10 Jan 2019 10:16:03 +0900	[thread overview]
Message-ID: <875zuxb9uy.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <20190109141439.GE10405@sirena.org.uk>


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.

> I would like someone to explain what multi-platform means? Even if a
> soundcard supports multiple platforms, there is only one platform you
> are using at any time so ...
(snip)
> ... I don't understand why you would ever need a 'num_platform' as the
> machine driver just needs to understand which platform is using it at
> any given time. Right?

As Mark explained, "platform" on ALSA SoC means "DMA",
and we might have multiple DMA sound sysytem (= multi-platform) in the future.
Currently, all driver/sysytem is using single DMA for 1 sound card.

> > # So, I guess if your driver can switch to use
> > # snd_soc_init_platform style directly, your problem can gone ?
> 
> 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.

Yeah I agree.
But my concern is that the same problem happen on codec side too,
by same logic, because snd_soc_init_multicodec() is overwriting
dai_link too.
Your posted patch solved platform side only, I think.

> > >> 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 of conversions that
> > > touch everything at some point no matter what :/
> 
> > Do you have a preference here? Do you think that we can fix-up the
> > soc-core or should I go ahead and migrate the Tegra machine driver to
> > workaround this issue now?
> 
> We're going to need to migrate Tegra regardless so it'd be good to do
> that whatever happens, I'm intending to try to properly review the patch
> today.

As I mentioned above, I think we have same issue on codec side too.
exchanging *platform to platform doesn't solve all issues.
And we need to exchange all driver again if we had multi-platform
support in the future (I don't know when it can happen though...)

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 ?

So, how about this ?

I will try to add snd_soc_dai_link_component support for CPU,
and switch all driver to use modern style for v5.1 (or v5.2 ?).
Until then, as temporary solution, we can use above quick-patch style.

And to avoid "memory leak crash" attach,
it temporary have bind dai_link limitation (max 5time?).
If it goes to max limitation, ALSA SoC doesn't allow to try again.
In such case, all related CPU/Codec driver need to rmmod/unbind,
and insmod/bind again.
Then, the limitation will be 0 cleared. You can try bind again.

It can solve "dirty pointer" issue, "memory leak" issue,
and "memory leak attack" issue.
The problem is that code can be dirty temporary.
But it will be removed if all driver can be swtich to modern style.

Best regards
---
Kuninori Morimoto

  reply	other threads:[~2019-01-10  1:16 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18 11:18 [PATCH v1 0/3] ASoC: last minute fixes Marcel Ziswiler
2018-10-18 11:18 ` Marcel Ziswiler
2018-10-18 11:18 ` [PATCH v1 1/3] ASoC: tegra_sgtl5000: fix device_node refcounting Marcel Ziswiler
2018-10-18 11:18   ` Marcel Ziswiler
2018-10-18 11:18 ` [PATCH v1 2/3] ASoC: soc-core: fix trivial checkpatch issues Marcel Ziswiler
2018-10-18 11:18   ` Marcel Ziswiler
2018-10-19 12:26   ` Applied "ASoC: soc-core: fix trivial checkpatch issues" to the asoc tree Mark Brown
2018-10-19 12:26     ` Mark Brown
2018-10-19 12:26     ` Mark Brown
2018-10-19 12:34   ` Mark Brown
2018-10-19 12:34     ` Mark Brown
2018-10-19 12:34     ` Mark Brown
2018-10-18 11:18 ` [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement Marcel Ziswiler
2018-10-18 11:18   ` Marcel Ziswiler
2018-10-19 10:22   ` Jon Hunter
2018-10-19 10:22     ` Jon Hunter
2018-10-21 11:23     ` Mark Brown
2018-10-21 11:23       ` Mark Brown
2018-12-18 17:40       ` Matthias Reichl
2018-12-18 17:40         ` [alsa-devel] " Matthias Reichl
2019-01-03 16:42         ` Jon Hunter
2019-01-03 16:42           ` Jon Hunter
2019-01-08  2:25           ` Kuninori Morimoto
2019-01-08  2:25             ` Kuninori Morimoto
2019-01-08 10:50             ` Jon Hunter
2019-01-08 10:50               ` [alsa-devel] " Jon Hunter
2019-01-08 12:03               ` Jon Hunter
2019-01-08 12:03                 ` Jon Hunter
2019-01-08 15:48                 ` Jon Hunter
2019-01-08 15:48                   ` Jon Hunter
2019-01-08 16:09                   ` Mark Brown
2019-01-08 16:09                     ` [alsa-devel] " Mark Brown
2019-01-09  1:51                   ` Kuninori Morimoto
2019-01-09  1:51                     ` Kuninori Morimoto
2019-01-09 11:03                     ` Jon Hunter
2019-01-09 11:03                       ` Jon Hunter
2019-01-09 12:53                       ` Mark Brown
2019-01-09 12:53                         ` [alsa-devel] " Mark Brown
2019-01-09 14:11                         ` Jon Hunter
2019-01-09 14:11                           ` Jon Hunter
2019-01-09 14:14                           ` Mark Brown
2019-01-09 14:14                             ` [alsa-devel] " Mark Brown
2019-01-10  1:16                             ` Kuninori Morimoto [this message]
2019-01-10  3:46                               ` Kuninori Morimoto
2019-01-10 10:56                               ` Jon Hunter
2019-01-10 10:56                                 ` Jon Hunter
2019-01-11  0:52                                 ` Kuninori Morimoto
2019-01-11  0:52                                   ` [alsa-devel] " Kuninori Morimoto
2019-01-11  8:41                                   ` Jon Hunter
2019-01-11  8:41                                     ` Jon Hunter
2019-01-11  8:51                                     ` Kuninori Morimoto
2019-01-11  8:51                                       ` Kuninori Morimoto
2019-01-11  9:15                                       ` Jon Hunter
2019-01-11  9:15                                         ` Jon Hunter
2019-01-14 23:02                                         ` Mark Brown
2019-01-14 23:02                                           ` [alsa-devel] " Mark Brown
2019-01-15 15:26                                           ` Jon Hunter
2019-01-15 15:26                                             ` Jon Hunter
2019-01-15 18:07                                             ` Matthias Reichl
2019-01-08 15:33         ` Mark Brown
2019-01-08 15:33           ` [alsa-devel] " Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875zuxb9uy.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=hias@horus.com \
    --cc=jonathanh@nvidia.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=marcel.ziswiler@toradex.com \
    --cc=marcel@ziswiler.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.