From nobody Fri Dec 19 17:58:12 2025 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 CEF5C226165; Fri, 7 Nov 2025 03:39:34 +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=1762486776; cv=none; b=XiQC6WirTfflu0J5Xjh3qxXOCyKpQvD4+cwJlOx3C1B1aujcnQwcu8Q5/TKXP/tnZlOOMILqmJEckN4iY3/e6kg9SatfK3jhP840yrvobDagsE70YW5TuC9G4oEvXGBsfEUFEpTMEMA5auv+tkOy5swCK+YAcxb4zbp50MbblTQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762486776; c=relaxed/simple; bh=pW8CPbG5NzFUuHOLRpITRiR3Ksw9Yy71m5ZNvZG6vXI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OjgRSLcMpypWuqnAAjdJ1zbRvD9DzFUHB17p5k2aYrHzgm5+Z/4C1p4na+NaQ96H0DN84NtZdxa0VCMAdtHLbupGCvkaqC4n4WoSMZ4zUiYIfiyIv2dqAsnmQkq+6lNGP+R+PjgDakDYrRRijfMN5bTrLv8mh9jYM3BmB2c3eTw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=DLdCbUNq; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="DLdCbUNq" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5A6JfGs4629578; Fri, 7 Nov 2025 03:39:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=rMmRLjhdiIR peHRDuVPCwK9RaNnFhcASjqVMv5nFqBg=; b=DLdCbUNqXwotqxYdw8NqyL9Dxsh yK5AWxh2LMQmCd5rBt2nlpvipJRV9eBRrCGDlTH+1fqBlEEBK7/ihimRFyCPTwRV 4mJldZ3sNUUj+N9/LUyZGwQZuHtYKTXCL9T12jPURm7ffXacAjd8rqRUEDa4Lsaz BTj4bsSyVFvvRHZp8YwZRuFdsKEwxeKNHc3dJTVHaZ2tV4Na1ILcTgGu2vj+PLgi PJ31ELPjBUI6X+VgnMSG/Mb26zrN9+W+hi6zgKrX4l96IF2S5GWx+H++AjGzHRtA sIsV7zueLjlh5UfrxaqLiYy/pNAT73YW3RqzFTwUYcXWVaULRxPl6Mau6TA== Received: from aptaippmta01.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com [103.229.16.4]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4a922314uu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Nov 2025 03:39:30 +0000 (GMT) Received: from pps.filterd (APTAIPPMTA01.qualcomm.com [127.0.0.1]) by APTAIPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTP id 5A73dR1O014120; Fri, 7 Nov 2025 03:39:28 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APTAIPPMTA01.qualcomm.com (PPS) with ESMTPS id 4a5b9nc06j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Nov 2025 03:39:28 +0000 Received: from APTAIPPMTA01.qualcomm.com (APTAIPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 5A73apbt011614; Fri, 7 Nov 2025 03:39:27 GMT Received: from bt-iot-sh02-lnx.ap.qualcomm.com (bt-iot-sh02-lnx.qualcomm.com [10.253.144.65]) by APTAIPPMTA01.qualcomm.com (PPS) with ESMTPS id 5A73dR5m014105 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Nov 2025 03:39:27 +0000 Received: by bt-iot-sh02-lnx.ap.qualcomm.com (Postfix, from userid 4467449) id 65D4D2327A; Fri, 7 Nov 2025 11:39:26 +0800 (CST) From: Shuai Zhang To: Bartosz Golaszewski , Marcel Holtmann , Luiz Augusto von Dentz Cc: linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, quic_chejiang@quicinc.com, quic_jiaymao@quicinc.com, quic_chezhou@quicinc.com, Shuai Zhang Subject: [PATCH v3 1/2] Bluetooth: qca: Fix delayed hw_error handling due to missing wakeup during SSR Date: Fri, 7 Nov 2025 11:39:23 +0800 Message-Id: <20251107033924.3707495-2-quic_shuaz@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251107033924.3707495-1-quic_shuaz@quicinc.com> References: <20251107033924.3707495-1-quic_shuaz@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTA3MDAyNiBTYWx0ZWRfX0KcojV/VT2+P +tLoABWMv+C77fp+lkKIEEP42kaMEZTEIkcafUP2b4YrN2lAJDK67BJGlGM/kmbPP2/ac4/4uXc 0nbshHXwt22kzbvg3zCPm0K3dZUy6BjDQGG2uWi+6MZIRXqITn6uPuA+rLkNPZKKmjy8nMfdkQ/ 2K8gYClvEPqfwY0fpFsQzYnG+Jn2VeoC9mURk85/y4Sp2RSb7kHfHiYfXBINBlisZHHEZGZSHVC YuAjKYkSd3wslKEmaPCG8v4N6lO/dd5uLV/Qao+bRVEmeiJRJH/0TPsVV+G9HVmtl+S4oS+xiXF P0pi5lJP/W5Qyx9QcjmHdeP8U7iwRHKAaAHPnkhNSCh7lwGpz1PIW3lUwRKwvfBlbSMbPi+kh11 sY3qHxyOxZClE1RZInTr5e4rgFHbVA== X-Authority-Analysis: v=2.4 cv=Csmys34D c=1 sm=1 tr=0 ts=690d69f3 cx=c_pps a=nuhDOHQX5FNHPW3J6Bj6AA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=COk6AnOGAAAA:8 a=eIGlGOcC9ytwnVZZLkwA:9 a=TjNXssC_j7lpFel5tvFf:22 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-GUID: PEqset9ezb0WcrLylz9MvdqWxuZeoe9H X-Proofpoint-ORIG-GUID: PEqset9ezb0WcrLylz9MvdqWxuZeoe9H X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-06_05,2025-11-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 clxscore=1015 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511070026 Content-Type: text/plain; charset="utf-8" When Bluetooth controller encounters a coredump, it triggers the Subsystem Restart (SSR) mechanism. The controller first reports the coredump data, and once the data upload is complete, it sends a hw_error event. The host relies on this event to proceed with subsequent recovery actions. If the host has not finished processing the coredump data when the hw_error event is received, it sets a timer to wait until either the data processing is complete or the timeout expires before handling the event. The current implementation lacks a wakeup trigger. As a result, even if the coredump data has already been processed, the host continues to wait until the timer expires, causing unnecessary delays in handling the hw_error event. To fix this issue, adds a `wake_up_bit()` call after the host finishes processing the coredump data. This ensures that the waiting thread is promptly notified and can proceed to handle the hw_error event without waiting for the timeout. Test case: - Trigger controller coredump using the command: `hcitool cmd 0x3f 0c 26`. - Use `btmon` to capture HCI logs. - Observe the time interval between receiving the hw_error event and the execution of the power-off sequence in the HCI log. 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 888176b0f..fa6be1992 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -1103,7 +1103,7 @@ static void qca_controller_memdump(struct work_struct= *work) qca->qca_memdump =3D NULL; qca->memdump_state =3D QCA_MEMDUMP_COLLECTED; cancel_delayed_work(&qca->ctrl_memdump_timeout); - clear_bit(QCA_MEMDUMP_COLLECTION, &qca->flags); + clear_and_wake_up_bit(QCA_MEMDUMP_COLLECTION, &qca->flags); clear_bit(QCA_IBS_DISABLED, &qca->flags); mutex_unlock(&qca->hci_memdump_lock); return; @@ -1181,7 +1181,7 @@ static void qca_controller_memdump(struct work_struct= *work) kfree(qca->qca_memdump); qca->qca_memdump =3D NULL; qca->memdump_state =3D QCA_MEMDUMP_COLLECTED; - clear_bit(QCA_MEMDUMP_COLLECTION, &qca->flags); + clear_and_wake_up_bit(QCA_MEMDUMP_COLLECTION, &qca->flags); } =20 mutex_unlock(&qca->hci_memdump_lock); --=20 2.34.1