Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Don't force DISCOVERY_STOPPED state in inquiry_cache_flush
@ 2012-03-01 21:19 Andre Guedes
  2012-03-01 22:32 ` Johan Hedberg
  2012-03-02 23:44 ` Johan Hedberg
  0 siblings, 2 replies; 5+ messages in thread
From: Andre Guedes @ 2012-03-01 21:19 UTC (permalink / raw)
  To: linux-bluetooth

We are not supposed to force DISCOVERY_STOPPED in inquiry_cache_flush
because we may break the discovery state machine. For instance,
during interleaved discovery, when we are about to start inquiry,
the state machine forcibly goes to DISCOVERY_STOPPED while it
should stay in DISCOVERY_FINDING state.

This problem results in unexpected behaviors such as sending two
mgmt_discovering events to userspace (when only one event is
expected) and Stop Discovery failures.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 net/bluetooth/hci_core.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index d3ddc0b..661d65f 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -413,7 +413,6 @@ static void inquiry_cache_flush(struct hci_dev *hdev)
 
 	INIT_LIST_HEAD(&cache->unknown);
 	INIT_LIST_HEAD(&cache->resolve);
-	cache->state = DISCOVERY_STOPPED;
 }
 
 struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr)
-- 
1.7.9.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-02 23:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 21:19 [PATCH] Bluetooth: Don't force DISCOVERY_STOPPED state in inquiry_cache_flush Andre Guedes
2012-03-01 22:32 ` Johan Hedberg
2012-03-02 13:48   ` Andre Guedes
2012-03-02 23:40     ` Johan Hedberg
2012-03-02 23:44 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox