Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp438871lqd; Wed, 24 Apr 2024 07:03:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX6FF/6JZh/YmbEc1TuAnMXQjjtBA+K6gJzNl/6GrGAjWCceMW+lyaYIKcg2HhCv+vIT2RxMtvp0wGJD6m4CY862Mw3uoMZ2BAwJ2wR/g== X-Google-Smtp-Source: AGHT+IGRLBHHRY3/gqlh6+lbbFLN/0FZdjdFrZA3nWWzP5+w2XgZsWEu9XkJHCAuR8jmb7/PSVIf X-Received: by 2002:ad4:4e0a:0:b0:6a0:5978:40fc with SMTP id dl10-20020ad44e0a000000b006a0597840fcmr2552647qvb.61.1713967389890; Wed, 24 Apr 2024 07:03:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713967389; cv=pass; d=google.com; s=arc-20160816; b=BJWSY7k6FM/NHIeBgFVNDKJFHi5HFAO7u8htNzB2oCP2nn7MGFxtYHY2l9+lHXeDmp ffM/Idvm2kZwEID8hGmYYbEFOAF2dRj47UYETCQvt1SFzWO9sM7fV2paC5MKNIuWMPy2 y9Ignjfe38ZXQ5k0fgEATyjXOiwLrKWpoj7vb2OfRrgG+Y02zBVnhgWluBXgvLmjLoql PFeFhijK96mRb2iXLdltmuNMwZIATWL+VHi+qYbz3Qfx9pGVVpaExRMWLVc2/4mJldhW wqDg3gdDgqQrOEHpnKSgPfZ8aimmCBkaLNFpHfDOSCTxhEpHosTpWXUwgmGdZY5/0Dae dGzg== 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=Rzo5Rc1BtV9rx2z4n0U4/4xN9Y5TF6zpjFkVOhcV8BY=; fh=0Zdii7QNcMBY0lSX/CJ52u8qTqT3+MGmA89ISwVDZwk=; b=FC/g83Ep4ijiueP7deZLBY3e5UaeV3Orb2VA7QsJD8Sh5vHEpDQlVicdpeRkyYzB86 C8ePaIu8AW70OK+T+RCbA6SXSmSy1IDfdYBkYsmvBMysrqzx9NRNjzmaw8uodXQ0GPAM F3iJanKWGIHqRd6RtXyb0dlNFIqRJxF2xPWzFjJBBJjQ2QdFmOXG+X9e8/rQsVSD2V3Y gwxYqQTDxdrN8NPTEs8D4JgsSsNQULEHJ3uS1DmH4XiYaoOC/2dxOUVZWAgcdy+7PWJh JjO6ENxaouEOiYyd+UeW6KrSAhoiNi44q6UECiEEVNyJX8y3B+kN7vFKVjq900r8FlQn Ey+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GW3FmOcN; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4004-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4004-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 f6-20020a0562141d2600b0069b4b76c635si15826284qvd.13.2024.04.24.07.03.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 07:03:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4004-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=@gmail.com header.s=20230601 header.b=GW3FmOcN; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4004-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4004-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 492CD1C2159E for ; Wed, 24 Apr 2024 14:03:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8DCE615DBC3; Wed, 24 Apr 2024 14:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GW3FmOcN" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 CC10B15B986 for ; Wed, 24 Apr 2024 14:02:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713967379; cv=none; b=exHm8Z7DOXqRw0EDzq3vXSKeoAUMy+BzZU3F1U3RXVOUD21tQYDCwUmPtIbAwFWm8CqtBSHO2J/fI52ScR2q3ZNc9ZUoxXXlKLS+2dEwU+MEk2km7t5TccXebDnINEDP+ypJpgtJFagmWwP1a8mw6229Rgy0QNabT43M5l2n3mE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713967379; c=relaxed/simple; bh=T3dsrVXvM1BzpCdkc7fICVJHK0ny7JNkxS2SkwBDyiQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=V0pnho0s6n131KZqbXYezMxH2Xg8zfuiARTWAQGBa30oyg7e5E/QSKpeQJbXAa86EvKuoXdjNeKV1svk+zMYKRM81YnphNXB0YcPsDUe+bcGMCBiaP+wp2kwiD2y2CAcHs9F9jCGrxJvLAsvJ39W7Gi8rDLNK8rW3bQq/SuV20E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GW3FmOcN; arc=none smtp.client-ip=209.85.208.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2d858501412so93230531fa.0 for ; Wed, 24 Apr 2024 07:02:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713967374; x=1714572174; 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=Rzo5Rc1BtV9rx2z4n0U4/4xN9Y5TF6zpjFkVOhcV8BY=; b=GW3FmOcNnTcHbTmHZZTg+E6nh5qLKxtqtW81LH4Q3DjIxT+IJxr+dT9bVCS8iyXody OrkCfB4gr5/nCg0I3eaGE3dfG0uSnIphdiIPcj3sMquFVpmvdCvfUvIBjSS2THX+faL6 2M9fwfV+kkzP1iBkOrvHOu35aZeBCPISlXQyR9FOKA/nfLo0LzaiD2jPDVD8GRd9qKxA mMOKwHqPhYgJszTn4gkgTXebBJGcRcnFQcsDqgLnZbZK3sqExNfCnxr8GMJ+OPpRmYxL vfuow5hVFK7vojj2V/SAic1N8VcxIauRN3ySq9N91WZbjZy3CuoiuegjJpt+bO/ogFab mCjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713967374; x=1714572174; 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=Rzo5Rc1BtV9rx2z4n0U4/4xN9Y5TF6zpjFkVOhcV8BY=; b=FT7yYtYsH8gcqJujzKeJO2YW5yl777Pi9nCwSnDeZGT4iCSSrpEqAUi5pDDHllQocN sGm6pw8XOIJhK4DJ/dm7SXSQ+5O3zMBDDYn4t2q3RtEYGIBmydhl5DQV89n1f6aGnMmt s1CV6B59hiImgWVF6dYsbHPEhzVsP+0IiM6+xanNuDBUeKaZ96kXEzXtCIrvSxw3nUpm yYEov+QOqXpXh/yhaFVv4mxubBtyLSkMGxmw3MCY/i2Rd6YkbgLH9gFsrmoaCnqnqK/2 KdB3GtwMD/JvOHo9x214X0f9797g8TToSpmYoZx1Snqppo6XlZL8lQ30oM4BMwaIistj c6Aw== X-Forwarded-Encrypted: i=1; AJvYcCXR25+r9JqEM8VTxEZrtvx1Yk/YXm4tgFcwOpCAL4vFiTwLjXeF6j2p+jRgsPJ6My4hRPJ29IAdAOSoZPI90ZeNR8rikKUajs6gWhzv3x5f X-Gm-Message-State: AOJu0YzHa9WtBfemIJjq/Gpt9UTGdF2uh7M5ocsqeG1n+sQAAdJ1Dtup 4m2dHYamXsfMOoyIhtwitOcCXnxaqpVfQaDi6rbzkAfGYaca14qIxdQULdt6M9IOWOLN/ChCYl3 67hEF/VlU2gfFhGJX06OBe8p+4I4= X-Received: by 2002:a05:651c:1046:b0:2d8:6561:72ca with SMTP id x6-20020a05651c104600b002d8656172camr1623297ljm.19.1713967373471; Wed, 24 Apr 2024 07:02:53 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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> In-Reply-To: From: Luiz Augusto von Dentz Date: Wed, 24 Apr 2024 10:02:40 -0400 Message-ID: Subject: Re: [PATCH v6 1/2] Bluetooth: qca: Fix BT enable failure for QCA6390 To: Bartosz Golaszewski Cc: Wren Turkal , Krzysztof Kozlowski , quic_zijuhu , luiz.von.dentz@intel.com, marcel@holtmann.org, linux-bluetooth@vger.kernel.org, regressions@lists.linux.dev, kernel@quicinc.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Bartosz, On Wed, Apr 24, 2024 at 9:52=E2=80=AFAM Bartosz Golaszewski wrote: > > On Wed, 24 Apr 2024 at 15:49, Luiz Augusto von Dentz > wrote: > > > > Hi Wren, > > > > On Wed, Apr 24, 2024 at 1:04=E2=80=AFAM 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 regressio= n 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 =3D devm_gpiod_get_optional(&serdev->dev, "enabl= e", > > > >>>>>> 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 =3D 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=3D218726 > > > >>>>>> Link: https://lore.kernel.org/linux-bluetooth/ea20bb9b-6b60-47= fc-ae42-5eed918ad7b4@quicinc.com/T/#m73d6a71d2f454bb03588c66f3ef7912274d37c= 6f > > > >>>>>> 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 upstrea= m > > > >>> 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 doubt= s in > > > > your judgment here as well. > > > > > > Please slow down here. Zijun's patch works and Bartosz's patch does n= ot. > > > I don't think Zijun means any ill intent. I am replying to Bartosz's > > > patch right now. > > > > Ok, that is great feedback, so I might be picking up the Zijun v7 set > > if we don't find any major problems with it. > > > > Luiz, > > Please consider my alternative[1] also tested by Wren. Zijun's usage > of GPIO API is wrong. > > Bart > > [1] https://lore.kernel.org/linux-bluetooth/CAMRc=3DMfJ1v3pAB+Wvu1ahJAUvD= fk3OsN5nieA-EYgTXPwMzqyg@mail.gmail.com/T/#mbf94795476d21df0a24441470ce02de= f9d2970a7 @Wren Turkal How did you test this, what patches did you have? --=20 Luiz Augusto von Dentz