From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH v1] Bluetooth: btintel_pcie: Add support for device coredump
Date: Mon, 3 Mar 2025 00:03:30 +0800 [thread overview]
Message-ID: <202503022332.biRVCDMP-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250227102625.20642-1-kiran.k@intel.com>
References: <20250227102625.20642-1-kiran.k@intel.com>
TO: Kiran K <kiran.k@intel.com>
TO: linux-bluetooth@vger.kernel.org
CC: ravishankar.srivatsa@intel.com
CC: chethan.tumkur.narayan@intel.com
CC: chandrashekar.devegowda@intel.com
CC: vijay.satija@intel.com
CC: Kiran K <kiran.k@intel.com>
Hi Kiran,
kernel test robot noticed the following build warnings:
[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on next-20250228]
[cannot apply to bluetooth/master linus/master v6.14-rc4]
[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_pcie-Add-support-for-device-coredump/20250227-181131
base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
patch link: https://lore.kernel.org/r/20250227102625.20642-1-kiran.k%40intel.com
patch subject: [PATCH v1] Bluetooth: btintel_pcie: Add support for device coredump
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: sparc-randconfig-r071-20250302 (https://download.01.org/0day-ci/archive/20250302/202503022332.biRVCDMP-lkp@intel.com/config)
compiler: sparc-linux-gcc (GCC) 14.2.0
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@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202503022332.biRVCDMP-lkp@intel.com/
New smatch warnings:
drivers/bluetooth/btintel_pcie.c:493 btintel_pcie_read_dram_buffers() error: snprintf() is printing too much 100 vs 70
Old smatch warnings:
drivers/bluetooth/btintel_pcie.c:144 btintel_pcie_setup_dbgc() warn: right shifting more than type allows 32 vs 32
vim +493 drivers/bluetooth/btintel_pcie.c
b8cc1a1cce30cc Kiran K 2025-02-27 453
b8cc1a1cce30cc Kiran K 2025-02-27 454 static int btintel_pcie_read_dram_buffers(struct btintel_pcie_data *data)
b8cc1a1cce30cc Kiran K 2025-02-27 455 {
b8cc1a1cce30cc Kiran K 2025-02-27 456 u32 offset, prev_size, wr_ptr_status, dump_size, i;
b8cc1a1cce30cc Kiran K 2025-02-27 457 struct btintel_pcie_dbgc *dbgc = &data->dbgc;
b8cc1a1cce30cc Kiran K 2025-02-27 458 u8 buf_idx, dump_time_len, fw_build;
b8cc1a1cce30cc Kiran K 2025-02-27 459 struct hci_dev *hdev = data->hdev;
b8cc1a1cce30cc Kiran K 2025-02-27 460 struct intel_tlv *tlv;
b8cc1a1cce30cc Kiran K 2025-02-27 461 struct timespec64 now;
b8cc1a1cce30cc Kiran K 2025-02-27 462 struct sk_buff *skb;
b8cc1a1cce30cc Kiran K 2025-02-27 463 struct tm tm_now;
b8cc1a1cce30cc Kiran K 2025-02-27 464 char buf[100];
b8cc1a1cce30cc Kiran K 2025-02-27 465 u16 hdr_len;
b8cc1a1cce30cc Kiran K 2025-02-27 466 int ret;
b8cc1a1cce30cc Kiran K 2025-02-27 467
b8cc1a1cce30cc Kiran K 2025-02-27 468 wr_ptr_status = btintel_pcie_rd_dev_mem(data, BTINTEL_PCIE_DBGC_CUR_DBGBUFF_STATUS);
b8cc1a1cce30cc Kiran K 2025-02-27 469 offset = wr_ptr_status & BTINTEL_PCIE_DBG_OFFSET_BIT_MASK;
b8cc1a1cce30cc Kiran K 2025-02-27 470
b8cc1a1cce30cc Kiran K 2025-02-27 471 buf_idx = BTINTEL_PCIE_DBGC_DBG_BUF_IDX(wr_ptr_status);
b8cc1a1cce30cc Kiran K 2025-02-27 472 if (buf_idx > dbgc->count) {
b8cc1a1cce30cc Kiran K 2025-02-27 473 bt_dev_warn(hdev, "Buffer index is invalid");
b8cc1a1cce30cc Kiran K 2025-02-27 474 return -EINVAL;
b8cc1a1cce30cc Kiran K 2025-02-27 475 }
b8cc1a1cce30cc Kiran K 2025-02-27 476
b8cc1a1cce30cc Kiran K 2025-02-27 477 prev_size = buf_idx * BTINTEL_PCIE_DBGC_BUFFER_SIZE;
b8cc1a1cce30cc Kiran K 2025-02-27 478 if (prev_size + offset >= prev_size)
b8cc1a1cce30cc Kiran K 2025-02-27 479 data->dmp_hdr.write_ptr = prev_size + offset;
b8cc1a1cce30cc Kiran K 2025-02-27 480 else
b8cc1a1cce30cc Kiran K 2025-02-27 481 return -EINVAL;
b8cc1a1cce30cc Kiran K 2025-02-27 482
b8cc1a1cce30cc Kiran K 2025-02-27 483 ktime_get_real_ts64(&now);
b8cc1a1cce30cc Kiran K 2025-02-27 484 time64_to_tm(now.tv_sec, 0, &tm_now);
b8cc1a1cce30cc Kiran K 2025-02-27 485 dump_time_len = snprintf(buf, sizeof(buf), "Dump Time: %02d-%02d-%04ld %02d:%02d:%02d",
b8cc1a1cce30cc Kiran K 2025-02-27 486 tm_now.tm_mday, tm_now.tm_mon + 1, tm_now.tm_year + 1900,
b8cc1a1cce30cc Kiran K 2025-02-27 487 tm_now.tm_hour, tm_now.tm_min, tm_now.tm_sec);
b8cc1a1cce30cc Kiran K 2025-02-27 488
b8cc1a1cce30cc Kiran K 2025-02-27 489 fw_build = snprintf(buf + dump_time_len, sizeof(buf),
b8cc1a1cce30cc Kiran K 2025-02-27 490 "Firmware Timestamp: Year %u WW %02u buildtype %u build %u",
b8cc1a1cce30cc Kiran K 2025-02-27 491 2000 + (data->dmp_hdr.fw_timestamp >> 8),
b8cc1a1cce30cc Kiran K 2025-02-27 492 data->dmp_hdr.fw_timestamp & 0xff, data->dmp_hdr.fw_build_type,
b8cc1a1cce30cc Kiran K 2025-02-27 @493 data->dmp_hdr.fw_build_num);
b8cc1a1cce30cc Kiran K 2025-02-27 494
b8cc1a1cce30cc Kiran K 2025-02-27 495 hdr_len = sizeof(*tlv) + sizeof(data->dmp_hdr.cnvi_bt) +
b8cc1a1cce30cc Kiran K 2025-02-27 496 sizeof(*tlv) + sizeof(data->dmp_hdr.write_ptr) +
b8cc1a1cce30cc Kiran K 2025-02-27 497 sizeof(*tlv) + sizeof(data->dmp_hdr.wrap_ctr) +
b8cc1a1cce30cc Kiran K 2025-02-27 498 sizeof(*tlv) + sizeof(data->dmp_hdr.trigger_reason) +
b8cc1a1cce30cc Kiran K 2025-02-27 499 sizeof(*tlv) + sizeof(data->dmp_hdr.fw_git_sha1) +
b8cc1a1cce30cc Kiran K 2025-02-27 500 sizeof(*tlv) + sizeof(data->dmp_hdr.cnvr_top) +
b8cc1a1cce30cc Kiran K 2025-02-27 501 sizeof(*tlv) + sizeof(data->dmp_hdr.cnvi_top) +
b8cc1a1cce30cc Kiran K 2025-02-27 502 sizeof(*tlv) + dump_time_len +
b8cc1a1cce30cc Kiran K 2025-02-27 503 sizeof(*tlv) + fw_build;
b8cc1a1cce30cc Kiran K 2025-02-27 504
b8cc1a1cce30cc Kiran K 2025-02-27 505 dump_size = hdr_len + sizeof(hdr_len);
b8cc1a1cce30cc Kiran K 2025-02-27 506
b8cc1a1cce30cc Kiran K 2025-02-27 507 skb = alloc_skb(dump_size, GFP_KERNEL);
b8cc1a1cce30cc Kiran K 2025-02-27 508 if (!skb)
b8cc1a1cce30cc Kiran K 2025-02-27 509 return -ENOMEM;
b8cc1a1cce30cc Kiran K 2025-02-27 510
b8cc1a1cce30cc Kiran K 2025-02-27 511 /* Add debug buffers data length to dump size */
b8cc1a1cce30cc Kiran K 2025-02-27 512 dump_size += BTINTEL_PCIE_DBGC_BUFFER_SIZE * dbgc->count;
b8cc1a1cce30cc Kiran K 2025-02-27 513
b8cc1a1cce30cc Kiran K 2025-02-27 514 ret = hci_devcd_init(hdev, dump_size);
b8cc1a1cce30cc Kiran K 2025-02-27 515 if (ret) {
b8cc1a1cce30cc Kiran K 2025-02-27 516 bt_dev_err(hdev, "Failed to init devcoredump, err %d", ret);
b8cc1a1cce30cc Kiran K 2025-02-27 517 kfree_skb(skb);
b8cc1a1cce30cc Kiran K 2025-02-27 518 return ret;
b8cc1a1cce30cc Kiran K 2025-02-27 519 }
b8cc1a1cce30cc Kiran K 2025-02-27 520
b8cc1a1cce30cc Kiran K 2025-02-27 521 skb_put_data(skb, &hdr_len, sizeof(hdr_len));
b8cc1a1cce30cc Kiran K 2025-02-27 522
b8cc1a1cce30cc Kiran K 2025-02-27 523 btintel_pcie_copy_tlv(skb, BTINTEL_CNVI_BT, &data->dmp_hdr.cnvi_bt,
b8cc1a1cce30cc Kiran K 2025-02-27 524 sizeof(data->dmp_hdr.cnvi_bt));
b8cc1a1cce30cc Kiran K 2025-02-27 525
b8cc1a1cce30cc Kiran K 2025-02-27 526 btintel_pcie_copy_tlv(skb, BTINTEL_WRITE_PTR, &data->dmp_hdr.write_ptr,
b8cc1a1cce30cc Kiran K 2025-02-27 527 sizeof(data->dmp_hdr.write_ptr));
b8cc1a1cce30cc Kiran K 2025-02-27 528
b8cc1a1cce30cc Kiran K 2025-02-27 529 data->dmp_hdr.wrap_ctr = btintel_pcie_rd_dev_mem(data,
b8cc1a1cce30cc Kiran K 2025-02-27 530 BTINTEL_PCIE_DBGC_DBGBUFF_WRAP_ARND);
b8cc1a1cce30cc Kiran K 2025-02-27 531
b8cc1a1cce30cc Kiran K 2025-02-27 532 btintel_pcie_copy_tlv(skb, BTINTEL_WRAP_CTR, &data->dmp_hdr.wrap_ctr,
b8cc1a1cce30cc Kiran K 2025-02-27 533 sizeof(data->dmp_hdr.wrap_ctr));
b8cc1a1cce30cc Kiran K 2025-02-27 534
b8cc1a1cce30cc Kiran K 2025-02-27 535 btintel_pcie_copy_tlv(skb, BTINTEL_TRIGGER_REASON, &data->dmp_hdr.trigger_reason,
b8cc1a1cce30cc Kiran K 2025-02-27 536 sizeof(data->dmp_hdr.trigger_reason));
b8cc1a1cce30cc Kiran K 2025-02-27 537
b8cc1a1cce30cc Kiran K 2025-02-27 538 btintel_pcie_copy_tlv(skb, BTINTEL_FW_SHA, &data->dmp_hdr.fw_git_sha1,
b8cc1a1cce30cc Kiran K 2025-02-27 539 sizeof(data->dmp_hdr.fw_git_sha1));
b8cc1a1cce30cc Kiran K 2025-02-27 540
b8cc1a1cce30cc Kiran K 2025-02-27 541 btintel_pcie_copy_tlv(skb, BTINTEL_CNVR_TOP, &data->dmp_hdr.cnvr_top,
b8cc1a1cce30cc Kiran K 2025-02-27 542 sizeof(data->dmp_hdr.cnvr_top));
b8cc1a1cce30cc Kiran K 2025-02-27 543
b8cc1a1cce30cc Kiran K 2025-02-27 544 btintel_pcie_copy_tlv(skb, BTINTEL_CNVI_TOP, &data->dmp_hdr.cnvi_top,
b8cc1a1cce30cc Kiran K 2025-02-27 545 sizeof(data->dmp_hdr.cnvi_top));
b8cc1a1cce30cc Kiran K 2025-02-27 546
b8cc1a1cce30cc Kiran K 2025-02-27 547 btintel_pcie_copy_tlv(skb, BTINTEL_DUMP_TIME, buf, dump_time_len);
b8cc1a1cce30cc Kiran K 2025-02-27 548
b8cc1a1cce30cc Kiran K 2025-02-27 549 btintel_pcie_copy_tlv(skb, BTINTEL_FW_BUILD, buf + dump_time_len, fw_build);
b8cc1a1cce30cc Kiran K 2025-02-27 550
b8cc1a1cce30cc Kiran K 2025-02-27 551 ret = hci_devcd_append(hdev, skb);
b8cc1a1cce30cc Kiran K 2025-02-27 552 if (ret)
b8cc1a1cce30cc Kiran K 2025-02-27 553 goto exit_err;
b8cc1a1cce30cc Kiran K 2025-02-27 554
b8cc1a1cce30cc Kiran K 2025-02-27 555 for (i = 0; i < dbgc->count; i++) {
b8cc1a1cce30cc Kiran K 2025-02-27 556 ret = btintel_pcie_add_dmp_data(hdev, dbgc->bufs[i].data,
b8cc1a1cce30cc Kiran K 2025-02-27 557 BTINTEL_PCIE_DBGC_BUFFER_SIZE);
b8cc1a1cce30cc Kiran K 2025-02-27 558 if (ret)
b8cc1a1cce30cc Kiran K 2025-02-27 559 break;
b8cc1a1cce30cc Kiran K 2025-02-27 560 }
b8cc1a1cce30cc Kiran K 2025-02-27 561
b8cc1a1cce30cc Kiran K 2025-02-27 562 exit_err:
b8cc1a1cce30cc Kiran K 2025-02-27 563 hci_devcd_complete(hdev);
b8cc1a1cce30cc Kiran K 2025-02-27 564 return ret;
b8cc1a1cce30cc Kiran K 2025-02-27 565 }
b8cc1a1cce30cc Kiran K 2025-02-27 566
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-03-02 16:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-02 16:03 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-02-27 10:26 [PATCH v1] Bluetooth: btintel_pcie: Add support for device coredump Kiran K
2025-03-03 7:10 ` Dan Carpenter
2025-03-03 16:31 ` K, Kiran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202503022332.biRVCDMP-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.