linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Bluetooth: btintel: Fix bdaddress comparison with garbage value
@ 2021-10-13  8:05 Kiran K
  2021-10-13  9:10 ` [v2] " bluez.test.bot
  2021-10-13 12:31 ` [PATCH v2] " Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Kiran K @ 2021-10-13  8:05 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: ravishankar.srivatsa, chethan.tumkur.narayan, tedd.an,
	luiz.von.dentz, Kiran K

Intel Read Verision(TLV) data is parsed into a local structure variable
and it contains a field for bd address. Bd address is returned only in
bootloader mode and hence bd address in TLV structure needs to be validated
only if controller is present in boot loader mode.

Signed-off-by: Kiran K <kiran.k@intel.com>
Reviewed-by: Tedd Ho-Jeong An <tedd.an@intel.com>
---

Notes:
    changes in v2:
    - Add comment for memsetting ver_tlv

 drivers/bluetooth/btintel.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 9359bff47296..8f9109b40961 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -2081,14 +2081,16 @@ static int btintel_prepare_fw_download_tlv(struct hci_dev *hdev,
 	if (ver->img_type == 0x03) {
 		btintel_clear_flag(hdev, INTEL_BOOTLOADER);
 		btintel_check_bdaddr(hdev);
-	}
-
-	/* If the OTP has no valid Bluetooth device address, then there will
-	 * also be no valid address for the operational firmware.
-	 */
-	if (!bacmp(&ver->otp_bd_addr, BDADDR_ANY)) {
-		bt_dev_info(hdev, "No device address configured");
-		set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
+	} else {
+		/*
+		 * Check for valid bd address in boot loader mode. Device
+		 * will be marked as unconfigured if empty bd address is
+		 * found.
+		 */
+		if (!bacmp(&ver->otp_bd_addr, BDADDR_ANY)) {
+			bt_dev_info(hdev, "No device address configured");
+			set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
+		}
 	}
 
 	btintel_get_fw_name_tlv(ver, fwname, sizeof(fwname), "sfi");
@@ -2466,6 +2468,10 @@ static int btintel_setup_combined(struct hci_dev *hdev)
 		goto exit_error;
 	}
 
+	/* memset ver_tlv to start with clean state as few fields are exclusive
+	 * to bootloader mode and are not populated in operational mode
+	 */
+	memset(&ver_tlv, 0, sizeof(ver_tlv));
 	/* For TLV type device, parse the tlv data */
 	err = btintel_parse_version_tlv(hdev, &ver_tlv, skb);
 	if (err) {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [v2] Bluetooth: btintel: Fix bdaddress comparison with garbage value
  2021-10-13  8:05 [PATCH v2] Bluetooth: btintel: Fix bdaddress comparison with garbage value Kiran K
@ 2021-10-13  9:10 ` bluez.test.bot
  2021-10-13 12:31 ` [PATCH v2] " Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2021-10-13  9:10 UTC (permalink / raw)
  To: linux-bluetooth, kiran.k

[-- Attachment #1: Type: text/plain, Size: 935 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=562455

---Test result---

Test Summary:
CheckPatch                    PASS      1.89 seconds
GitLint                       PASS      0.93 seconds
BuildKernel                   PASS      543.17 seconds
TestRunner: Setup             PASS      405.31 seconds
TestRunner: l2cap-tester      PASS      9.27 seconds
TestRunner: bnep-tester       PASS      4.96 seconds
TestRunner: mgmt-tester       PASS      85.41 seconds
TestRunner: rfcomm-tester     PASS      5.99 seconds
TestRunner: sco-tester        PASS      6.26 seconds
TestRunner: smp-tester        PASS      6.01 seconds
TestRunner: userchan-tester   PASS      5.24 seconds



---
Regards,
Linux Bluetooth


[-- Attachment #2: l2cap-tester.log --]
[-- Type: application/octet-stream, Size: 44357 bytes --]

[-- Attachment #3: bnep-tester.log --]
[-- Type: application/octet-stream, Size: 3564 bytes --]

[-- Attachment #4: mgmt-tester.log --]
[-- Type: application/octet-stream, Size: 646011 bytes --]

[-- Attachment #5: rfcomm-tester.log --]
[-- Type: application/octet-stream, Size: 11684 bytes --]

[-- Attachment #6: sco-tester.log --]
[-- Type: application/octet-stream, Size: 13924 bytes --]

[-- Attachment #7: smp-tester.log --]
[-- Type: application/octet-stream, Size: 11830 bytes --]

[-- Attachment #8: userchan-tester.log --]
[-- Type: application/octet-stream, Size: 6372 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Bluetooth: btintel: Fix bdaddress comparison with garbage value
  2021-10-13  8:05 [PATCH v2] Bluetooth: btintel: Fix bdaddress comparison with garbage value Kiran K
  2021-10-13  9:10 ` [v2] " bluez.test.bot
@ 2021-10-13 12:31 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2021-10-13 12:31 UTC (permalink / raw)
  To: Kiran K
  Cc: linux-bluetooth, Srivatsa, Ravishankar, Tumkur Narayan, Chethan,
	An, Tedd, Luiz Augusto von Dentz

Hi Kiran,

> Intel Read Verision(TLV) data is parsed into a local structure variable
> and it contains a field for bd address. Bd address is returned only in
> bootloader mode and hence bd address in TLV structure needs to be validated
> only if controller is present in boot loader mode.
> 
> Signed-off-by: Kiran K <kiran.k@intel.com>
> Reviewed-by: Tedd Ho-Jeong An <tedd.an@intel.com>
> ---
> 
> Notes:
>    changes in v2:
>    - Add comment for memsetting ver_tlv
> 
> drivers/bluetooth/btintel.c | 22 ++++++++++++++--------
> 1 file changed, 14 insertions(+), 8 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-13 12:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13  8:05 [PATCH v2] Bluetooth: btintel: Fix bdaddress comparison with garbage value Kiran K
2021-10-13  9:10 ` [v2] " bluez.test.bot
2021-10-13 12:31 ` [PATCH v2] " Marcel Holtmann

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).