All the mail mirrored from lore.kernel.org
 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>
Subject: Re: [PATCH v1 2/2] Bluetooth: qca: Fix BT enable failure for QCA_QCA6390 after disable then warm reboot
Date: Fri, 19 Apr 2024 06:05:53 +0800	[thread overview]
Message-ID: <f4b93d58-56a2-4fa1-88aa-7d5dfb8dcb0e@quicinc.com> (raw)
In-Reply-To: <93af3308-d70f-4423-a911-0f437f882462@linaro.org>

On 4/19/2024 4:58 AM, Krzysztof Kozlowski wrote:
> On 18/04/2024 22:34, quic_zijuhu wrote:
>> On 4/19/2024 12:48 AM, Krzysztof Kozlowski wrote:
>>> On 18/04/2024 16:06, Zijun Hu wrote:
>>>> From: Zijun Hu <zijuhu@qti.qualcomm.com>
>>>>
>>>> Commit 272970be3dab ("Bluetooth: hci_qca: Fix driver shutdown on closed
>>>> serdev") will cause regression issue for QCA_QCA6390 if BT reset pin is
>>>> not configured by DT or ACPI, the regression issue is that BT can't be
>>>> enabled after disable then warm reboot, fixed by correcting conditions
>>>> for sending the VSC reset controller within qca_serdev_shutdown().
>>>
>>> I have trouble understanding what is the bug. Can you rephrase it?
>>>
>> Think about below sequences:
>> cold reboot(power off then power on) -> Enable BT -> Disable BT -> Warm reboot -> Enable BT again ...
>> BT is failed to be enabled after warm reboot.
> 
> Still not. Please get someone to help you rephrase it. One long sentence
> is not good approach. Describe the problem, how it can be reproduced and
> then come with brief explanation how you fixed it (because it is not
> obvious to me).
> 
thanks for your suggestions. will optimize commit message based on your suggestions.
>>>>
>>>> Fixes: 272970be3dab ("Bluetooth: hci_qca: Fix driver shutdown on closed serdev")
>>>> Reported-by: Wren Turkal <wt@penguintechs.org>
>>>> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218726
>>>> Signed-off-by: Zijun Hu <zijuhu@qti.qualcomm.com>
>>>> Tested-by: Wren Turkal <wt@penguintechs.org>
>>>> ---
>>>>  drivers/bluetooth/hci_qca.c | 12 +++++++++---
>>>>  1 file changed, 9 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
>>>> index 160175a23a49..2a47a60ecc25 100644
>>>> --- a/drivers/bluetooth/hci_qca.c
>>>> +++ b/drivers/bluetooth/hci_qca.c
>>>> @@ -2437,15 +2437,21 @@ static void qca_serdev_shutdown(struct device *dev)
>>>>  	struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
>>>>  	struct hci_uart *hu = &qcadev->serdev_hu;
>>>>  	struct hci_dev *hdev = hu->hdev;
>>>> -	struct qca_data *qca = hu->priv;
>>>>  	const u8 ibs_wake_cmd[] = { 0xFD };
>>>>  	const u8 edl_reset_soc_cmd[] = { 0x01, 0x00, 0xFC, 0x01, 0x05 };
>>>>  
>>>>  	if (qcadev->btsoc_type == QCA_QCA6390) {
>>>> -		if (test_bit(QCA_BT_OFF, &qca->flags) ||
>>>> -		    !test_bit(HCI_RUNNING, &hdev->flags))
>>>> +		if (test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) {
>>>> +			BT_INFO("QCA do not need to send EDL_RESET_REQ");
>>>>  			return;
>>>> +		}
>>>> +
>>>> +		if (hci_dev_test_flag(hdev, HCI_SETUP)) {
>>>
>>> Commit msg does not help me at all to understand why you are changing
>>> the test bits.
>> it is test bits not changing bits.
> 
> Previously we tested bits for BT off and HCI running. Now not, so you
> changed the logic. Maybe it is correct, maybe not, I don't understand why.
> 
if HCI_QUIRK_NON_PERSISTENT_SETUP is set, it means we can and need to do initialization
by calling hdev->setup() for every BT enable,  so we don't need to send VSC to reset controller
here.

if HCI_QUIRK_NON_PERSISTENT_SETUP is cleared. it means we only can or need to do initialization
for the first BT enable operation. if HCI_SETUP is set, that means we don't do any BT enable yet
and the initialization operations are never performed. so we also don't need to send VSC any more.

otherwise, we need to send VSC to reset controller since initialization have been Done regardless of
BT state. for this case the serdev have still be opened. so it also don't meet the crash the 272970be3dab
fixed.

>>>
>>>> +			BT_INFO("QCA do not send EDL_RESET_REQ");
>>>> +			return;
>>>> +		}
>>>>  
>>>> +		BT_INFO("QCA start to send EDL_RESET_REQ");
>>>
>>> Why debugging info is part of the fix?
>>>
>> they are reserved intentionally to print critical info.
> 
> No, it's downstream coding style. Please don't bring it upstream. Or
> explain why this deserves informing user. Drivers should be quiet mostly.
> 
> 
okay, will remove BT_INFO("QCA start to send EDL_RESET_REQ");
> 
> Best regards,
> Krzysztof
> 


  reply	other threads:[~2024-04-18 22:06 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
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 [this message]
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=f4b93d58-56a2-4fa1-88aa-7d5dfb8dcb0e@quicinc.com \
    --to=quic_zijuhu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.