Linux-Bluetooth Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 3/3] Bluetooth: hci_bcm: Ignore deprecated command fail case
@ 2020-10-14  5:47 Amitesh Chandra
  0 siblings, 0 replies; only message in thread
From: Amitesh Chandra @ 2020-10-14  5:47 UTC (permalink / raw)
  To: marcel, johan.hedberg, linux-bluetooth, linux-kernel
  Cc: amitesh.chandra, ravi.nagarajan, cheneyni, Manoj Babulal

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14  5:47 [PATCH 3/3] Bluetooth: hci_bcm: Ignore deprecated command fail case Amitesh Chandra

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org
	public-inbox-index linux-bluetooth

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git