Re: [PATCH v3] Bluetooth: hci_qca: Stop IBS timer during BT OFF

From: Matthias Kaehlcke
Date: Tue Dec 14 2021 - 12:22:53 EST


On Tue, Dec 14, 2021 at 05:54:51PM +0530, Panicker Harish wrote:
> The IBS timers are not stopped properly once BT OFF is triggered.
> we could see IBS commands being sent along with version command,
> so stopped IBS timers while Bluetooth is off.
>
> Fixes: 3e4be65eb82c ("Bluetooth: hci_qca: Add poweroff support during hci down for wcn3990")
>
> Signed-off-by: Panicker Harish <quic_pharish@xxxxxxxxxxx>
> ---
> drivers/bluetooth/hci_qca.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index dd768a8..6f44b26 100644
> --- a/drivers/bluetooth/hci_qca.c
> +++ b/drivers/bluetooth/hci_qca.c
> @@ -1928,6 +1928,9 @@ static int qca_power_off(struct hci_dev *hdev)
> hu->hdev->hw_error = NULL;
> hu->hdev->cmd_timeout = NULL;
>
> + mod_timer(&qca->tx_idle_timer, 0);
> + mod_timer(&qca->wake_retrans_timer, 0);
> +

If one of the timers is already running it wouldn't be stopped by mod_timer().
I think you want a del_timer_sync() here to ensure the timers aren't running
when the chip is powered off.