linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Balakrishna Godavarthi <bgodavar@codeaurora.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>,
	Matthias Kaehlcke <mka@chromium.org>,
	open list <linux-kernel@vger.kernel.org>,
	linux-bluetooth@vger.kernel.org, hemantg@codeaurora.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v1 3/4] Bluetooth: hci_qca: clear HCI_QUIRK_RESET_ON_CLOSE flag
Date: Tue, 6 Nov 2018 14:02:03 +0100	[thread overview]
Message-ID: <0CE81F0B-B122-4793-817F-F0F4738C44E0@holtmann.org> (raw)
In-Reply-To: <170e0419929840109d349b5df5e38364@codeaurora.org>

Hi Balakrishna,

>>> During hci down we are sending reset command to chip, which
>>> is not required for wcn3990, as hdev->shutdown() will turn off the
>>> regulators.
>>> Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
>>> ---
>>> drivers/bluetooth/hci_qca.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
>>> index 8301663f0004..97b57e0f4725 100644
>>> --- a/drivers/bluetooth/hci_qca.c
>>> +++ b/drivers/bluetooth/hci_qca.c
>>> @@ -1190,6 +1190,7 @@ static int qca_setup(struct hci_uart *hu)
>>> 		 */
>>> 		set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks);
>>> 		set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
>>> +		clear_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
>>> 		hu->hdev->shutdown = qca_power_off;
>>> 		ret = qca_wcn3990_init(hu);
>>> 		if (ret)
>> I am pretty certain that you didn’t want this quirk:
>>        /* When this quirk is set, the HCI Reset command is send when
>>         * closing the transport instead of when opening it.
>> This quirk is for Bluetooth 1.0b devices where the HCI_Reset behavior
>> was not clear or for devices that actually misbehave with the initial
>> HCI_Reset.
>> In addition, you commit message is totally misleading. That is not
>> what is happening with this quirk.
>> Regards
>> Marcel
> 
> My intention was reset command is not required when we do an hci down.
> this is because of hdev->shutdown will turn off the regulators.
> It is like turning off the chip. sending reset command after turning off the chip is not required.
> 
> I understand the usage of the quirk, will update the commit text.

you are papering over the issue. Actually hci_serdev.c:hci_uart_register_device() is the culprit with the legacy code copied over from hci_ldisc.c:hci_uart_register_dev(). I think there is no point doing all this legacy line discipline quirk handling until it is really needed. The serdev drivers are all for recent hardware.

That said, having moved over to a btuart.c approach and killed the whole hci_serdev.c thing would have been a lot better here. You will keep running in weird situations where 18 year old code keeps surprising you.

Regards

Marcel


  reply	other threads:[~2018-11-06 13:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 12:05 Bug fixes for Qualcomm BT chip wcn3990 Balakrishna Godavarthi
2018-11-06 12:05 ` [PATCH v1 1/4] Bluetooth: hci_qca: use wait_until_sent() for power pulses Balakrishna Godavarthi
2018-11-14  0:17   ` Matthias Kaehlcke
2018-11-14  6:29     ` Balakrishna Godavarthi
2018-11-14 15:27   ` Johan Hovold
2018-11-15 14:34     ` Balakrishna Godavarthi
2018-11-16  9:47       ` Johan Hovold
2018-11-06 12:05 ` [PATCH v1 2/4] Bluetooth: hci_qca: Pull RTS line high for baudrate change command Balakrishna Godavarthi
2018-11-14  1:55   ` Matthias Kaehlcke
2018-11-14  6:32     ` Balakrishna Godavarthi
2018-11-06 12:05 ` [PATCH v1 3/4] Bluetooth: hci_qca: clear HCI_QUIRK_RESET_ON_CLOSE flag Balakrishna Godavarthi
2018-11-06 12:33   ` Marcel Holtmann
2018-11-06 12:44     ` Balakrishna Godavarthi
2018-11-06 13:02       ` Marcel Holtmann [this message]
2018-11-06 13:14         ` Balakrishna Godavarthi
2018-11-06 13:36           ` Balakrishna Godavarthi
2018-11-14  7:48             ` Marcel Holtmann
2018-11-14 13:37               ` Balakrishna Godavarthi
2018-11-14  2:14           ` Matthias Kaehlcke
2018-11-14  6:50             ` Balakrishna Godavarthi
2018-11-06 12:05 ` [PATCH v1 4/4] Bluetooth: hci_qca: Fix frame reassembly errors for wcn3990 Balakrishna Godavarthi
2018-11-14 19:36   ` Matthias Kaehlcke
2018-11-15 11:40     ` Balakrishna Godavarthi

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=0CE81F0B-B122-4793-817F-F0F4738C44E0@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=bgodavar@codeaurora.org \
    --cc=hemantg@codeaurora.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mka@chromium.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).