Re: [PATCH 3/3] scsi: ufs: add quirk to support host reset only

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

 



Hi jongmin,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on scsi/for-next v5.13-rc3 next-20210526]
[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/jongmin-jeong/scsi-ufs-add-quirk-to-handle-broken-UIC-command/20210527-120913
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: powerpc64-randconfig-r016-20210526 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 6505c630407c5feec818f0bb1c284f9eeebf2071)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/1418a728f0fcd3a50e41d3314d8d9e1ec672a0c7
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review jongmin-jeong/scsi-ufs-add-quirk-to-handle-broken-UIC-command/20210527-120913
        git checkout 1418a728f0fcd3a50e41d3314d8d9e1ec672a0c7
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

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

All warnings (new ones prefixed by >>):

>> drivers/scsi/ufs/ufshcd.c:6827:6: warning: variable 'hba' is uninitialized when used here [-Wuninitialized]
           if (hba->quirks & UFSHCD_QUIRK_BROKEN_RESET_HANDLER)
               ^~~
   drivers/scsi/ufs/ufshcd.c:6821:21: note: initialize the variable 'hba' to silence this warning
           struct ufs_hba *hba;
                              ^
                               = NULL
   1 warning generated.


vim +/hba +6827 drivers/scsi/ufs/ufshcd.c

  6810	
  6811	/**
  6812	 * ufshcd_eh_device_reset_handler - device reset handler registered to
  6813	 *                                    scsi layer.
  6814	 * @cmd: SCSI command pointer
  6815	 *
  6816	 * Returns SUCCESS/FAILED
  6817	 */
  6818	static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
  6819	{
  6820		struct Scsi_Host *host;
  6821		struct ufs_hba *hba;
  6822		u32 pos;
  6823		int err;
  6824		u8 resp = 0xF, lun;
  6825		unsigned long flags;
  6826	
> 6827		if (hba->quirks & UFSHCD_QUIRK_BROKEN_RESET_HANDLER)
  6828			return ufshcd_eh_host_reset_handler(cmd);
  6829	
  6830		host = cmd->device->host;
  6831		hba = shost_priv(host);
  6832	
  6833		lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun);
  6834		err = ufshcd_issue_tm_cmd(hba, lun, 0, UFS_LOGICAL_RESET, &resp);
  6835		if (err || resp != UPIU_TASK_MANAGEMENT_FUNC_COMPL) {
  6836			if (!err)
  6837				err = resp;
  6838			goto out;
  6839		}
  6840	
  6841		/* clear the commands that were pending for corresponding LUN */
  6842		for_each_set_bit(pos, &hba->outstanding_reqs, hba->nutrs) {
  6843			if (hba->lrb[pos].lun == lun) {
  6844				err = ufshcd_clear_cmd(hba, pos);
  6845				if (err)
  6846					break;
  6847			}
  6848		}
  6849		spin_lock_irqsave(host->host_lock, flags);
  6850		ufshcd_transfer_req_compl(hba);
  6851		spin_unlock_irqrestore(host->host_lock, flags);
  6852	
  6853	out:
  6854		hba->req_abort_count = 0;
  6855		ufshcd_update_evt_hist(hba, UFS_EVT_DEV_RESET, (u32)err);
  6856		if (!err) {
  6857			err = SUCCESS;
  6858		} else {
  6859			dev_err(hba->dev, "%s: failed with err %d\n", __func__, err);
  6860			err = FAILED;
  6861		}
  6862		return err;
  6863	}
  6864	

---
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