alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Oder Chiou <oder_chiou@realtek.com>
Cc: Jack Yu <jack.yu@realtek.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	John Lin <john.lin@realtek.com>, Bard Liao <bardliao@realtek.com>,
	Flove <flove@realtek.com>
Subject: Re: [PATCH v3] ASoC: rt5514: add rt5514 SPI driver
Date: Fri, 3 Jun 2016 12:01:05 +0100	[thread overview]
Message-ID: <20160603110105.GA2282@sirena.org.uk> (raw)
In-Reply-To: <7EB0DE829A537248AF2ED30C97D12694FDDF5C@RTITMBSV03.realtek.com.tw>


[-- Attachment #1.1: Type: text/plain, Size: 1086 bytes --]

On Tue, May 17, 2016 at 02:33:16AM +0000, Oder Chiou wrote:
> > > +static void rt5514_spi_copy_work(struct work_struct *work)
> > > +{
> > > +	struct rt5514_dsp *rt5514_dsp =
> > > +		container_of(work, struct rt5514_dsp, copy_work.work);
> > > +	struct snd_pcm_runtime *runtime = rt5514_dsp->substream->runtime;
> > > +	size_t period_bytes, truncated_bytes = 0;

> > I can't see anything that cancels this work when the PCM stream to
> > userspace is stopped or if things power off otherwise?

> In the beginning of the function "rt5514_spi_copy_work", there is a if
> condition to check the variable "rt5514_dsp->substream", and the function
> "rt5514_spi_hw_free" will set the variable "rt5514_dsp->substream" to NULL.
> It also will make the delayed work stop and won't schedule again.

No, that won't stop the currently running work which means that on
driver removal we could for example try to free the driver data while
the work is still running.  The driver needs to explicitly ensure that
there is no work running when it shouldn't be, not just stop any new
work being added.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



      reply	other threads:[~2016-06-03 11:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09 10:30 [PATCH v3] ASoC: rt5514: add rt5514 SPI driver Oder Chiou
2016-05-13 12:19 ` Mark Brown
2016-05-17  2:33   ` Oder Chiou
2016-06-03 11:01     ` Mark Brown [this message]

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=20160603110105.GA2282@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=flove@realtek.com \
    --cc=jack.yu@realtek.com \
    --cc=john.lin@realtek.com \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).