From: Amitesh Chandra <amitesh.chandra@gmail.com>
To: marcel@holtmann.org, johan.hedberg@gmail.com,
linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: amitesh.chandra@broadcom.com, ravi.nagarajan@broadcom.com,
cheneyni@google.com, Manoj Babulal <manoj.babulal@broadcom.com>
Subject: [PATCH 3/3] Bluetooth: hci_bcm: Ignore deprecated command fail case
Date: Wed, 14 Oct 2020 11:17:46 +0530 [thread overview]
Message-ID: <20201014054746.2507-1-amitesh.chandra@gmail.com> (raw)
From: Manoj Babulal <manoj.babulal@broadcom.com>
Broadcom VSC uart_clock_setting is deprecated in
newer controllers. Ignore error if the controller
returns invalid or bad request error code.
Signed-off-by: Amitesh Chandra <amitesh.chandra@broadcom.com>
Signed-off-by: Manoj Babulal <manoj.babulal@broadcom.com>
---
drivers/bluetooth/hci_bcm.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 680478f..d316788 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -158,15 +158,18 @@ static int bcm_set_baudrate(struct hci_uart *hu, unsigned int speed)
skb = __hci_cmd_sync(hdev, 0xfc45, 1, &clock, HCI_INIT_TIMEOUT);
if (IS_ERR(skb)) {
int err = PTR_ERR(skb);
- bt_dev_err(hdev, "BCM: failed to write clock (%d)",
- err);
- return err;
+ /* Ignore err if command is deprecated in controller */
+ if (err != -EBADRQC) {
+ bt_dev_err(hdev, "BCM: failed to write "
+ "clock (%d)", err);
+ return err;
+ }
+ } else {
+ kfree_skb(skb);
}
-
- kfree_skb(skb);
}
- bt_dev_dbg(hdev, "Set Controller UART speed to %d bit/s", speed);
+ bt_dev_info(hdev, "Set Controller UART speed to %d bit/s", speed);
param.zero = cpu_to_le16(0);
param.baud_rate = cpu_to_le32(speed);
--
2.7.4
next reply other threads:[~2020-10-14 8:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-14 5:47 Amitesh Chandra [this message]
2020-11-11 11:07 ` [PATCH 3/3] Bluetooth: hci_bcm: Ignore deprecated command fail case 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=20201014054746.2507-1-amitesh.chandra@gmail.com \
--to=amitesh.chandra@gmail.com \
--cc=amitesh.chandra@broadcom.com \
--cc=cheneyni@google.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manoj.babulal@broadcom.com \
--cc=marcel@holtmann.org \
--cc=ravi.nagarajan@broadcom.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).