Re: [PATCH 1/2] Bluetooth: btusb: Fix race when waiting for BTUSB_DOWNLOADING

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

 



Hi Johan,

> The test for BTUSB_DOWNLOADING must be after adding to the wait queue
> and setting the TASK_INTERRUPTIBLE state. Otherwise the flag may get
> cleared after we test for it and we end up getting a timeout since
> schedule_timeout() waits for the full duration. This patch uses a
> wait_on_bit_timeout() + wake_up_bit(). To perform the task both
> race-free as well as in a much simpler way.
> 
> Since there's no global wait_on_bit_timeout() helper yet (even though
> all the building blocks for it are in place) this patch creates a
> temporary local btusb copy of it until the global one has made it to
> upstream trees.
> 
> Signed-off-by: Johan Hedberg <johan.hedberg@xxxxxxxxx>
> ---
> drivers/bluetooth/btusb.c | 67 ++++++++++++++++++++++++-----------------------
> 1 file changed, 34 insertions(+), 33 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

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