Re: [PATCH 02/10] mpt3sas: Add support for NVMe shutdown.

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

 



On Fri, Dec 20, 2019 at 05:32:02AM -0500, Suganath Prabu S wrote:
<snip>

Hi Suganath,

We received an email from the 0day bot about this patch (see below)
about this patch. Would you look into addressing it?

> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> index a038be8..c451e57 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> @@ -1049,6 +1049,34 @@ mpt3sas_get_pdev_by_handle(struct MPT3SAS_ADAPTER *ioc, u16 handle)
>  	return pcie_device;
>  }
>  
> +/**
> + * _scsih_set_nvme_max_shutdown_latency - Update max_shutdown_latency.
> + * @ioc: per adapter object
> + * Context: This function will acquire ioc->pcie_device_lock
> + *
> + * Update ioc->max_shutdown_latency to that NVMe drives RTD3 Entry Latency
> + * which has reported maximum among all available NVMe drives.
> + * Minimum max_shutdown_latency will be six seconds.
> + */
> +static void
> +_scsih_set_nvme_max_shutdown_latency(struct MPT3SAS_ADAPTER *ioc)
> +{
> +	struct _pcie_device *pcie_device;
> +	unsigned long flags;
> +	u16 shutdown_latency = IO_UNIT_CONTROL_SHUTDOWN_TIMEOUT;
> +
> +	spin_lock_irqsave(&ioc->pcie_device_lock, flags);
> +	list_for_each_entry(pcie_device, &ioc->pcie_device_list, list) {
> +		if (pcie_device->shutdown_latency) {
> +			if (shutdown_latency < pcie_device->shutdown_latency)
> +				shutdown_latency =
> +					pcie_device->shutdown_latency;
> +		}
> +	}
> +	ioc->max_shutdown_latency = shutdown_latency;
> +	spin_unlock_irqrestore(&ioc->pcie_device_lock, flags);
> +}
> +
>  /**
>   * _scsih_pcie_device_remove - remove pcie_device from list.
>   * @ioc: per adapter object
> @@ -1063,6 +1091,7 @@ _scsih_pcie_device_remove(struct MPT3SAS_ADAPTER *ioc,
>  {
>  	unsigned long flags;
>  	int was_on_pcie_device_list = 0;
> +	u8 update_latency;

This should be initialized to 0 like the remove_by_handle function
below.

Cheers,
Nathan

On Tue, Dec 24, 2019 at 05:13:52AM +0800, kbuild test robot wrote:
> CC: kbuild-all@xxxxxxxxxxxx
> In-Reply-To: <20191220103210.43631-3-suganath-prabu.subramani@xxxxxxxxxxxx>
> References: <20191220103210.43631-3-suganath-prabu.subramani@xxxxxxxxxxxx>
> TO: Suganath Prabu S <suganath-prabu.subramani@xxxxxxxxxxxx>
> CC: linux-scsi@xxxxxxxxxxxxxxx, martin.petersen@xxxxxxxxxx
> CC: sreekanth.reddy@xxxxxxxxxxxx, sathya.prakash@xxxxxxxxxxxx, kashyap.desai@xxxxxxxxxxxx, Suganath Prabu S <suganath-prabu.subramani@xxxxxxxxxxxx>
> 
> Hi Suganath,
> 
> I love your patch! Perhaps something to improve:
> 
> [auto build test WARNING on scsi/for-next]
> [also build test WARNING on mkp-scsi/for-next v5.5-rc3 next-20191220]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> 
> url:    https://github.com/0day-ci/linux/commits/Suganath-Prabu-S/mpt3sas-Enhancements-of-phase14/20191223-182859
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
> config: arm64-defconfig (attached as .config)
> compiler: clang version 10.0.0 (git://gitmirror/llvm_project 891e25b02d760d0de18c7d46947913b3166047e7)
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=arm64 
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@xxxxxxxxx>
> 
> All warnings (new ones prefixed by >>):
> 
> >> drivers/scsi/mpt3sas/mpt3sas_scsih.c:1114:6: warning: variable 'update_latency' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
>            if (pcie_device->shutdown_latency == ioc->max_shutdown_latency)
>                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/scsi/mpt3sas/mpt3sas_scsih.c:1128:6: note: uninitialized use occurs here
>            if (update_latency)
>                ^~~~~~~~~~~~~~
>    drivers/scsi/mpt3sas/mpt3sas_scsih.c:1114:2: note: remove the 'if' if its condition is always true
>            if (pcie_device->shutdown_latency == ioc->max_shutdown_latency)
>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/scsi/mpt3sas/mpt3sas_scsih.c:1094:19: note: initialize the variable 'update_latency' to silence this warning
>            u8 update_latency;
>                             ^
>                              = '\0'
>    1 warning generated.



[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