Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2153920lqt; Mon, 22 Apr 2024 03:06:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXx/27AZSFIBBQ5RWWvWR5zkBmGLhtH6W6WlHD6mASq7VKkrDp+Qcu6Y0nYLOWBH6AGKcDYBtzKMkK7fJeoEgWsvZBJ7t9MPT6LE/17wA== X-Google-Smtp-Source: AGHT+IHEcJq8FcEipfOvw1tcZv+lhdbrNYl7H+LwaJanYbHxqa95a5lq0f+5MmNhNRHKpxuFRm3j X-Received: by 2002:a17:90a:fd01:b0:2a8:5968:449d with SMTP id cv1-20020a17090afd0100b002a85968449dmr7555894pjb.32.1713780387107; Mon, 22 Apr 2024 03:06:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713780387; cv=pass; d=google.com; s=arc-20160816; b=GK4MjNm73SpdD3CLWOKgK70fVskJ9ZYpooAhmb6PuAapyc6g8g/l6GrMj/Y+z/FZXF 2fqpYpUP1fzTFbEa47ZgU48hOVCrFmrh70fqqqF7lQQxSeesMlbK65kalC7HJZU+H/AB qeaaSR2jl7dd1c78NOGl5JBFXBPtE4Htp7PfcdQAbKgZFU3D2LtIW1dCiXbpVk2RxWcQ AKq0GNAahlrv5igZnFoZ+CunvrNTJMDNCNIpzVhNakISCGQsws+sZkXZGsIMjP5GRUjF 6eBKI+O0xqCrTXg+uhss+d6YxdglUT/e9Gn0FB5YuKl0YB9AVszSwLEviN+ecZLKq6W/ 5Eqg== 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=cCGAXm+BLnaLsmVGODVMV9DrQGce84LB+51kR75mb+4=; fh=6XqS24M901+BCo+ZpyLmoJWXLHvAIySeko9AkkD8vhs=; b=mY6MYMoMH7uTUBpBQuFOzfjWXnTWTpRHNPen/uXFIZow/lCHr50QZd+7YWWLGtWMHh KuBq8581sd6iCcGCBx4SMuwQM6vcOBLv8iRtwljNKK5zoA3HNQ1hLmKR3pm6ChvMmx7m rGSqE9B0xn/S6ikvZ2LLZmGGfo7mL3A3QVP5TjjWDKlMcxwL3ttNrBBj+9zIlhhova6+ 9nm/cHJce35ulA/zckzpoi+EkRp/DWlGRw5mLWQkx7j5CHw8GxSDF9ZbEgd4qvUCC1Bz v4/6L1RIFSkgRylkUzW4kw/XgM4xO0nP2u8IuO6YlJaSfetebPZ7lOygXLUcHlLFS3c8 EByg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=B1Cr2HvE; 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-3850-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3850-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 my15-20020a17090b4c8f00b002ae460e8b91si464084pjb.18.2024.04.22.03.06.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 03:06:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3850-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=B1Cr2HvE; 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-3850-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3850-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 19AB5283838 for ; Mon, 22 Apr 2024 10:06:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F86913E05E; Mon, 22 Apr 2024 10:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="B1Cr2HvE" 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 957BC13C3F4 for ; Mon, 22 Apr 2024 10:06:07 +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=1713780370; cv=none; b=t4Z1tCp7jhCWBG0ziqu3Le2SsrxY+MPhNk9zCJCyB95qoCEfG/tBEuJuS1a5AU0Tnmwog608soldCQkKDcMHopBCEJO8AHJVWq3Cf0g1eyXCN0PJVp+nNB3OYhPNg3Kh5v5uYma2iIm3velUGvXVKJyEhF+NY25LFKvFwi4/gL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713780370; c=relaxed/simple; bh=oR1rWwDyedGxBr1N4vvrYHssvhX6UCgY6XUX0M/nhA0=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=jJjvBEpvguuyslEjHsITZjUWYuRED+jRPjxgITGXwC2E0wg90APaifgRPIqdgZ7eq3oDjZ9i8tlG3rl84zraVsfbReHMJfJqe+RbUFkpcVQEZby42FYmYrSwh2wJAtPZYemR3ltgILxaWs52wPNssVgO+7OMmWAQJHrusb9vqCc= 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=B1Cr2HvE; 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 (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43M1XkbJ031424; Mon, 22 Apr 2024 10:05:58 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=cCGAXm+BLnaLsmVGODVMV9DrQGce84LB+51kR75mb+4=; b=B1 Cr2HvEZ5b7rZKcFpvjraQtZxrtHqrMLQPZ0Mb10d/u8yeUEKOIDyu9AycCnTBEvR 80Ng2kxUNuOgLz4BF8FtaOvvaUG+ljNWzpvyCWKJvZ+5gBNHXMbfxbDAeTsuo7gs RcIVXmiZHMx66pxYn9MMpalnIb0dlOrzGjfq8sirEbcf9j8iLkVAbYpUPqg4WDiP Xb+yf22wcb9ktSf5qjJgMHFXNtNSW0/E1fGRV19GICk+j+4I7P/0WMj4SqikncJw iCclUbQJ7pzFNXb/3LbGM1DrX+Y1RWHlHPQ54gvxHKNzKDs05NqoDv6i+bKHKXrU S/EfyLYIl9mSYiTQ2kkQ== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xmxq4t38w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Apr 2024 10:05:57 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43MA5u97011549 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Apr 2024 10:05:56 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 03:05:54 -0700 Message-ID: <96702ddc-ef5c-499c-abd4-95f89eb3aeba@quicinc.com> Date: Mon, 22 Apr 2024 18:05:52 +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 v4 0/2] Fix two regression issues for QCA controllers To: Krzysztof Kozlowski , Wren Turkal , , , CC: , , References: <1713564212-21725-1-git-send-email-quic_zijuhu@quicinc.com> <1713650800-29741-1-git-send-email-quic_zijuhu@quicinc.com> <369512e2-f091-4370-bce5-9ac32178dc4d@penguintechs.org> <2bd1f1bf-f867-4430-8ce5-c691485665e1@kernel.org> Content-Language: en-US From: quic_zijuhu In-Reply-To: <2bd1f1bf-f867-4430-8ce5-c691485665e1@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: m--UWKHpdnId69fVVaeytEYny6Qe6JZr X-Proofpoint-ORIG-GUID: m--UWKHpdnId69fVVaeytEYny6Qe6JZr 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_07,2024-04-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 clxscore=1015 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404220038 On 4/22/2024 1:52 PM, Krzysztof Kozlowski wrote: > On 22/04/2024 02:14, quic_zijuhu wrote: >> On 4/22/2024 2:41 AM, Krzysztof Kozlowski wrote: >>> On 21/04/2024 09:44, Wren Turkal wrote: >>>> On 4/20/24 3:06 PM, Zijun Hu wrote: >>>>> This patch series are to fix below 2 regression issues for QCA controllers >>>>> 1) BT can't be enabled once BT was ever enabled for QCA_QCA6390 >>>>> 2) BT can't be enabled after disable then warm reboot for QCA_QCA6390 >>>> >>>> @Zijun @Krzysztof and @Bartosz Would it be helpful for me to test these >>>> to ensure they fix the issues I reported? >>>> >>> >>> I look forward to someone testing these on other hardware, not yours. On >>> the hardware where the original issues were happening leading to this >>> changes, e.g. RB5. >>> >>> Anyway, the problem here is poor explanation of the problem which did >>> not improve in v3 and v4. Instead I receive explanations like: >>> >>> "this is shutdown of serdev and not hdev's shutdown." >>> Not related... >>> >> this is the reply for secondary issue. i believe i have given much >> explain for my fix for the 2nd issue as shown by below links. > > No, you did not. > >> let me add a bit more explanation within the ending "For the 2nd issue" >> section, supposed you known much for generic flag >> HCI_QUIRK_NON_PERSISTENT_SETUP, otherwise, see header comment for the >> quirk. also supposed you see commit history to find why >> qca_serdev_shutdown() was introduced for QCA6390. >> https://lore.kernel.org/all/fe1a0e3b-3408-4a33-90e9-d4ffcfc7a99b@quicinc.com/ > > You did not answer my questions. > > Let's quote: > > "i don't explain much since these HCI_QUIRK_NON_PERSISTENT_SETUP and > HCI_SETUP is generic flag." > > Srsly, what is such answer? > > i reviewed my reply. i have explained to you why my change fix both this issue and the issue your commit fixed. so i don't think it is meaningful to explain why your wrong condition are changed by me. > > > >>> "now. you understood why your merged change as shown link of 4) have >>> problems and introduced our discussed issue, right?" >>> >> this is the reply for the first issue as shown by below link. it almost >> have the same description as the following "For 1st issue:" section. >> i believe it have clear illustration why the commit have bugs. >> https://lore.kernel.org/all/2166fc66-9340-4e8c-8662-17a19a7d8ce6@linaro.org/ >>> No. I did not understand and I feel I am wasting here time. >>>> Code could be correct, could be wrong. Especially second patch looks >>> suspicious. But the way Zijun Hu explains it and the way Zijun Hu >>> responds is not helping at all. >>> >>> Sorry, with such replies to review, it is not worth my time. >>> >>> Best regards, >>> Krzysztof >>> >> Hi luiz,marcel >> >> it is time for me to request you give comments for our discussion >> and for my fixes, Let me explain the 1st issue then 2nd one. > > You keep pushing and pushing even though I stated my remarks. > > >> >> For 1st issue: >> 1) the following commit will cause serious regression issue for QCA >> controllers, and it has been merged with linus's mainline kernel. >> >> Commit 56d074d26c58 ("Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() >> with gpiod_get_optional()"). >> >> 2) the regression issue is described by [PATCH v4 1/2] commit message >> as following: >> 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. >> i will verify and confirm if QCA_QCA2066 and QCA_ROME also are impacted. >> >> 3) let me explain the bug point for commit mentioned by 1), its >> commit message and bug change applet are shown below. >> >> The optional variants for the gpiod_get() family of functions return >> NULL if the GPIO in question is not associated with this device. They >> return ERR_PTR() on any other error. NULL descriptors are graciously >> handled by GPIOLIB and can be safely passed to any of the GPIO consumer >> interfaces as they will return 0 and act as if the function succeeded. >> If one is using the optional variant, then there's no point in checking >> for NULL. >> >> qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable", >> GPIOD_OUT_LOW); >> - if (IS_ERR_OR_NULL(qcadev->bt_en)) { >> + if (IS_ERR(qcadev->bt_en)) { >> dev_warn(&serdev->dev, "failed to acquire enable gpio\n"); >> power_ctrl_enabled = false; >> } >> 3.1) we only need to discuss how to handle case "qcadev->bt_en == >> NULL" since this is only difference between the commit and BT original >> design. >> 3.2) BT original design are agree with the point of above commit >> message that case "qcadev->bt_en == NULL" should not be treated as >> error, so BT original design does not do error return for the case and >> use dev_warn() instead of dev_err() to give. >> 3.3) the commit misunderstands BT original design and wrongly think >> BT original design take "qcadev->bt_en == NULL" as error case, >> so change the following flag power_ctrl_enabled set logic and cause >> discussed issue. >> >> For the 2nd issue: >> 1) the following commit will cause below regression issue for QCA_QCA6390. >> Commit 272970be3dab ("Bluetooth: hci_qca: Fix driver shutdown on closed >> serdev") >> >> 2) the regression issue is described by [PATCH v4 2/2] commit message >> as following: >> 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. > > You did not address original issue of crash during shutdown and did not > clarify my questions. > as i statemented. my fix have fixed both this issue and the original crash issue. don't need to talk about others. >> >> 3) qca_serdev_shutdown() is serdev's shutdown and not hdev's shutdown() >> it should not and also never get chance to be invoked even if BT is >> disabled at above 2) step. qca_serdev_shutdown() need to send the VSC >> to reset controller during warm reset phase of above 2) steps. > > 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. > > BTW, provide here exact kernel version you tested this patches with. > Also the exact hardware. > there are almost no commit with tag Tested-by also provide exact kernel version. for one type bt controller. different h/w has different config. important is that this issue is fixed in reported H/W and don't cause issue for other issue. let us stop here and wait for other comments. i have given too much explanations for my change of only total 7 lines. > > Best regards, > Krzysztof >