Skip to contentSkip to conversation

Bluetooth: btintel: Allow lowering of drive strength of BRI

PATCH Superseded Kiran K 3 participants 5 messages Jun 21, 2024 – Jun 26, 2024 Bluetooth drivers

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Kiran K

author
#0 lore raw

PATCH v2 1/1 Bluetooth: btintel: Allow lowering of drive strength of BRI

BRI (Bluetooth Radio Interface) traffic from CNVr to CNVi was found causing cross talk step errors to WiFi. As a workaround, driver needs to reduce the drive strength of BRI. During *setup*, driver reads the drive strength value from efi variable and passes it controller via vendor specific command with opcode 0xfc0a.

---
 drivers/bluetooth/btintel.c | 114 ++++++++++++++++++++++++++++++++++++
 1 file changed, 114 insertions(+)
drivers/bluetooth/btintel.c +114 -0
index 5d735391545a..3dc557aac43d 100644
@@ -12,6 +12,8 @@
 #include <linux/acpi.h>
 #include <acpi/acpi_bus.h>
 #include <asm/unaligned.h>
+#include <linux/efi.h>
+
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
@@ -49,6 +51,38 @@ static const guid_t btintel_guid_dsm =
 	GUID_INIT(0xaa10f4e0, 0x81ac, 0x4233,
 		  0xab, 0xf6, 0x3b, 0x2a, 0xc5, 0x0e, 0x28, 0xd9);
 
+static void *btintel_uefi_get_variable(efi_char16_t *name, efi_guid_t *guid)
+{
+	void *data;
+	efi_status_t status;
+	size_t data_size = 0;
+
+	if (!IS_ENABLED(CONFIG_EFI))
+		return ERR_PTR(-EOPNOTSUPP);
+
+	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
+		return ERR_PTR(-EOPNOTSUPP);
+
+	status = efi.get_variable(name, guid, NULL, &data_size, NULL);
+
+	if (status != EFI_BUFFER_TOO_SMALL || !data_size)
+		return ERR_PTR(-EIO);
+
+	data = kmalloc(data_size, GFP_KERNEL);
+
+	if (!data)
+		return ERR_PTR(-ENOMEM);
+
+	status = efi.get_variable(name, guid, NULL, &data_size, data);
+
+	if (status != EFI_SUCCESS) {
+		kfree(data);
+		return ERR_PTR(-ENXIO);
+	}
+
+	return data;
+}
+
 int btintel_check_bdaddr(struct hci_dev *hdev)
 {
 	struct hci_rp_read_bd_addr *bda;
@@ -2615,6 +2649,80 @@ static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb)
 	return hci_skb_pkt_type(skb);
 }
 
+static int btintel_set_dsbr(struct hci_dev *hdev, struct intel_version_tlv *ver)
+{
+	struct btintel_dsbr_cmd {
+		u8 enable;
+		u8 dsbr;
+	} __packed;
+
+	struct btintel_dsbr {
+		u8 header;
+		u32 dsbr;
+	} __packed;
+
+	struct btintel_dsbr *dsbr;
+	struct btintel_dsbr_cmd cmd;
+	struct sk_buff *skb;
+	u8 status;
+	efi_guid_t guid = EFI_GUID(0xe65d8884, 0xd4af, 0x4b20, 0x8d, 0x03,
+				   0x77, 0x2e, 0xcc, 0x3d, 0xa5, 0x31);
+
+	memset(&cmd, 0, sizeof(cmd));
+	dsbr = btintel_uefi_get_variable(L"UefiCnvCommonDSBR", &guid);
+	if (IS_ERR(dsbr)) {
+		/* If efi variable is not present, driver still needs to send
+		 * 0xfc0a command with default values
+		 */
+		bt_dev_dbg(hdev, "Error reading efi DSBR (%ld)",
+			   PTR_ERR(dsbr));
+		dsbr = NULL;
+	}
+
+	if (dsbr) {
+		/* bit0: 0 - Use firmware default value
+		 *       1 - Override firmware value
+		 * bit3:1 - Reserved
+		 * bit7:4 - DSBR override values
+		 * bt31:7 - Reserved
+		 */
+		cmd.enable = dsbr->dsbr & BIT(0);
+		if (cmd.enable)
+			cmd.dsbr = dsbr->dsbr >> 4 & 0xF;
+		kfree(dsbr);
+	}
+
+	bt_dev_info(hdev, "dsbr: enabled: 0x%2.2x value: 0x%2.2x", cmd.enable,
+		    cmd.dsbr);
+
+	skb = __hci_cmd_sync(hdev, 0xfc0a, sizeof(cmd), &cmd,  HCI_CMD_TIMEOUT);
+	if (IS_ERR(skb)) {
+		bt_dev_err(hdev, "Failed to send Intel DSBR command (%ld)",
+			   PTR_ERR(skb));
+		return -bt_to_errno(PTR_ERR(skb));
+	}
+
+	status = skb->data[0];
+	kfree_skb(skb);
+
+	if (status) {
+		bt_dev_err(hdev, "Set DSBR failed 0x%2.2x", status);
+		return -bt_to_errno(status);
+	}
+	return 0;
+}
+
+static int btintel_apply_dsbr(struct hci_dev *hdev,
+			      struct intel_version_tlv *ver)
+{
+	/* For BlazarI + B0 step, DSBR command needs to be sent just after
+	 * downloading IML firmware
+	 */
+	return ver->img_type == BTINTEL_IMG_IML &&
+		((ver->cnvi_top & 0xfff) == BTINTEL_CNVI_BLAZARI) &&
+		INTEL_CNVX_TOP_STEP(ver->cnvi_top) == 0x01;
+}
+
 int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
 				 struct intel_version_tlv *ver)
 {
@@ -2649,6 +2757,12 @@ int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
 	if (err)
 		return err;
 
+	if (btintel_apply_dsbr(hdev, ver)) {
+		err = btintel_set_dsbr(hdev, ver);
+		if (err)
+			return err;
+	}
+
 	/* If image type returned is BTINTEL_IMG_IML, then controller supports
 	 * intermediae loader image
 	 */
Signature · 1 line
2.40.1
#1 lore raw

Dear Kiran,

Thank you for the patch.

Am 21.06.24 um 08:44 schrieb Kiran K:

Quoted 2 lines

BRI (Bluetooth Radio Interface) traffic from CNVr to CNVi was found causing cross talk step errors to WiFi.

Interesting. Can you please elaborate how that can be detected?

Quoted 3 lines

As a workaround, driver needs to
reduce the drive strength of BRI. During *setup*, driver reads the drive strength value from efi variable and passes it controller via vendor

Where is this EFI variable described?

… passes it *to the* controller …

Quoted 1 line

specific command with opcode 0xfc0a.

Please document your test system and also add the new log messages.

Quoted 58 lines
---
  drivers/bluetooth/btintel.c | 114 ++++++++++++++++++++++++++++++++++++
  1 file changed, 114 insertions(+)
drivers/bluetooth/btintel.c +34 -0
index 5d735391545a..3dc557aac43d 100644
@@ -12,6 +12,8 @@
  #include <linux/acpi.h>
  #include <acpi/acpi_bus.h>
  #include <asm/unaligned.h>
+#include <linux/efi.h>
+
 
  #include <net/bluetooth/bluetooth.h>
  #include <net/bluetooth/hci_core.h>
@@ -49,6 +51,38 @@ static const guid_t btintel_guid_dsm =
  	GUID_INIT(0xaa10f4e0, 0x81ac, 0x4233,
  		  0xab, 0xf6, 0x3b, 0x2a, 0xc5, 0x0e, 0x28, 0xd9);
 
+static void *btintel_uefi_get_variable(efi_char16_t *name, efi_guid_t *guid)
+{
+	void *data;
+	efi_status_t status;
+	size_t data_size = 0;
+
+	if (!IS_ENABLED(CONFIG_EFI))
+		return ERR_PTR(-EOPNOTSUPP);
+
+	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
+		return ERR_PTR(-EOPNOTSUPP);
+
+	status = efi.get_variable(name, guid, NULL, &data_size, NULL);
+
+	if (status != EFI_BUFFER_TOO_SMALL || !data_size)
+		return ERR_PTR(-EIO);
+
+	data = kmalloc(data_size, GFP_KERNEL);
+
+	if (!data)
+		return ERR_PTR(-ENOMEM);
+
+	status = efi.get_variable(name, guid, NULL, &data_size, data);
+
+	if (status != EFI_SUCCESS) {
+		kfree(data);
+		return ERR_PTR(-ENXIO);
+	}
+
+	return data;
+}
+
  int btintel_check_bdaddr(struct hci_dev *hdev)
  {
  	struct hci_rp_read_bd_addr *bda;

drivers/bluetooth/btintel.c static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb) · line 2652

Quoted 4 lines
drivers/bluetooth/btintel.c +1 -0
@@ -2615,6 +2649,80 @@ static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb)
  	return hci_skb_pkt_type(skb);
  }
 
+static int btintel_set_dsbr(struct hci_dev *hdev, struct intel_version_tlv *ver)

Add a comment, what dsbr is?

Quoted 15 lines
drivers/bluetooth/btintel.c +15 -0
+{
+	struct btintel_dsbr_cmd {
+		u8 enable;
+		u8 dsbr;
+	} __packed;
+
+	struct btintel_dsbr {
+		u8 header;
+		u32 dsbr;
+	} __packed;
+
+	struct btintel_dsbr *dsbr;
+	struct btintel_dsbr_cmd cmd;
+	struct sk_buff *skb;
+	u8 status;

drivers/bluetooth/btintel.c static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb) · line 2677

Quoted 10 lines
drivers/bluetooth/btintel.c +10 -0
+	efi_guid_t guid = EFI_GUID(0xe65d8884, 0xd4af, 0x4b20, 0x8d, 0x03,
+				   0x77, 0x2e, 0xcc, 0x3d, 0xa5, 0x31);
+
+	memset(&cmd, 0, sizeof(cmd));
+	dsbr = btintel_uefi_get_variable(L"UefiCnvCommonDSBR", &guid);
+	if (IS_ERR(dsbr)) {
+		/* If efi variable is not present, driver still needs to send
+		 * 0xfc0a command with default values
+		 */
+		bt_dev_dbg(hdev, "Error reading efi DSBR (%ld)",

Maybe: Error reading EFI variable UefiCnvCommonDSBR (%ld)

Quoted 32 lines
drivers/bluetooth/btintel.c +32 -0
+			   PTR_ERR(dsbr));
+		dsbr = NULL;
+	}
+
+	if (dsbr) {
+		/* bit0: 0 - Use firmware default value
+		 *       1 - Override firmware value
+		 * bit3:1 - Reserved
+		 * bit7:4 - DSBR override values
+		 * bt31:7 - Reserved
+		 */
+		cmd.enable = dsbr->dsbr & BIT(0);
+		if (cmd.enable)
+			cmd.dsbr = dsbr->dsbr >> 4 & 0xF;
+		kfree(dsbr);
+	}
+
+	bt_dev_info(hdev, "dsbr: enabled: 0x%2.2x value: 0x%2.2x", cmd.enable,
+		    cmd.dsbr);
+
+	skb = __hci_cmd_sync(hdev, 0xfc0a, sizeof(cmd), &cmd,  HCI_CMD_TIMEOUT);
+	if (IS_ERR(skb)) {
+		bt_dev_err(hdev, "Failed to send Intel DSBR command (%ld)",
+			   PTR_ERR(skb));
+		return -bt_to_errno(PTR_ERR(skb));
+	}
+
+	status = skb->data[0];
+	kfree_skb(skb);
+
+	if (status) {
+		bt_dev_err(hdev, "Set DSBR failed 0x%2.2x", status);

drivers/bluetooth/btintel.c static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb) · line 2719

Quoted 10 lines
drivers/bluetooth/btintel.c +10 -0
+		return -bt_to_errno(status);
+	}
+	return 0;
+}
+
+static int btintel_apply_dsbr(struct hci_dev *hdev,
+			      struct intel_version_tlv *ver)
+{
+	/* For BlazarI + B0 step, DSBR command needs to be sent just after
+	 * downloading IML firmware

Add the section of the datasheet?

Quoted 12 lines
drivers/bluetooth/btintel.c +6 -0
+	 */
+	return ver->img_type == BTINTEL_IMG_IML &&
+		((ver->cnvi_top & 0xfff) == BTINTEL_CNVI_BLAZARI) &&
+		INTEL_CNVX_TOP_STEP(ver->cnvi_top) == 0x01;
+}
+
  int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
  				 struct intel_version_tlv *ver)
  {
@@ -2649,6 +2757,12 @@ int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
  	if (err)
  		return err;

drivers/bluetooth/btintel.c int btintel_bootloader_setup_tlv(struct hci_dev *hdev, · line 2768

Quoted 10 lines
drivers/bluetooth/btintel.c +6 -0
 
+	if (btintel_apply_dsbr(hdev, ver)) {
+		err = btintel_set_dsbr(hdev, ver);
+		if (err)
+			return err;
+	}
+
  	/* If image type returned is BTINTEL_IMG_IML, then controller supports
  	 * intermediae loader image
  	 */

Kind regards,

Paul

author
#2 lore raw

Hi Paul,

Thanks for your comments.

Quoted 14 lines

-----Original Message-----
From: Paul Menzel <[email protected]>
Sent: Friday, June 21, 2024 12:46 PM
To: K, Kiran <[email protected]>
Cc: Srivatsa, Ravishankar <[email protected]>; Tumkur Narayan, Chethan <[email protected]>; Devegowda, Chandrashekar <[email protected]>; Satija, Vijay <[email protected]>; [email protected]
Subject: Re: [PATCH v2] Bluetooth: btintel: Allow lowering of drive strength of BRI

Dear Kiran,

Quoted 8 lines

Thank you for the patch.

Am 21.06.24 um 08:44 schrieb Kiran K:

Quoted 2 lines

BRI (Bluetooth Radio Interface) traffic from CNVr to CNVi was found causing cross talk step errors to WiFi.

Interesting. Can you please elaborate how that can be detected?

Packet errors - Need special hardware to detect this issue.

Quoted 7 lines
Quoted 5 lines

As a workaround, driver needs to
reduce the drive strength of BRI. During *setup*, driver reads the drive strength value from efi variable and passes it controller via vendor

Where is this EFI variable described?

https://www.kernel.org/doc/html//v5.13/filesystems/efivarfs.html

Quoted 2 lines

… passes it *to the* controller …

Ack.

Quoted 4 lines
Quoted 2 lines

specific command with opcode 0xfc0a.

Please document your test system and also add the new log messages.

Ack.

Quoted 61 lines
Quoted 4 lines
---
  drivers/bluetooth/btintel.c | 114

++++++++++++++++++++++++++++++++++++

drivers/bluetooth/btintel.c static u8 btintel_classify_pkt_type(struct hci_dev

Quoted 55 lines
  1 file changed, 114 insertions(+)
drivers/bluetooth/btintel.c +34 -0
index 5d735391545a..3dc557aac43d 100644
@@ -12,6 +12,8 @@
  #include <linux/acpi.h>
  #include <acpi/acpi_bus.h>
  #include <asm/unaligned.h>
+#include <linux/efi.h>
+
 
  #include <net/bluetooth/bluetooth.h>
  #include <net/bluetooth/hci_core.h>
@@ -49,6 +51,38 @@ static const guid_t btintel_guid_dsm =
  	GUID_INIT(0xaa10f4e0, 0x81ac, 0x4233,
  		  0xab, 0xf6, 0x3b, 0x2a, 0xc5, 0x0e, 0x28, 0xd9);
 
+static void *btintel_uefi_get_variable(efi_char16_t *name, efi_guid_t
+*guid) {
+	void *data;
+	efi_status_t status;
+	size_t data_size = 0;
+
+	if (!IS_ENABLED(CONFIG_EFI))
+		return ERR_PTR(-EOPNOTSUPP);
+
+	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
+		return ERR_PTR(-EOPNOTSUPP);
+
+	status = efi.get_variable(name, guid, NULL, &data_size, NULL);
+
+	if (status != EFI_BUFFER_TOO_SMALL || !data_size)
+		return ERR_PTR(-EIO);
+
+	data = kmalloc(data_size, GFP_KERNEL);
+
+	if (!data)
+		return ERR_PTR(-ENOMEM);
+
+	status = efi.get_variable(name, guid, NULL, &data_size, data);
+
+	if (status != EFI_SUCCESS) {
+		kfree(data);
+		return ERR_PTR(-ENXIO);
+	}
+
+	return data;
+}
+
  int btintel_check_bdaddr(struct hci_dev *hdev)
  {
  	struct hci_rp_read_bd_addr *bda;
@@ -2615,6 +2649,80 @@ static u8 btintel_classify_pkt_type(struct hci_dev

*hdev, struct sk_buff *skb)

Quoted 7 lines

drivers/bluetooth/btintel.c static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb)

Quoted 5 lines
drivers/bluetooth/btintel.c +2 -0
  	return hci_skb_pkt_type(skb);
  }
 
+static int btintel_set_dsbr(struct hci_dev *hdev, struct
+intel_version_tlv *ver)

Add a comment, what dsbr is?

Ack.

Quoted 20 lines
Quoted 20 lines
drivers/bluetooth/btintel.c +19 -0
+{
+	struct btintel_dsbr_cmd {
+		u8 enable;
+		u8 dsbr;
+	} __packed;
+
+	struct btintel_dsbr {
+		u8 header;
+		u32 dsbr;
+	} __packed;
+
+	struct btintel_dsbr *dsbr;
+	struct btintel_dsbr_cmd cmd;
+	struct sk_buff *skb;
+	u8 status;
+	efi_guid_t guid = EFI_GUID(0xe65d8884, 0xd4af, 0x4b20, 0x8d, 0x03,
+				   0x77, 0x2e, 0xcc, 0x3d, 0xa5, 0x31);
+
+	memset(&cmd, 0, sizeof(cmd));
Quoted 8 lines

drivers/bluetooth/btintel.c static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb) · line 2677

Quoted 6 lines
drivers/bluetooth/btintel.c +6 -0
+	dsbr = btintel_uefi_get_variable(L"UefiCnvCommonDSBR", &guid);
+	if (IS_ERR(dsbr)) {
+		/* If efi variable is not present, driver still needs to send
+		 * 0xfc0a command with default values
+		 */
+		bt_dev_dbg(hdev, "Error reading efi DSBR (%ld)",

Maybe: Error reading EFI variable UefiCnvCommonDSBR (%ld)

Ack.

Quoted 68 lines
Quoted 9 lines
drivers/bluetooth/btintel.c +8 -0
+			   PTR_ERR(dsbr));
+		dsbr = NULL;
+	}
+
+	if (dsbr) {
+		/* bit0: 0 - Use firmware default value
+		 *       1 - Override firmware value
+		 * bit3:1 - Reserved

drivers/bluetooth/btintel.c static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb)

Quoted 10 lines
drivers/bluetooth/btintel.c +10 -0
+		 * bit7:4 - DSBR override values
+		 * bt31:7 - Reserved
+		 */
+		cmd.enable = dsbr->dsbr & BIT(0);
+		if (cmd.enable)
+			cmd.dsbr = dsbr->dsbr >> 4 & 0xF;
+		kfree(dsbr);
+	}
+
+	bt_dev_info(hdev, "dsbr: enabled: 0x%2.2x value: 0x%2.2x",

cmd.enable,

drivers/bluetooth/btintel.c static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb)

Quoted 3 lines
drivers/bluetooth/btintel.c +3 -0
+		    cmd.dsbr);
+
+	skb = __hci_cmd_sync(hdev, 0xfc0a, sizeof(cmd), &cmd,

HCI_CMD_TIMEOUT);

Quoted 10 lines
drivers/bluetooth/btintel.c +10 -0
+	if (IS_ERR(skb)) {
+		bt_dev_err(hdev, "Failed to send Intel DSBR command (%ld)",
+			   PTR_ERR(skb));
+		return -bt_to_errno(PTR_ERR(skb));
+	}
+
+	status = skb->data[0];
+	kfree_skb(skb);
+
+	if (status) {

drivers/bluetooth/btintel.c static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb) · line 2719

Quoted 10 lines
drivers/bluetooth/btintel.c +10 -0
+		bt_dev_err(hdev, "Set DSBR failed 0x%2.2x", status);
+		return -bt_to_errno(status);
+	}
+	return 0;
+}
+
+static int btintel_apply_dsbr(struct hci_dev *hdev,
+			      struct intel_version_tlv *ver) {
+	/* For BlazarI + B0 step, DSBR command needs to be sent just after
+	 * downloading IML firmware

Add the section of the datasheet?

drivers/bluetooth/btintel.c int btintel_bootloader_setup_tlv(struct hci_dev

Quoted 9 lines
drivers/bluetooth/btintel.c +5 -0
+	 */
+	return ver->img_type == BTINTEL_IMG_IML &&
+		((ver->cnvi_top & 0xfff) == BTINTEL_CNVI_BLAZARI) &&
+		INTEL_CNVX_TOP_STEP(ver->cnvi_top) == 0x01; }
+
  int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
  				 struct intel_version_tlv *ver)
  {
@@ -2649,6 +2757,12 @@ int btintel_bootloader_setup_tlv(struct hci_dev

*hdev,

drivers/bluetooth/btintel.c int btintel_bootloader_setup_tlv(struct hci_dev *hdev,

Quoted 10 lines
drivers/bluetooth/btintel.c +6 -0
  	if (err)
  		return err;
 
+	if (btintel_apply_dsbr(hdev, ver)) {
+		err = btintel_set_dsbr(hdev, ver);
+		if (err)
+			return err;
+	}
+
  	/* If image type returned is BTINTEL_IMG_IML, then controller

supports

Quoted 7 lines

drivers/bluetooth/btintel.c int btintel_bootloader_setup_tlv(struct hci_dev *hdev, · line 2768

Quoted 2 lines
drivers/bluetooth/btintel.c +0 -0
  	 * intermediae loader image
  	 */

Kind regards,

Paul

Thanks,
Kiran

#3 lore raw
In reply to Kiran K
kernel test robot noticed the following build errors:

Hi Kiran,

kernel test robot noticed the following build errors:

[auto build test ERROR on bluetooth-next/master]
[also build test ERROR on next-20240625]
[cannot apply to bluetooth/master linus/master v6.10-rc5] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kiran-K/Bluetooth-btintel-Allow-lowering-of-drive-strength-of-BRI/20240625-161151
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
patch link:    https://lore.kernel.org/r/20240621064419.2185652-1-kiran.k%40intel.com
patch subject: [PATCH v2] Bluetooth: btintel: Allow lowering of drive strength of BRI
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20240626/[email protected]/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240626/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/bluetooth/btintel.c: In function 'btintel_uefi_get_variable':

>> drivers/bluetooth/btintel.c:66:53: error: passing argument 4 of 'efi.get_variable' from incompatible pointer type [-Werror=incompatible-pointer-types]
      66 |         status = efi.get_variable(name, guid, NULL, &data_size, NULL);
         |                                                     ^~~~~~~~~~
         |                                                     |
         |                                                     size_t * {aka unsigned int *}
   drivers/bluetooth/btintel.c:66:53: note: expected 'long unsigned int *' but argument is of type 'size_t *' {aka 'unsigned int *'}
   drivers/bluetooth/btintel.c:76:53: error: passing argument 4 of 'efi.get_variable' from incompatible pointer type [-Werror=incompatible-pointer-types]
      76 |         status = efi.get_variable(name, guid, NULL, &data_size, data);
         |                                                     ^~~~~~~~~~
         |                                                     |
         |                                                     size_t * {aka unsigned int *}

drivers/bluetooth/btintel.c:76:53: note: expected 'long unsigned int *' but argument is of type 'size_t *' {aka 'unsigned int *'}
cc1: some warnings being treated as errors

vim +66 drivers/bluetooth/btintel.c

    49	
    50	static const guid_t btintel_guid_dsm =
    51		GUID_INIT(0xaa10f4e0, 0x81ac, 0x4233,
    52			  0xab, 0xf6, 0x3b, 0x2a, 0xc5, 0x0e, 0x28, 0xd9);
    53	
    54	static void *btintel_uefi_get_variable(efi_char16_t *name, efi_guid_t *guid)
    55	{
    56		void *data;
    57		efi_status_t status;
    58		size_t data_size = 0;
    59	
    60		if (!IS_ENABLED(CONFIG_EFI))
    61			return ERR_PTR(-EOPNOTSUPP);
    62	
    63		if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
    64			return ERR_PTR(-EOPNOTSUPP);
    65	
  > 66		status = efi.get_variable(name, guid, NULL, &data_size, NULL);
    67	
    68		if (status != EFI_BUFFER_TOO_SMALL || !data_size)
    69			return ERR_PTR(-EIO);
    70	
    71		data = kmalloc(data_size, GFP_KERNEL);
    72	
    73		if (!data)
    74			return ERR_PTR(-ENOMEM);
    75	
    76		status = efi.get_variable(name, guid, NULL, &data_size, data);
    77	
    78		if (status != EFI_SUCCESS) {
    79			kfree(data);
    80			return ERR_PTR(-ENXIO);
    81		}
    82	
    83		return data;
    84	}
    85	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#4 lore raw
In reply to Kiran K
kernel test robot noticed the following build errors:

Hi Kiran,

kernel test robot noticed the following build errors:

[auto build test ERROR on bluetooth-next/master]
[also build test ERROR on next-20240625]
[cannot apply to bluetooth/master linus/master v6.10-rc5] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kiran-K/Bluetooth-btintel-Allow-lowering-of-drive-strength-of-BRI/20240625-161151
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
patch link:    https://lore.kernel.org/r/20240621064419.2185652-1-kiran.k%40intel.com
patch subject: [PATCH v2] Bluetooth: btintel: Allow lowering of drive strength of BRI
config: i386-buildonly-randconfig-001-20240626 (https://download.01.org/0day-ci/archive/20240626/[email protected]/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240626/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/bluetooth/btintel.c:66:46: error: incompatible pointer types passing 'size_t *' (aka 'unsigned int *') to parameter of type 'unsigned long *' [-Werror,-Wincompatible-pointer-types]
      66 |         status = efi.get_variable(name, guid, NULL, &data_size, NULL);
         |                                                     ^~~~~~~~~~
   drivers/bluetooth/btintel.c:76:46: error: incompatible pointer types passing 'size_t *' (aka 'unsigned int *') to parameter of type 'unsigned long *' [-Werror,-Wincompatible-pointer-types]
      76 |         status = efi.get_variable(name, guid, NULL, &data_size, data);
         |                                                     ^~~~~~~~~~

2 errors generated.

vim +66 drivers/bluetooth/btintel.c

    49	
    50	static const guid_t btintel_guid_dsm =
    51		GUID_INIT(0xaa10f4e0, 0x81ac, 0x4233,
    52			  0xab, 0xf6, 0x3b, 0x2a, 0xc5, 0x0e, 0x28, 0xd9);
    53	
    54	static void *btintel_uefi_get_variable(efi_char16_t *name, efi_guid_t *guid)
    55	{
    56		void *data;
    57		efi_status_t status;
    58		size_t data_size = 0;
    59	
    60		if (!IS_ENABLED(CONFIG_EFI))
    61			return ERR_PTR(-EOPNOTSUPP);
    62	
    63		if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
    64			return ERR_PTR(-EOPNOTSUPP);
    65	
  > 66		status = efi.get_variable(name, guid, NULL, &data_size, NULL);
    67	
    68		if (status != EFI_BUFFER_TOO_SMALL || !data_size)
    69			return ERR_PTR(-EIO);
    70	
    71		data = kmalloc(data_size, GFP_KERNEL);
    72	
    73		if (!data)
    74			return ERR_PTR(-ENOMEM);
    75	
    76		status = efi.get_variable(name, guid, NULL, &data_size, data);
    77	
    78		if (status != EFI_SUCCESS) {
    79			kfree(data);
    80			return ERR_PTR(-ENXIO);
    81		}
    82	
    83		return data;
    84	}
    85	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki