Re: [PATCH v1 2/2] scsi: ufs: Handle LINERESET indication in err handler

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

 



Hi Can,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on mkp-scsi/for-next]
[cannot apply to scsi/for-next v5.9-rc2 next-20200824]
[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/Can-Guo/Add-UFS-LINERESET-handling/20200824-174334
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: riscv-randconfig-r035-20200824 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project b587ca93be114d07ec3bf654add97d7872325281)
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 riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

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/ufs/ufshcd.c:5897:13: error: use of undeclared identifier 'UIC_PHY_ADAPTER_LAYER_GENERIC_ERROR'
                   if (reg & UIC_PHY_ADAPTER_LAYER_GENERIC_ERROR) {
                             ^
   drivers/scsi/ufs/ufshcd.c:8928:44: warning: shift count >= width of type [-Wshift-count-overflow]
                   if (!dma_set_mask_and_coherent(hba->dev, DMA_BIT_MASK(64)))
                                                            ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:139:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   1 warning and 1 error generated.

# https://github.com/0day-ci/linux/commit/ec9dcd8fd02bf2ecd2d75d2bd272d06d10818198
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Can-Guo/Add-UFS-LINERESET-handling/20200824-174334
git checkout ec9dcd8fd02bf2ecd2d75d2bd272d06d10818198
vim +/UIC_PHY_ADAPTER_LAYER_GENERIC_ERROR +5897 drivers/scsi/ufs/ufshcd.c

  5869	
  5870	/**
  5871	 * ufshcd_update_uic_error - check and set fatal UIC error flags.
  5872	 * @hba: per-adapter instance
  5873	 *
  5874	 * Returns
  5875	 *  IRQ_HANDLED - If interrupt is valid
  5876	 *  IRQ_NONE    - If invalid interrupt
  5877	 */
  5878	static irqreturn_t ufshcd_update_uic_error(struct ufs_hba *hba)
  5879	{
  5880		u32 reg;
  5881		irqreturn_t retval = IRQ_NONE;
  5882	
  5883		/* PHY layer error */
  5884		reg = ufshcd_readl(hba, REG_UIC_ERROR_CODE_PHY_ADAPTER_LAYER);
  5885		if ((reg & UIC_PHY_ADAPTER_LAYER_ERROR) &&
  5886		    (reg & UIC_PHY_ADAPTER_LAYER_ERROR_CODE_MASK)) {
  5887			ufshcd_update_reg_hist(&hba->ufs_stats.pa_err, reg);
  5888			/*
  5889			 * To know whether this error is fatal or not, DB timeout
  5890			 * must be checked but this error is handled separately.
  5891			 */
  5892			if (reg & UIC_PHY_ADAPTER_LAYER_LANE_ERR_MASK)
  5893				dev_dbg(hba->dev, "%s: UIC Lane error reported\n",
  5894						__func__);
  5895	
  5896			/* Got a LINERESET indication. */
> 5897			if (reg & UIC_PHY_ADAPTER_LAYER_GENERIC_ERROR) {
  5898				struct uic_command *cmd = NULL;
  5899	
  5900				hba->uic_error |= UFSHCD_UIC_PA_GENERIC_ERROR;
  5901				if (hba->uic_async_done && hba->active_uic_cmd)
  5902					cmd = hba->active_uic_cmd;
  5903				/*
  5904				 * Ignore the LINERESET during power mode change
  5905				 * operation via DME_SET command.
  5906				 */
  5907				if (cmd && (cmd->command == UIC_CMD_DME_SET))
  5908					hba->uic_error &= ~UFSHCD_UIC_PA_GENERIC_ERROR;
  5909			}
  5910			retval |= IRQ_HANDLED;
  5911		}
  5912	
  5913		/* PA_INIT_ERROR is fatal and needs UIC reset */
  5914		reg = ufshcd_readl(hba, REG_UIC_ERROR_CODE_DATA_LINK_LAYER);
  5915		if ((reg & UIC_DATA_LINK_LAYER_ERROR) &&
  5916		    (reg & UIC_DATA_LINK_LAYER_ERROR_CODE_MASK)) {
  5917			ufshcd_update_reg_hist(&hba->ufs_stats.dl_err, reg);
  5918	
  5919			if (reg & UIC_DATA_LINK_LAYER_ERROR_PA_INIT)
  5920				hba->uic_error |= UFSHCD_UIC_DL_PA_INIT_ERROR;
  5921			else if (hba->dev_quirks &
  5922					UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS) {
  5923				if (reg & UIC_DATA_LINK_LAYER_ERROR_NAC_RECEIVED)
  5924					hba->uic_error |=
  5925						UFSHCD_UIC_DL_NAC_RECEIVED_ERROR;
  5926				else if (reg & UIC_DATA_LINK_LAYER_ERROR_TCx_REPLAY_TIMEOUT)
  5927					hba->uic_error |= UFSHCD_UIC_DL_TCx_REPLAY_ERROR;
  5928			}
  5929			retval |= IRQ_HANDLED;
  5930		}
  5931	
  5932		/* UIC NL/TL/DME errors needs software retry */
  5933		reg = ufshcd_readl(hba, REG_UIC_ERROR_CODE_NETWORK_LAYER);
  5934		if ((reg & UIC_NETWORK_LAYER_ERROR) &&
  5935		    (reg & UIC_NETWORK_LAYER_ERROR_CODE_MASK)) {
  5936			ufshcd_update_reg_hist(&hba->ufs_stats.nl_err, reg);
  5937			hba->uic_error |= UFSHCD_UIC_NL_ERROR;
  5938			retval |= IRQ_HANDLED;
  5939		}
  5940	
  5941		reg = ufshcd_readl(hba, REG_UIC_ERROR_CODE_TRANSPORT_LAYER);
  5942		if ((reg & UIC_TRANSPORT_LAYER_ERROR) &&
  5943		    (reg & UIC_TRANSPORT_LAYER_ERROR_CODE_MASK)) {
  5944			ufshcd_update_reg_hist(&hba->ufs_stats.tl_err, reg);
  5945			hba->uic_error |= UFSHCD_UIC_TL_ERROR;
  5946			retval |= IRQ_HANDLED;
  5947		}
  5948	
  5949		reg = ufshcd_readl(hba, REG_UIC_ERROR_CODE_DME);
  5950		if ((reg & UIC_DME_ERROR) &&
  5951		    (reg & UIC_DME_ERROR_CODE_MASK)) {
  5952			ufshcd_update_reg_hist(&hba->ufs_stats.dme_err, reg);
  5953			hba->uic_error |= UFSHCD_UIC_DME_ERROR;
  5954			retval |= IRQ_HANDLED;
  5955		}
  5956	
  5957		dev_dbg(hba->dev, "%s: UIC error flags = 0x%08x\n",
  5958				__func__, hba->uic_error);
  5959		return retval;
  5960	}
  5961	

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