Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp13630lqf; Thu, 25 Apr 2024 19:45:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUra0eyeGM6jKLL76+bK0aQBHP2k9uDFMbnQdJxAfM+LPz86fFGw5PBH3P2gs/bogcbqj8m75qZ+jQWV+HYEZPq+1wa2CjQ3qUrenm8hA== X-Google-Smtp-Source: AGHT+IFMLoLKsTExtDCqV7KY426YXOX+2j2CHh8E9jdI+vhM4SpIp5ZBCeETO7a9oo962Z/cDFdF X-Received: by 2002:a05:620a:2911:b0:790:a96c:a400 with SMTP id m17-20020a05620a291100b00790a96ca400mr1559449qkp.74.1714099539500; Thu, 25 Apr 2024 19:45:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714099539; cv=pass; d=google.com; s=arc-20160816; b=u8vYc9XbgNtvqHf0qqxS2LNIekD+uXhfR/l+KBBNiPkKPhoobgPNwasDhD4K0D95Z9 knsEAlcx9mjuVn6XeFiCd8ZKDIMaa7qGGpaEDDD1mihhB4nnxJvfrIyK/koPr7EzGbIl XVYYc8lBD1X7SE4cULz6kkDNmZbS46aFDd3VswNnZT+LY4LO5AL9d/xlZOvqIfCp8f3B f4/0NKNCIREClZd6pRAL5YUtS8ji+9U6TPMcSI45LcZ5TySoCdWZBgRZTuLJhf1osWJn bd9yWuETDtIufoZ9LRzPmW7Kikk9XBO7fdmEoScSaI1teNlwPz5tUZMDxFbotHGxoD09 /oqw== 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=DI7GxnJPjKmih5BwPgdk3yn0NGBLhLa/++djMIvNyTU=; fh=VNRsYvcJVhHs1wdw3HKkzDt7kUao7r9mHWz6/uqqMDE=; b=JT61/YJUZtGIuSyl3HHq7ZvDlIGGaKJBGbIFWKeDhC50kqcMnR8A+KnLyopb4QTGZn 1V+kKnr0ln156kXVN9WfJ2XW1v1zMhFMO7C1ywfKFwAhB8kDZN6KWx7QgbOCKxGcdX8+ l9izfU7mMlQnVsQ9/aZ+CCLnd7empIOxBVzYGwFw5+/v3gfgk1AkUkpDaOzPUNKGjT18 m5K0k+WeplM11rP7/S0GxCtCKWwx7RRtrC6WnwQ9li0cpx+9DNquMHPVLibivAPQ65dr j+KVeli7SuGgqC69OQ/YRBMFElOy9aV5lxQRAuYc+cGs7HHkFDz5NYJQUjW4c+r+z19f 1b/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=HZAsBwMR; 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-4087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v22-20020a05620a091600b0078d619afccesi18401212qkv.293.2024.04.25.19.45.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 19:45:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=HZAsBwMR; 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-4087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4087-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2D27B1C21B2C for ; Fri, 26 Apr 2024 02:45:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 435CE2907; Fri, 26 Apr 2024 02:45:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="HZAsBwMR" X-Original-To: linux-bluetooth@vger.kernel.org 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 F3EF51879 for ; Fri, 26 Apr 2024 02:45:31 +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=1714099533; cv=none; b=uXrgQMQxCCmDxm6aEuKzT4vBM2KdQFLU/UyFbwF2A9wPwKmOZfRvZKaPKDezSV+sOar75G6itH3fDTMySwC8CuInMDFj/6VsKIh8s5x8LBKirHvu9lL764MRQ7JKd11rm0EeBHovJ66KaaxaULX7GOllQ2PL1D/Kj6vJpfzXI4Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714099533; c=relaxed/simple; bh=Uh15HOXdVPTXlOc1wcePfZ+aybRFyXt+28ErjxGscc4=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=ZOa/AswP8bCwNc9w3zmrZ54eBFu4P6hhWqBtXPerADaAXreYrMjLa1UaILu9BNsp41XudwCS8rSxLvpllKZKu4+0sAKlYz9Q5777BW7lotUlAHH4ck1Ekj7OvLYEYAJi6G5qXLUo39KUQuN6LEahQEpnLoA4fG/5IQQB/yxRuTk= 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=HZAsBwMR; arc=none smtp.client-ip=205.220.168.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 (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43Q1BdDQ028099; Fri, 26 Apr 2024 02:45:19 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=DI7GxnJPjKmih5BwPgdk3yn0NGBLhLa/++djMIvNyTU=; b=HZ AsBwMRSHJzLmFBqpCqNW1NhCGLEcN0K74fmJ7kc1J6ouv6NSBdogoDW/f3A7ZJBt wt2CzVhaHaugGaEkImc9ipRRjo4xHrB7tFCYxmnjhZcxHs4s+RUDRTvPNJhMKvmb qpjlf8a42ChB1qpCuTuG5mZhMPGjwqE0hfWwpM1clckLvamkeyGClRy+g+vCFBUZ jFuvEm+00fjJEn29eqTrHGVLcYaLReV4MIhnJlnWaLP1bUWAls1QaggBl/RrhJk+ 0iP2BOh/00z/b4WybHZNwIPP3jgp4qB35K0I6OVT21+ugZMMp0wgaEiB1c1KiKVb nwWZVcm/ENKNV0P+cRPw== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xqenh46j7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Apr 2024 02:45:19 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43Q2jIGF006187 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Apr 2024 02:45:18 GMT Received: from [10.253.14.224] (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; Thu, 25 Apr 2024 19:45:12 -0700 Message-ID: <3d61680a-79da-4a5b-a5c8-feb6f41bd5a6@quicinc.com> Date: Fri, 26 Apr 2024 10:45:09 +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 v6 1/2] Bluetooth: qca: Fix BT enable failure for QCA6390 To: Elliot Berman CC: Wren Turkal , Krzysztof Kozlowski , , , , , , , , Greg KH , Trilok Soni , "Bjorn Andersson" References: <1713919602-5812-1-git-send-email-quic_zijuhu@quicinc.com> <1713919602-5812-2-git-send-email-quic_zijuhu@quicinc.com> <349b27a5-d2d3-46f1-b002-44f81e0cedef@linaro.org> <8ae32009-5f5e-49a1-88a1-e330f0614f60@quicinc.com> <5e363318-c6e4-4874-8026-7940b434d583@linaro.org> <2020a858-c3d9-48a7-ad59-3691c6b98fb2@penguintechs.org> <053f51ae-1eb7-4ea8-bb04-38bfa1e0b8f5@quicinc.com> <20240425103329807-0700.eberman@hu-eberman-lv.qualcomm.com> Content-Language: en-US From: quic_zijuhu In-Reply-To: <20240425103329807-0700.eberman@hu-eberman-lv.qualcomm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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-ORIG-GUID: uLgcg69HNtqgMPCt2htnuzPCT_DOcMq_ X-Proofpoint-GUID: uLgcg69HNtqgMPCt2htnuzPCT_DOcMq_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-26_03,2024-04-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 spamscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 bulkscore=0 clxscore=1011 suspectscore=0 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404260015 On 4/26/2024 1:37 AM, Elliot Berman wrote: > Hi Zijun, > > On Wed, Apr 24, 2024 at 01:33:50PM +0800, quic_zijuhu wrote: >> On 4/24/2024 1:04 PM, Wren Turkal wrote: >>> On 4/23/24 9:31 PM, Krzysztof Kozlowski wrote: >>>> On 24/04/2024 06:18, quic_zijuhu wrote: >>>>> On 4/24/2024 12:10 PM, Krzysztof Kozlowski wrote: >>>>>> On 24/04/2024 06:07, quic_zijuhu wrote: >>>>>>> On 4/24/2024 12:06 PM, Krzysztof Kozlowski wrote: >>>>>>>> On 24/04/2024 02:46, Zijun Hu wrote: >>>>>>>>> Commit 56d074d26c58 ("Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() >>>>>>>>> with gpiod_get_optional()") will cause below serious regression >>>>>>>>> issue: >>>>>>>>> >>>>>>>>> BT can't be enabled any more after below steps: >>>>>>>>> cold boot -> enable BT -> disable BT -> BT enable failure >>>>>>>>> if property enable-gpios is not configured within DT|ACPI for >>>>>>>>> QCA6390. >>>>>>>>> >>>>>>>>> The commit wrongly changes flag @power_ctrl_enabled set logic for >>>>>>>>> this >>>>>>>>> case as shown by its below code applet and causes this serious >>>>>>>>> issue. >>>>>>>>> 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; >>>>>>>>>    } >>>>>>>>> >>>>>>>>> Fixed by reverting the mentioned commit for QCA6390. >>>>>>>>> >>>>>>>>> Fixes: 56d074d26c58 ("Bluetooth: hci_qca: don't use >>>>>>>>> IS_ERR_OR_NULL() with gpiod_get_optional()") >>>>>>>>> Reported-by: Wren Turkal >>>>>>>>> Link: https://bugzilla.kernel.org/show_bug.cgi?id=218726 >>>>>>>>> Link: >>>>>>>>> https://lore.kernel.org/linux-bluetooth/ea20bb9b-6b60-47fc-ae42-5eed918ad7b4@quicinc.com/T/#m73d6a71d2f454bb03588c66f3ef7912274d37c6f >>>>>>>>> Signed-off-by: Zijun Hu >>>>>>>>> Tested-by: Wren Turkal >>>>>>>> >>>>>>>> No, Bartosz' patch should go. >>>>>>>> >>>>>>> what is Bartosz' patch. >>>>>> >>>>>> Srsly? You were Cc'ed on it. How many upstream patches on upstream >>>>>> mailing lists do you receive that you lost track of them? >>>>>> >>>>> Bartosz' patch have basic serious mistook and logic error and have no >>>>> any help for QCA6390, and it is not suitable regarding DTS usage. >>>> >>>> Really? Why you did not respond with comments then? Considering how >>>> imprecise and vague you are in describing real issues, I have doubts in >>>> your judgment here as well. >>> >>> Please slow down here. Zijun's patch works and Bartosz's patch does not. >>> I don't think Zijun means any ill intent. I am replying to Bartosz's >>> patch right now. >>> >> this is reporter's latest verification results. actually i don't have >> much time for kernel upstream. i really hope my fix is able to merged >> ASAP, it will help us to solve other possible impacted QCA controllers. > > I saw you were planning to slow down for a minute. When you're ready to > work on these patches again, let's get them reviewed internally first. > Please check go/upstream for some helpful hints. > thank you @Elliot for your reminder. i will learn go/upstream again before next upstream, and i will request for internal code review before do external upstream for further upstream. thank you Elliot again. > Thanks, > Elliot >