From: Johan Hedberg <johan.hedberg@gmail.com>
To: Peter Hurley <peter@hurleysoftware.com>
Cc: linux-bluetooth <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH] Audio: fix race condition when starting a stream
Date: Sun, 10 Jul 2011 10:55:53 +0300 [thread overview]
Message-ID: <20110710075553.GD1808@dell.ger.corp.intel.com> (raw)
In-Reply-To: <1310050294.5639.1.camel@THOR>
Hi Peter,
On Thu, Jul 07, 2011, Peter Hurley wrote:
> The AVDTP spec allows for a race condition between remote and local
> device when issuing an AVDTP_START cmd on a stream in the OPEN state.
>
> However, the internal state must continue to be consistent. For example,
> suppose that avdtp_start() has been called while in the OPEN state and
> a AVDTP_START cmd is sent. Now before we have received a response (and
> thus entered the STREAMING state), we *receive* a START cmd. Prior to
> this fix, since the sep is still in the OPEN state, we would accept
> the new START cmd. This will leads us to send both a Start_Ind and
> Start_Cfm - not good.
>
> Now, we track this transitional state (starting == TRUE).
>
> NB - 'starting' is only in a valid state while the sep is in the
> OPEN state. 'starting' is reset when we return to the OPEN state.
> ---
> audio/avdtp.c | 29 +++++++++++++++++++++++++----
> 1 files changed, 25 insertions(+), 4 deletions(-)
Applied. Thanks.
Johan
prev parent reply other threads:[~2011-07-10 7:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-07 14:51 [PATCH] Audio: fix race condition when starting a stream Peter Hurley
2011-07-10 7:55 ` Johan Hedberg [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=20110710075553.GD1808@dell.ger.corp.intel.com \
--to=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=peter@hurleysoftware.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).