All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shuai Zhang <quic_shuaz@quicinc.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	<linux-bluetooth@vger.kernel.org>,
	<linux-arm-msm@vger.kernel.org>
Cc: <quic_bt@quicinc.com>
Subject: Re: [PATCH v3 4/4] driver: bluetooth: hci_qca: SSR(SubSystem Restart)process failed due to tx_idle_timer timeout
Date: Thu, 14 Aug 2025 19:52:19 +0800	[thread overview]
Message-ID: <4e4e4f7a-fe7e-4df3-baca-240ddaf2cd05@quicinc.com> (raw)
In-Reply-To: <55bad41f-b483-4609-a85a-3f89c49ddfb5@oss.qualcomm.com>

Dear,Konrad

On 8/13/2025 7:13 PM, Konrad Dybcio wrote:
> On 8/13/25 5:35 AM, Shuai Zhang wrote:
>> When the SSR (SubSystem Restart) duration exceeds 2 seconds, it triggers
>> host tx_idle_timeout, which sets host TX state to sleep. due to the
> 
> Host? Looks like we're sending a command to the BT chip and that
> triggers the issue

Since the firmware is not downloaded after ssR, the controller does not enter
the ibs_sleep state. If the host enters ibs_sleep, it will send a wake-up 
command before sending any other commands. 

However, the controller only processes IBS wake-up commands when it is already
in ibs_sleep. As a result, it will not respond to the host's wake-up command,
which prevents host from send actual command and leads to a send command timeout.

Therefore, the host must not enter the ibs_sleep state.

> 
>> hardware pulling up bt_en, the firmware is not downloaded after the SSR.
>> As a result, the controller does not enter sleep mode. Consequently,
>> when the host sends a command afterward, it sends 0xFD to the controller,
>> but the controller does not respond, leading to a command timeout.
>>
>> So reset tx_idle_timer after SSR to prevent host enter TX IBS_Sloeep mode.
>>
>> Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
>> ---
>>  drivers/bluetooth/hci_qca.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
>> index 33c2dd7b8..1fb8eea09 100644
>> --- a/drivers/bluetooth/hci_qca.c
>> +++ b/drivers/bluetooth/hci_qca.c
>> @@ -1668,6 +1668,15 @@ static void qca_hw_error(struct hci_dev *hdev, u8 code)
>>  	if (!test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) {
>>  		clear_bit(QCA_SSR_TRIGGERED, &qca->flags);
>>  		clear_bit(QCA_IBS_DISABLED, &qca->flags);
>> +		/*
>> +		 * When the SSR (Sub-System Restart) duration exceeds 2 seconds,
> 
> This comment will become out of date quickly, refer to 'tx_idle_delay' instead
> 

i will update.

> Konrad
> 
>> +		 * it triggers host tx_idle_timeout, which sets host TX state
>> +		 * to sleep. Reset tx_idle_timer after SSR to prevent
>> +		 * host enter TX IBS_Sloeep mode.
>> +		 */
>> +		mod_timer(&qca->tx_idle_timer, jiffies +
>> +			  msecs_to_jiffies(qca->tx_idle_delay));
>> +
>>  		qca->tx_ibs_state = HCI_IBS_TX_AWAKE;
>>  		qca->memdump_state = QCA_MEMDUMP_IDLE;
>>  		msleep(50);

BR,
Shuai


      reply	other threads:[~2025-08-14 11:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13  3:35 [PATCH v3 0/4] Fix SSR(SubSystem Restart) issues caused by BT_EN being pulled up by hardware Shuai Zhang
2025-08-13  3:35 ` [PATCH v3 1/4] driver: bluetooth: hci_qca: fix ssr fail when BT_EN is pulled up by hw Shuai Zhang
2025-08-13  4:18   ` Fix SSR(SubSystem Restart) issues caused by BT_EN being pulled up by hardware bluez.test.bot
2025-08-13 11:05   ` [PATCH v3 1/4] driver: bluetooth: hci_qca: fix ssr fail when BT_EN is pulled up by hw Konrad Dybcio
2025-08-13 11:28     ` Shuai Zhang
2025-08-13 11:32       ` Konrad Dybcio
2025-08-14 11:41         ` Shuai Zhang
2025-08-13  3:35 ` [PATCH v3 2/4] driver: bluetooth: hci_qca: fix host IBS state after SSR Shuai Zhang
2025-08-13  3:35 ` [PATCH v3 3/4] driver: bluetooth: hci_qca: Multiple triggers of SSR only generate one coredump file Shuai Zhang
2025-08-13 11:11   ` Konrad Dybcio
2025-08-13 11:30     ` Shuai Zhang
2025-08-13  3:35 ` [PATCH v3 4/4] driver: bluetooth: hci_qca: SSR(SubSystem Restart)process failed due to tx_idle_timer timeout Shuai Zhang
2025-08-13 11:13   ` Konrad Dybcio
2025-08-14 11:52     ` Shuai Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4e4e4f7a-fe7e-4df3-baca-240ddaf2cd05@quicinc.com \
    --to=quic_shuaz@quicinc.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=quic_bt@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.