linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
To: marcel@holtmann.org
Cc: chromeos-bluetooth-upstreaming@chromium.org, mcchou@chromium.org,
	michaelfsun@google.com, linux-bluetooth@vger.kernel.org,
	apusaka@chromium.org,
	Abhishek Pandit-Subedi <abhishekpandit@chromium.org>,
	Daniel Winkler <danielwinkler@google.com>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] Bluetooth: btusb: Trigger gpio reset quicker
Date: Tue, 19 Jan 2021 12:43:13 -0800	[thread overview]
Message-ID: <20210119124258.2.I52cc5d2b62fdeb5f3c5249d41f3631ae25d8dc71@changeid> (raw)
In-Reply-To: <20210119204315.2611811-1-abhishekpandit@chromium.org>

Currently, btusb will only trigger gpio reset during cmd_timeout after
5 commands fail. This number is arbitrarily large and can result in
resets taking longer to occur than necessary.

Reduce this number to 3, which was chosen as a recommended value by
Intel (their firmware allow two commands in flight so they recommend
resetting on the third failed command).

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Reviewed-by: Daniel Winkler <danielwinkler@google.com>
---

 drivers/bluetooth/btusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 03341e6cbf3ed..880e9cd4ee713 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -578,7 +578,7 @@ static void btusb_gpio_cmd_timeout(struct hci_dev *hdev)
 {
 	struct btusb_data *data = hci_get_drvdata(hdev);
 
-	if (++data->cmd_timeout_cnt < 5)
+	if (++data->cmd_timeout_cnt < 3)
 		return;
 
 	if (!data->reset_gpio) {
-- 
2.30.0.284.gd98b1dd5eaa7-goog


  parent reply	other threads:[~2021-01-19 21:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19 20:43 [PATCH 0/3] Bluetooth: btusb: Expose hw reset to debugfs Abhishek Pandit-Subedi
2021-01-19 20:43 ` [PATCH 1/3] Bluetooth: btusb: Refactor gpio reset Abhishek Pandit-Subedi
2021-01-25 15:19   ` Marcel Holtmann
2021-01-19 20:43 ` Abhishek Pandit-Subedi [this message]
2021-01-19 20:43 ` [PATCH 3/3] Bluetooth: btusb: Expose reset gpio to debugfs Abhishek Pandit-Subedi
2021-01-25 17:51   ` Marcel Holtmann

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=20210119124258.2.I52cc5d2b62fdeb5f3c5249d41f3631ae25d8dc71@changeid \
    --to=abhishekpandit@chromium.org \
    --cc=apusaka@chromium.org \
    --cc=chromeos-bluetooth-upstreaming@chromium.org \
    --cc=danielwinkler@google.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=mcchou@chromium.org \
    --cc=michaelfsun@google.com \
    /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).