From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 8463133C51A for ; Mon, 30 Mar 2026 02:11:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774836667; cv=none; b=O/VZ/YDoY0DXIPoLP8p1iIAnH3bkfAPCj+KzYmTko68ilN2Y4Qi/VSbe6Z/F9pa1DYnf+sjP+x2Or84JePkwL1PGHon7FUdokQZJE7SqQfrHR9nsgX45PB3lOpK0ukhFwaoW95XAsBhANi03RNXmJpR/3NxFX5lFfQhak5IzDeo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774836667; c=relaxed/simple; bh=FbloVJ6ZYAwb202X2oY4C5QbMUVhVHukJiZul5rQuEY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uETu7kSn2RaHTrgjAiryVTLXlUvTP2Eyo/V6evjQaUfliYGIDyiAuE4bnOC/mcEnS6chneDHSIdFTsz9NfUp+KPLQQ+3J5Tg8E3JE2gjNRiGswbGr4iRVfMFMvJE9+FiNeTmnAAtRFtUEBNfI+IhXJmMKs3ridd855t8JvSpkss= 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=aeVAa28b; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=XMM1tQDN; arc=none smtp.client-ip=205.220.168.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="aeVAa28b"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="XMM1tQDN" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62TAhZla3931721 for ; Mon, 30 Mar 2026 02:11:05 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= gAJ++qiIe/HkmvU48xI1bbnnG+ouTJL7+deDhZkHf8Y=; b=aeVAa28bEpF2QGSe cgM+YN5fN6taUqQo3NvOWILmzn6RuH/zk6kDh4oCWSBjbF/HkVgs21VRkyYxCZ7S 1D+C1Lhw6/GeJBAZbSxaMZmw+Sae6u6Ll0agjoVP7k0k72tD5ezzrbgJAR9Azs0S 8cSddbPavJGgiaF4sVm2sBiHX/XViuanWvgF2TabGg1tEOu+EiAHzz5IJOmAKoV3 EnC7IOZBlZ0OJhmIImfGPMAuwg8T8XtXmTUiA2SNFW5LIloWaUfAQty7bNdD60Rb m1gJ7JjHi3h41kesjunCvbMx/DPLT1e2+U0/gej+BfyaPCRtu76K3J0692xO2JNG 2ZljPA== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4d64pdccrf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 30 Mar 2026 02:11:04 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-35d93a8149bso1997279a91.0 for ; Sun, 29 Mar 2026 19:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1774836664; x=1775441464; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=gAJ++qiIe/HkmvU48xI1bbnnG+ouTJL7+deDhZkHf8Y=; b=XMM1tQDNsKc8SfG8SqSRJ2zK/vXXqKwl/33NBYimEBzYKadP/mMqiWon/NplAzfaDA Fm4MPzUfHaLUhkTRrrA9UXCqQ8N0m6PNy8iCb7FNqIJ0vdJWW5IR66g3M3ps3kApWLYW 8oljPjy4+INXBkym28HoLrni163GWeKw79MMh4XwknES7lSWPDhMDtAIgC6XrcVyaO3U Eu995XunsKbPfFFKmoKj2468yz/wyg5o0r3irFUrc9wEC4UUPn5NifNaaoZ/S6hn9S0F jiy5PhQ5PcpUYGuT1/ng4iW7VTcMlFBUg4/3p1RgqjAN0pkNBi1VEuZs2b8P4DP40Hng Cd2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774836664; x=1775441464; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gAJ++qiIe/HkmvU48xI1bbnnG+ouTJL7+deDhZkHf8Y=; b=Uc9eX2ls4CFS76JKCEQqdT7ga7b34tPdVm+gxlYH6xFOHFnKbdhAcGSB45Ws4wg1uq 7VzppCJt+PZ1xywaLSKpTjojq2WIihj8vHQcQcYsKg3VQICLIevgJEklFT3cYxg4FfnG OruslNnB+ZrQOcMqBD71doa9wGTQsMvharHvZ1I5XB9K+Zrq6Lyul8oQVQ61OpxUFP3X 15gEo+C/CA9LcEF1wRn/kAiC/rIg7rrIXzyYJUAJZAcuh0BbbmaRs65+QLZakdYOcyl9 blUrkD52o24UhtP6POJUb0Ggse4Y6GlEum/DiiuEI7/IYkGPCHvfkwGm08UxrLGwGPAh KESw== X-Forwarded-Encrypted: i=1; AJvYcCVxdBa4goufDQl8UzgMCYlUuR4RHgggqRHEgeeQknbZ8dhG5+4fSZezcovLF8GV8k/JeJDJapeRDczb8Zw=@vger.kernel.org X-Gm-Message-State: AOJu0YyA/OVW8+P93ugby8VTsaFQUShpg5Z6X5ZbX51WnH1YmlMYsACN ikb2JYzMyuJuBH1CKBJgOWIel/BPR4LGcuEzEH1ledPL1jeXlZuLhth4pkat3OJUabL9Ns9+vm2 KTIny9V/t07XxIzVFx2K1Iq2X6cfmCPYiyZMeinQHNPJJju/p3H0B14J7Af9V7ytDrFM= X-Gm-Gg: ATEYQzzOKqVtmrXjeJbQ/xna3rqwgI3ExUPiABEJpVjivBobzRHwIdSYmVTHsldhrKU /PAcfAX1krZWyOcpfkUooSwo7Tr8StDJrSyOSZAW83IDtTrvBxEglqx+4BvCPbVlXjdETx9Y75u lFcKRNDZp2Qg9YUFQo90T/j6Zebs7UVx62O6fWA4rhRCZ3XDjmwUdAp6UeqU6lA7dQA30Den3LP IFtJkg0EGrxgKqwdBJkUCH5H0LBf0BJ9qfQeJ9G1I4I6cCzBEiImo2HNBjXJigDvXhvUUh+6n4x R7Wo5L+U9RdRmAMsoaFACwSGA2DquWPVUfbLmTeUSt5jn9x8+QDqL8snYyB5oLq1b2E+TPqc6XS i7HycqO3FpRVun4ay2LdTVRIGejHA+o9G6o7lCjzm69U7NCc2LCKYEhb0R829/hDNdBucYe0c6R nz X-Received: by 2002:a17:90b:3d81:b0:35b:952c:43ab with SMTP id 98e67ed59e1d1-35c30bb5f2amr7681723a91.4.1774836663845; Sun, 29 Mar 2026 19:11:03 -0700 (PDT) X-Received: by 2002:a17:90b:3d81:b0:35b:952c:43ab with SMTP id 98e67ed59e1d1-35c30bb5f2amr7681693a91.4.1774836663333; Sun, 29 Mar 2026 19:11:03 -0700 (PDT) Received: from [10.110.2.194] (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35d9509cf33sm5321474a91.13.2026.03.29.19.10.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Mar 2026 19:11:02 -0700 (PDT) Message-ID: Date: Mon, 30 Mar 2026 10:10:58 +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 Subject: Re: [PATCH v4] Bluetooth: qca: Fix delayed hw_error handling due to missing wakeup during SSR To: 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, Shuai Zhang , Bartosz Golaszewski References: <20260327083258.1398450-1-shuai.zhang@oss.qualcomm.com> Content-Language: en-US From: Shuai Zhang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: 6xxmt4i-4z_UpGcbiOJRyJXOgHEdGIV4 X-Authority-Analysis: v=2.4 cv=UZpciaSN c=1 sm=1 tr=0 ts=69c9dbb8 cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=VwQbUJbxAAAA:8 a=COk6AnOGAAAA:8 a=c92rfblmAAAA:8 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=nMkBCxXBiB_ylkh7ArAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 a=TjNXssC_j7lpFel5tvFf:22 a=GvGzcOZaWPEFPQC_NcjD:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: 6xxmt4i-4z_UpGcbiOJRyJXOgHEdGIV4 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzMwMDAxNCBTYWx0ZWRfXw+xksSi1NMn9 VSLMmUw3J1Fi88z9oRYfJEK7MO7U4vYI/b2b52N68Da5FXQMshn0Q9BlbZbpCYPA2qpFRQwGnyM Noqmn6W5VoZuL95UWAFZM+eoQjoe3Rtb4du9++Dw67iSMYf+QYvM6LrabQGKXsxvT20+zqTGuw8 Domb1U77CYenDg4ZvjVOamGrNe4ou5p4EBsX9sP4Df7OkoTyE55gEoQ9VLPIxDOgbcFENEfeZK/ nNioCzF9p7gXxoLYbL7dL17ESpfCR1RoGzcbB5kAuaBTDxfR03feoqDneahsSNinZqna8KAkn3X ELX1rWbMail5UZ4Y8aPtFaFSeUP2IrCoe7UgPhilDoZOp85Pc9ZAhwQPwdYAASu9+vG+J0Hwr36 o7BK+tpfZsMtPHte3gTY6G+4yqB8jiaXJZjiGjNNiD4fYi7XyZVfXh80fCbN9cPCM/uhutO/WEo 3Mf4m3cvCfjNRBdw+WQ== 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-03-29_05,2026-03-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 adultscore=0 spamscore=0 malwarescore=0 impostorscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603300014 Hi Luiz Thanks for the suggestion. On 3/28/2026 1:51 AM, Luiz Augusto von Dentz wrote: > Hi Shuai, > > On Fri, Mar 27, 2026 at 4:33 AM Shuai Zhang > wrote: >> From: Shuai Zhang >> >> 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 >> Link: https://lore.kernel.org/stable/20251107033924.3707495-2-quic_shuaz%40quicinc.com >> Acked-by: Bartosz Golaszewski >> --- >> Changes v4: >> - add Acked-by signoff >> - Link to v3 >> https://lore.kernel.org/all/20251107033924.3707495-1-quic_shuaz@quicinc.com/ >> >> Changes v3: >> - add Fixes tag >> - Link to v2 >> https://lore.kernel.org/all/20251106140103.1406081-1-quic_shuaz@quicinc.com/ >> >> Changes v2: >> - Split timeout conversion into a separate patch. >> - Clarified commit messages and added test case description. >> - Link to v1 >> https://lore.kernel.org/all/20251104112601.2670019-1-quic_shuaz@quicinc.com/ >> --- >> 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 c17a462ae..228a754a9 100644 >> --- a/drivers/bluetooth/hci_qca.c >> +++ b/drivers/bluetooth/hci_qca.c >> @@ -1108,7 +1108,7 @@ static void qca_controller_memdump(struct work_struct *work) >> qca->qca_memdump = NULL; >> qca->memdump_state = 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; >> @@ -1186,7 +1186,7 @@ static void qca_controller_memdump(struct work_struct *work) >> kfree(qca->qca_memdump); >> qca->qca_memdump = NULL; >> qca->memdump_state = QCA_MEMDUMP_COLLECTED; >> - clear_bit(QCA_MEMDUMP_COLLECTION, &qca->flags); >> + clear_and_wake_up_bit(QCA_MEMDUMP_COLLECTION, &qca->flags); >> } >> >> mutex_unlock(&qca->hci_memdump_lock); >> -- >> 2.34.1 > https://sashiko.dev/#/patchset/20260327083258.1398450-1-shuai.zhang%40oss.qualcomm.com > > Not saying the feedback is actually valid, but if there are other part > of the code still using clear_bit(QCA_MEMDUMP_COLLECTION then perhaps > they should be updated as well? Only these two locations incorrectly use clear_bit instead of clear_and_wake_up_bit.  All other uses of QCA_MEMDUMP_COLLECTION only involve set_bit and test_bit. Thanks, Shuai