linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] scsi: ufs: Re-enable WB after device reset
@ 2020-12-08 13:56 Stanley Chu
  2020-12-08 13:56 ` [PATCH v2 1/2] scsi: ufs: Re-enable WriteBooster " Stanley Chu
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Stanley Chu @ 2020-12-08 13:56 UTC (permalink / raw)
  To: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
  Cc: beanhuo, asutoshd, cang, matthias.bgg, bvanassche,
	linux-mediatek, linux-arm-kernel, linux-kernel, nguyenb,
	bjorn.andersson, kuohong.wang, peter.wang, chun-hung.wu,
	andy.teng, chaotian.jing, cc.chou, jiajie.hao, alice.chao,
	Stanley Chu

Hi,

This series fixes up an issue that WB is not re-enabled after device reset.

Stanley Chu (2):
  scsi: ufs: Re-enable WriteBooster after device reset
  scsi: ufs: Uninline ufshcd_vops_device_reset function

 drivers/scsi/ufs/ufshcd.c | 27 ++++++++++++++++++++++-----
 drivers/scsi/ufs/ufshcd.h | 14 +++++---------
 2 files changed, 27 insertions(+), 14 deletions(-)

-- 
2.18.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/2] scsi: ufs: Re-enable WriteBooster after device reset
  2020-12-08 13:56 [PATCH v2 0/2] scsi: ufs: Re-enable WB after device reset Stanley Chu
@ 2020-12-08 13:56 ` Stanley Chu
  2020-12-08 14:13   ` Bean Huo
  2020-12-08 13:56 ` [PATCH v2 2/2] scsi: ufs: Uninline ufshcd_vops_device_reset function Stanley Chu
  2020-12-09 17:12 ` [PATCH v2 0/2] scsi: ufs: Re-enable WB after device reset Martin K. Petersen
  2 siblings, 1 reply; 9+ messages in thread
From: Stanley Chu @ 2020-12-08 13:56 UTC (permalink / raw)
  To: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
  Cc: beanhuo, asutoshd, cang, matthias.bgg, bvanassche,
	linux-mediatek, linux-arm-kernel, linux-kernel, nguyenb,
	bjorn.andersson, kuohong.wang, peter.wang, chun-hung.wu,
	andy.teng, chaotian.jing, cc.chou, jiajie.hao, alice.chao,
	Stanley Chu

UFS 3.1 specification mentions that below WriteBooster flags will be
set to default value, say disabled, after power cycle or any type
of reset event. Thus we need to reset those flag variables kept
in struct hba to align the device status and ensure WriteBooster
related functions being configured properly after device reset.

Without this fix, WriteBooster will not be enabled successfully
after by ufshcd_wb_ctrl() after device reset because hba->wb_enabled
remains true.

Flags required to be reset to default values:
- fWriteBoosterEn: hba->wb_enabled
- fWriteBoosterBufferFlushEn: hba->wb_buf_flush_enabled
- fWriteBoosterBufferFlushDuringHibernate: No variable mapped

Fixes: 3d17b9b5ab11 ("scsi: ufs: Add write booster feature support")
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
---
 drivers/scsi/ufs/ufshcd.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 08c8a591e6b0..36d367eb8139 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -1221,8 +1221,13 @@ static inline void ufshcd_vops_device_reset(struct ufs_hba *hba)
 	if (hba->vops && hba->vops->device_reset) {
 		int err = hba->vops->device_reset(hba);
 
-		if (!err)
+		if (!err) {
 			ufshcd_set_ufs_dev_active(hba);
+			if (ufshcd_is_wb_allowed(hba)) {
+				hba->wb_enabled = false;
+				hba->wb_buf_flush_enabled = false;
+			}
+		}
 		if (err != -EOPNOTSUPP)
 			ufshcd_update_evt_hist(hba, UFS_EVT_DEV_RESET, err);
 	}
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/2] scsi: ufs: Uninline ufshcd_vops_device_reset function
  2020-12-08 13:56 [PATCH v2 0/2] scsi: ufs: Re-enable WB after device reset Stanley Chu
  2020-12-08 13:56 ` [PATCH v2 1/2] scsi: ufs: Re-enable WriteBooster " Stanley Chu
@ 2020-12-08 13:56 ` Stanley Chu
  2020-12-08 14:14   ` Bean Huo
  2020-12-15 17:33   ` Asutosh Das (asd)
  2020-12-09 17:12 ` [PATCH v2 0/2] scsi: ufs: Re-enable WB after device reset Martin K. Petersen
  2 siblings, 2 replies; 9+ messages in thread
From: Stanley Chu @ 2020-12-08 13:56 UTC (permalink / raw)
  To: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
  Cc: beanhuo, asutoshd, cang, matthias.bgg, bvanassche,
	linux-mediatek, linux-arm-kernel, linux-kernel, nguyenb,
	bjorn.andersson, kuohong.wang, peter.wang, chun-hung.wu,
	andy.teng, chaotian.jing, cc.chou, jiajie.hao, alice.chao,
	Stanley Chu

Since more and more statements showing up in ufshcd_vops_device_reset(),
uninline it to allow compiler making possibly better optimization.

Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
---
 drivers/scsi/ufs/ufshcd.c | 27 ++++++++++++++++++++++-----
 drivers/scsi/ufs/ufshcd.h | 19 +++++--------------
 2 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index c1c401b2b69d..b2ca1a6ad426 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -580,6 +580,23 @@ static void ufshcd_print_pwr_info(struct ufs_hba *hba)
 		 hba->pwr_info.hs_rate);
 }
 
+static void ufshcd_device_reset(struct ufs_hba *hba)
+{
+	int err;
+
+	err = ufshcd_vops_device_reset(hba);
+
+	if (!err) {
+		ufshcd_set_ufs_dev_active(hba);
+		if (ufshcd_is_wb_allowed(hba)) {
+			hba->wb_enabled = false;
+			hba->wb_buf_flush_enabled = false;
+		}
+	}
+	if (err != -EOPNOTSUPP)
+		ufshcd_update_evt_hist(hba, UFS_EVT_DEV_RESET, err);
+}
+
 void ufshcd_delay_us(unsigned long us, unsigned long tolerance)
 {
 	if (!us)
@@ -3932,7 +3949,7 @@ int ufshcd_link_recovery(struct ufs_hba *hba)
 	spin_unlock_irqrestore(hba->host->host_lock, flags);
 
 	/* Reset the attached device */
-	ufshcd_vops_device_reset(hba);
+	ufshcd_device_reset(hba);
 
 	ret = ufshcd_host_reset_and_restore(hba);
 
@@ -6933,7 +6950,7 @@ static int ufshcd_reset_and_restore(struct ufs_hba *hba)
 
 	do {
 		/* Reset the attached device */
-		ufshcd_vops_device_reset(hba);
+		ufshcd_device_reset(hba);
 
 		err = ufshcd_host_reset_and_restore(hba);
 	} while (err && --retries);
@@ -8712,7 +8729,7 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 	 * further below.
 	 */
 	if (ufshcd_is_ufs_dev_deepsleep(hba)) {
-		ufshcd_vops_device_reset(hba);
+		ufshcd_device_reset(hba);
 		WARN_ON(!ufshcd_is_link_off(hba));
 	}
 	if (ufshcd_is_link_hibern8(hba) && !ufshcd_uic_hibern8_exit(hba))
@@ -8722,7 +8739,7 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 set_dev_active:
 	/* Can also get here needing to exit DeepSleep */
 	if (ufshcd_is_ufs_dev_deepsleep(hba)) {
-		ufshcd_vops_device_reset(hba);
+		ufshcd_device_reset(hba);
 		ufshcd_host_reset_and_restore(hba);
 	}
 	if (!ufshcd_set_dev_pwr_mode(hba, UFS_ACTIVE_PWR_MODE))
@@ -9321,7 +9338,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
 	}
 
 	/* Reset the attached device */
-	ufshcd_vops_device_reset(hba);
+	ufshcd_device_reset(hba);
 
 	ufshcd_init_crypto(hba);
 
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 36d367eb8139..9bb5f0ed4124 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -1216,21 +1216,12 @@ static inline void ufshcd_vops_dbg_register_dump(struct ufs_hba *hba)
 		hba->vops->dbg_register_dump(hba);
 }
 
-static inline void ufshcd_vops_device_reset(struct ufs_hba *hba)
+static inline int ufshcd_vops_device_reset(struct ufs_hba *hba)
 {
-	if (hba->vops && hba->vops->device_reset) {
-		int err = hba->vops->device_reset(hba);
-
-		if (!err) {
-			ufshcd_set_ufs_dev_active(hba);
-			if (ufshcd_is_wb_allowed(hba)) {
-				hba->wb_enabled = false;
-				hba->wb_buf_flush_enabled = false;
-			}
-		}
-		if (err != -EOPNOTSUPP)
-			ufshcd_update_evt_hist(hba, UFS_EVT_DEV_RESET, err);
-	}
+	if (hba->vops && hba->vops->device_reset)
+		return hba->vops->device_reset(hba);
+
+	return -EOPNOTSUPP;
 }
 
 static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba,
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/2] scsi: ufs: Re-enable WriteBooster after device reset
  2020-12-08 13:56 ` [PATCH v2 1/2] scsi: ufs: Re-enable WriteBooster " Stanley Chu
@ 2020-12-08 14:13   ` Bean Huo
  2020-12-09  1:09     ` Stanley Chu
  0 siblings, 1 reply; 9+ messages in thread
From: Bean Huo @ 2020-12-08 14:13 UTC (permalink / raw)
  To: Stanley Chu, linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
  Cc: beanhuo, asutoshd, cang, matthias.bgg, bvanassche,
	linux-mediatek, linux-arm-kernel, linux-kernel, nguyenb,
	bjorn.andersson, kuohong.wang, peter.wang, chun-hung.wu,
	andy.teng, chaotian.jing, cc.chou, jiajie.hao, alice.chao

On Tue, 2020-12-08 at 21:56 +0800, Stanley Chu wrote:
> index 08c8a591e6b0..36d367eb8139 100644
> --- a/drivers/scsi/ufs/ufshcd.h
> +++ b/drivers/scsi/ufs/ufshcd.h
> @@ -1221,8 +1221,13 @@ static inline void
> ufshcd_vops_device_reset(struct ufs_hba *hba)
>         if (hba->vops && hba->vops->device_reset) {
>                 int err = hba->vops->device_reset(hba);
>  
> -               if (!err)
> +               if (!err) {
>                         ufshcd_set_ufs_dev_active(hba);
> +                       if (ufshcd_is_wb_allowed(hba)) {
> +                               hba->wb_enabled = false;
> +                               hba->wb_buf_flush_enabled = false;
> +                       }
> +               }

Stanley,
how do you think group wb_buf_flush_enabled and wb_enabled to the
dev_info, since they are UFS device attributes. means they are set only
when UFS device flags being set.

Reviewed-by: Bean Huo <beanhuo@micron.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] scsi: ufs: Uninline ufshcd_vops_device_reset function
  2020-12-08 13:56 ` [PATCH v2 2/2] scsi: ufs: Uninline ufshcd_vops_device_reset function Stanley Chu
@ 2020-12-08 14:14   ` Bean Huo
  2020-12-15 17:33   ` Asutosh Das (asd)
  1 sibling, 0 replies; 9+ messages in thread
From: Bean Huo @ 2020-12-08 14:14 UTC (permalink / raw)
  To: Stanley Chu, linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
  Cc: beanhuo, asutoshd, cang, matthias.bgg, bvanassche,
	linux-mediatek, linux-arm-kernel, linux-kernel, nguyenb,
	bjorn.andersson, kuohong.wang, peter.wang, chun-hung.wu,
	andy.teng, chaotian.jing, cc.chou, jiajie.hao, alice.chao

On Tue, 2020-12-08 at 21:56 +0800, Stanley Chu wrote:
> Since more and more statements showing up in
> ufshcd_vops_device_reset(),
> uninline it to allow compiler making possibly better optimization.
> 
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
reviewed-by: Bean Huo <beanhuo@micron.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/2] scsi: ufs: Re-enable WriteBooster after device reset
  2020-12-08 14:13   ` Bean Huo
@ 2020-12-09  1:09     ` Stanley Chu
  2020-12-14 20:32       ` Bean Huo
  0 siblings, 1 reply; 9+ messages in thread
From: Stanley Chu @ 2020-12-09  1:09 UTC (permalink / raw)
  To: Bean Huo
  Cc: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb,
	beanhuo, asutoshd, cang, matthias.bgg, bvanassche,
	linux-mediatek, linux-arm-kernel, linux-kernel, nguyenb,
	bjorn.andersson, kuohong.wang, peter.wang, chun-hung.wu,
	andy.teng, chaotian.jing, cc.chou, jiajie.hao, alice.chao

On Tue, 2020-12-08 at 15:13 +0100, Bean Huo wrote:
> On Tue, 2020-12-08 at 21:56 +0800, Stanley Chu wrote:
> > index 08c8a591e6b0..36d367eb8139 100644
> > --- a/drivers/scsi/ufs/ufshcd.h
> > +++ b/drivers/scsi/ufs/ufshcd.h
> > @@ -1221,8 +1221,13 @@ static inline void
> > ufshcd_vops_device_reset(struct ufs_hba *hba)
> >         if (hba->vops && hba->vops->device_reset) {
> >                 int err = hba->vops->device_reset(hba);
> >  
> > -               if (!err)
> > +               if (!err) {
> >                         ufshcd_set_ufs_dev_active(hba);
> > +                       if (ufshcd_is_wb_allowed(hba)) {
> > +                               hba->wb_enabled = false;
> > +                               hba->wb_buf_flush_enabled = false;
> > +                       }
> > +               }
> 
> Stanley,
> how do you think group wb_buf_flush_enabled and wb_enabled to the
> dev_info, since they are UFS device attributes. means they are set only
> when UFS device flags being set.

Hi Bean,

Thanks for your review.

Yes, I agreed that wb related variables is a mess currently. I would
like to clean them up once I have time. Feel free to post your patch if
you want to take it up : )

Thanks,
Stanley Chu

> 
> Reviewed-by: Bean Huo <beanhuo@micron.com>
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 0/2] scsi: ufs: Re-enable WB after device reset
  2020-12-08 13:56 [PATCH v2 0/2] scsi: ufs: Re-enable WB after device reset Stanley Chu
  2020-12-08 13:56 ` [PATCH v2 1/2] scsi: ufs: Re-enable WriteBooster " Stanley Chu
  2020-12-08 13:56 ` [PATCH v2 2/2] scsi: ufs: Uninline ufshcd_vops_device_reset function Stanley Chu
@ 2020-12-09 17:12 ` Martin K. Petersen
  2 siblings, 0 replies; 9+ messages in thread
From: Martin K. Petersen @ 2020-12-09 17:12 UTC (permalink / raw)
  To: Stanley Chu
  Cc: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb,
	beanhuo, asutoshd, cang, matthias.bgg, bvanassche,
	linux-mediatek, linux-arm-kernel, linux-kernel, nguyenb,
	bjorn.andersson, kuohong.wang, peter.wang, chun-hung.wu,
	andy.teng, chaotian.jing, cc.chou, jiajie.hao, alice.chao


Stanley,

> This series fixes up an issue that WB is not re-enabled after device
> reset.

Applied to 5.11/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/2] scsi: ufs: Re-enable WriteBooster after device reset
  2020-12-09  1:09     ` Stanley Chu
@ 2020-12-14 20:32       ` Bean Huo
  0 siblings, 0 replies; 9+ messages in thread
From: Bean Huo @ 2020-12-14 20:32 UTC (permalink / raw)
  To: Stanley Chu
  Cc: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb,
	beanhuo, asutoshd, cang, matthias.bgg, bvanassche,
	linux-mediatek, linux-arm-kernel, linux-kernel, nguyenb,
	bjorn.andersson, kuohong.wang, peter.wang, chun-hung.wu,
	andy.teng, chaotian.jing, cc.chou, jiajie.hao, alice.chao

On Wed, 2020-12-09 at 09:09 +0800, Stanley Chu wrote:
> > >   
> > > -               if (!err)
> > > +               if (!err) {
> > >                          ufshcd_set_ufs_dev_active(hba);
> > > +                       if (ufshcd_is_wb_allowed(hba)) {
> > > +                               hba->wb_enabled = false;
> > > +                               hba->wb_buf_flush_enabled =
> > > false;
> > > +                       }
> > > +               }
> > 
> > Stanley,
> > how do you think group wb_buf_flush_enabled and wb_enabled to the
> > dev_info, since they are UFS device attributes. means they are set
> > only
> > when UFS device flags being set.
> 
> Hi Bean,
> 
> Thanks for your review.
> 
> Yes, I agreed that wb related variables is a mess currently. I would
> like to clean them up once I have time. Feel free to post your patch
> if
> you want to take it up : )
> 

Hi Stanley
I updated this change in my new "Several changes for UFS WriteBooster"
series patch, are you interested in reviewing that? to help Martin
easier pick up the changes.

Thanks,
Bean



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] scsi: ufs: Uninline ufshcd_vops_device_reset function
  2020-12-08 13:56 ` [PATCH v2 2/2] scsi: ufs: Uninline ufshcd_vops_device_reset function Stanley Chu
  2020-12-08 14:14   ` Bean Huo
@ 2020-12-15 17:33   ` Asutosh Das (asd)
  1 sibling, 0 replies; 9+ messages in thread
From: Asutosh Das (asd) @ 2020-12-15 17:33 UTC (permalink / raw)
  To: Stanley Chu, linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
  Cc: beanhuo, cang, matthias.bgg, bvanassche, linux-mediatek,
	linux-arm-kernel, linux-kernel, nguyenb, bjorn.andersson,
	kuohong.wang, peter.wang, chun-hung.wu, andy.teng, chaotian.jing,
	cc.chou, jiajie.hao, alice.chao

On 12/8/2020 5:56 AM, Stanley Chu wrote:
> Since more and more statements showing up in ufshcd_vops_device_reset(),
> uninline it to allow compiler making possibly better optimization.
> 
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> ---

Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>

>   drivers/scsi/ufs/ufshcd.c | 27 ++++++++++++++++++++++-----
>   drivers/scsi/ufs/ufshcd.h | 19 +++++--------------
>   2 files changed, 27 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index c1c401b2b69d..b2ca1a6ad426 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -580,6 +580,23 @@ static void ufshcd_print_pwr_info(struct ufs_hba *hba)
>   		 hba->pwr_info.hs_rate);
>   }
>   
> +static void ufshcd_device_reset(struct ufs_hba *hba)
> +{
> +	int err;
> +
> +	err = ufshcd_vops_device_reset(hba);
> +
> +	if (!err) {
> +		ufshcd_set_ufs_dev_active(hba);
> +		if (ufshcd_is_wb_allowed(hba)) {
> +			hba->wb_enabled = false;
> +			hba->wb_buf_flush_enabled = false;
> +		}
> +	}
> +	if (err != -EOPNOTSUPP)
> +		ufshcd_update_evt_hist(hba, UFS_EVT_DEV_RESET, err);
> +}
> +
>   void ufshcd_delay_us(unsigned long us, unsigned long tolerance)
>   {
>   	if (!us)
> @@ -3932,7 +3949,7 @@ int ufshcd_link_recovery(struct ufs_hba *hba)
>   	spin_unlock_irqrestore(hba->host->host_lock, flags);
>   
>   	/* Reset the attached device */
> -	ufshcd_vops_device_reset(hba);
> +	ufshcd_device_reset(hba);
>   
>   	ret = ufshcd_host_reset_and_restore(hba);
>   
> @@ -6933,7 +6950,7 @@ static int ufshcd_reset_and_restore(struct ufs_hba *hba)
>   
>   	do {
>   		/* Reset the attached device */
> -		ufshcd_vops_device_reset(hba);
> +		ufshcd_device_reset(hba);
>   
>   		err = ufshcd_host_reset_and_restore(hba);
>   	} while (err && --retries);
> @@ -8712,7 +8729,7 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
>   	 * further below.
>   	 */
>   	if (ufshcd_is_ufs_dev_deepsleep(hba)) {
> -		ufshcd_vops_device_reset(hba);
> +		ufshcd_device_reset(hba);
>   		WARN_ON(!ufshcd_is_link_off(hba));
>   	}
>   	if (ufshcd_is_link_hibern8(hba) && !ufshcd_uic_hibern8_exit(hba))
> @@ -8722,7 +8739,7 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
>   set_dev_active:
>   	/* Can also get here needing to exit DeepSleep */
>   	if (ufshcd_is_ufs_dev_deepsleep(hba)) {
> -		ufshcd_vops_device_reset(hba);
> +		ufshcd_device_reset(hba);
>   		ufshcd_host_reset_and_restore(hba);
>   	}
>   	if (!ufshcd_set_dev_pwr_mode(hba, UFS_ACTIVE_PWR_MODE))
> @@ -9321,7 +9338,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
>   	}
>   
>   	/* Reset the attached device */
> -	ufshcd_vops_device_reset(hba);
> +	ufshcd_device_reset(hba);
>   
>   	ufshcd_init_crypto(hba);
>   
> diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
> index 36d367eb8139..9bb5f0ed4124 100644
> --- a/drivers/scsi/ufs/ufshcd.h
> +++ b/drivers/scsi/ufs/ufshcd.h
> @@ -1216,21 +1216,12 @@ static inline void ufshcd_vops_dbg_register_dump(struct ufs_hba *hba)
>   		hba->vops->dbg_register_dump(hba);
>   }
>   
> -static inline void ufshcd_vops_device_reset(struct ufs_hba *hba)
> +static inline int ufshcd_vops_device_reset(struct ufs_hba *hba)
>   {
> -	if (hba->vops && hba->vops->device_reset) {
> -		int err = hba->vops->device_reset(hba);
> -
> -		if (!err) {
> -			ufshcd_set_ufs_dev_active(hba);
> -			if (ufshcd_is_wb_allowed(hba)) {
> -				hba->wb_enabled = false;
> -				hba->wb_buf_flush_enabled = false;
> -			}
> -		}
> -		if (err != -EOPNOTSUPP)
> -			ufshcd_update_evt_hist(hba, UFS_EVT_DEV_RESET, err);
> -	}
> +	if (hba->vops && hba->vops->device_reset)
> +		return hba->vops->device_reset(hba);
> +
> +	return -EOPNOTSUPP;
>   }
>   
>   static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba,
> 


-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-12-15 17:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 13:56 [PATCH v2 0/2] scsi: ufs: Re-enable WB after device reset Stanley Chu
2020-12-08 13:56 ` [PATCH v2 1/2] scsi: ufs: Re-enable WriteBooster " Stanley Chu
2020-12-08 14:13   ` Bean Huo
2020-12-09  1:09     ` Stanley Chu
2020-12-14 20:32       ` Bean Huo
2020-12-08 13:56 ` [PATCH v2 2/2] scsi: ufs: Uninline ufshcd_vops_device_reset function Stanley Chu
2020-12-08 14:14   ` Bean Huo
2020-12-15 17:33   ` Asutosh Das (asd)
2020-12-09 17:12 ` [PATCH v2 0/2] scsi: ufs: Re-enable WB after device reset Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).