All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Subject: [PATCH 00/11] Add bonding test cases
Date: Sun, 2 Feb 2014 12:16:30 +0100	[thread overview]
Message-ID: <1391339801-587-1-git-send-email-andrzej.kaczmarek@tieto.com> (raw)

Hi,

A bit more explanation for last patch in this series:

We've encountered random timeouts for test cases which we found to be
because of missing "credit" in bthost which queued HCI command
indefinitely. The problem here was that previous HCI command in bthost
was sent from notification_handler thread in android-tester while reply
was handled in main thread. This caused race condition in bthost code
which is not thread-safe.

A quick fix for this would be to simply change order of operations in
send_command as follows:

if (bthost->ncmd) {
	bthost->ncmd--;
	send_packet(bthost, pkt_data, pkt_len);
} else {


So, first decrease number of "credits" and then send packet, so command
complete received in another thread cannot overwrite this value before
it's updated. But since this does not make code thread-safe and just
hides problem temporarily, we've decided to wrap all callbacks from
notification_thread to serialize their execution in main loop.


Andrzej Kaczmarek (1):
  android/tester: Make bt_callbacks thread-safe

Grzegorz Kolodziejczyk (10):
  android/tester: Coding style and syntax fix
  android/tester: Add create bond with PIN success test case
  android/tester: Add create bond with PIN fail test case
  android/tester: Add create bond with SSP sucess test case
  android/tester: Add create bond with SSP fail test case
  android/tester: Add create bond with no discovery test case
  android/tester: Add create bond with bad addr fail test case
  android/tester: Add cancel bond success test case
  android/tester: Add remove bond success test case
  android/tester: Add remove bond bad addr dev test case

 android/android-tester.c | 809 ++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 763 insertions(+), 46 deletions(-)

-- 
1.8.5.2


             reply	other threads:[~2014-02-02 11:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-02 11:16 Andrzej Kaczmarek [this message]
2014-02-02 11:16 ` [PATCH 01/11] android/tester: Coding style and syntax fix Andrzej Kaczmarek
2014-02-02 11:16 ` [PATCH 02/11] android/tester: Add create bond with PIN success test case Andrzej Kaczmarek
2014-02-02 12:45   ` Anderson Lizardo
2014-02-02 11:16 ` [PATCH 03/11] android/tester: Add create bond with PIN fail " Andrzej Kaczmarek
2014-02-02 11:16 ` [PATCH 04/11] android/tester: Add create bond with SSP sucess " Andrzej Kaczmarek
2014-02-02 11:16 ` [PATCH 05/11] android/tester: Add create bond with SSP fail " Andrzej Kaczmarek
2014-02-02 11:16 ` [PATCH 06/11] android/tester: Add create bond with no discovery " Andrzej Kaczmarek
2014-02-02 11:16 ` [PATCH 07/11] android/tester: Add create bond with bad addr fail " Andrzej Kaczmarek
2014-02-02 11:16 ` [PATCH 08/11] android/tester: Add cancel bond success " Andrzej Kaczmarek
2014-02-02 11:16 ` [PATCH 09/11] android/tester: Add remove " Andrzej Kaczmarek
2014-02-02 11:16 ` [PATCH 10/11] android/tester: Add remove bond bad addr dev " Andrzej Kaczmarek
2014-02-02 11:16 ` [PATCH 11/11] android/tester: Make bt_callbacks thread-safe Andrzej Kaczmarek
2014-02-02 13:27   ` Anderson Lizardo
2014-02-02 16:55     ` Marcel Holtmann
2014-02-02 20:12       ` Anderson Lizardo
2014-02-16 21:04       ` Szymon Janc

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=1391339801-587-1-git-send-email-andrzej.kaczmarek@tieto.com \
    --to=andrzej.kaczmarek@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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.