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 EC0E63A255D for ; Fri, 10 Apr 2026 09:56:06 +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=1775814969; cv=none; b=BRbTt8/YS+oKs8e2zd2Ioty5feGOlLnGDTR5BhLXbUvD+FqzJC7MSkCXGm+LYCCc3J4FCg4peENJ9WNdslm0z+xO6BE3tTrV4KXX8e8Qy2VIv46Lzn8GbVUA8mZ5r3YE7KHq+nCVFidIFEWCh+sZoiEVCMZg2yh4H1A/jNy+PY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775814969; c=relaxed/simple; bh=kecB0tUeYMe0UIVftwBRbSgxiekhLG6a/RcXZdFG73w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Pe7EbfrXbs4j3MCoczt8/TnCPoQkkLwIUJFXJ57wvXLF7ZJ7/W+hJ/voGDMDqoyPzihrk65wl28WX4rSK3mtopwwiQ2d2Q5VW1AaVhkgQZ5ysFC7Vw1Jg2g/nqSomyNpXYpx9UPTCJw6dMyxipiZRUIzojXT3+UiV0wFhT3JhZo= 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=mzXpGK1T; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ZRb2kI7y; 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="mzXpGK1T"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ZRb2kI7y" 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 63A8bGII115435 for ; Fri, 10 Apr 2026 09:56:06 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= WPvge4uWTP2wAKPGSlERwY7rGowwQNeKVWqNbDd1tGo=; b=mzXpGK1Tcpa7E28n MQj2T4T50ZUYAUweYctPpSRCcAL9T3ZamBoBrTmRICUGTR1SszZAUlb5SMkdMr7O 5dXyy7rYJvaQLEBWbg8kZ7Yvovp8T9h1nrzOe+5hvvZxlO6oHLkEarTCpABPeTxM qDMYt0MPQFcpfq1jFGk+XUYUuxATadEc576kPGa47opdjHJnHoStUXLM2Dtxdl+D W33PCkNolTnUcApyXW1ZSe3GfLNtA+D8r4gsQrm++LJYGZjVb/GfWC5+IsJxlVES MItMZLRnLdfHMlCt33wjUuwbMGj2myN7DXbdAdOpxG67kbf83VVaInpcJyqTc4Du RUtpsA== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dee8xbbg9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 10 Apr 2026 09:56:05 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2b24308165dso38580345ad.1 for ; Fri, 10 Apr 2026 02:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1775814965; x=1776419765; 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=WPvge4uWTP2wAKPGSlERwY7rGowwQNeKVWqNbDd1tGo=; b=ZRb2kI7y9KudOC8rNZe+/DX95bQiPSJLk1henXRl8FdB1RmuumEET3brPprUTj7QiE j8VqXCsH5fck5vrHnlIu4FvCS2CD/d9D3ADkM8bC6/xen4PF0sPs9aof/drCjtcqpIp5 qeqlhMSjptbX35OWyiijn4+7upIFzhTxZ5Bxe/z++tlselb+cK5mBgcDd1RzscEpG+2x aRW/tGUDSDuKdCyab9+OprmForp/ztmJfJ7kYtLvwJdw7CvrrWGj1ZadEg7kDR0/vi4U 1ZTZZafL+GpvFoeBZXVtlTN4sRo05ltGAXcdfVdMPP/I393aMJ6MxhhHVO9/HgP3ppa3 tzvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775814965; x=1776419765; 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=WPvge4uWTP2wAKPGSlERwY7rGowwQNeKVWqNbDd1tGo=; b=L/SK8kCReeb/FJl3J1gHhXTOV+FAAgr2SOlhOKX9n8yH1L+5DYpk//+rlCRIK+yhSd /nbJa2xtcctCt6Qwo1ab+hKvAb82aSW7m6NWsdcf4PSot09Fvs/zrgVFa/PWLT13+7F+ qOvhqgq0Hk1USF+ZgNdevlSuzypJXb8xMzz7r0FWqd+gg8pdcMOM8ND3exJPdV8lWIrW FQn2q2NhTnucnP7ScRU9j5KpnJAEh+T0FsqLuBzjeHsdAQ+U+xzTeOQFqMPQ7lTAvOGB aUV/jOvBbxmciRNIamtPGeHplgdM5nc7/Ob0Xk7kLG9QL1XzRQ7y2LO2UYDn1ARkpde2 Jy2g== X-Forwarded-Encrypted: i=1; AJvYcCUKyPUhGbvLz41s8UNENy7hox1P+/XTUKMrE15u7Nq9otdXW/fe4UGB8SEDiXm6juUfPRR0O5WsNvQGaz8=@vger.kernel.org X-Gm-Message-State: AOJu0YzsehojNHSltcpNEqLW2yGLf9M8FTknzSVkiktNqplPJcte6DBP 0E/RqGUigg3bR+lCGyTVYSsZ+UcFUEBwi4Qb4S6cIoTx1aACuN4Qyp3aZPRg1vVb1cmU402bmi/ LcAnyOX0Qdyglo6g8G3lWXm5dxJfSsJ1nl35K0CVyNtBsEQHimBJU8wbUBq9/MYgn+us= X-Gm-Gg: AeBDietCNHBSAV9qqs+z+7nL3Bgz4HQam0JVNoJmZnQTs2ClseFklt7bjzKTRcEnH18 bPLe928ItxTUJsRvtuDGhmlYcdCWwqgGyIb0tGGADXAJDzy1JOezsUeDNxnDA+XaSebmJVQPe0Q hsivzZ+I+SdZVVpla3A33UwLTy6VeJkNnsre3nGKKBuiJtm3yRjluyXWgz5VvWkrKRvsDb11pg0 XZxfekPZjM95TBdJV3lRVZp0JxGM+JtGEZAo8kBNKqEoNkb0E5Icx8TPw0dVIm4jRLozpUs8xBY VoolBrRwFMSPVU/NwmXt2G9HXdjAxd3ypMpu1SLHfdp0dH9Vr4m0JPFgCuqUs6ZYoBeurBHWS/6 0tjY3xamegVEGfQSDgIdq5cwQtstMSV9Lb24ZDsnAZ4w00tM= X-Received: by 2002:a17:902:d50a:b0:2ae:c358:bb7c with SMTP id d9443c01a7336-2b2d5a4a515mr27985505ad.35.1775814964886; Fri, 10 Apr 2026 02:56:04 -0700 (PDT) X-Received: by 2002:a17:902:d50a:b0:2ae:c358:bb7c with SMTP id d9443c01a7336-2b2d5a4a515mr27985135ad.35.1775814964368; Fri, 10 Apr 2026 02:56:04 -0700 (PDT) Received: from [10.239.97.158] ([114.94.8.21]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b2d4ddb462sm23812085ad.24.2026.04.10.02.56.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Apr 2026 02:56:03 -0700 (PDT) Message-ID: Date: Fri, 10 Apr 2026 17:55: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 v6] Bluetooth: qca: Fix delayed hw_error handling due to missing wakeup during SSR To: Paul Menzel Cc: Bartosz Golaszewski , Marcel Holtmann , Luiz Augusto von Dentz , 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, Bartosz Golaszewski References: <20260410085202.4128000-1-shuai.zhang@oss.qualcomm.com> <489d33f4-16a1-430c-9ec6-7f13a8f2f995@molgen.mpg.de> Content-Language: en-US From: Shuai Zhang In-Reply-To: <489d33f4-16a1-430c-9ec6-7f13a8f2f995@molgen.mpg.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDEwMDA5MiBTYWx0ZWRfX4Gamj8B2wBDb DqJQlO9mSd/xlnXDPeHkwU4BLvd3G0daJWvpEukJgL5Co5O71XSHUpqx71u4mExFbJSOEBFaZGD DJXrCzQDhspV3LgzvPp6BGVPqZLgpGkJNFxB2x0uCC5JI+NiOGDlpePMHl2/mw/4miXpTwhsyNF KdZELUvwLYuCudR1ZjzNckZkKIfCHk4e4wXmyB611KKxJxokFMVinzXVzbK49cr1+tFA92j1P5a pBBTn4uJsL0BqNvrWzoTFQM59q7QzFmpVbxG/8+PVTChASxFgy7DoZOG/FrGA93ySV7H7eI9POg jqLlTt5n8LBP7WuflixXrHKSCGMbTPRL+Cp4FCf9voedZ9Ud2aGjPL5PHksYFXtkn2IIAtlj3H7 8lj5BNgup29fm9AaVqTKx0gLJ4T1eavsT/gp3bhTdvNl0hCtLTMM32ednbPq4E6MwJUTE3pzTBf hgk7v/y/4K9rmRCCpvA== X-Proofpoint-GUID: BKRC5KptD5feXWt5N9ZR3RB8ZDLupfZG X-Proofpoint-ORIG-GUID: BKRC5KptD5feXWt5N9ZR3RB8ZDLupfZG X-Authority-Analysis: v=2.4 cv=O7YJeh9W c=1 sm=1 tr=0 ts=69d8c935 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=COk6AnOGAAAA:8 a=c92rfblmAAAA:8 a=nMkBCxXBiB_ylkh7ArAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 a=TjNXssC_j7lpFel5tvFf:22 a=GvGzcOZaWPEFPQC_NcjD: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-04-10_03,2026-04-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 phishscore=0 priorityscore=1501 adultscore=0 impostorscore=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604100092 Hi Paul Thank you for the suggestion. I have updated it in v7. On 4/10/2026 5:38 PM, Paul Menzel wrote: > Dear Shuai, > > > Thank you for your patch. Just some last style things. It’d be great > if you could re-flow the commit message to 75 characters per line. > This would save some lines. > > Am 10.04.26 um 10:52 schrieb 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. > > Maybe mention the timer value? > >> 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 > > s/adds/add/ > > Now that you use `clear_and_wake_up_bit()`, this might confuse > readers. Maybe: > > To fix this issue, also wake up the other thread by using > `clear_and_wake_up_bit()`. > > Feel free to ignore though. > >> 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`. > > It’d be great if you mentioned one affected controller. > >> - 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. > > Please paste the logs. > >> Reviewed-by: Bartosz Golaszewski >> Signed-off-by: Shuai Zhang >> --- >> Changes v6: >> - Replace wake_up_bit with clear_and_wake_up_bit >> - Link to v5 >> https://lore.kernel.org/all/20260409112233.3326467-1-shuai.zhang@oss.qualcomm.com/ >> >> Changes v5: >> - Replace clear_and_wake_up_bit with wake_up_bit >> - Link to v4 >> https://lore.kernel.org/all/20260327083258.1398450-1-shuai.zhang@oss.qualcomm.com/ >> >> 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); > > With the comments above addressed: > > Reviewed-by: Paul Menzel > > > Kind regards, > > Paul > > > PS: gemini/gemini-3.1-pro-preview has some unrelated(?) comments [1]. > It’d be great if Qualcomm could look into this. > > > [1]: > https://sashiko.dev/#/patchset/20260410085202.4128000-1-shuai.zhang%40oss.qualcomm.com > Thanks, shuai