Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp444825lqd; Wed, 24 Apr 2024 07:10:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUz8kLvpkr6afDpXlhsEko9hoYhzNNtOcy7E5EiU59q+05wsUWHuA2bQF3611NALUx+2UrdQg/QRiStcloLsnb1TZma+G6KBfkWaNyp1g== X-Google-Smtp-Source: AGHT+IGRPz7CHPXmWXLaKYLiyridxLE7zjJm1SK9I4OVeICiFnNsm6tJGhF7gR/Gsjj9mxdgRD3q X-Received: by 2002:a05:6e02:184b:b0:368:9ba9:fcb5 with SMTP id b11-20020a056e02184b00b003689ba9fcb5mr3263324ilv.4.1713967805242; Wed, 24 Apr 2024 07:10:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713967805; cv=pass; d=google.com; s=arc-20160816; b=jYVJC1MneV8P1CRlGq5S4LWFb0q/E67zzUIfvTvEeeTaMcBnYkEXv2mV1MK8QJxpip DOwVUbnHX1hXIUvrYQujETcpGLrQmcGYftWmD1ZLxlJ/R+iUwmk8F3X8o964msICBsq/ CVs5qvAccHsk0OOFUd+b0p9VyuKYBCyPR6dCqAPJo4raG+M+yeocyllWqaRxeCe5JTZS lW4ZYg/8wZMkrzDsq/2v04bsmqtTeeheeJfoNFLBj6ZXPFMYZURO65O9xIhw7RV/RUag e3FB07A3Pw/hHM2jnkPJhcBgrFcV11hM71NA0KIv6oHMdC+NYWeN15OPrTPV3fKFBxiO yF6A== 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=qV0CXA+ylMXkr9COBOzretOakNx5+NjvGyfHdPO4aZE=; fh=cBKbWEcKXaTsR7Yd8RWPBng6jt7T815D8xEvg4YxVtc=; b=GjIbmfMxECx879Tzg856xZz8zCPLU9gClPqv/Upy7FfBQZMkCGg75WPcnS8rjQ8yGj PgzS75z4lPV4EEXLyz18HT8aNpQHqBMlunGB8pkWI777L56mi30Ef/ODUOR2GUu2V4Xy 0459Q5+rpdiSnIRkDlx/d5YKjHsg1AILjsa5bal1m0QIcyHGqpvEK2vrjTl/Sr00Ima3 PcG4WgJzxBN7YhafhQuXhrqoCzQeymgKYKvTss9oTMFUNW0Be+8NTlTJ3ATzYd3K/5qG ex5Y//PC9mqZOtdpJxTPUQ1t+4YIlaSE/NM1s+vR+iV+IX00FoSYNqAOO8ju5batn7DX CIwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eGNnaQpb; 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-3999-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3999-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i14-20020a63220e000000b005f057f9ede2si11035854pgi.858.2024.04.24.07.10.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 07:10:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3999-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=@gmail.com header.s=20230601 header.b=eGNnaQpb; 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-3999-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3999-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EC24328BD31 for ; Wed, 24 Apr 2024 13:57:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3E6515D5D7; Wed, 24 Apr 2024 13:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eGNnaQpb" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 AAF7315D5C7 for ; Wed, 24 Apr 2024 13:56:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713966978; cv=none; b=WH/1FCPw3C/3n/rHEOgUkno4Rk7mqBS+mto0Abx1BS7v3H3pSrYdrrOlLVLl8ixhBcVFnsw/+eiuX0gi7scDmN5VZya/Dx/7RuYB0Hp42hcmVg67RbXs/GHee7TfLD4VrtqrVbmnJp/p67dD3KK/tH+yVui7FTxdpmPgXv+eWhE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713966978; c=relaxed/simple; bh=25nDsIMgZ2HeG8QMinIGq2/PgGv73H9aW1N1Y9zUInk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=uEoSlvl6PQOIsi+0Q56Ssm+xSz6RZTaPwh1yqsUxjA64aqKfLDpWAc05OtZ+MFZGyZMhukor4JgHXib8X1kTzPIPdX+iJRC2DKdwVkKtXBBI4ez1coIcOvUVLmg/zs9UQAL4rFSXWTrxP03uwl/mNCWAalujkwcNGJ9Lu8xPYSU= 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=eGNnaQpb; arc=none smtp.client-ip=209.85.208.173 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-f173.google.com with SMTP id 38308e7fff4ca-2db2f6cb312so118695421fa.2 for ; Wed, 24 Apr 2024 06:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713966975; x=1714571775; 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=qV0CXA+ylMXkr9COBOzretOakNx5+NjvGyfHdPO4aZE=; b=eGNnaQpbNg1evp2OIQOuYqUd8IzFynosInIq49KObkt9cN4nbklJJOecgu0AE8rk5P ja+NOH9/Q5gRp7JqUzzkxSCwqY2uNCPCeVMrOXPWL5zm38C7hxTQgici7wcDLlMgJq8F 4m4PqqW+lGJLMjFP2BTc3/lXAyitR7jfH1kCMMN08j042AwlpdvJWQIJ/lpgrVaDjBvA mGWaAIDI4hEbavqp5PdbgcT400J1qp5NSZEoksptHa36roi6XZwEB1h5LMkPBaP9ijmU nNnn9pIO5aumcyORy61Il1rbwZl+TVCTvB3/p5vK7V1XQSdcqtTyBQxTmrAVx45HXei7 vrxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713966975; x=1714571775; 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=qV0CXA+ylMXkr9COBOzretOakNx5+NjvGyfHdPO4aZE=; b=T9rtvzxC5g312xn6ZOwEsWiUbyNaLpsKdvpdHNHTCxhckJ6JAO0nUfvWzDKxyAlWrl GaQ6he0MKE6wcDSSyRaPt0t2wxZLvYmeX5Dlr/X1oUsv/llR3pVPsR+kWEPUSsokMRma qf2bg82b1IcpNwXwB3grOuUiwjeXQP1Y4GIdmHrPzKeCabTin+FsKrpfDxl/5iYRMgfi eqRR0B7o6Adh0anxtWj3Hq2Flg6vSJaeDpcaxkheD+iGXVt9SjDDLF/XnNzEuKzK2htO OOdVAoKwj734nusF9ShtDTOKOK2mQU2nrD6f7Gb0ESs0L2AL3umgwV0ADmCzfv6YxOqU 5tkA== X-Forwarded-Encrypted: i=1; AJvYcCVwd1IYwlI7D7Se3NJnYh9HD2hQBDr8c9F+MMoW8Ezvtvu5sbgSJ3asZ6CiXWCRrdAuuy+jAUtqsdxT8JeG4t0JxbByrF1+aBjRubgMuGXF X-Gm-Message-State: AOJu0YymK9rXZ7gU0L93S/A0bQml7XWmvNGijoXVhHCexK8W9JvgR6oU dY82OasSrXB+pfPKhwcMiM/odxPSFh7NBcwwC8HTdWHIZoZRhGdMmamWvpjoCoWZxK4FCKg9yhz dzz192HkmHbpIWaidkYInXnjJ9IpLyQ== X-Received: by 2002:a2e:3a0f:0:b0:2de:22b2:ab3d with SMTP id h15-20020a2e3a0f000000b002de22b2ab3dmr2219301lja.7.1713966974687; Wed, 24 Apr 2024 06:56:14 -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> <053f51ae-1eb7-4ea8-bb04-38bfa1e0b8f5@quicinc.com> In-Reply-To: <053f51ae-1eb7-4ea8-bb04-38bfa1e0b8f5@quicinc.com> From: Luiz Augusto von Dentz Date: Wed, 24 Apr 2024 09:56:01 -0400 Message-ID: Subject: Re: [PATCH v6 1/2] Bluetooth: qca: Fix BT enable failure for QCA6390 To: quic_zijuhu Cc: Wren Turkal , Krzysztof Kozlowski , luiz.von.dentz@intel.com, marcel@holtmann.org, linux-bluetooth@vger.kernel.org, bartosz.golaszewski@linaro.org, regressions@lists.linux.dev, kernel@quicinc.com, Greg KH Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Quic_zijuhu, On Wed, Apr 24, 2024 at 1:33=E2=80=AFAM 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_NUL= L() > >>>>>>> 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 =3D 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 =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-47fc-ae42-5= eed918ad7b4@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 i= n > >> 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. Well I really hope we get some more support upstream because things don't look quite clean right now and it should be a lesson that you guys need to spend more time reviewing what goes upstream otherwise things escalate since there isn't much documentation about your hardware we can rely on. > >> > >> Best regards, > >> Krzysztof > >> > > > --=20 Luiz Augusto von Dentz