Hi Andre, On Thu, Feb 16, 2012, Andre Guedes wrote: > #define INQUIRY_LEN_BREDR 0x08 /* TGAP(100) */ > +#define INQUIRY_LEN_BREDR_LE 0x04 /* TGAP(100)/2 */ > + > > #define SERVICE_CACHE_TIMEOUT (5 * 1000) One unnecessary empty line added above. > +int mgmt_interleaved_discovery(struct hci_dev *hdev) > +{ > + int err; > + > + BT_DBG("%s", hdev->name); > + > + err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR_LE); > + if (err < 0) { > + hci_dev_lock(hdev); > + hci_discovery_set_state(hdev, DISCOVERY_STOPPED); > + hci_dev_unlock(hdev); > + } > + > + return err; > +} The locking doesn't look right to me above. hci_do_inquiry should be called with the lock held. I think it might be simpler if you make mgmt_interleaved_discovery() require the caller to hold the lock. Johan -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html