[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202506110121.gsOqZR79-lkp@intel.com>
Date: Wed, 11 Jun 2025 01:50:55 +0800
From: kernel test robot <lkp@...el.com>
To: Ranjan Kumar <ranjan.kumar@...adcom.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Sathya Prakash <sathya.prakash@...adcom.com>
Subject: drivers/scsi/mpi3mr/mpi3mr_fw.c:1531:54: warning: variable
'scratch_pad0' set but not used
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f09079bd04a924c72d555cd97942d5f8d7eca98c
commit: 0a2714b787b91176e7d4f005dcef8d177efdff8a scsi: mpi3mr: Debug ability improvements
date: 1 year, 3 months ago
config: csky-randconfig-002-20250106
compiler: csky-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build):
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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506110121.gsOqZR79-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/scsi/mpi3mr/mpi3mr_fw.c: In function 'mpi3mr_issue_reset':
>> drivers/scsi/mpi3mr/mpi3mr_fw.c:1531:54: warning: variable 'scratch_pad0' set but not used [-Wunused-but-set-variable]
1531 | u32 host_diagnostic, ioc_status, ioc_config, scratch_pad0;
| ^~~~~~~~~~~~
drivers/scsi/mpi3mr/mpi3mr_fw.c: In function 'mpi3mr_setup_isr':
drivers/scsi/mpi3mr/mpi3mr_fw.c:732:58: warning: '%d' directive output may be truncated writing between 1 and 3 bytes into a region of size between 1 and 64 [-Wformat-truncation=]
732 | snprintf(intr_info->name, MPI3MR_NAME_LENGTH, "%s%d-msix%d",
| ^~
In function 'mpi3mr_request_irq',
inlined from 'mpi3mr_setup_isr' at drivers/scsi/mpi3mr/mpi3mr_fw.c:857:12:
drivers/scsi/mpi3mr/mpi3mr_fw.c:732:55: note: directive argument in the range [0, 255]
732 | snprintf(intr_info->name, MPI3MR_NAME_LENGTH, "%s%d-msix%d",
| ^~~~~~~~~~~~~
drivers/scsi/mpi3mr/mpi3mr_fw.c:732:55: note: directive argument in the range [0, 65535]
drivers/scsi/mpi3mr/mpi3mr_fw.c:732:9: note: 'snprintf' output between 8 and 77 bytes into a destination of size 64
732 | snprintf(intr_info->name, MPI3MR_NAME_LENGTH, "%s%d-msix%d",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
733 | mrioc->driver_name, mrioc->id, index);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/mpi3mr/mpi3mr_fw.c: In function 'mpi3mr_start_watchdog':
drivers/scsi/mpi3mr/mpi3mr_fw.c:2690:60: warning: '%s' directive output may be truncated writing up to 63 bytes into a region of size 41 [-Wformat-truncation=]
2690 | sizeof(mrioc->watchdog_work_q_name), "watchdog_%s%d", mrioc->name,
| ^~
drivers/scsi/mpi3mr/mpi3mr_fw.c:2690:50: note: directive argument in the range [0, 255]
2690 | sizeof(mrioc->watchdog_work_q_name), "watchdog_%s%d", mrioc->name,
| ^~~~~~~~~~~~~~~
drivers/scsi/mpi3mr/mpi3mr_fw.c:2689:9: note: 'snprintf' output between 11 and 76 bytes into a destination of size 50
2689 | snprintf(mrioc->watchdog_work_q_name,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2690 | sizeof(mrioc->watchdog_work_q_name), "watchdog_%s%d", mrioc->name,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2691 | mrioc->id);
| ~~~~~~~~~~
vim +/scratch_pad0 +1531 drivers/scsi/mpi3mr/mpi3mr_fw.c
1512
1513 /**
1514 * mpi3mr_issue_reset - Issue reset to the controller
1515 * @mrioc: Adapter reference
1516 * @reset_type: Reset type
1517 * @reset_reason: Reset reason code
1518 *
1519 * Unlock the host diagnostic registers and write the specific
1520 * reset type to that, wait for reset acknowledgment from the
1521 * controller, if the reset is not successful retry for the
1522 * predefined number of times.
1523 *
1524 * Return: 0 on success, non-zero on failure.
1525 */
1526 static int mpi3mr_issue_reset(struct mpi3mr_ioc *mrioc, u16 reset_type,
1527 u16 reset_reason)
1528 {
1529 int retval = -1;
1530 u8 unlock_retry_count = 0;
> 1531 u32 host_diagnostic, ioc_status, ioc_config, scratch_pad0;
1532 u32 timeout = MPI3MR_RESET_ACK_TIMEOUT * 10;
1533
1534 if ((reset_type != MPI3_SYSIF_HOST_DIAG_RESET_ACTION_SOFT_RESET) &&
1535 (reset_type != MPI3_SYSIF_HOST_DIAG_RESET_ACTION_DIAG_FAULT))
1536 return retval;
1537 if (mrioc->unrecoverable)
1538 return retval;
1539 if (reset_reason == MPI3MR_RESET_FROM_FIRMWARE) {
1540 retval = 0;
1541 return retval;
1542 }
1543
1544 ioc_info(mrioc, "%s reset due to %s(0x%x)\n",
1545 mpi3mr_reset_type_name(reset_type),
1546 mpi3mr_reset_rc_name(reset_reason), reset_reason);
1547
1548 mpi3mr_clear_reset_history(mrioc);
1549 do {
1550 ioc_info(mrioc,
1551 "Write magic sequence to unlock host diag register (retry=%d)\n",
1552 ++unlock_retry_count);
1553 if (unlock_retry_count >= MPI3MR_HOSTDIAG_UNLOCK_RETRY_COUNT) {
1554 ioc_err(mrioc,
1555 "%s reset failed due to unlock failure, host_diagnostic(0x%08x)\n",
1556 mpi3mr_reset_type_name(reset_type),
1557 host_diagnostic);
1558 mrioc->unrecoverable = 1;
1559 return retval;
1560 }
1561
1562 writel(MPI3_SYSIF_WRITE_SEQUENCE_KEY_VALUE_FLUSH,
1563 &mrioc->sysif_regs->write_sequence);
1564 writel(MPI3_SYSIF_WRITE_SEQUENCE_KEY_VALUE_1ST,
1565 &mrioc->sysif_regs->write_sequence);
1566 writel(MPI3_SYSIF_WRITE_SEQUENCE_KEY_VALUE_2ND,
1567 &mrioc->sysif_regs->write_sequence);
1568 writel(MPI3_SYSIF_WRITE_SEQUENCE_KEY_VALUE_3RD,
1569 &mrioc->sysif_regs->write_sequence);
1570 writel(MPI3_SYSIF_WRITE_SEQUENCE_KEY_VALUE_4TH,
1571 &mrioc->sysif_regs->write_sequence);
1572 writel(MPI3_SYSIF_WRITE_SEQUENCE_KEY_VALUE_5TH,
1573 &mrioc->sysif_regs->write_sequence);
1574 writel(MPI3_SYSIF_WRITE_SEQUENCE_KEY_VALUE_6TH,
1575 &mrioc->sysif_regs->write_sequence);
1576 usleep_range(1000, 1100);
1577 host_diagnostic = readl(&mrioc->sysif_regs->host_diagnostic);
1578 ioc_info(mrioc,
1579 "wrote magic sequence: retry_count(%d), host_diagnostic(0x%08x)\n",
1580 unlock_retry_count, host_diagnostic);
1581 } while (!(host_diagnostic & MPI3_SYSIF_HOST_DIAG_DIAG_WRITE_ENABLE));
1582
1583 scratch_pad0 = ((MPI3MR_RESET_REASON_OSTYPE_LINUX <<
1584 MPI3MR_RESET_REASON_OSTYPE_SHIFT) | (mrioc->facts.ioc_num <<
1585 MPI3MR_RESET_REASON_IOCNUM_SHIFT) | reset_reason);
1586 writel(reset_reason, &mrioc->sysif_regs->scratchpad[0]);
1587 writel(host_diagnostic | reset_type,
1588 &mrioc->sysif_regs->host_diagnostic);
1589 switch (reset_type) {
1590 case MPI3_SYSIF_HOST_DIAG_RESET_ACTION_SOFT_RESET:
1591 do {
1592 ioc_status = readl(&mrioc->sysif_regs->ioc_status);
1593 ioc_config =
1594 readl(&mrioc->sysif_regs->ioc_configuration);
1595 if ((ioc_status & MPI3_SYSIF_IOC_STATUS_RESET_HISTORY)
1596 && mpi3mr_soft_reset_success(ioc_status, ioc_config)
1597 ) {
1598 mpi3mr_clear_reset_history(mrioc);
1599 retval = 0;
1600 break;
1601 }
1602 msleep(100);
1603 } while (--timeout);
1604 mpi3mr_print_fault_info(mrioc);
1605 break;
1606 case MPI3_SYSIF_HOST_DIAG_RESET_ACTION_DIAG_FAULT:
1607 do {
1608 ioc_status = readl(&mrioc->sysif_regs->ioc_status);
1609 if (mpi3mr_diagfault_success(mrioc, ioc_status)) {
1610 retval = 0;
1611 break;
1612 }
1613 msleep(100);
1614 } while (--timeout);
1615 break;
1616 default:
1617 break;
1618 }
1619
1620 writel(MPI3_SYSIF_WRITE_SEQUENCE_KEY_VALUE_2ND,
1621 &mrioc->sysif_regs->write_sequence);
1622
1623 ioc_config = readl(&mrioc->sysif_regs->ioc_configuration);
1624 ioc_status = readl(&mrioc->sysif_regs->ioc_status);
1625 ioc_info(mrioc,
1626 "ioc_status/ioc_onfig after %s reset is (0x%x)/(0x%x)\n",
1627 (!retval)?"successful":"failed", ioc_status,
1628 ioc_config);
1629 if (retval)
1630 mrioc->unrecoverable = 1;
1631 return retval;
1632 }
1633
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
View attachment "reproduce" of type "text/plain" (825 bytes)
View attachment "config" of type "text/plain" (192832 bytes)
Powered by blists - more mailing lists