diff mbox series

[v1] scsi: ufs: disable auto hibern8 while entering suspend

Message ID 20220123234044.163394-1-hy50.seo@samsung.com (mailing list archive)
State Superseded
Headers show
Series [v1] scsi: ufs: disable auto hibern8 while entering suspend | expand

Commit Message

SEO HOYOUNG Jan. 23, 2022, 11:40 p.m. UTC
If using auto hibern8 mode, need to disable auto hibern8 while
entering suspend.
When using auto hibern8 mode, it does not seem right to send a uic command
for entry into hibern8 in the next line(ufshcd_lik_state_transition(..))
It seem right to send after disable auto hibern8.

In addition, if the auto hibern8 mode supported, it is enabled in resume.
So it seems that it will be paired only when auto hibern8 is disabled
while entering suspend.

Signed-off-by: SEO HOYOUNG <hy50.seo@samsung.com>
---
 drivers/scsi/ufs/ufshcd.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

kernel test robot Jan. 24, 2022, 3:42 p.m. UTC | #1
Hi SEO,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on jejb-scsi/for-next]
[also build test WARNING on mkp-scsi/for-next linux/master linus/master v5.17-rc1 next-20220124]
[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/SEO-HOYOUNG/scsi-ufs-disable-auto-hibern8-while-entering-suspend/20220124-195745
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: hexagon-randconfig-r005-20220124 (https://download.01.org/0day-ci/archive/20220124/202201242333.B4Rc0F9H-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2e58a18910867ba6795066e044293e6daf89edf5)
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/0day-ci/linux/commit/07442fb1071785299ef4ec421a37874e0d84babf
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review SEO-HOYOUNG/scsi-ufs-disable-auto-hibern8-while-entering-suspend/20220124-195745
        git checkout 07442fb1071785299ef4ec421a37874e0d84babf
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/scsi/ufs/

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

All warnings (new ones prefixed by >>):

>> drivers/scsi/ufs/ufshcd.c:4207:6: warning: no previous prototype for function 'ufshcd_auto_hibern8_disable' [-Wmissing-prototypes]
   void ufshcd_auto_hibern8_disable(struct ufs_hba *hba)
        ^
   drivers/scsi/ufs/ufshcd.c:4207:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void ufshcd_auto_hibern8_disable(struct ufs_hba *hba)
   ^
   static 
   1 warning generated.


vim +/ufshcd_auto_hibern8_disable +4207 drivers/scsi/ufs/ufshcd.c

  4206	
> 4207	void ufshcd_auto_hibern8_disable(struct ufs_hba *hba)
  4208	{
  4209		unsigned long flags;
  4210	
  4211		if (!ufshcd_is_auto_hibern8_supported(hba))
  4212			return;
  4213	
  4214		spin_lock_irqsave(hba->host->host_lock, flags);
  4215		ufshcd_writel(hba, 0, REG_AUTO_HIBERNATE_IDLE_TIMER);
  4216		spin_unlock_irqrestore(hba->host->host_lock, flags);
  4217	}
  4218	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot Jan. 24, 2022, 3:42 p.m. UTC | #2
Hi SEO,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on jejb-scsi/for-next]
[also build test WARNING on mkp-scsi/for-next linux/master linus/master v5.17-rc1 next-20220124]
[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/SEO-HOYOUNG/scsi-ufs-disable-auto-hibern8-while-entering-suspend/20220124-195745
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: arc-randconfig-r043-20220124 (https://download.01.org/0day-ci/archive/20220124/202201242328.jXmzUj9v-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 11.2.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/0day-ci/linux/commit/07442fb1071785299ef4ec421a37874e0d84babf
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review SEO-HOYOUNG/scsi-ufs-disable-auto-hibern8-while-entering-suspend/20220124-195745
        git checkout 07442fb1071785299ef4ec421a37874e0d84babf
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/scsi/ufs/

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

All warnings (new ones prefixed by >>):

>> drivers/scsi/ufs/ufshcd.c:4207:6: warning: no previous prototype for 'ufshcd_auto_hibern8_disable' [-Wmissing-prototypes]
    4207 | void ufshcd_auto_hibern8_disable(struct ufs_hba *hba)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/ufshcd_auto_hibern8_disable +4207 drivers/scsi/ufs/ufshcd.c

  4206	
> 4207	void ufshcd_auto_hibern8_disable(struct ufs_hba *hba)
  4208	{
  4209		unsigned long flags;
  4210	
  4211		if (!ufshcd_is_auto_hibern8_supported(hba))
  4212			return;
  4213	
  4214		spin_lock_irqsave(hba->host->host_lock, flags);
  4215		ufshcd_writel(hba, 0, REG_AUTO_HIBERNATE_IDLE_TIMER);
  4216		spin_unlock_irqrestore(hba->host->host_lock, flags);
  4217	}
  4218	

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

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 460d2b440d2e..f6b16e229ad3 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4204,6 +4204,18 @@  void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
 }
 EXPORT_SYMBOL_GPL(ufshcd_auto_hibern8_update);
 
+void ufshcd_auto_hibern8_disable(struct ufs_hba *hba)
+{
+	unsigned long flags;
+
+	if (!ufshcd_is_auto_hibern8_supported(hba))
+		return;
+
+	spin_lock_irqsave(hba->host->host_lock, flags);
+	ufshcd_writel(hba, 0, REG_AUTO_HIBERNATE_IDLE_TIMER);
+	spin_unlock_irqrestore(hba->host->host_lock, flags);
+}
+
 void ufshcd_auto_hibern8_enable(struct ufs_hba *hba)
 {
 	unsigned long flags;
@@ -8925,6 +8937,7 @@  static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 	 * with the link off, so do not check for bkops.
 	 */
 	check_for_bkops = !ufshcd_is_ufs_dev_deepsleep(hba);
+	ufshcd_auto_hibern8_disable(hba);
 	ret = ufshcd_link_state_transition(hba, req_link_state, check_for_bkops);
 	if (ret)
 		goto set_dev_active;