Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2245618lqt; Mon, 22 Apr 2024 05:59:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWwbtYU13DhCwOwqyogYhRLpspJVdv4aw8jOBnc0IvPsLYVx6dgrPzdXf2tv8GbSqHCiHQPOp0973sFWOzYbYVttFj6jY0CQuH1/zYPHA== X-Google-Smtp-Source: AGHT+IGjj7+vaCvmZL3IQwOGXYsfj8HZtigX2ZElNjbzR0Z6PHfLzL1Rnip1YFVY2ZxjkpD6A7oy X-Received: by 2002:a05:6a20:9782:b0:1a7:294c:1a6b with SMTP id hx2-20020a056a20978200b001a7294c1a6bmr9353433pzc.59.1713790786742; Mon, 22 Apr 2024 05:59:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713790786; cv=pass; d=google.com; s=arc-20160816; b=uCQdQbx4Yl5lpheG6N6NS7pW6KCY8yr3PEc36OcE+Nc09JPh5Xv0V30rQKWtJPHhHP w/4h3QtRXoVILvvr1K3NR8ZiAPW+qK0eKEHXu3RTx3YCDlKQKIgFxDXUokOa3yu+HjD5 axvb3Xd/lsAVRZ+l756Ui81+BzXBw3aJtu8hZ+JXCVncdTCLV7sektiD9kwe/NI2W7br zBnYmTv2fOZeZEGEW6O050VyNUpj50fDVPrFXTHOyKMtosq7JVckQEoKaqxMy/vYzLgX aqKwwQLYyKzNTRU/WCXQF+vOUsxCuQO2VKWxwBt0J8/jrF/JNcuZPDLRzZe0DLuN0Wse CESA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=8wrVt0/VjRkt1zb9z5YMK3jk5u7j2B45htwyCqFXlv0=; fh=9AeQCCczayS8HQi4eWcaab/mj/A+cIGPx+yRrJoRNg8=; b=KAM3stJfdkZnGbLCxWHVPn4HnAMerDYtfz/uKCGE811Bn2LnYPcPxkIOhsPXjMoaJs L19AaHL0N7kG2sb4xw23xDZoD+CyV9C0Iy8lzyvFylV8cIOFM3sD6M9ERYMFl7AgabCW eXcc+pANVz+9y5PDMCVyHRy/hc05q2F8+/Ccn/t2sJLKys8Gti+nzkqZfZHI8PoByhle qtXA4QqKHexywdPJ3rj9QqHLYGrCinzw2UcalTpyEV3QGEJ6E82Vx1fS91upf8Sh6oHL y4Whwt5odFmlZRO2SRycvWjkyvloCWBBjKCFk4NvJ1FICtPdnkHYjhl4LgPOARJsOQwS Pk1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=jcGJzdEx; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-bluetooth+bounces-3856-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d1-20020a63bd41000000b005f0c099b6f0si7696868pgp.87.2024.04.22.05.59.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 05:59:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3856-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=jcGJzdEx; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-bluetooth+bounces-3856-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 89FA428166A for ; Mon, 22 Apr 2024 12:59:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EA1D14A4C4; Mon, 22 Apr 2024 12:59:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="jcGJzdEx" X-Original-To: linux-bluetooth@vger.kernel.org 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 1F3914C630 for ; Mon, 22 Apr 2024 12:59:41 +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=1713790782; cv=none; b=Gl3vdn+I6CYfYKuxHE4uU6cJK5F3zLV4JXouIBBjljFEwKVq9Rmb/Obsvbw/poM9aZnKprF20DOkt/qp1Z/O8cUf4NnA7Uf0PJxoaJAbqs6wDsl6MmoVHEFqr39KL8048DmVRuskQ4herK8UkPA/xP+B8QIq2xNji4Ey1mjfBeQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713790782; c=relaxed/simple; bh=JkRtCItjT4NMSrbW/cfwXoeV8pTXaXLRZxT9BbtPJpo=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=G2E24eu5RUuGxDGmq4QTSiSA5l63GinuECbLKRRERA/x8RbayAS3BQwxxb/NCx3Ylu/CcoiuEXTtG56RLtUE9u33X+kS5fbCIbUxIk2e6+wH221pzxb5Z26EKPeE4y0FsLy0qKlSwh137mtfv6BGo1U8mUOCjV3tpnxOnkhohdU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=jcGJzdEx; 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=quicinc.com Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43M9cRd4006564; Mon, 22 Apr 2024 12:59:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=8wrVt0/VjRkt1zb9z5YMK3jk5u7j2B45htwyCqFXlv0=; b=jc GJzdExp6K+/kfWOay9z8KeXDfOjZktqzknxXzohvbIScMtMuqhvenQw3js40ltF1 Ln2idpepDQKEP7kgkoFTDDBpBDbteF4+qW3bSlppomVcPsFW07OYeT0UeWV6RZFy uzts5xGi4hczD5+qEBLvuFGXMyGQgRXEWrdsU80HQM/hLZy05Bz05Tnxl37KUoXh Nxvzmua7KPRXjVNeHSGI7oYoZp/2tV5cYlVlOFjvZaEQGlJLe48METRINfHGtSD6 Tkr5uOr6qjM+nWed+XFpkotJbeXiu73G2wpjv31AeNfwAGe267IdWaX8e3W7qW1H K2faaPdQAB5+330Q1Ejw== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xnne28dyp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Apr 2024 12:59:33 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43MCxWfd030679 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Apr 2024 12:59:32 GMT Received: from [10.253.37.80] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 22 Apr 2024 05:59:29 -0700 Message-ID: <9ac11453-b7cf-43f3-8e46-f96e41ef190d@quicinc.com> Date: Mon, 22 Apr 2024 20:59:27 +0800 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 2/2] Bluetooth: qca: Fix BT enable failure for QCA_QCA6390 after disable then warm reboot To: Krzysztof Kozlowski , , , CC: , , , References: <1713650800-29741-1-git-send-email-quic_zijuhu@quicinc.com> <1713771497-5733-1-git-send-email-quic_zijuhu@quicinc.com> <1713771497-5733-3-git-send-email-quic_zijuhu@quicinc.com> <930736f3-696c-4076-93fb-d879691bac66@quicinc.com> <01b0f63e-55f0-4396-bb8b-521bbe9b060e@linaro.org> Content-Language: en-US From: quic_zijuhu In-Reply-To: <01b0f63e-55f0-4396-bb8b-521bbe9b060e@linaro.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 7P5UiZAPTQtkCccWb4_CJ_zdaVrIdgVV X-Proofpoint-ORIG-GUID: 7P5UiZAPTQtkCccWb4_CJ_zdaVrIdgVV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-22_09,2024-04-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 mlxlogscore=999 mlxscore=0 malwarescore=0 clxscore=1015 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404220057 On 4/22/2024 8:22 PM, Krzysztof Kozlowski wrote: > On 22/04/2024 13:25, quic_zijuhu wrote: >> On 4/22/2024 3:42 PM, Krzysztof Kozlowski wrote: >>> On 22/04/2024 09:38, Zijun Hu wrote: >>>> From: Zijun Hu >>>> >>>> Commit 272970be3dab ("Bluetooth: hci_qca: Fix driver shutdown on closed >>>> serdev") will cause below regression issue: >>>> >>>> BT can't be enabled after below steps: >>>> cold boot -> enable BT -> disable BT -> warm reboot -> BT enable failure >>>> if property enable-gpios is not configured within DT|ACPI for QCA_QCA6390. >>>> >>>> The commit is to fix a use-after-free issue within qca_serdev_shutdown() >>>> during reboot, but also introduces this new issue regarding above steps >>>> since the VSC is not sent to reset controller during warm reboot. >>>> >>>> Fixed by sending the VSC to reset controller within qca_serdev_shutdown() >>>> once BT was ever enabled, and the use-after-free issue is also be fixed >>>> by this change since serdev is still opened when send to serdev. >>>> >>>> Fixes: 272970be3dab ("Bluetooth: hci_qca: Fix driver shutdown on closed serdev") >>>> Reported-by: Wren Turkal >>> >>> NAK. This is way too much. Previous discussion is going, I asked there >>> questions and before any answers happen, you keep sending new version. >>> This leads to previous discussion gone/missed. >>> >>> You ignored several questions and feedbacks. >>> >>> Best regards, >>> Krzysztof >>> >> i believe my commit message explains WHAT/WHY/HOW about this issue. >> >> 1) the qca_serdev_shutdown() was introduced by my below commit >> Commit 7e7bbddd029b ("Bluetooth: hci_qca: Fix qca6390 enable failure >> after warm reboot") >> >> 2) then Krzysztof's below commit was made to fix use-after-free issue >> but also causes discussed regression issue. >> Commit 0b7015132878 ("Bluetooth: btusb: mediatek: add MediaTek >> devcoredump support") >> >> 3) my fix will solve both this issue and the use-after-free issue. > > I had to keep reminding you about answering to question multiple times. > So one more time: > >> You did not address original issue of crash during shutdown and did > not clarify my questions. > let me explain here. original crash your commit fixed should only happens with machine for which property enable-gpios is configured, which also results in quirk HCI_QUIRK_NON_PERSISTENT_SETUP is set. for this case. for this case, serdev has been closed when qca_serdev_shutdown() write the VSC to serdev, so cause the crash. your commit fix this issue for this cause but cause regression for the case my commit message described. >> Anyway, any explanation providing background how you are fixing this > issue while keeping *previous problem fixed* is useful but should be > provided in commit msg. I asked about this two or three times. > i have provided it in this v5 commit. >> BTW, provide here exact kernel version you tested this patches with. > Also the exact hardware. > we can provide the kernel version in the bugzilla, as explained above, for the same soc_type, different machine have different config. different config have different result. > Best regards, > Krzysztof >