Re: [RFC 4/4] Bluetooth: Interleaved discovery support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johan,

On Thu, Feb 16, 2012 at 7:12 PM, Johan Hedberg <johan.hedberg@xxxxxxxxx> wrote:
> 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.

Thanks, I'll fix it.

>> +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.

Yes, you're right. I just realized hci_do_inquiry now calls inquiry_
cache_flush which requires hdev->lock held. I'll fix this too. Thanks.

BR,

Andre
--
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


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux