Re: [PATCH 2/2] habanalabs: add information about PCIe controller

From: kernel test robot
Date: Sat Aug 01 2020 - 15:24:21 EST


Hi Oded,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on char-misc/char-misc-testing]
[cannot apply to linux/master linus/master v5.8-rc7]
[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]

url: https://github.com/0day-ci/linux/commits/Oded-Gabbay/habanalabs-Replace-dma-fence-mechanism-with-completions/20200730-211536
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 22362aa30bad6f03b5bcbbeee3cdc61950d40086
config: x86_64-randconfig-s022-20200801 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-115-g5fc204f2-dirty
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

>> drivers/misc/habanalabs/common/firmware_if.c:368:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [assigned] [usertype] index @@ got restricted __le64 [usertype] @@
>> drivers/misc/habanalabs/common/firmware_if.c:368:19: sparse: expected restricted __le32 [assigned] [usertype] index
>> drivers/misc/habanalabs/common/firmware_if.c:368:19: sparse: got restricted __le64 [usertype]
>> drivers/misc/habanalabs/common/firmware_if.c:379:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [addressable] [assigned] [usertype] index @@ got restricted __le64 [usertype] @@
>> drivers/misc/habanalabs/common/firmware_if.c:379:19: sparse: expected restricted __le32 [addressable] [assigned] [usertype] index
drivers/misc/habanalabs/common/firmware_if.c:379:19: sparse: got restricted __le64 [usertype]

vim +368 drivers/misc/habanalabs/common/firmware_if.c

356
357 int hl_fw_armcp_pci_counters_get(struct hl_device *hdev,
358 struct hl_info_pci_counters *counters)
359 {
360 struct armcp_packet pkt = {};
361 long result;
362 int rc;
363
364 pkt.ctl = cpu_to_le32(ARMCP_PACKET_PCIE_THROUGHPUT_GET <<
365 ARMCP_PKT_CTL_OPCODE_SHIFT);
366
367 /* Fetch PCI rx counter */
> 368 pkt.index = cpu_to_le64(armcp_pcie_throughput_rx);
369 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
370 HL_ARMCP_INFO_TIMEOUT_USEC, &result);
371 if (rc) {
372 dev_err(hdev->dev,
373 "Failed to handle ArmCP PCI info pkt, error %d\n", rc);
374 return rc;
375 }
376 counters->rx_throughput = result;
377
378 /* Fetch PCI tx counter */
> 379 pkt.index = cpu_to_le64(armcp_pcie_throughput_tx);
380 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
381 HL_ARMCP_INFO_TIMEOUT_USEC, &result);
382 if (rc) {
383 dev_err(hdev->dev,
384 "Failed to handle ArmCP PCI info pkt, error %d\n", rc);
385 return rc;
386 }
387 counters->tx_throughput = result;
388
389 /* Fetch PCI replay counter */
390 pkt.ctl = cpu_to_le32(ARMCP_PACKET_PCIE_REPLAY_CNT_GET <<
391 ARMCP_PKT_CTL_OPCODE_SHIFT);
392
393 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
394 HL_ARMCP_INFO_TIMEOUT_USEC, &result);
395 if (rc) {
396 dev_err(hdev->dev,
397 "Failed to handle ArmCP PCI info pkt, error %d\n", rc);
398 return rc;
399 }
400 counters->replay_cnt = (u32) result;
401
402 return rc;
403 }
404

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip