Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp516249lqd; Wed, 24 Apr 2024 08:58:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVsBeZXl++YW0u5rxHyFqT3jJb18NOhI5qZzxh6veCBQeqlj0N4G8nZtCBZmhnmpZrKZK1bkrdgyt39pWwP3K1NzY1iwULbSmn7VX6f3g== X-Google-Smtp-Source: AGHT+IFfKz4iMp3CfaQeRNftcXIkJm+I4j2u+xZr2pf6I7DpE15qquV1VFlMEzpcU0/Ygcyd5vfs X-Received: by 2002:a67:f6c5:0:b0:47c:fe3:4fd6 with SMTP id v5-20020a67f6c5000000b0047c0fe34fd6mr1822777vso.24.1713974287855; Wed, 24 Apr 2024 08:58:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713974287; cv=pass; d=google.com; s=arc-20160816; b=OAAMTPyEC6vawwEEqxiZRZZOkCz/F8Q7svjHewkozpbEW+9BlnKjBgpOauUUvpGgNh sSI+PMZwpsMoCTLETlBgXc7KXassl0YiE84e8TBhnPhAlrr2lbsYvhVib4W/tB9MpZ09 f8QHXm4VaDGwbGcU5KVYBT6s5YIZxI9FzvuhsyReyYW9H9Y8HYh2/fRH5MUNVf1+N9RK RGDeOiCPTuV6KvwJCzdx/kVR3ZmiM1VXcOLm1AotdvNFDY9ZP+fv7wDqCfCYVOT2k0jL 3P5BGOlao988wv47PmjH/kJlL3T1HPfjonhm79Z32A+smTcTeNNS065A95/i3TVWk3Bl +NNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=HXqhNnCVnj4urhfrmzgAfywaXIs5n7kydyat0shKQ5U=; fh=CS7+5CT6EHTE8tP2jFOokhJoj9cskYktkeZxMGdeVmw=; b=v7kBxpBrP14VLfAtcZ9HZgiCHCZm9EABHj4srVSLxGIKrtl0q1sRvUi/a/z6RLTOQ8 ct+AjP2sZhI67TXHhJH6Iiz2PPP4lTSvZd44qEk/cD5X0Exz3w5JQ2lkidA3QvYKK2f+ xfumSBB2i4pTvsmtGnXKZV0maUw254cu9vX0yXrdQfGPTWXsUQEUQed8BTQqMIDGMaNK XJJsD3nV385bKQXP06mqsYcLIPPbfanXcRO4tmsgB4P+GZyuZYOeN5cXtBaDyJBAkFcH i32jPFW5mCcISCWRARs1VsnY7PSy8yiESK6OOP64JMclsT0KfBF0dMGa6nsYi1iBhAwp 3uEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZllCMom+; 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-4039-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4039-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. [147.75.199.223]) by mx.google.com with ESMTPS id if2-20020a0562141c4200b0069918b2b81esi15364528qvb.331.2024.04.24.08.58.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 08:58:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4039-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZllCMom+; 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-4039-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4039-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 7EB831C22398 for ; Wed, 24 Apr 2024 15:58:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31B681607B8; Wed, 24 Apr 2024 15:58:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ZllCMom+" 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 2DEE815FCED; Wed, 24 Apr 2024 15:57:58 +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=1713974280; cv=none; b=HeMrYcTCeAcgJSYhGRcuacdt9AiI8HMQ1yfJp7lR53og9vmcbXAU1JQXbm8NJVeJjlPhVqgkSXU0M7e1pMZnNxLR8VmR6Fb/kER6ih6OD3nrVO4SAdqdgB4zP+gDBN7gtUTgQ5hqqTZ2tcPHNJl8rEapzBYaPw3qQy6BcniVdhY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713974280; c=relaxed/simple; bh=ZzNkrV2fhi/P7CXl8CQL6Gv8PL1midi0/BgcWt9p6i0=; h=Message-ID:Date:MIME-Version:Subject:From:To:CC:References: In-Reply-To:Content-Type; b=YkRWGioqhByDZCaOmqXncDzIsdQIslMnGR76590wXYthUiWfCmyGs32JgpmCQD10mf5McYyPaav8k797BO0jeWnjifPxarlnEegZJH89JMEH54jhTIf1AO5Sx9ogVxmeV7tDlIrfvaqZQaXC6GpcC/BTdp82SL2RI8/QiHeT8wI= 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=ZllCMom+; 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 (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43OAVcXP025423; Wed, 24 Apr 2024 15:57:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:from:to:cc:references :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=HXqhNnCVnj4urhfrmzgAfywaXIs5n7kydyat0shKQ5U=; b=Zl lCMom+Fq2fyL9u58kQQG1q/Bj2+BXOJVXiCsn/MklYa4xRj0RK/G253HjiM7xnfz slwGcyZFpocJFEdRERR0sCxLxU03E+7wVulckHXn7BUZ+/B7W5179faj7PhAtzUr ND3SnvyFgHuyGk6Sa8kePeNmG+0qg0H+r8X2ZccZqj5qRfZl7rvfe/xl1bOahfG/ BricPpDj4DcdQmFGuk0nwUiigYP0kq+6tVyhJr3Kj/gGBcnshRbpVI+j+2kSuLqt oTIBgOXQwM1unnSWLNCIiarDzevBDIGJZ1v6O9UF8eDn4x++hnfTTGRoez8oi80i upkZmpESOi7MAKrphWCw== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xpv9g9amt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Apr 2024 15:57:50 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43OFvn8U020538 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Apr 2024 15:57:49 GMT Received: from [10.253.14.221] (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; Wed, 24 Apr 2024 08:57:47 -0700 Message-ID: Date: Wed, 24 Apr 2024 23:57:44 +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 v2] Bluetooth: qca: set power_ctrl_enabled on NULL returned by gpiod_get_optional() From: quic_zijuhu To: Luiz Augusto von Dentz CC: Bartosz Golaszewski , Bartosz Golaszewski , Krzysztof Kozlowski , Marcel Holtmann , , , Wren Turkal , , <--cc=regressions@lists.linux.dev>, Greg KH References: <20240424122932.79120-1-brgl@bgdev.pl> <0f8ba1b5-490e-4961-80e2-7942f66730ec@linaro.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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-ORIG-GUID: 7Oog-KOF8BfTFePTBIBaJvw7F3iH3Gjs X-Proofpoint-GUID: 7Oog-KOF8BfTFePTBIBaJvw7F3iH3Gjs 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-24_13,2024-04-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 suspectscore=0 clxscore=1011 mlxlogscore=999 malwarescore=0 adultscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404240064 On 4/24/2024 11:47 PM, quic_zijuhu wrote: > On 4/24/2024 11:41 PM, Luiz Augusto von Dentz wrote: >> Hi Quic_zijuhu, >> >> On Wed, Apr 24, 2024 at 11:35 AM quic_zijuhu wrote: >>> >>> On 4/24/2024 11:31 PM, Bartosz Golaszewski wrote: >>>> On Wed, Apr 24, 2024 at 5:30 PM quic_zijuhu wrote: >>>>> >>>>> On 4/24/2024 11:24 PM, quic_zijuhu wrote: >>>>>> On 4/24/2024 10:52 PM, Bartosz Golaszewski wrote: >>>>>>> On Wed, 24 Apr 2024 at 16:46, Krzysztof Kozlowski >>>>>>> wrote: >>>>>>>> >>>>>>>> On 24/04/2024 14:29, Bartosz Golaszewski wrote: >>>>>>>>> From: Bartosz Golaszewski >>>>>>>>> >>>>>>>> >>>>>>>>> qcadev->susclk = devm_clk_get_optional(&serdev->dev, NULL); >>>>>>>>> if (IS_ERR(qcadev->susclk)) { >>>>>>>>> @@ -2355,10 +2360,13 @@ static int qca_serdev_probe(struct serdev_device *serdev) >>>>>>>>> qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable", >>>>>>>>> GPIOD_OUT_LOW); >>>>>>>>> if (IS_ERR(qcadev->bt_en)) { >>>>>>>>> - dev_warn(&serdev->dev, "failed to acquire enable gpio\n"); >>>>>>>>> - power_ctrl_enabled = false; >>>>>>>>> + dev_err(&serdev->dev, "failed to acquire enable gpio\n"); >>>>>>>>> + return PTR_ERR(qcadev->bt_en); >>>>>> please think about for QCA2066. if it is returned from here. BT will >>>>>> not working at all. if you don't return here. i will be working fine >>>>>> for every BT functionality. >>>>> sorry, correct a type error, it is QCA6390 not QCA2066. >>>> >>>> Doesn't matter. If enable-gpios is not there, gpiod_get_optional() >>>> will return NULL and we will not return. >>>> >>> i think i need to explain more for my consider case. >>> let me take QCA6390, if the property enable-gpios is configured. >>> but IS_ERR(qcadev->bt_en) case happens, your change will do error >>> return, so BT will not work at all >>> >>> but if you don't do error return, BT will working fine. >>> >>> so your fix is not right regarding QCA6390. >> >> Actually I'd say he is probably right with respect to DT because that >> seems to require GPIO, we probably need a clearer way to differentiate >> if a device is being set up via DT or not (btattach), in any case DT >> is probably preferable thus why I went ahead and applied this one. >> > for QCA6390, i can confirm that enable-gpios is optional. it is bring-up > by my team. i can confirm reporter's machine don't config the GPIO pin. > DTS binding spec also don't mark it as required. > > that is why i change my changing from initial reverting the whole change > to only focus on QCA6390 that is the machine reported the issue. > > >>>> Bart >>>> >>>>>> NAK again by me. >>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> + if (!qcadev->bt_en) >>>>>>>>> + power_ctrl_enabled = false; >>>>>>>> >>>>>>>> This looks duplicated - you already have such check earlier. >>>>>>>> >>>>>>> >>>>>>> It's under a different switch case! >>>>>>> >>>>>>> Bartosz >>>>>> >>>>>> >>>>> >>> >> >> > > i find the change have been merged. i think it is not good manner to merge change in this way even if i give reasonable doubt