Re: [PATCH v2 2/3] Bluetooth: btnxpuart: Handle bootloader error during cmd5 and cmd7

From: kernel test robot
Date: Sun Mar 09 2025 - 07:17:54 EST


Hi Neeraj,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bluetooth/master]
[also build test WARNING on linus/master v6.14-rc5 next-20250307]
[cannot apply to bluetooth-next/master]
[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/Neeraj-Sanjay-Kale/Bluetooth-btnxpuart-Handle-bootloader-error-during-cmd5-and-cmd7/20250307-021228
base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git master
patch link: https://lore.kernel.org/r/20250306180931.57705-2-neeraj.sanjaykale%40nxp.com
patch subject: [PATCH v2 2/3] Bluetooth: btnxpuart: Handle bootloader error during cmd5 and cmd7
config: microblaze-randconfig-r123-20250309 (https://download.01.org/0day-ci/archive/20250309/202503091936.x9Evtskg-lkp@xxxxxxxxx/config)
compiler: microblaze-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250309/202503091936.x9Evtskg-lkp@xxxxxxxxx/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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503091936.x9Evtskg-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/bluetooth/btnxpuart.c:1113:24: sparse: sparse: restricted __le16 degrades to integer
drivers/bluetooth/btnxpuart.c:1119:24: sparse: sparse: restricted __le16 degrades to integer

vim +1113 drivers/bluetooth/btnxpuart.c

1089
1090 static int nxp_recv_fw_req_v3(struct hci_dev *hdev, struct sk_buff *skb)
1091 {
1092 struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev);
1093 struct v3_data_req *req;
1094 __u16 len = 0;
1095 __u32 offset;
1096
1097 if (!process_boot_signature(nxpdev))
1098 goto free_skb;
1099
1100 req = skb_pull_data(skb, sizeof(*req));
1101 if (!req || !nxpdev->fw)
1102 goto free_skb;
1103
1104 if (!req->error) {
1105 nxp_send_ack(NXP_ACK_V3, hdev);
1106 if (nxpdev->timeout_changed == cmd_sent)
1107 nxpdev->timeout_changed = changed;
1108 if (nxpdev->baudrate_changed == cmd_sent)
1109 nxpdev->baudrate_changed = changed;
1110 } else {
1111 nxp_handle_fw_download_error(hdev, req);
1112 if (nxpdev->timeout_changed == cmd_sent &&
> 1113 req->error == NXP_CRC_RX_ERROR) {
1114 nxpdev->fw_v3_offset_correction -= nxpdev->fw_v3_prev_sent;
1115 nxpdev->timeout_changed = not_changed;
1116 }
1117 /* After baudrate change, it is normal to get ACK Timeout error */
1118 if (nxpdev->baudrate_changed == cmd_sent &&
1119 req->error == NXP_CRC_RX_ERROR) {
1120 nxpdev->fw_v3_offset_correction -= nxpdev->fw_v3_prev_sent;
1121 nxpdev->baudrate_changed = not_changed;
1122 }
1123 goto free_skb;
1124 }
1125
1126 len = __le16_to_cpu(req->len);
1127
1128 if (nxpdev->timeout_changed != changed) {
1129 nxp_fw_change_timeout(hdev, len);
1130 nxpdev->timeout_changed = cmd_sent;
1131 goto free_skb;
1132 }
1133
1134 if (nxpdev->baudrate_changed != changed) {
1135 if (nxp_fw_change_baudrate(hdev, len)) {
1136 nxpdev->baudrate_changed = cmd_sent;
1137 serdev_device_set_baudrate(nxpdev->serdev,
1138 HCI_NXP_SEC_BAUDRATE);
1139 serdev_device_set_flow_control(nxpdev->serdev, true);
1140 nxpdev->current_baudrate = HCI_NXP_SEC_BAUDRATE;
1141 }
1142 goto free_skb;
1143 }
1144
1145 if (req->len == 0) {
1146 bt_dev_info(hdev, "FW Download Complete: %zu bytes",
1147 nxpdev->fw->size);
1148 clear_bit(BTNXPUART_FW_DOWNLOADING, &nxpdev->tx_state);
1149 wake_up_interruptible(&nxpdev->fw_dnld_done_wait_q);
1150 goto free_skb;
1151 }
1152
1153 offset = __le32_to_cpu(req->offset);
1154 if (offset < nxpdev->fw_v3_offset_correction) {
1155 /* This scenario should ideally never occur. But if it ever does,
1156 * FW is out of sync and needs a power cycle.
1157 */
1158 bt_dev_err(hdev, "Something went wrong during FW download");
1159 bt_dev_err(hdev, "Please power cycle and try again");
1160 goto free_skb;
1161 }
1162
1163 nxpdev->fw_dnld_v3_offset = offset - nxpdev->fw_v3_offset_correction;
1164 serdev_device_write_buf(nxpdev->serdev, nxpdev->fw->data +
1165 nxpdev->fw_dnld_v3_offset, len);
1166
1167 free_skb:
1168 nxpdev->fw_v3_prev_sent = len;
1169 kfree_skb(skb);
1170 return 0;
1171 }
1172

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki