Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2051875lqt; Sun, 21 Apr 2024 22:52:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUcDMsPoad8zpd4xYCRWOPm+R9Y1Creh9NEAne4LgT6jlLXynQePz5GqDtvXYfal5JcoMl2o+3ZW6SQhr4xnlT1zKcajwM42R0SPbPc9w== X-Google-Smtp-Source: AGHT+IFot3lqPC523o350PBjqIPbjaXjS8X5ICpHA5gPXg5sphNC8n9SF2gFJsWdKWeupzDAzZbn X-Received: by 2002:ac8:5f93:0:b0:437:b4ea:883c with SMTP id j19-20020ac85f93000000b00437b4ea883cmr16372883qta.5.1713765178622; Sun, 21 Apr 2024 22:52:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713765178; cv=pass; d=google.com; s=arc-20160816; b=RRz7DClfEdYa10TZ+JSNtBVE3Ctiz/So0aGr0h7je9MjszndXigVVcOuNEXVoUAHMA vgw3A9PTvSUdfpVUK0/OcvMCtEbt8E3G2Q3IgAySWUvHqhegALYHTj/xw+IpLJUXxcfJ ek8vp6bSHVt6z/v5G2TJbmtttCnyC08NtzpDkWVAQ6s0h5pDnxvukOffwzYVAgZFp3wg VInnY9n1l7gF5TiIIyzi7kTXd1HBf7aSXhZ3Oh+koWaSvwW1DlOcu9T75AnrqrYMsElL 8YMp2DPhWX4B4kOn6R4T9cqGnpDBOSMWrs/OydIHLrR6aGRStbB1TOpSKRDhfrhVRJnc dnKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=X289waNLCZ+JHoaWE2xgdJPwOWDDgvAxueFO4BpeHo0=; fh=5SKpfDtSBJtIlCv5J/Lwepmb+faJOtfia644XosAi9I=; b=T2rseSHORbbsaOeegm9WMlg+kzH1N//Y5CyL93iCm19b3LcWSNaYo982hD1vODVcob 73YbgZGOMnlKV6AKt6jHSVC+Lq2SBdfsILzGW15bqI8I21pNou8mBQ+zv4zG9abwJzuz YCrn+lW/po7v+UTtY3lOvw5ncV0qgjWxsY3nUwX1Y+mrF3ZGhx2zTJMOCt/fZwIJlvHb xHucMq4SFXU7ltNJQWoIYLKXCmzlPgcdgcY7EDDf7owPY0Q2CD+/5ZAxcVs/ctwHK9Up wpdmLk80691V/QfimmlAdd5622sJs4sdOjhNBWdhKvWeUGIT/NEiqbU7v+/UPUSV4dIJ 3sfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SMLqaWBz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-3824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bx7-20020a05622a090700b00439b6bf7328si1616047qtb.639.2024.04.21.22.52.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 22:52:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3824-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=@kernel.org header.s=k20201202 header.b=SMLqaWBz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-3824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 4DA231C213C7 for ; Mon, 22 Apr 2024 05:52:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0583418645; Mon, 22 Apr 2024 05:52:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SMLqaWBz" X-Original-To: linux-bluetooth@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5F98ADDA3; Mon, 22 Apr 2024 05:52:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713765173; cv=none; b=oOxh8tqgd5rXwTvmimChpM5fUM5gMovHQ057OxMMt952Y6OFNy9xiS7Sp7M0e72xsk9dRvWRBchxCLdX/IBWaQxIPf4LaSzKOcq7ND01RTSeTgtNHLqzuNFXpS9qFDGEs6B+DVdyXeHPA3A8SM9yS2pe20DMZPxmAfYi0a8Ffd0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713765173; c=relaxed/simple; bh=4O2jlXHsWYrDuABM02Eg1uO1xVYLZkgO343EIzuTYVI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kVQwxQGM66EoP4JYizDNuOykn+ZcAt8Zz+j0Xb3m57wed3FuvRmizK7cPNDec8CntH11TobgVqQQ1sn2CiqWAbOxGdytDw3H0e5yXLOu3kMUwvoUaOHNYCgBn0OQAqfZRsiXDCrbPYyJJTNTvDvGkuFnxVQf+qVAoxSFEFxjOW0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SMLqaWBz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DE44C113CC; Mon, 22 Apr 2024 05:52:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713765172; bh=4O2jlXHsWYrDuABM02Eg1uO1xVYLZkgO343EIzuTYVI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SMLqaWBzv+ulDAYwBBBIRgdmy6uo+URoiKqtvcdrAWc0McNQmTQAXV04+7nbaJ9H2 x216i5AIaU+xtu8zrRi00+4aTdGbo0yPLpb9dfVX4tz2uQUlfm1YZ2eVVVqHmRTtzi gFNBFyeLLxrqIj+ORXi3jY2wrcecP/mMUSj+Cnc7CvNjUuNwVeEo+WWcPtZg5vdwkw rbrIC88b9bssSOBaF3liXOnnVvIgyaAqdYv7lc7JkDok/V+kwMQYrloeDcZSFBBGAe pySbmBl0394jH8iVqtGnkG54d1D09bYyQ+VRD+vlkBgsO6znr1ZpYWErVnv5nVBRKG olyKb79QEG6Hw== Message-ID: <2bd1f1bf-f867-4430-8ce5-c691485665e1@kernel.org> Date: Mon, 22 Apr 2024 07:52:47 +0200 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 v4 0/2] Fix two regression issues for QCA controllers To: quic_zijuhu , Wren Turkal , luiz.dentz@gmail.com, luiz.von.dentz@intel.com, marcel@holtmann.org Cc: linux-bluetooth@vger.kernel.org, bartosz.golaszewski@linaro.org, regressions@lists.linux.dev References: <1713564212-21725-1-git-send-email-quic_zijuhu@quicinc.com> <1713650800-29741-1-git-send-email-quic_zijuhu@quicinc.com> <369512e2-f091-4370-bce5-9ac32178dc4d@penguintechs.org> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgIDAQIeAQIXgBYhBJvQfg4MUfjVlne3VBuTQ307QWKbBQJgPO8PBQkUX63hAAoJEBuTQ307 QWKbBn8P+QFxwl7pDsAKR1InemMAmuykCH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= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 22/04/2024 02:14, quic_zijuhu wrote: > On 4/22/2024 2:41 AM, Krzysztof Kozlowski wrote: >> On 21/04/2024 09:44, Wren Turkal wrote: >>> On 4/20/24 3:06 PM, Zijun Hu wrote: >>>> This patch series are to fix below 2 regression issues for QCA controllers >>>> 1) BT can't be enabled once BT was ever enabled for QCA_QCA6390 >>>> 2) BT can't be enabled after disable then warm reboot for QCA_QCA6390 >>> >>> @Zijun @Krzysztof and @Bartosz Would it be helpful for me to test these >>> to ensure they fix the issues I reported? >>> >> >> I look forward to someone testing these on other hardware, not yours. On >> the hardware where the original issues were happening leading to this >> changes, e.g. RB5. >> >> Anyway, the problem here is poor explanation of the problem which did >> not improve in v3 and v4. Instead I receive explanations like: >> >> "this is shutdown of serdev and not hdev's shutdown." >> Not related... >> > this is the reply for secondary issue. i believe i have given much > explain for my fix for the 2nd issue as shown by below links. No, you did not. > let me add a bit more explanation within the ending "For the 2nd issue" > section, supposed you known much for generic flag > HCI_QUIRK_NON_PERSISTENT_SETUP, otherwise, see header comment for the > quirk. also supposed you see commit history to find why > qca_serdev_shutdown() was introduced for QCA6390. > https://lore.kernel.org/all/fe1a0e3b-3408-4a33-90e9-d4ffcfc7a99b@quicinc.com/ You did not answer my questions. Let's quote: "i don't explain much since these HCI_QUIRK_NON_PERSISTENT_SETUP and HCI_SETUP is generic flag." Srsly, what is such answer? >> "now. you understood why your merged change as shown link of 4) have >> problems and introduced our discussed issue, right?" >> > this is the reply for the first issue as shown by below link. it almost > have the same description as the following "For 1st issue:" section. > i believe it have clear illustration why the commit have bugs. > https://lore.kernel.org/all/2166fc66-9340-4e8c-8662-17a19a7d8ce6@linaro.org/ >> No. I did not understand and I feel I am wasting here time. >>> Code could be correct, could be wrong. Especially second patch looks >> suspicious. But the way Zijun Hu explains it and the way Zijun Hu >> responds is not helping at all. >> >> Sorry, with such replies to review, it is not worth my time. >> >> Best regards, >> Krzysztof >> > Hi luiz,marcel > > it is time for me to request you give comments for our discussion > and for my fixes, Let me explain the 1st issue then 2nd one. You keep pushing and pushing even though I stated my remarks. > > For 1st issue: > 1) the following commit will cause serious regression issue for QCA > controllers, and it has been merged with linus's mainline kernel. > > Commit 56d074d26c58 ("Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() > with gpiod_get_optional()"). > > 2) the regression issue is described by [PATCH v4 1/2] commit message > as following: > BT can't be enabled after below steps: > cold boot -> enable BT -> disable BT -> warm reboot -> BT enable > failure if property enable-gpios is not configured within DT|ACPI for > QCA_QCA6390. > i will verify and confirm if QCA_QCA2066 and QCA_ROME also are impacted. > > 3) let me explain the bug point for commit mentioned by 1), its > commit message and bug change applet are shown below. > > The optional variants for the gpiod_get() family of functions return > NULL if the GPIO in question is not associated with this device. They > return ERR_PTR() on any other error. NULL descriptors are graciously > handled by GPIOLIB and can be safely passed to any of the GPIO consumer > interfaces as they will return 0 and act as if the function succeeded. > If one is using the optional variant, then there's no point in checking > for NULL. > > qcadev->bt_en = 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 = false; > } > 3.1) we only need to discuss how to handle case "qcadev->bt_en == > NULL" since this is only difference between the commit and BT original > design. > 3.2) BT original design are agree with the point of above commit > message that case "qcadev->bt_en == NULL" should not be treated as > error, so BT original design does not do error return for the case and > use dev_warn() instead of dev_err() to give. > 3.3) the commit misunderstands BT original design and wrongly think > BT original design take "qcadev->bt_en == NULL" as error case, > so change the following flag power_ctrl_enabled set logic and cause > discussed issue. > > For the 2nd issue: > 1) the following commit will cause below regression issue for QCA_QCA6390. > Commit 272970be3dab ("Bluetooth: hci_qca: Fix driver shutdown on closed > serdev") > > 2) the regression issue is described by [PATCH v4 2/2] commit message > as following: > BT can't be enabled after below steps: > cold boot -> enable BT -> disable BT -> warm reboot -> BT enable > failure if property enable-gpios is not configured within DT|ACPI for > QCA_QCA6390. You did not address original issue of crash during shutdown and did not clarify my questions. > > 3) qca_serdev_shutdown() is serdev's shutdown and not hdev's shutdown() > it should not and also never get chance to be invoked even if BT is > disabled at above 2) step. qca_serdev_shutdown() need to send the VSC > to reset controller during warm reset phase of above 2) steps. Anyway, any explanation providing background how you are fixing this issue while keeping *previous problem fixed* is useful but should be provided in commit msg. I asked about this two or three times. BTW, provide here exact kernel version you tested this patches with. Also the exact hardware. Best regards, Krzysztof