Skip to contentSkip to conversation

Bluetooth: Fix spurious error message

RFC In review Szymon Janc 2 participants 3 messages Mar 29, 2018 – Apr 18, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 Bluetooth: Fix spurious error message

This message was debug message before 2064ee332e4c1b7495cf68b. Looks like it was changed by accident in that patch. This is causing some error messages when doing BR/EDR discovery since Inquiry Command generates Command Status event, not Command Complete.

I'm sending this as RFC for now since while things seem to work fine despite this condition (and it was like that for quite some time) it feels like this is indeed case that should be handled by HCI request code.

---
 net/bluetooth/hci_event.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/bluetooth/hci_event.c +1 -2
index cd3bbb766c24..3f111343f57b 100644
@@ -5207,8 +5207,7 @@ static bool hci_get_cmd_complete(struct hci_dev *hdev, u16 opcode,
 	}
 
 	if (hdr->evt != HCI_EV_CMD_COMPLETE) {
-		bt_dev_err(hdev, "last event is not cmd complete (0x%2.2x)",
-			   hdr->evt);
+		BT_DBG("last event is not cmd complete (0x%2.2x)", hdr->evt);
 		return false;
 	}
 
Signature · 1 line
2.14.3
#1 lore raw

Hi,

Quoted 20 lines · On Thursday, 29 March 2018 11:41:17 CEST Szymon Janc wrote:

This message was debug message before 2064ee332e4c1b7495cf68b. Looks like it was changed by accident in that patch. This is causing some error messages when doing BR/EDR discovery since Inquiry Command generates Command Status event, not Command Complete.

I'm sending this as RFC for now since while things seem to work fine despite this condition (and it was like that for quite some time) it feels like this is indeed case that should be handled by HCI request code.

---
 net/bluetooth/hci_event.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/bluetooth/hci_event.c +0 -0
index cd3bbb766c24..3f111343f57b 100644

net/bluetooth/hci_event.c static bool hci_get_cmd_complete(struct hci_dev *hdev, · line 5212

Quoted 8 lines
net/bluetooth/hci_event.c +1 -2
@@ -5207,8 +5207,7 @@ static bool hci_get_cmd_complete(struct hci_dev *hdev,
 u16 opcode, }
 
 	if (hdr->evt != HCI_EV_CMD_COMPLETE) {
-		bt_dev_err(hdev, "last event is not cmd complete (0x%2.2x)",
-			   hdr->evt);
+		BT_DBG("last event is not cmd complete (0x%2.2x)", hdr->evt);
 		return false;
 	}

Any thoughts on this?

Signature · 2 lines
pozdrawiam
Szymon Janc
maintainer
#2 lore raw
In reply to Szymon Janc

Hi Szymon,

Quoted 20 lines

This message was debug message before 2064ee332e4c1b7495cf68b. Looks like it was changed by accident in that patch. This is causing some error messages when doing BR/EDR discovery since Inquiry Command generates Command Status event, not Command Complete.

I'm sending this as RFC for now since while things seem to work fine despite this condition (and it was like that for quite some time) it feels like this is indeed case that should be handled by HCI request code.

---
net/bluetooth/hci_event.c | 3 +--

1 file changed, 1 insertion(+), 2 deletions(-)
net/bluetooth/hci_event.c +0 -0
index cd3bbb766c24..3f111343f57b 100644

net/bluetooth/hci_event.c static bool hci_get_cmd_complete(struct hci_dev *hdev, u16 opcode, · line 5212

Quoted 8 lines
net/bluetooth/hci_event.c +1 -2
@@ -5207,8 +5207,7 @@ static bool hci_get_cmd_complete(struct hci_dev *hdev, u16 opcode,
 	}
 
 	if (hdr->evt != HCI_EV_CMD_COMPLETE) {
-		bt_dev_err(hdev, "last event is not cmd complete (0x%2.2x)",
-			   hdr->evt);
+		BT_DBG("last event is not cmd complete (0x%2.2x)", hdr->evt);
 		return false;
 	}

I changed this intentionally since it looked like an error to me. However Johan needs to have a look at this and we need to get a proper fix. Just hiding it behind a debug statement is not helping.

Regards

Marcel