From: Mark Brown <broonie@kernel.org>
To: Andrew Jackson <Andrew.Jackson@arm.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Rajeev Kumar <rajeevkumar.linux@gmail.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Liviu Dudau <Liviu.Dudau@arm.com>
Subject: Re: [PATCH 2/5] ASoC: dwc: Don't allow negative use counts
Date: Thu, 4 Dec 2014 10:51:21 +0000 [thread overview]
Message-ID: <20141204105121.GQ7712@sirena.org.uk> (raw)
In-Reply-To: <548022B3.8050105@arm.com>
[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]
On Thu, Dec 04, 2014 at 09:00:35AM +0000, Andrew Jackson wrote:
> On 12/03/14 17:25, Mark Brown wrote:
> > On Wed, Dec 03, 2014 at 04:38:55PM +0000, Andrew Jackson wrote:
> >> case SNDRV_PCM_TRIGGER_STOP:
> >> case SNDRV_PCM_TRIGGER_SUSPEND:
> >> case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
> >> - dev->active--;
> >> + if (dev->active > 0)
> >> + dev->active--;
> > How is this triggering - this sounds like you're papering over some
> > other bug somewhere?
> When I looked at the code paths I couldn't convince myself that STOP
> wouldn't be called more than once. Then actuve would be negative and
> the device might not be restartable. I didn't have a problem per se,
> it was just that it seemed to be something of a loophole.
If you're just adding the check on the off chance that it might fire you
need to add a warning message as well - what your change does is make
the code look like it's supposed to have broken reference counting since
it has a check to silently fix up and ignore problems.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2014-12-04 10:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-03 16:38 [PATCH 2/5] ASoC: dwc: Don't allow negative use counts Andrew Jackson
2014-12-03 17:25 ` Mark Brown
2014-12-04 6:40 ` rajeev kumar
2014-12-04 6:43 ` rajeev kumar
2014-12-04 9:07 ` Andrew Jackson
2014-12-04 9:00 ` Andrew Jackson
2014-12-04 10:51 ` 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=20141204105121.GQ7712@sirena.org.uk \
--to=broonie@kernel.org \
--cc=Andrew.Jackson@arm.com \
--cc=Liviu.Dudau@arm.com \
--cc=alsa-devel@alsa-project.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=rajeevkumar.linux@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox