linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: quic_zijuhu <quic_zijuhu@quicinc.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	<luiz.dentz@gmail.com>, <luiz.von.dentz@intel.com>,
	<marcel@holtmann.org>
Cc: <linux-bluetooth@vger.kernel.org>, <wt@penguintechs.org>,
	<bartosz.golaszewski@linaro.org>, <",kernel"@quicinc.com>
Subject: Re: [PATCH v1 1/2] Revert "Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() with gpiod_get_optional()"
Date: Sat, 20 Apr 2024 13:25:25 +0800	[thread overview]
Message-ID: <01677a26-ea91-47cc-bdc4-283cf313d8e4@quicinc.com> (raw)
In-Reply-To: <4e4d8ee0-fbbe-4dc7-b40b-b983f9f39539@linaro.org>

On 4/19/2024 9:49 PM, Krzysztof Kozlowski wrote:

Hi Krzysztof,bartosz,

let me summarize our discussion here in order to reduce unneccessary
disagreements here.

1) i only revert your change IS_ERR() to my change IS_ERR_OR_NULL.

2) your change will cause serious regression issues for many lunched
products

3) we only need to discuss how to handle devm_gpiod_get_optional(...,
"enable", ...) returning NULL since this is only difference between your
change and mine.

4) your change doesn't solve any actual issue and the reason you
submitted is that "The optional variants for the gpiod_get() family of
functions return NULL if the GPIO in question is not associated with
this device, and should not treat it as error".

code applet of your merged change is shown by below link
https://patchwork.kernel.org/project/bluetooth/patch/20240208164017.26699-1-brgl@bgdev.pl/#25705104

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;
 		}

5) Original BT driver design agree with your point mentioned at 4), so
for case "qcadev->bt_en == nullptr", qca_serdev_probe() don't do error
return for this scenario and use dev_warn() instead of dev_err() to give
user prompt.

6) your wrong fix changes flag power_ctrl_enabled set logic and will
cause serious BT regression issue, hope you will realize this point.


i would like to give below extra comments even if these comments are
irrelevant to the critical point of this issue mentioned at above 3)

A) you need to investigate it is a) the prompting approach or message
 error or b) the if condition error even if if dev_err() is used to give
prompt instead of dev_warn() in above 4).

B) don't talk about how about devm_gpiod_get_optional() returning error
case since it is meaningless as explained by above 3). also don't
require a fix to fix another unreported issue. a fix is a good fix
if it fix the issue in question and don't introduce new issue.

C) per DTS property enable-gpios of BT, different soc types have
different requirements, many are required and another many are NOT
mandatory as shown be below link.
https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/tree/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml.

for a soc type which are attached to 3rd platform, customer doesn't
would like to or are not able to congfig BT reset pin within DTS for QCA
driver even if QC strongly suggest customer config it and also be marked
as required within above DTS bindings spec link. i often meet this
scenario. there are many of such lunched products.

i will try to fix this issue due your change product by product in new
patch thread based on this DTS comment.

D) you maybe ping me offline about this issue if you are a member of QC
since you known "go/upstream"

> On 19/04/2024 01:17, quic_zijuhu wrote:
>> On 4/19/2024 6:37 AM, Krzysztof Kozlowski wrote:
>>> On 18/04/2024 23:16, quic_zijuhu wrote:
>>>> On 4/19/2024 12:52 AM, Krzysztof Kozlowski wrote:
>>>>> On 18/04/2024 16:06, Zijun Hu wrote:
>>>>>> This reverts commit 56d074d26c5828773b00b2185dd7e1d08273b8e8.
>>>>>>
>>>>>> Commit 56d074d26c58 ("Bluetooth: hci_qca: don't use IS_ERR_OR_NULL()
>>>>>> with gpiod_get_optional()") will cause serious regression issue for
>>>>>> several QCA controllers such as QCA_WCN6750,QCA_WCN6855,QCA_ROME,
>>>>>
>>>>> The pin is required on 6750, 6855 and maybe others. You cannot not have
>>>>> the GPIO.
>>>>>
>>>>> This is no correct fix. You provide wrong DTS and, instead fixing it,
>>>>> try to revert kernel code.
>>>>>
>>>>> No, fix your DTS first.
>>>>>
>>>> no. your point is not right.
>>>>
>>>> 1) do you have any evidence that the hci_qca driver must use reset GPIO?
>>>
>>> I think we talk here about enable-gpios, right? Then the evidence are
>>> bindings.
>>>
>> yes. properties within bindings only means driver supporting it, don't means user must
>> config it. the gpio is got by devm_gpiod_get_optional() variant. that means it is optional
>> about if user need to config it.
> 
> No. Read writing bindings and other presentations explaining what are
> Devicetree bindings.
> 
> You miss entirely the point and use downstream narrative. This won't
> work and it was told so many times, that I expect you to do the homework
> first.
> 
> Use "go/upstream" before posting more on this topic.
> 
> 
>>>> 2) why does original design do error return when get GPIO error if GPIO is mandatory?
>>>
>>> If GPIO is mandatory, then it is expected to return error. What is the
>>> problem here?
>>>
>> sorry, i miss a NOT for my question. my question is that
>> 2) why does original design NOT do error return when get GPIO error if GPIO is mandatory?
>>>
>>>> 3) i meet many customer cases that BT are working fine without hci_qca operating the GPIO,
>>>> there is why HCI_QUIRK_NON_PERSISTENT_SETUP are introduced.
>>>
>>> Bindings tell different story and nothing in the commit msg explained
>>> this. You did not correct bindings either.
>>>
>> don't need to correct bindings. i believe bindings does not say enable gpio
>> must be configured.
> 
> They say. Read the bindings. Test your DTS. Or better: upstream your DTS
> and prove to us that dtbs_check allows lack of enable-gpios.
> 
> 
>>>
>>>> 4) does the reverted change solve the issue your mentioned ?
>>>
>>> ??? I did not mention any issue. I am saying that your rationale is
>>> either not complete or not correct.
>>>
>> do you suggest about how to make it complete?
> 
> Yes, read what are bindings and then describe your change including
> that: what is the issue, how it can be reproduced, what is the hardware,
> why the bindings are not correct (if they are not correct) etc.
> 
> 
> Best regards,
> Krzysztof
> 


  reply	other threads:[~2024-04-20  5:25 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18 14:06 [PATCH v1 0/2] Fix two regression issues for QCA controllers Zijun Hu
2024-04-18 14:06 ` [PATCH v1 1/2] Revert "Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() with gpiod_get_optional()" Zijun Hu
2024-04-18 14:31   ` Fix two regression issues for QCA controllers bluez.test.bot
2024-04-18 16:52   ` [PATCH v1 1/2] Revert "Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() with gpiod_get_optional()" Krzysztof Kozlowski
2024-04-18 21:16     ` quic_zijuhu
2024-04-18 22:37       ` Krzysztof Kozlowski
2024-04-18 23:17         ` quic_zijuhu
2024-04-19 13:49           ` Krzysztof Kozlowski
2024-04-20  5:25             ` quic_zijuhu [this message]
2024-04-20  5:27               ` quic_zijuhu
2024-04-20 11:13               ` Krzysztof Kozlowski
2024-04-20 23:01                 ` quic_zijuhu
2024-04-18 17:00   ` Bartosz Golaszewski
2024-04-18 21:43     ` quic_zijuhu
2024-04-18 22:42       ` Bartosz Golaszewski
2024-04-18 23:36         ` quic_zijuhu
2024-04-19 21:27           ` Bartosz Golaszewski
2024-04-20  5:39             ` quic_zijuhu
2024-04-21  7:14         ` Wren Turkal
2024-04-21  9:40           ` quic_zijuhu
2024-04-22  5:26             ` Wren Turkal
2024-04-18 14:06 ` [PATCH v1 2/2] Bluetooth: qca: Fix BT enable failure for QCA_QCA6390 after disable then warm reboot Zijun Hu
2024-04-18 16:48   ` Krzysztof Kozlowski
2024-04-18 20:34     ` quic_zijuhu
2024-04-18 20:58       ` Krzysztof Kozlowski
2024-04-18 22:05         ` quic_zijuhu
2024-04-18 22:38           ` Krzysztof Kozlowski
2024-04-18 23:24             ` quic_zijuhu
2024-04-19 21:48 ` [PATCH v1 0/2] Fix two regression issues for QCA controllers Zijun Hu
2024-04-19 21:48   ` [PATCH v2 1/2] Bluetooth: MGMT: Fix failing to MGMT_OP_ADD_UUID/MGMT_OP_REMOVE_UUID Zijun Hu
2024-04-19 22:05     ` quic_zijuhu
2024-04-19 22:12     ` [v2,1/2] " bluez.test.bot
2024-04-19 21:48   ` [PATCH v2 2/2] Bluetooth: qca: Fix BT enable failure for QCA_QCA6390 Zijun Hu
2024-04-19 22:06     ` quic_zijuhu
2024-04-19 22:03 ` [PATCH v3 0/2] Fix two regression issues for QCA controllers Zijun Hu
2024-04-19 22:03   ` [PATCH v3 1/2] Bluetooth: qca: Fix BT enable failure for QCA_QCA6390 Zijun Hu
2024-04-19 22:30     ` Fix two regression issues for QCA controllers bluez.test.bot
2024-04-20 11:03     ` [PATCH v3 1/2] Bluetooth: qca: Fix BT enable failure for QCA_QCA6390 Krzysztof Kozlowski
2024-04-20 21:28       ` quic_zijuhu
2024-04-19 22:03   ` [PATCH v3 2/2] Bluetooth: qca: Fix BT enable failure for QCA_QCA6390 after disable then warm reboot Zijun Hu
2024-04-20 11:07     ` Krzysztof Kozlowski
2024-04-20 21:42       ` quic_zijuhu
2024-04-20 11:01   ` [PATCH v3 0/2] Fix two regression issues for QCA controllers Krzysztof Kozlowski
2024-04-22  7:44     ` Krzysztof Kozlowski
2024-04-22  8:07       ` quic_zijuhu
2024-04-22  8:11         ` Krzysztof Kozlowski
2024-04-22  8:21           ` quic_zijuhu
2024-04-20 22:06   ` [PATCH v4 " Zijun Hu
2024-04-20 22:06     ` [PATCH v4 1/2] Bluetooth: qca: Fix BT enable failure for QCA_QCA6390 Zijun Hu
2024-04-20 22:31       ` Fix two regression issues for QCA controllers bluez.test.bot
2024-04-20 22:06     ` [PATCH v4 2/2] Bluetooth: qca: Fix BT enable failure for QCA_QCA6390 after disable then warm reboot Zijun Hu
2024-04-21  7:44     ` [PATCH v4 0/2] Fix two regression issues for QCA controllers Wren Turkal
2024-04-21  9:30       ` quic_zijuhu
2024-04-21 18:41       ` Krzysztof Kozlowski
2024-04-22  0:14         ` quic_zijuhu
2024-04-22  5:21           ` Wren Turkal
2024-04-22  8:51             ` Bartosz Golaszewski
2024-04-22 10:42               ` Wren Turkal
2024-04-22 13:02                 ` Bartosz Golaszewski
2024-04-24  1:52                   ` Wren Turkal
2024-04-22  5:52           ` Krzysztof Kozlowski
2024-04-22  6:00             ` quic_zijuhu
2024-04-22  7:45               ` Krzysztof Kozlowski
2024-04-22 10:05             ` quic_zijuhu
2024-04-22 12:28               ` Krzysztof Kozlowski
2024-04-21 13:51     ` Krzysztof Kozlowski
2024-04-22  7:38     ` [PATCH v5 " Zijun Hu
2024-04-22  7:38       ` [PATCH v5 1/2] Bluetooth: qca: Fix BT enable failure for QCA_QCA6390 Zijun Hu
2024-04-22  8:36         ` Fix two regression issues for QCA controllers bluez.test.bot
2024-04-22  7:38       ` [PATCH v5 2/2] Bluetooth: qca: Fix BT enable failure for QCA_QCA6390 after disable then warm reboot Zijun Hu
2024-04-22  7:42         ` Krzysztof Kozlowski
2024-04-22 11:25           ` quic_zijuhu
2024-04-22 12:22             ` Krzysztof Kozlowski
2024-04-22 12:59               ` quic_zijuhu
2024-04-25  0:59       ` [PATCH v6 v7] Fix two BT regression issues for QCA6390 Zijun Hu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01677a26-ea91-47cc-bdc4-283cf313d8e4@quicinc.com \
    --to=quic_zijuhu@quicinc.com \
    --cc=",kernel"@quicinc.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=luiz.von.dentz@intel.com \
    --cc=marcel@holtmann.org \
    --cc=wt@penguintechs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).