Re: [PATCH v2 02/24] mpi3mr: base driver code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Kashyap,

I love your patch! Yet something to improve:

[auto build test ERROR on e09481c55ba7346ab725f41891e1bb61729dda00]

url:    https://github.com/0day-ci/linux/commits/Kashyap-Desai/Introducing-mpi3mr-driver/20210407-100619
base:   e09481c55ba7346ab725f41891e1bb61729dda00
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/a8eb9c746b98316c9c916b835394ba7c5f50add3
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Kashyap-Desai/Introducing-mpi3mr-driver/20210407-100619
        git checkout a8eb9c746b98316c9c916b835394ba7c5f50add3
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All errors (new ones prefixed by >>):

   drivers/scsi/mpi3mr/mpi3mr_fw.c: In function 'mpi3mr_isr':
   drivers/scsi/mpi3mr/mpi3mr_fw.c:315:6: warning: variable 'midx' set but not used [-Wunused-but-set-variable]
     315 |  u16 midx;
         |      ^~~~
   drivers/scsi/mpi3mr/mpi3mr_fw.c:314:21: warning: variable 'mrioc' set but not used [-Wunused-but-set-variable]
     314 |  struct mpi3mr_ioc *mrioc;
         |                     ^~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:16,
                    from arch/x86/include/asm/percpu.h:27,
                    from arch/x86/include/asm/current.h:6,
                    from include/linux/sched.h:12,
                    from include/linux/blkdev.h:5,
                    from drivers/scsi/mpi3mr/mpi3mr.h:13,
                    from drivers/scsi/mpi3mr/mpi3mr_fw.c:10:
   drivers/scsi/mpi3mr/mpi3mr_fw.c: In function 'mpi3mr_process_factsdata':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'unsigned int' [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:12:22: note: in expansion of macro 'KERN_SOH'
      12 | #define KERN_WARNING KERN_SOH "4" /* warning conditions */
         |                      ^~~~~~~~
   include/linux/printk.h:353:9: note: in expansion of macro 'KERN_WARNING'
     353 |  printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~~~~
   drivers/scsi/mpi3mr/mpi3mr_debug.h:49:2: note: in expansion of macro 'pr_warn'
      49 |  pr_warn("%s: " fmt, (ioc)->name, ##__VA_ARGS__)
         |  ^~~~~~~
   drivers/scsi/mpi3mr/mpi3mr_fw.c:933:3: note: in expansion of macro 'ioc_warn'
     933 |   ioc_warn(mrioc,
         |   ^~~~~~~~
   drivers/scsi/mpi3mr/mpi3mr_fw.c:934:49: note: format string is defined here
     934 |       "IOCFactsdata length mismatch driver_sz(%ld) firmware_sz(%d)\n",
         |                                               ~~^
         |                                                 |
         |                                                 long int
         |                                               %d
   drivers/scsi/mpi3mr/mpi3mr_fw.c: In function 'mpi3mr_init_ioc':
>> drivers/scsi/mpi3mr/mpi3mr_fw.c:1476:14: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration]
    1476 |  base_info = readq(&mrioc->sysif_regs->IOCInformation);
         |              ^~~~~
         |              readl
   cc1: some warnings being treated as errors


vim +1476 drivers/scsi/mpi3mr/mpi3mr_fw.c

  1437	
  1438	/**
  1439	 * mpi3mr_init_ioc - Initialize the controller
  1440	 * @mrioc: Adapter instance reference
  1441	 *
  1442	 * This the controller initialization routine, executed either
  1443	 * after soft reset or from pci probe callback.
  1444	 * Setup the required resources, memory map the controller
  1445	 * registers, create admin and operational reply queue pairs,
  1446	 * allocate required memory for reply pool, sense buffer pool,
  1447	 * issue IOC init request to the firmware, unmask the events and
  1448	 * issue port enable to discover SAS/SATA/NVMe devies and RAID
  1449	 * volumes.
  1450	 *
  1451	 * Return: 0 on success and non-zero on failure.
  1452	 */
  1453	int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc)
  1454	{
  1455		int retval = 0;
  1456		enum mpi3mr_iocstate ioc_state;
  1457		u64 base_info;
  1458		u32 timeout;
  1459		u32 ioc_status, ioc_config;
  1460		Mpi3IOCFactsData_t facts_data;
  1461	
  1462		mrioc->change_count = 0;
  1463		mrioc->cpu_count = num_online_cpus();
  1464		retval = mpi3mr_setup_resources(mrioc);
  1465		if (retval) {
  1466			ioc_err(mrioc, "Failed to setup resources:error %d\n",
  1467			    retval);
  1468			goto out_nocleanup;
  1469		}
  1470		ioc_status = readl(&mrioc->sysif_regs->IOCStatus);
  1471		ioc_config = readl(&mrioc->sysif_regs->IOCConfiguration);
  1472	
  1473		ioc_info(mrioc, "SOD status %x configuration %x\n",
  1474		    ioc_status, ioc_config);
  1475	
> 1476		base_info = readq(&mrioc->sysif_regs->IOCInformation);
  1477		ioc_info(mrioc, "SOD base_info %llx\n",	base_info);
  1478	
  1479		/*The timeout value is in 2sec unit, changing it to seconds*/
  1480		mrioc->ready_timeout =
  1481		    ((base_info & MPI3_SYSIF_IOC_INFO_LOW_TIMEOUT_MASK) >>
  1482		    MPI3_SYSIF_IOC_INFO_LOW_TIMEOUT_SHIFT) * 2;
  1483	
  1484		ioc_info(mrioc, "IOC ready timeout %d\n", mrioc->ready_timeout);
  1485	
  1486		ioc_state = mpi3mr_get_iocstate(mrioc);
  1487		ioc_info(mrioc, "IOC in %s state during detection\n",
  1488		    mpi3mr_iocstate_name(ioc_state));
  1489	
  1490		if (ioc_state == MRIOC_STATE_BECOMING_READY ||
  1491				ioc_state == MRIOC_STATE_RESET_REQUESTED) {
  1492			timeout = mrioc->ready_timeout * 10;
  1493			do {
  1494				msleep(100);
  1495			} while (--timeout);
  1496	
  1497			ioc_state = mpi3mr_get_iocstate(mrioc);
  1498			ioc_info(mrioc,
  1499				"IOC in %s state after waiting for reset time\n",
  1500				mpi3mr_iocstate_name(ioc_state));
  1501		}
  1502	
  1503		if (ioc_state == MRIOC_STATE_READY) {
  1504			retval = mpi3mr_issue_and_process_mur(mrioc,
  1505			    MPI3MR_RESET_FROM_BRINGUP);
  1506			if (retval) {
  1507				ioc_err(mrioc, "Failed to MU reset IOC error %d\n",
  1508				    retval);
  1509			}
  1510			ioc_state = mpi3mr_get_iocstate(mrioc);
  1511		}
  1512		if (ioc_state != MRIOC_STATE_RESET) {
  1513			mpi3mr_print_fault_info(mrioc);
  1514			retval = mpi3mr_issue_reset(mrioc,
  1515			    MPI3_SYSIF_HOST_DIAG_RESET_ACTION_SOFT_RESET,
  1516			    MPI3MR_RESET_FROM_BRINGUP);
  1517			if (retval) {
  1518				ioc_err(mrioc,
  1519				    "%s :Failed to soft reset IOC error %d\n",
  1520				    __func__, retval);
  1521				goto out_failed;
  1522			}
  1523		}
  1524		ioc_state = mpi3mr_get_iocstate(mrioc);
  1525		if (ioc_state != MRIOC_STATE_RESET) {
  1526			ioc_err(mrioc, "Cannot bring IOC to reset state\n");
  1527			goto out_failed;
  1528		}
  1529	
  1530		retval = mpi3mr_setup_admin_qpair(mrioc);
  1531		if (retval) {
  1532			ioc_err(mrioc, "Failed to setup admin Qs: error %d\n",
  1533			    retval);
  1534			goto out_failed;
  1535		}
  1536	
  1537		retval = mpi3mr_bring_ioc_ready(mrioc);
  1538		if (retval) {
  1539			ioc_err(mrioc, "Failed to bring ioc ready: error %d\n",
  1540			    retval);
  1541			goto out_failed;
  1542		}
  1543	
  1544		retval = mpi3mr_setup_isr(mrioc, 1);
  1545		if (retval) {
  1546			ioc_err(mrioc, "Failed to setup ISR error %d\n",
  1547			    retval);
  1548			goto out_failed;
  1549		}
  1550	
  1551		retval = mpi3mr_issue_iocfacts(mrioc, &facts_data);
  1552		if (retval) {
  1553			ioc_err(mrioc, "Failed to Issue IOC Facts %d\n",
  1554			    retval);
  1555			goto out_failed;
  1556		}
  1557	
  1558		mpi3mr_process_factsdata(mrioc, &facts_data);
  1559		retval = mpi3mr_check_reset_dma_mask(mrioc);
  1560		if (retval) {
  1561			ioc_err(mrioc, "Resetting dma mask failed %d\n",
  1562			    retval);
  1563			goto out_failed;
  1564		}
  1565	
  1566		retval = mpi3mr_alloc_reply_sense_bufs(mrioc);
  1567		if (retval) {
  1568			ioc_err(mrioc,
  1569			    "%s :Failed to allocated reply sense buffers %d\n",
  1570			    __func__, retval);
  1571			goto out_failed;
  1572		}
  1573	
  1574		retval = mpi3mr_alloc_chain_bufs(mrioc);
  1575		if (retval) {
  1576			ioc_err(mrioc, "Failed to allocated chain buffers %d\n",
  1577			    retval);
  1578			goto out_failed;
  1579		}
  1580	
  1581		retval = mpi3mr_issue_iocinit(mrioc);
  1582		if (retval) {
  1583			ioc_err(mrioc, "Failed to Issue IOC Init %d\n",
  1584			    retval);
  1585			goto out_failed;
  1586		}
  1587		mrioc->reply_free_queue_host_index = mrioc->num_reply_bufs;
  1588		writel(mrioc->reply_free_queue_host_index,
  1589		    &mrioc->sysif_regs->ReplyFreeHostIndex);
  1590	
  1591		mrioc->sbq_host_index = mrioc->num_sense_bufs;
  1592		writel(mrioc->sbq_host_index,
  1593		    &mrioc->sysif_regs->SenseBufferFreeHostIndex);
  1594	
  1595		retval = mpi3mr_setup_isr(mrioc, 0);
  1596		if (retval) {
  1597			ioc_err(mrioc, "Failed to re-setup ISR, error %d\n",
  1598			    retval);
  1599			goto out_failed;
  1600		}
  1601	
  1602		return retval;
  1603	
  1604	out_failed:
  1605		mpi3mr_cleanup_ioc(mrioc);
  1606	out_nocleanup:
  1607		return retval;
  1608	}
  1609	

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

Attachment: .config.gz
Description: application/gzip


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux