Message ID | 20221223084158.10069-1-peter.wang@mediatek.com |
---|---|
State | New |
Headers | show |
Series | [v2] ufs: core: wlun resume SSU(Acitve) fail recovery | expand |
Hi, Thank you for the patch! Yet something to improve: [auto build test ERROR on jejb-scsi/for-next] [also build test ERROR on mkp-scsi/for-next linus/master v6.2-rc1 next-20221226] [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#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/peter-wang-mediatek-com/ufs-core-wlun-resume-SSU-Acitve-fail-recovery/20221223-164240 base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next patch link: https://lore.kernel.org/r/20221223084158.10069-1-peter.wang%40mediatek.com patch subject: [PATCH v2] ufs: core: wlun resume SSU(Acitve) fail recovery config: nios2-allyesconfig compiler: nios2-linux-gcc (GCC) 12.1.0 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 # https://github.com/intel-lab-lkp/linux/commit/cd4c2e13ebc910bc510ad403cc21cf899e5cb771 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review peter-wang-mediatek-com/ufs-core-wlun-resume-SSU-Acitve-fail-recovery/20221223-164240 git checkout cd4c2e13ebc910bc510ad403cc21cf899e5cb771 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=nios2 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=nios2 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/ufs/core/ufshcd.c: In function 'ufshcd_eh_host_reset_handler': >> drivers/ufs/core/ufshcd.c:7377:23: error: 'struct dev_pm_info' has no member named 'runtime_status' 7377 | if (dev->power.runtime_status == RPM_RESUMING) { | ^ In file included from include/linux/device.h:15, from include/linux/async.h:14, from drivers/ufs/core/ufshcd.c:12: drivers/ufs/core/ufshcd.c:7381:43: error: 'struct dev_pm_info' has no member named 'runtime_status' 7381 | dev->power.runtime_status, | ^ include/linux/dev_printk.h:110:37: note: in definition of macro 'dev_printk_index_wrap' 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ | ^~~~~~~~~~~ drivers/ufs/core/ufshcd.c:7380:25: note: in expansion of macro 'dev_err' 7380 | dev_err(hba->dev, "WL Device PM: status:%d, err:%d\n", | ^~~~~~~ >> drivers/ufs/core/ufshcd.c:7382:43: error: 'struct dev_pm_info' has no member named 'runtime_error' 7382 | dev->power.runtime_error); | ^ include/linux/dev_printk.h:110:37: note: in definition of macro 'dev_printk_index_wrap' 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ | ^~~~~~~~~~~ drivers/ufs/core/ufshcd.c:7380:25: note: in expansion of macro 'dev_err' 7380 | dev_err(hba->dev, "WL Device PM: status:%d, err:%d\n", | ^~~~~~~ vim +7377 drivers/ufs/core/ufshcd.c 7354 7355 /** 7356 * ufshcd_eh_host_reset_handler - host reset handler registered to scsi layer 7357 * @cmd: SCSI command pointer 7358 * 7359 * Returns SUCCESS/FAILED 7360 */ 7361 static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd) 7362 { 7363 int err = SUCCESS; 7364 unsigned long flags; 7365 struct ufs_hba *hba; 7366 struct device *dev; 7367 7368 hba = shost_priv(cmd->device->host); 7369 7370 /* 7371 * If __ufshcd_wl_suspend get fail and runtime_status = RPM_RESUMING, 7372 * do link recovery only. Because schedule eh work will get dead lock 7373 * in ufshcd_rpm_get_sync to wait wlun resume, but wlun resume get 7374 * error and wait eh work finish. 7375 */ 7376 dev = &hba->ufs_device_wlun->sdev_gendev; > 7377 if (dev->power.runtime_status == RPM_RESUMING) { 7378 err = ufshcd_link_recovery(hba); 7379 if (err) { 7380 dev_err(hba->dev, "WL Device PM: status:%d, err:%d\n", > 7381 dev->power.runtime_status, > 7382 dev->power.runtime_error); 7383 } 7384 return err; 7385 } 7386 7387 spin_lock_irqsave(hba->host->host_lock, flags); 7388 hba->force_reset = true; 7389 ufshcd_schedule_eh_work(hba); 7390 dev_err(hba->dev, "%s: reset in progress - 1\n", __func__); 7391 spin_unlock_irqrestore(hba->host->host_lock, flags); 7392 7393 flush_work(&hba->eh_work); 7394 7395 spin_lock_irqsave(hba->host->host_lock, flags); 7396 if (hba->ufshcd_state == UFSHCD_STATE_ERROR) 7397 err = FAILED; 7398 spin_unlock_irqrestore(hba->host->host_lock, flags); 7399 7400 return err; 7401 } 7402
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index e18c9f4463ec..de20cf587fa1 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -7363,9 +7363,27 @@ static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd) int err = SUCCESS; unsigned long flags; struct ufs_hba *hba; + struct device *dev; hba = shost_priv(cmd->device->host); + /* + * If __ufshcd_wl_suspend get fail and runtime_status = RPM_RESUMING, + * do link recovery only. Because schedule eh work will get dead lock + * in ufshcd_rpm_get_sync to wait wlun resume, but wlun resume get + * error and wait eh work finish. + */ + dev = &hba->ufs_device_wlun->sdev_gendev; + if (dev->power.runtime_status == RPM_RESUMING) { + err = ufshcd_link_recovery(hba); + if (err) { + dev_err(hba->dev, "WL Device PM: status:%d, err:%d\n", + dev->power.runtime_status, + dev->power.runtime_error); + } + return err; + } + spin_lock_irqsave(hba->host->host_lock, flags); hba->force_reset = true; ufshcd_schedule_eh_work(hba);