RE: [PATCH v4] scsi: ufs-mediatek: fix ufs power down specs violation

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

 



On Thu, 2021-05-13 at 06:45 +0000, Avri Altman wrote:
> > From: Peter Wang <peter.wang@xxxxxxxxxxxx>
> > 
> > As per specs, e.g, JESD220E chapter 7.2, while powering off
> > the ufs device, RST_N signal should be between VSS(Ground)
> > and VCCQ/VCCQ2. The power down sequence after fixing as below:
> > 
> > Power down:
> > 1. Assert RST_N low
> > 2. Turn-off VCC
> > 3. Turn-off VCCQ/VCCQ2
> > 
> > Signed-off-by: Peter Wang <peter.wang@xxxxxxxxxxxx>
> > ---
> >  drivers/scsi/ufs/ufs-mediatek.c |    4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
> > index c55202b..47b4066 100644
> > --- a/drivers/scsi/ufs/ufs-mediatek.c
> > +++ b/drivers/scsi/ufs/ufs-mediatek.c
> > @@ -922,6 +922,7 @@ static void ufs_mtk_vreg_set_lpm(struct ufs_hba
> > *hba, bool lpm)
> >  static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
> >  {
> >         int err;
> > +       struct arm_smccc_res res;
> > 
> >         if (ufshcd_is_link_hibern8(hba)) {
> >                 err = ufs_mtk_link_set_lpm(hba);
> > @@ -941,6 +942,9 @@ static int ufs_mtk_suspend(struct ufs_hba *hba,
> > enum ufs_pm_op pm_op)
> >                         goto fail;
> >         }
> > 
> > +       if (ufshcd_is_link_off(hba))
> > +               ufs_mtk_device_reset_ctrl(0, res);
> According to your commit log, you should call reset just before 
> ufs_mtk_vreg_set_lpm, or turn phy off, whichever turn off vcc - 
> Few lines above.
> 
> Thanks,
> Avri

ufs_mtk_vreg_set_lpm only set vccq2 power mode to lpm, dose't trun off
vccq2.And turn phy off is also turn off vcc, dose't turn off vccq2.
RST_N keep high is no problem when we trun off vcc and vccq2 keep on.
But RST_N will got problem if we trun off vccq2.
(RST_N signal should be between VSS(Ground) and VCCQ/VCCQ2)
Here set RST_N to low is after shut down pm set link off, and before
shutdown pm turn off vccq2.

Thanks
Peter

> 
> > +
> >         return 0;
> >  fail:
> >         /*
> > --
> > 1.7.9.5
> 





[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