All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: patches.audio@intel.com, alsa-devel@alsa-project.org,
	Mark Brown <broonie@kernel.org>,
	"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>,
	lgirdwood@gmail.com
Subject: Re: [PATCH] ASoC: topology: Fix not to keep a reference to	tplg fw
Date: Thu, 26 Nov 2015 16:49:58 +0530	[thread overview]
Message-ID: <20151126111958.GB2309@localhost> (raw)
In-Reply-To: <s5hd1uxt42r.wl-tiwai@suse.de>

On Thu, Nov 26, 2015 at 12:03:56PM +0100, Takashi Iwai wrote:
> On Thu, 26 Nov 2015 12:01:23 +0100,
> Mark Brown wrote:
> > 
> > On Thu, Nov 26, 2015 at 10:19:51AM +0100, Takashi Iwai wrote:
> > > Vinod Koul wrote:
> > 
> > > > So in SKL, we do request firmware of topology binary and topology core uses
> > > > that for strings here, so the patch 87b5ed8ec freed the topology binary
> > > > which causes panic while accessing kcontrols.
> > 
> > > This is strange.  If it's about the kctl name string, the panic
> > > shouldn't happen at accessing the kctl but at instantiating the kctl
> > > from snd_kcontrol_new that contains the invalid string pointer.
> > > The kctl object contains the string in itself, and there copies the
> > > string from the template.
> > 
> > I guess it's possible that if the control creation happens soon enough
> > after the memory is freed the data will still be valid.  This could be
> > tested for by hacking things to deliberately trash the memory before we
> > get to control creation.
> > 
> > > You really need to identify which path hits the issue exactly how.  In
> > > general, the string passed to template is only for creating the kctl.
> > > Once when kctl is created, the whole snd_kcontrol_new template and the
> > > allocated string is no use, so they can be freed.
> > 
> > That does suggest a fairly simple fix of just holding on to the firmware
> > for longer assuming that the analysis is correct.
> 
> Right, that would be the simplest fix.  Just assure that the whole f/w
> image is kept until all objects are instantiated.

Yes, going by the discussion here, we can then free the topology firmware
later, but then question is how do we know when is the card completely
instantiated and we can free the topology binary... I do not know how..

Only thing I can think of is to free this is driver .remove()

So then we can simply revert 87b5ed8ecb : ('ASoC: Intel: Skylake: fix memory
leak) and then add a new one..

Thanks
-- 
~Vinod

  reply	other threads:[~2015-11-26 11:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 14:11 [PATCH] ASoC: topology: Fix not to keep a reference to tplg fw Subhransu S. Prusty
2015-11-26  8:48 ` Takashi Iwai
2015-11-26  9:10   ` Vinod Koul
2015-11-26  9:19     ` Takashi Iwai
2015-11-26 11:01       ` Mark Brown
2015-11-26 11:03         ` Takashi Iwai
2015-11-26 11:19           ` Vinod Koul [this message]
2015-11-26 11:24       ` Vinod Koul
2015-11-26 11:46         ` Takashi Iwai
2015-11-26 16:13           ` Vinod Koul
2015-11-26 17:39             ` Takashi Iwai
2015-11-27  9:15               ` Subhransu S. Prusty
2015-11-27  5:54                 ` Takashi Iwai
2015-11-27 11:42                   ` Subhransu S. Prusty
2015-11-27  6:21                     ` Takashi Iwai
2015-11-26 11:02 ` Mark Brown
2015-11-26 11:11   ` Vinod Koul

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=20151126111958.GB2309@localhost \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=patches.audio@intel.com \
    --cc=subhransu.s.prusty@intel.com \
    --cc=tiwai@suse.de \
    /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.