Re: [PATCH v4] ufs: core: wlun suspend SSU/enter hibern8 fail recovery

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

 



On Wed, 2022-12-07 at 19:17 +0200, Adrian Hunter wrote:
> On 6/12/22 05:11, peter.wang@xxxxxxxxxxxx wrote:
> > From: Peter Wang <peter.wang@xxxxxxxxxxxx>
> > 
> > When SSU/enter hibern8 fail in wlun suspend flow, trigger error
> > handler and return busy to break the suspend.
> > If not, wlun runtime pm status become error and the consumer will
> > stuck in runtime suspend status.
> > 
> > Signed-off-by: Peter Wang <peter.wang@xxxxxxxxxxxx>
> 
> Should this have a Fixes or stable tag?
> 

Hi Adrian,

Yes, will add Fixes tag. 
Thanks for reminder.


> Another minor comment below, otherwise:
> 
> Reviewed-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> 
> > ---
> >  drivers/ufs/core/ufshcd.c | 26 ++++++++++++++++++++++++++
> >  1 file changed, 26 insertions(+)
> > 
> > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> > index b1f59a5fe632..98f105f32877 100644
> > --- a/drivers/ufs/core/ufshcd.c
> > +++ b/drivers/ufs/core/ufshcd.c
> > @@ -9049,6 +9049,19 @@ static int __ufshcd_wl_suspend(struct
> > ufs_hba *hba, enum ufs_pm_op pm_op)
> >  
> >  		if (!hba->dev_info.b_rpm_dev_flush_capable) {
> >  			ret = ufshcd_set_dev_pwr_mode(hba,
> > req_dev_pwr_mode);
> > +			if (ret && pm_op != UFS_SHUTDOWN_PM) {
> > +				/*
> > +				 * If return err in suspend flow, IO
> > will hang.
> > +				 * Trigger error handler and break
> > suspend for
> > +				 * error recovery.
> > +				 */
> > +				spin_lock_irq(hba->host->host_lock);
> > +				hba->force_reset = true;
> > +				ufshcd_schedule_eh_work(hba);
> > +				spin_unlock_irq(hba->host->host_lock);
> > +
> > +				ret = -EBUSY;
> > +			}
> >  			if (ret)
> >  				goto enable_scaling;
> >  		}
> > @@ -9060,6 +9073,19 @@ static int __ufshcd_wl_suspend(struct
> > ufs_hba *hba, enum ufs_pm_op pm_op)
> >  	 */
> >  	check_for_bkops = !ufshcd_is_ufs_dev_deepsleep(hba);
> >  	ret = ufshcd_link_state_transition(hba, req_link_state,
> > check_for_bkops);
> > +	if (ret && pm_op != UFS_SHUTDOWN_PM) {
> > +		/*
> > +		 * If return err in suspend flow, IO will hang.
> > +		 * Trigger error handler and break suspend for
> > +		 * error recovery.
> > +		 */
> > +		spin_lock_irq(hba->host->host_lock);
> > +		hba->force_reset = true;
> > +		ufshcd_schedule_eh_work(hba);
> > +		spin_unlock_irq(hba->host->host_lock);
> 
> Same 4 lines of code could be separated into a helper function.

OK, will change next version.
Thanks for review.

> 
> > +
> > +		ret = -EBUSY;
> > +	}
> >  	if (ret)
> >  		goto set_dev_active;
> >  
> 
> 




[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