From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 394683A9635 for ; Mon, 25 May 2026 06:49:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779691765; cv=none; b=N23vfPkPPljn2WvlgVDc1ZCvGESkAPkqL3+tJj/630xt3HSxCACp8BknlGkLH9LcUm1edUg6wlYDKQ2i9LPGxJfSSoYBNNGwGhhMrBl/naxx6l/YlRWzY9NnFvmtMaZHSf9bVsfjFrVf57e0ZZC5AZLJAVYBCZn9HU2O7MMVt3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779691765; c=relaxed/simple; bh=utLLGRdarLRCiW1US6VVGRZPWxf5/fO3v/VjqNUQ/5Y=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=nOBhdOCzE/a8UyBUC4qNqaQb5P8yYTk/E01pWwB6nSfzgAe9beoDQfVJPB4qpF3428ChE9/pP+aKDIALtqwwoNTF0TVHb+YYxbfGSy8Yho0bl4ENa3w6G9oulwkDbAJyWAo7QFfErrEGH1YH5+i7td3fsBPV/1lvdLxvzJx8x1M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=CHmOp2n+; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=SDz/esvW; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="CHmOp2n+"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="SDz/esvW" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64ON6BQn419389 for ; Mon, 25 May 2026 06:49:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= xa1aVs2gD/q5yikyQaG219MKMNic86aisit5i/OTAcg=; b=CHmOp2n+w+lkf2EW khHn4UFhTvWFL/8VH5pPtW+s7qG8bs2z+9FbqIf1UWO43dSYEnq7FF40cO6n8/U3 +//b9TdlGUiHWXU7HzCUNZRi6AtA4w4aiL2TshEYThiHHWe5RFnTjFgGBPITWqPJ XN9JfvbE+QiuNHfPsktgcbTX85fBMpimwx0zfgRFzP88obCSUOmdAJWrkqp8vLl9 xF4Lgj1vA1p8MBO3nSlCBqxNG3qHHv+PzFASa0yL5aYek3SRVT+IpYYBNkvUc4XS NMLMpzJprUHCoXXdVbN4ZkGPATMxC5yl3Il7vt9nToziREFs0+izXn2UpqdfM6Yd H97NNg== Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eb386nm3r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 25 May 2026 06:49:19 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-2ef62078ee7so10303212eec.0 for ; Sun, 24 May 2026 23:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779691759; x=1780296559; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=xa1aVs2gD/q5yikyQaG219MKMNic86aisit5i/OTAcg=; b=SDz/esvWSqTudXrS/3Ck89zw2tF4qNUy5zggx0M/iZ7yFii7AOkROXFrpw2+98KqAE w6Xi9tFIZDPbuzd9gA0ScLz+bgmvYfaV1mp/TJK8bm0xqLMDfxshbSjnJIBxGX/M70vg dmgYKAHkIKsgxL06Y4sWlX4KMfT47f3cGsC29qN6D0fPGO1y3Azqca/Syr0LjO9tg+Zs oewV5NORdGC/8WKsf3Lx4ac/tVMc/ICg3q5B1CWtUeO0g/UvpdA176iWVs0Xipy/9k/t OzRx2jojhRtEeZzKqfeGKk3o/5guknf+PKpk7hhoNmuq94QdDdKbTY7yZP2uuKwd2gJI UDqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779691759; x=1780296559; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xa1aVs2gD/q5yikyQaG219MKMNic86aisit5i/OTAcg=; b=TrdwQMHZZC6N2drqt87tTclMnnWY34l9KmObQS9o2yN9d6ggemlNwlNWdsBbEa5gr5 S8Aag6EqJNjqleG8ef8t3JDz0clrh+dG1M2DBPuTuvlKXGtueXoy9dpYw75IIBwSBh4k 65KFsmr3QIkk1bROgPfq52qpez6oH/rGRWpbXOeCBQcyTo9cKTM3SEMYUIfISj07fCxA qnw8tVpK0zthkJcVH2nH8Cig4JkplDYUor+dIAjLNokylijASu2+Ey1+flci997lphrC PZRxpZigz/H3FwQG/07j3vRlOgAyLjQHCDio7lXmm5D7B59xuBWy/H/I4dokWMiS+jPK eBCA== X-Forwarded-Encrypted: i=1; AFNElJ93urQRJlw60/JT/6KDlctMneCm0Ge+QYOPXRBLt1xuvzsdv6tUgen/CmjwnEf2kpc+eayBERctm5+gZB4=@vger.kernel.org X-Gm-Message-State: AOJu0Yw1tJYdVphaNWnM7enyKeuv4OW9IM8PkPe6sbUu6bn5uoQtub42 GevnOKubDQ2aWPcul+6QwHpdxLm199egnVs7+ZH5Q5n/+MZUh+0puLhMrWW80Fv4ecY4fs+RoFX ORGAQ9Pv4VzEuDRygfIHr9K8kXhIpWdx3NAtYprgqDaw0aaz7KWbOyECJPsFGeyOZwBg= X-Gm-Gg: Acq92OGvhWrw1v5xsRgTsi5LwVYvTS323ilvrRchg51dc2bbSYaBiPVyc8NpLoELPDJ WE3g5H9/UKofNfJ5ucl/fGYlwNgHDLMhEPsRkvdiUl+P4MxN8TxMV1AFEMQVrcWVqtpXED5T7w3 lVWFVvEhUW4zdoSM58GDtnwfvVHDWbevAVUT1wNUGbJMM4qy7hUHA2edTfI5QXZRM9zlIIrCkqa WdSC7oyEWbUTXZl3O6+lDfmn+Z8IdPv9SBPEuRFtqMPY03mZM3mWnSVn7FSfJBjgQrYWRE0Aput NPQdNlG5IPZJpaTnzt3k/PMYMlR7goza1F7DYbdIyoS5y3bELhc65Nn/AFSjqLQmVU1Z0bnBrjz hO9B38fFi0SvNwrDCRDXmClyPkn7J/CrVcZoJqejA+zucrTx8oibQXwoY9R5klkeYr1ZelF5VwJ XmUw== X-Received: by 2002:a05:7300:ad09:b0:2be:7fc2:fc38 with SMTP id 5a478bee46e88-3044904e1b2mr6215572eec.5.1779691758541; Sun, 24 May 2026 23:49:18 -0700 (PDT) X-Received: by 2002:a05:7300:ad09:b0:2be:7fc2:fc38 with SMTP id 5a478bee46e88-3044904e1b2mr6215559eec.5.1779691757979; Sun, 24 May 2026 23:49:17 -0700 (PDT) Received: from [10.110.33.191] (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30452259de0sm6536599eec.22.2026.05.24.23.49.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 May 2026 23:49:17 -0700 (PDT) Message-ID: <4e3d1338-7680-4ccf-a2d1-875c81605d8f@oss.qualcomm.com> Date: Mon, 25 May 2026 14:49:12 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Shuai Zhang Subject: Re: [PATCH v1] Bluetooth: hci_qca: Increase SSR delay for rampatch and NVM loading To: Paul Menzel , Luiz Augusto von Dentz Cc: Bartosz Golaszewski , Marcel Holtmann , linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, cheng.jiang@oss.qualcomm.com, quic_chezhou@quicinc.com, wei.deng@oss.qualcomm.com, jinwang.li@oss.qualcomm.com, mengshi.wu@oss.qualcomm.com, stable@vger.kernel.org References: <20260522110838.1158643-1-shuai.zhang@oss.qualcomm.com> <1b8e8129-4f42-429e-bd70-5e368551739c@molgen.mpg.de> <55439fa7-2057-4dd7-9651-db15bd27de3a@molgen.mpg.de> Content-Language: en-US In-Reply-To: <55439fa7-2057-4dd7-9651-db15bd27de3a@molgen.mpg.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: apSDSf8fYcBdIiS8kbib7nD-mTzSgviB X-Proofpoint-GUID: apSDSf8fYcBdIiS8kbib7nD-mTzSgviB X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTI1MDA2NSBTYWx0ZWRfX2Ps0j4KfSxYy 2PQQnJwQE0ML+4oaXYQIA/5cs31odwXKvt4AUEMET5pjfdZt737AcKwvKGwbXvimw9GK1JmLLIZ YnfBFOAZqPyqKW+4R4mFBlYOJh8Su78xhFmNJDahkoyUwii7jkDWRjEERyx8SDD6Oe72C9klSw2 fonrXP1ONq8Jef3mqEDJHNOcJBspbCgoKZA15yZgDqvNbIq8ML0ycuT8iH6xdo8JoQ7FyyLGY8v BM/Bj57DOCHoTRKLT9g3Th5CCeC8Oas1EZhNS/aZKwn8sP8Xdnx9zFNamYnEdz9i2Uo9aCcgOOI ZZ9/2ZJIVmuNlLpdi20fRZJccfnKCFdZsAZMaHHitPXQpxh1XGF2LktMn6k1Rfwhql/bstr1uji 0zEuEMGN0NLQzpDtd+23X7eCq8SqdwwUEFC3e95yRtYAaftRVFJGVLMD1uMT0TokWXTuQaCeRdT d3s73u84uB8gj3vfgwA== X-Authority-Analysis: v=2.4 cv=PJY/P/qC c=1 sm=1 tr=0 ts=6a13f0ef cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=SMXFAHEO-8xBPAYFaCoA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-25_02,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605250065 Hi Paul, Luiz On 5/23/2026 4:42 AM, Paul Menzel wrote: > Dear Luiz, > > > Thank you for your reply. > > Am 22.05.26 um 18:22 schrieb Luiz Augusto von Dentz: > >> On Fri, May 22, 2026 at 10:50 AM Paul Menzel >> wrote: > >>> Thank you for your patch. Please mention the delay in the >>> summary/title. >>> Maybe: >>> >>> Use 100 ms SSR delay for rampatch and NVM loading >>> >>> Am 22.05.26 um 13:08 schrieb Shuai Zhang: >>>> When bt_en is pulled high by hardware, the host does not re-download >>>> the firmware after SSR. The controller loads the rampatch and NVM >>>> internally. >>>> >>>> On HMT chip, due to the large firmware file size, the >>> >>> Please document the size (> X MB) >>> >>>> loading process takes approximately 70ms. The previous 50ms delay is >>>> too short, causing the controller to not respond to the reset command >>>> sent by the host, which leads to BT initialization failure. >>> >>> Maybe paste the log? >>> >>>> Increase the delay to 100ms to ensure the controller has finished >>>> loading the firmware before the host sends commands. >>> >>> Why can’t it be increased to 1 s? >> >> Why would increasing it to 1s be a good idea? Actually a _proper_ >> driver should be able to detect when loading has finished, not just >> use an arbitrary timer and hope that works and the controller is >> responsive afterward. > > Indeed it’s not a fail safe in this case, and that’s what my comment > was about, that it should be explained why 100 ms is chosen, and not a > flexible way implemented. Sorry for not being clear. The 100 ms value is based on actual measurement data from the controller team. In HMT2.1 ROM, the BT boot time (warm reset, which is the SSR recovery path) was observed to approach 50+ ms. The previous 50 ms delay therefore provides no margin, causing intermittent initialization failures. 100 ms was chosen as it gives approximately 2x margin over the observed worst-case boot time, while keeping the SSR recovery latency reasonable for userspace. Regarding a more flexible approach: in the current configuration where bt_en is pulled high and the controller self-loads the rampatch/NVM, no HCI event is generated by the controller to indicate firmware load completion. Without such a notification mechanism, a fixed delay is the only viable option at this level. > >>>> Steps to reproduce: >>>> 1. Trigger SSR and wait for SSR to complete: >>>>      hcitool cmd 0x3f 0c 26 >>>> 2. Run "bluetoothctl power on" and observe that BT fails to start. >>>> >>>> Fixes: fce1a9244a0f ("Bluetooth: hci_qca: Fix SSR (SubSystem >>>> Restart) fail when BT_EN is pulled up by hw") >>>> Cc: stable@vger.kernel.org >>>> Signed-off-by: Shuai Zhang >>>> --- >>>>    drivers/bluetooth/hci_qca.c | 4 ++-- >>>>    1 file changed, 2 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c >>>> index ed280399b..184f52f9c 100644 >>>> --- a/drivers/bluetooth/hci_qca.c >>>> +++ b/drivers/bluetooth/hci_qca.c >>>> @@ -1680,8 +1680,8 @@ static void qca_hw_error(struct hci_dev >>>> *hdev, u8 code) >>>>                mod_timer(&qca->tx_idle_timer, jiffies + >>>> msecs_to_jiffies(qca->tx_idle_delay)); >>>> >>>> -             /* Controller reset completion time is 50ms */ >>>> -             msleep(50); >>>> +             /* Wait for the controller to load the rampatch and >>>> NVM.*/ >>> >>> Missing space at the end. >>> >>>> +             msleep(100); >>>> >>>>                clear_bit(QCA_SSR_TRIGGERED, &qca->flags); >>>>                clear_bit(QCA_IBS_DISABLED, &qca->flags); >>> >>> Is the time it took to load the rampatch and NVM visible in the logs? > > > Kind regards, > > Paul Thanks, Shuai