Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp417702lqd; Wed, 24 Apr 2024 06:30:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLBXwYRJDuUbHsp2Ng7bD44LaTVETwWl2Qreywd8Ezu36VQRa9/Kzjibmali7BL1PQKJxRxPwi66VlTeI7hUXP+tgMig4Bm9Hhs21CFg== X-Google-Smtp-Source: AGHT+IFFu7rJ5C4n4gp2Ob7Ei/Ze3aCgnZJkg9dyWLbOfXNhxMJY95JQIf4BZ+M6fV/fYycWEgno X-Received: by 2002:a17:903:1103:b0:1e4:2b90:758e with SMTP id n3-20020a170903110300b001e42b90758emr3210689plh.39.1713965455541; Wed, 24 Apr 2024 06:30:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713965455; cv=pass; d=google.com; s=arc-20160816; b=hBAYEMX6gCssvrfi9h2oqQyfCGN9kCO/vJhhHDj2PrWfUc9p9M+2jiwPJwGamqZ4sP qAUwrr3YEzWVwEh4eCK8D6QvJX+VPD1JRT3mYBuhBm2OxRnDn6lhsaxIsViL0s/I2QOg +hqRxyJo9slP8ezvgvBFxk5XbHd25ShuihqkCsakE/gq1shNiEJOCbi+qIKU6F90YCd3 PWtfxV1XXek+AvWUAcJDY9rUNAqwawkW8kb4kyqrTi4YSwRl8Ckhn+4V66liKwZAYjOU ZntspzeoS076QelrNiZHl+xUgyZ5mdOzcQUGOt2GeC7pt6VlKFeWC24jRhnrxc9QTEpe D5bw== 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=XG3+IqvPxEra7iPK/tJ4oWh7H1vamJU4p+FmAgOmWWA=; fh=zABYuAZVGZMpkPBxq1HvVHQXwzhII2mayhZiHHYAisI=; b=cZJyeUuEkAG2Zj2Ru3UVqEqPqos4C2UmnBu59w3mjQchIiecs/YI6nUj8d0tz7ti6M 9FTfjhIxOoGqoW3QfGVsKKkj7bQOe0tNCAstG3Dn9xmcnxT4uHUAWhMPxfTgykTiFp72 6oLbks0mSbEqP/Gy8Q7W97AeL++z89iq9y0BdGW7lSHe/x+I/3bulbzGcQhK0IW74nHU MJv7pfCNdi4dyaj4v3LWVyoAo6U2RfCAApgs5Z/1PMKo8LJ3tukn87Q5dpkM4IdLZISo 4P5Ur+1DUK4JVKWKY7TivnbrTSnZWYGXkmnaTsMwHbFVVkq/HezHYd3AqRg4gpYqNJ8D mM/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JbeDNqRM; 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-3988-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3988-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 k6-20020a170902d58600b001e950a302d5si7097101plh.357.2024.04.24.06.30.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 06:30:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3988-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=JbeDNqRM; 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-3988-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3988-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 2946F2849C9 for ; Wed, 24 Apr 2024 13:30:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 311F215CD51; Wed, 24 Apr 2024 13:30:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="JbeDNqRM" 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 E69F71598E3; Wed, 24 Apr 2024 13:30:46 +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=1713965448; cv=none; b=p/1/1dpv0BpLquw3ex3LDgpOAZoodfEOsYNZa2J/E0N1Lfit4iw8HpxJJ/bLSfL/9Ig2h4IFEklxeRHDEmMykxNmJW89mkfbNdHxPKpWJ+/kKwl4qbsfPdC62Sm/X6ZvtBXiW19/BHBvpbfSbSyiyErmFRT7mo4TceGaE5dycpE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713965448; c=relaxed/simple; bh=4gwKXrOPdUFR5lhUIndigSGaORrN26b5N4qgWiiUAEY=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=d1Wj0UZuKpC9s7I6F17s1i8BaF5K+mjbt4kC2/xRqVo4jQwPMxwMl3IEGz/8f/g/Bmtzax8IEX0oTtav80mdoJeB2iSa3wTYhwCOlmeqmZtJk5wcJfcC7WSnEI1Qp2L6PUT6xpM9RU1CJoX3/+NYfkaZCvZqSFzWmefSd13v/jQ= 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=JbeDNqRM; 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 (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43O6X62I012813; Wed, 24 Apr 2024 13:30:39 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=XG3+IqvPxEra7iPK/tJ4oWh7H1vamJU4p+FmAgOmWWA=; b=Jb eDNqRMoscKz7LG8q2k59u13ZLqB4blZAVe41/NiCxonZmjMJIG6xaITPKMAY+dtp 2oW1XALd+qhtRqSC8aSUQLzOs+fHFuAUzx6yTpjLCymxo9a5FwXQof2Sa2k1CT4R jVnZDxXVQoyrMf+MtW+RskW6g++SOpYyGRJUsg68VUYRaSgZr87DhZJJ9am8P7DJ wPGARQJgFTKqjOWSeEJybGQAFaw1UDssKdA+8k2EJJ54mpFwvWHjEyMxoivtSdZW WIH4smvbCwH6sQSQUolTEspXrVaZKMTCjwFnYMv68i8WcMSf9bDc7sNxaRSHV/QX JrxzpkvbnONmzgCMWBoQ== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xpv9pgxpj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Apr 2024 13:30:39 +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 43ODUcVn010303 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Apr 2024 13:30:38 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 06:30:36 -0700 Message-ID: Date: Wed, 24 Apr 2024 21:30:34 +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] Bluetooth: qca: set power_ctrl_enabled on NULL returned by gpiod_get_optional() To: Wren Turkal , Bartosz Golaszewski CC: Bartosz Golaszewski , , , Marcel Holtmann , Luiz Augusto von Dentz , Krzysztof Kozlowski References: <20240422130036.31856-1-brgl@bgdev.pl> <99242a7c-53bf-4227-9623-7bc092f564b3@penguintechs.org> <0381f39c-38ba-4a2b-915c-f14c5f911eb9@penguintechs.org> <2371f538-ec53-4037-b171-c62bf4e06eb1@penguintechs.org> <4c33304a-5dbc-450a-b874-e04ba9e93150@penguintechs.org> <93e15ecf-252f-4789-a23b-a28280f6aa84@quicinc.com> Content-Language: en-US From: quic_zijuhu 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-GUID: IqRmyarL06ii4McPmcPm5Gr8c6IGpRf- X-Proofpoint-ORIG-GUID: IqRmyarL06ii4McPmcPm5Gr8c6IGpRf- 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_10,2024-04-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 spamscore=0 mlxscore=0 mlxlogscore=678 clxscore=1015 adultscore=0 malwarescore=0 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404240046 On 4/24/2024 9:26 PM, Wren Turkal wrote: > On 4/24/24 6:12 AM, quic_zijuhu wrote: >> On 4/24/2024 8:27 PM, Bartosz Golaszewski wrote: >>> On Wed, Apr 24, 2024 at 2:24 PM Wren Turkal wrote: >>>>>>> >>>>>>> That's OK, we have the first part right. Let's now see if we can >>>>>>> reuse >>>>>>> patch 2/2 from Zijun. >>>>>> >>>>>> I'm compiling it right now. Be back soon. >>>>>> >>>>> >>>>> Well I doubt it's correct as it removed Krzysztof's fix which looks >>>>> right. If I were to guess I'd say we need some mix of both. >>>> >>>> Patch 2/2 remove K's fix? I thought only 1/2 did that. >>>> >>>> To be specific, I have applied your patch and Zijun's 2/2 only. >>>> >>> >>> No, patch 1/2 from Zijun reverted my changes. Patch 2/2 removes >>> Krzysztof's changes and replaces them with a different if else. This >>> patch is a better alternative to Zijun's patch 1/2. For 2/2, I'll let >>> Krzysztof handle it. >>> >> do you really realize what do you talk about? >> do you really listen what do @Wren says? >> >> he says that my patch 2/2 is right based on several verification results. > > she, not he > >> BTW, my 2/2 fix don't have anything about DTS usage. > > I think the problem with your 2/2 patch is that it removes the > conditional bailing if the device is shutdown or not open. > > Maybe this patch instead? > > diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c > index 2f7ae38d85eb..fcac44ae7898 100644 > --- a/drivers/bluetooth/hci_qca.c > +++ b/drivers/bluetooth/hci_qca.c > @@ -2456,6 +2456,10 @@ static void qca_serdev_shutdown(struct device *dev) >                     !test_bit(HCI_RUNNING, &hdev->flags)) >                         return; > > +               if (test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, > &hdev->quirks) || > +                   hci_dev_test_flag(hdev, HCI_SETUP)) > +                       return; > + >                 serdev_device_write_flush(serdev); >                 ret = serdev_device_write_buf(serdev, ibs_wake_cmd, >                                               sizeof(ibs_wake_cmd)); > >> he maybe be a DTS expert but not BT from his present fix history for >> bluetooth system. > > Hi Wren, i think i don't need to care about why wrong condition cause wrong results.