Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp432323lqd; Wed, 24 Apr 2024 06:54:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUXoRZTNqYMdSfp68mmukSTigYb+pF83HROM0H+M/DSqr5HKtIRyD44xmAZhIkohXVV3LucbuC0D3G8Wf+B3LxBMzxM4nXw/JA6bELm6A== X-Google-Smtp-Source: AGHT+IG1OZN4mTuRLiroI8K+xlpwZ+9mK6OyJZxovppolgGnOrRUNBk4yh2u4FrSA6iKLBWrYMOi X-Received: by 2002:a05:6808:1396:b0:3c7:52aa:2af4 with SMTP id c22-20020a056808139600b003c752aa2af4mr3010206oiw.36.1713966845990; Wed, 24 Apr 2024 06:54:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713966845; cv=pass; d=google.com; s=arc-20160816; b=GJpwUIEcfthnIch7EiCBI3juhMjzZHs0XSmgkfXfRO0L1Tz5ITH39V87wZX1UdB5Le q7gIpOxPNLPfovKo2swFTfJGbyt6qko5/04Ic5ZT59higrwzWeW9xq24WrDDR8nqbOId LErSrXlaaQd9ygrk0+jqy8HmMWtGE1HdoKLTCTaury46KAm6LaUkgBZX64zsqFrS+gwj hJ4bvnYujwcKKBLOgR6839PyoXC9g9pOu0vfld6Zh3YOAiZwID1IgJPUDBpzMQrM1Aw2 7qCuzWmDJFsLnfGPdYt4zTToqbg8QP4n0wQyNDd2sLbZenOYlDyNy0DVF4kGOVs5kSFC FedQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=YTF0+jQz4A/5exiMNPE0r/1P9poMBy5VmCr9Kl+mvRg=; fh=19jdLjf4jBxHYoDSujTtICarP+Y/2Ubrquov2+AQ8mU=; b=iUAsKM2KvKaAbG7uiRp3+rPIqmAk1eJt4FOQIHRB11LfS3kIwBNoG9hLLiWdZpelg0 TI8pSPczoZCyxUMiWhCT4VcKYlXjhc/IBTQbbIT2e6VbK6dvhdaH3lnHxYRJKmOSqT7H 3bpCukQjrVqu3YtZ+h7I24HhzWPLruzI1ISosLx5HyW94V+WTmJ+B0c5KjMLGKLVTbhk snoESwEaE/H2/B/UVbGtrwrc6tVFnyKxJVr0InT4tyahF66+DFFMeTMVGf0Sxs5+RfY4 EUYKDnI+lcSvpe1YCuYrmIuj0WU6De0m8HpadBCi+Pt3kV8BcGDRpU1ZmSkGEH1CIMnf lz7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DIEvzPxm; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-bluetooth+bounces-3998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3998-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q7-20020ad45747000000b006a081d966f0si6769267qvx.289.2024.04.24.06.54.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 06:54:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3998-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=@linaro.org header.s=google header.b=DIEvzPxm; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-bluetooth+bounces-3998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3998-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 A2A721C2225F for ; Wed, 24 Apr 2024 13:54:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC35C15D5D9; Wed, 24 Apr 2024 13:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DIEvzPxm" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85A2E15D5B3 for ; Wed, 24 Apr 2024 13:53:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713966835; cv=none; b=oBsm9B/4EB+5zo9QwFDYPQozds78YbkJ7i9BzD6MPs2d2O6mjE3zqNhK2OdB46RGyk9brTlVzs97Q7XQ56FEyMtdfDylzRernCgFImaVya8xbZAbZKhEZElQIeIePSjMyMrMpGF/ms57dFZA6WYyvyqSLdQvp3A6g76LZ22y+Gk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713966835; c=relaxed/simple; bh=fhR4uE4yLyvD+B2f4w/tGJIZJC7P2TcQOXf71qR0Hdw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=sJcqzfCcoIKIci3lstc5HkX0BqT+Yw5FGK5zg5olHRnSDs2+FyLAL7xbG4jeHRYuL0dDYGEtNjGCYPgNQkFTuvM/bDVGLEyyCeAe7eReWL/R+7MDf3I+iv0/TyLq1XdZ+wFkP109BF/2Z8THnJak1t+ZgB2bGm+eEARr/UYPcU8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=DIEvzPxm; arc=none smtp.client-ip=209.85.219.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f174.google.com with SMTP id 3f1490d57ef6-de54cb87998so2090377276.2 for ; Wed, 24 Apr 2024 06:53:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713966831; x=1714571631; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YTF0+jQz4A/5exiMNPE0r/1P9poMBy5VmCr9Kl+mvRg=; b=DIEvzPxm4h7EvhTvt7CcorloTm0ogL6LBZsf8CKcZfI07oIEWSkJYc0OemQR4M7UXc p1VoAALVPgPBCAmBOUQ7MuJFd4U1UqSpSdGZrye8UxwJFPO2hzjyssS3VYiKd/VWd4CY nNAevEU3J9kqpa7pbGp93ebhfNcUNkcAHR8D63Sln8w8PhkAOcq/oURRMVBBuX7ftSBU 7gzZllSqdqQGmPQOH6/oxTXKPIHNs9j5ubErXmtAL2ob4KYITbEi38OlvYDNAYSTLqyp aPvzPYUIts42fOdpGs4X0UkMRmD2XFK6iMgZJOObaD4UiTw5DihrWu6+gRA3DmJ44G6S FvUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713966831; x=1714571631; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YTF0+jQz4A/5exiMNPE0r/1P9poMBy5VmCr9Kl+mvRg=; b=ad+8Hb20lowoy7mc5fzbXQ/rd92ZRrYICHPJb1FPRhllwNy4nG5AF4KZxKsj4I1j9+ IvlSfGaIjcCT3SLkH1BvNGCvIF+KwheBEg0HBPOMO9FAs7gChTvCRiFVGzVrQ1Ihrkvk /4XFnD4jyHAdH/Yr5QRtmTD6VvtUCqCR4kNJo3egE6re249ufHVhenBL8jKUZZ9E1yyP 1m+OgYH4koo6bB3+xsnmdDk0LyWOfttdWoS4uRSNtgnjWmAA5v/NHR204yaCnMR+MFVp 8RxdsA/sFJHWh6XNOSDRCo03ngCxoNi7q8lvndrMNTnGhwSwdiiE2Xla90tiqbD6N6n7 yNyw== X-Forwarded-Encrypted: i=1; AJvYcCVvBHKX+jsXj8Js2tkYvxP6a9UYhPT6X5tBgwqOT9Ws13mMt0tknnKdYlMSGR+znmF8pNeSGZIMgLGuwN93BUop+VHCjDRspw+a1gTlv104 X-Gm-Message-State: AOJu0Yzy2OpDJodZnxosw3mOfjdpioFXUXmO4C0NTqIGUiJeSeezbMdu NcFmOB0RzycoYclsZgIwpvoS2YlaPVrWpcdu0JExVd6TMy7hyfwQch49EC6xyeOguBbZZuhO7ez OFG3Pj8C6DMQfbXAY0JslIxFs+jZP27QZv16c9g== X-Received: by 2002:a25:26c8:0:b0:dcb:b072:82d5 with SMTP id m191-20020a2526c8000000b00dcbb07282d5mr2468708ybm.64.1713966831536; Wed, 24 Apr 2024 06:53:51 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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> In-Reply-To: From: Bartosz Golaszewski Date: Wed, 24 Apr 2024 15:53:40 +0200 Message-ID: Subject: Re: [PATCH] Bluetooth: qca: set power_ctrl_enabled on NULL returned by gpiod_get_optional() To: Wren Turkal Cc: quic_zijuhu , Bartosz Golaszewski , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Marcel Holtmann , Luiz Augusto von Dentz , Krzysztof Kozlowski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 24 Apr 2024 at 15:26, 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=E2=80=AFPM Wren Turkal wrote: > >>>>>> > >>>>>> That's OK, we have the first part right. Let's now see if we can r= euse > >>>>>> 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 result= s. > > 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 =3D 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. > > Did you test it? Does it work? If so, please consider sending it upstream for review. You can keep Zijun's authorship but add your own SoB tag at the end and mention what you did. Something like this: [Wren: kept Krzysztof's fix] Signed-off-by: Wren... Bartosz