* [PATCH] Bluetooth: hci_qca: Replace open-coded msleep()
@ 2018-06-26 17:06 Stephen Boyd
2018-06-26 20:49 ` Matthias Kaehlcke
2018-09-28 16:10 ` Stephen Boyd
0 siblings, 2 replies; 4+ messages in thread
From: Stephen Boyd @ 2018-06-26 17:06 UTC (permalink / raw)
To: Marcel Holtmann, Johan Hedberg
Cc: linux-kernel, linux-bluetooth, linux-arm-msm, Thierry Escande
These three lines make up what msleep() already does, i.e. setting the
task to uninterruptible, sleeping for so many jiffies, and then
schedule() already puts the task state back to TASK_RUNNING when it
returns. Make things clearer by just calling msleep() instead.
Cc: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
drivers/bluetooth/hci_qca.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 51790dd02afb..ef2b00bdf06d 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -908,9 +908,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
* controller will come back after they receive this HCI command
* then host can communicate with new baudrate to controller
*/
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(msecs_to_jiffies(BAUDRATE_SETTLE_TIMEOUT_MS));
- set_current_state(TASK_RUNNING);
+ msleep(BAUDRATE_SETTLE_TIMEOUT_MS);
return 0;
}
--
Sent by a computer through tubes
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Bluetooth: hci_qca: Replace open-coded msleep()
2018-06-26 17:06 [PATCH] Bluetooth: hci_qca: Replace open-coded msleep() Stephen Boyd
@ 2018-06-26 20:49 ` Matthias Kaehlcke
2018-09-28 16:10 ` Stephen Boyd
1 sibling, 0 replies; 4+ messages in thread
From: Matthias Kaehlcke @ 2018-06-26 20:49 UTC (permalink / raw)
To: Stephen Boyd
Cc: Marcel Holtmann, Johan Hedberg, linux-kernel, linux-bluetooth,
linux-arm-msm, Thierry Escande
On Tue, Jun 26, 2018 at 10:06:54AM -0700, Stephen Boyd wrote:
> These three lines make up what msleep() already does, i.e. setting the
> task to uninterruptible, sleeping for so many jiffies, and then
> schedule() already puts the task state back to TASK_RUNNING when it
> returns. Make things clearer by just calling msleep() instead.
>
> Cc: Thierry Escande <thierry.escande@linaro.org>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-off-by: Matthias Kaehlcke <mka@chromium.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Bluetooth: hci_qca: Replace open-coded msleep()
2018-06-26 17:06 [PATCH] Bluetooth: hci_qca: Replace open-coded msleep() Stephen Boyd
2018-06-26 20:49 ` Matthias Kaehlcke
@ 2018-09-28 16:10 ` Stephen Boyd
2018-09-28 17:20 ` Marcel Holtmann
1 sibling, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2018-09-28 16:10 UTC (permalink / raw)
To: Johan Hedberg, Marcel Holtmann
Cc: linux-kernel, linux-bluetooth, linux-arm-msm, Thierry Escande
Quoting Stephen Boyd (2018-06-26 10:06:54)
> These three lines make up what msleep() already does, i.e. setting the
> task to uninterruptible, sleeping for so many jiffies, and then
> schedule() already puts the task state back to TASK_RUNNING when it
> returns. Make things clearer by just calling msleep() instead.
>
> Cc: Thierry Escande <thierry.escande@linaro.org>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> ---
Marcel, can you pick this patch up?
> drivers/bluetooth/hci_qca.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index 51790dd02afb..ef2b00bdf06d 100644
> --- a/drivers/bluetooth/hci_qca.c
> +++ b/drivers/bluetooth/hci_qca.c
> @@ -908,9 +908,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
> * controller will come back after they receive this HCI command
> * then host can communicate with new baudrate to controller
> */
> - set_current_state(TASK_UNINTERRUPTIBLE);
> - schedule_timeout(msecs_to_jiffies(BAUDRATE_SETTLE_TIMEOUT_MS));
> - set_current_state(TASK_RUNNING);
> + msleep(BAUDRATE_SETTLE_TIMEOUT_MS);
>
> return 0;
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Bluetooth: hci_qca: Replace open-coded msleep()
2018-09-28 16:10 ` Stephen Boyd
@ 2018-09-28 17:20 ` Marcel Holtmann
0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2018-09-28 17:20 UTC (permalink / raw)
To: Stephen Boyd
Cc: Johan Hedberg, linux-kernel, linux-bluetooth, linux-arm-msm,
Thierry Escande
Hi Stephen,
>> These three lines make up what msleep() already does, i.e. setting the
>> task to uninterruptible, sleeping for so many jiffies, and then
>> schedule() already puts the task state back to TASK_RUNNING when it
>> returns. Make things clearer by just calling msleep() instead.
>>
>> Cc: Thierry Escande <thierry.escande@linaro.org>
>> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
>> ---
>
> Marcel, can you pick this patch up?
I would do that, but unfortunately it does apply against bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-28 17:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-26 17:06 [PATCH] Bluetooth: hci_qca: Replace open-coded msleep() Stephen Boyd
2018-06-26 20:49 ` Matthias Kaehlcke
2018-09-28 16:10 ` Stephen Boyd
2018-09-28 17:20 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).