[PATCH v2 2/2] Bluetooth: hci_qca: Convert timeout from jiffies to ms

Shuai Zhang posted 2 patches 1 month, 1 week ago
There is a newer version of this series
[PATCH v2 2/2] Bluetooth: hci_qca: Convert timeout from jiffies to ms
Posted by Shuai Zhang 1 month, 1 week ago
Since the timer uses jiffies as its unit rather than ms, the timeout value
must be converted from ms to jiffies when configuring the timer. Otherwise,
the intended 8s timeout is incorrectly set to approximately 33s.

Cc: stable@vger.kernel.org
Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
---
 drivers/bluetooth/hci_qca.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index fa6be1992..c14b2fa9d 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1602,7 +1602,7 @@ static void qca_wait_for_dump_collection(struct hci_dev *hdev)
 	struct qca_data *qca = hu->priv;
 
 	wait_on_bit_timeout(&qca->flags, QCA_MEMDUMP_COLLECTION,
-			    TASK_UNINTERRUPTIBLE, MEMDUMP_TIMEOUT_MS);
+			    TASK_UNINTERRUPTIBLE, msecs_to_jiffies(MEMDUMP_TIMEOUT_MS));
 
 	clear_bit(QCA_MEMDUMP_COLLECTION, &qca->flags);
 }
-- 
2.34.1
Re: [PATCH v2 2/2] Bluetooth: hci_qca: Convert timeout from jiffies to ms
Posted by Dmitry Baryshkov 1 month, 1 week ago
On Thu, Nov 06, 2025 at 10:01:03PM +0800, Shuai Zhang wrote:
> Since the timer uses jiffies as its unit rather than ms, the timeout value
> must be converted from ms to jiffies when configuring the timer. Otherwise,
> the intended 8s timeout is incorrectly set to approximately 33s.
> 
> Cc: stable@vger.kernel.org

Missing Fixes tag

> Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
> ---
>  drivers/bluetooth/hci_qca.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index fa6be1992..c14b2fa9d 100644
> --- a/drivers/bluetooth/hci_qca.c
> +++ b/drivers/bluetooth/hci_qca.c
> @@ -1602,7 +1602,7 @@ static void qca_wait_for_dump_collection(struct hci_dev *hdev)
>  	struct qca_data *qca = hu->priv;
>  
>  	wait_on_bit_timeout(&qca->flags, QCA_MEMDUMP_COLLECTION,
> -			    TASK_UNINTERRUPTIBLE, MEMDUMP_TIMEOUT_MS);
> +			    TASK_UNINTERRUPTIBLE, msecs_to_jiffies(MEMDUMP_TIMEOUT_MS));
>  
>  	clear_bit(QCA_MEMDUMP_COLLECTION, &qca->flags);
>  }
> -- 
> 2.34.1
> 

-- 
With best wishes
Dmitry
Re: [PATCH v2 2/2] Bluetooth: hci_qca: Convert timeout from jiffies to ms
Posted by Paul Menzel 1 month, 1 week ago
Dear Shuai,


Thank you for your patch.

Am 06.11.25 um 15:01 schrieb Shuai Zhang:
> Since the timer uses jiffies as its unit rather than ms, the timeout value
> must be converted from ms to jiffies when configuring the timer. Otherwise,
> the intended 8s timeout is incorrectly set to approximately 33s.
> 
> Cc: stable@vger.kernel.org

A Fixes: tag is needed.

> Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
> ---
>   drivers/bluetooth/hci_qca.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index fa6be1992..c14b2fa9d 100644
> --- a/drivers/bluetooth/hci_qca.c
> +++ b/drivers/bluetooth/hci_qca.c
> @@ -1602,7 +1602,7 @@ static void qca_wait_for_dump_collection(struct hci_dev *hdev)
>   	struct qca_data *qca = hu->priv;
>   
>   	wait_on_bit_timeout(&qca->flags, QCA_MEMDUMP_COLLECTION,
> -			    TASK_UNINTERRUPTIBLE, MEMDUMP_TIMEOUT_MS);
> +			    TASK_UNINTERRUPTIBLE, msecs_to_jiffies(MEMDUMP_TIMEOUT_MS));
>   
>   	clear_bit(QCA_MEMDUMP_COLLECTION, &qca->flags);
>   }

With the Fixes: tag added, feel free to add:

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul
Re: [PATCH v2 2/2] Bluetooth: hci_qca: Convert timeout from jiffies to ms
Posted by Shuai Zhang 1 month, 1 week ago
Dear Paul

On 11/6/2025 10:27 PM, Paul Menzel wrote:
> Dear Shuai,
> 
> 
> Thank you for your patch.
> 
> Am 06.11.25 um 15:01 schrieb Shuai Zhang:
>> Since the timer uses jiffies as its unit rather than ms, the timeout value
>> must be converted from ms to jiffies when configuring the timer. Otherwise,
>> the intended 8s timeout is incorrectly set to approximately 33s.
>>
>> Cc: stable@vger.kernel.org
> 
> A Fixes: tag is needed.
> 
>> Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
>> ---
>>   drivers/bluetooth/hci_qca.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
>> index fa6be1992..c14b2fa9d 100644
>> --- a/drivers/bluetooth/hci_qca.c
>> +++ b/drivers/bluetooth/hci_qca.c
>> @@ -1602,7 +1602,7 @@ static void qca_wait_for_dump_collection(struct hci_dev *hdev)
>>       struct qca_data *qca = hu->priv;
>>         wait_on_bit_timeout(&qca->flags, QCA_MEMDUMP_COLLECTION,
>> -                TASK_UNINTERRUPTIBLE, MEMDUMP_TIMEOUT_MS);
>> +                TASK_UNINTERRUPTIBLE, msecs_to_jiffies(MEMDUMP_TIMEOUT_MS));
>>         clear_bit(QCA_MEMDUMP_COLLECTION, &qca->flags);
>>   }
> 
> With the Fixes: tag added, feel free to add:
> 
> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
> 
> 

Thank you for your suggestion. I will update and resubmit. 

> Kind regards,
> 
> Paul

Best regards,
Shuai