linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanley Chu <stanley.chu@mediatek.com>
To: Avri Altman <Avri.Altman@wdc.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"linux-mediatek@lists.infradead.org" 
	<linux-mediatek@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kuohong.wang@mediatek.com" <kuohong.wang@mediatek.com>,
	"peter.wang@mediatek.com" <peter.wang@mediatek.com>,
	"chun-hung.wu@mediatek.com" <chun-hung.wu@mediatek.com>,
	"andy.teng@mediatek.com" <andy.teng@mediatek.com>,
	"chaotian.jing@mediatek.com" <chaotian.jing@mediatek.com>,
	"cc.chou@mediatek.com" <cc.chou@mediatek.com>
Subject: RE: [PATCH 3/4] scsi: ufs-mediatek: Fix flag of unipro low-power mode
Date: Tue, 27 Oct 2020 17:52:15 +0800	[thread overview]
Message-ID: <1603792335.2104.12.camel@mtkswgap22> (raw)
In-Reply-To: <BY5PR04MB67058DE7C6B5F63E960280CBFC3C0@BY5PR04MB6705.namprd04.prod.outlook.com>

Hi Avri,

On Sat, 2020-09-19 at 08:08 +0000, Avri Altman wrote:
> > 
> > Forcibly leave UniPro low-power mode if UIC commands is failed.
> > This makes hba_enable_delay_us as correct (default) value for
> > re-enabling the host.
> > 
> > At the same time, change type of parameter "lpm" in function
> > ufs_mtk_unipro_set_pm() to "bool".
> Semantically, better leave it u32 as its eventually assigned to the arg3 of the uic command 
> 

Thanks for reminding.
I will use specific u32 values while sending arg3 to fix this.

> > 
> > Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> > ---
> >  drivers/scsi/ufs/ufs-mediatek.c | 20 ++++++++++++++------
> >  1 file changed, 14 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
> > index 887c03e8bcc0..feba74a72309 100644
> > --- a/drivers/scsi/ufs/ufs-mediatek.c
> > +++ b/drivers/scsi/ufs/ufs-mediatek.c
> > @@ -419,7 +419,7 @@ static int ufs_mtk_pwr_change_notify(struct ufs_hba
> > *hba,
> >         return ret;
> >  }
> > 
> > -static int ufs_mtk_unipro_set_pm(struct ufs_hba *hba, u32 lpm)
> > +static int ufs_mtk_unipro_set_pm(struct ufs_hba *hba, bool lpm)
> >  {
> >         int ret;
> >         struct ufs_mtk_host *host = ufshcd_get_variant(hba);
> > @@ -427,8 +427,14 @@ static int ufs_mtk_unipro_set_pm(struct ufs_hba
> > *hba, u32 lpm)
> >         ret = ufshcd_dme_set(hba,
> >                              UIC_ARG_MIB_SEL(VS_UNIPROPOWERDOWNCONTROL, 0),
> >                              lpm);
> > -       if (!ret)
> > +       if (!ret || !lpm) {
> > +               /*
> > +                * Forcibly set as non-LPM mode if UIC commands is failed
> > +                * to use default hba_enable_delay_us value for re-enabling
> > +                * the host.
> > +                */
> >                 host->unipro_lpm = lpm;
> Maybe just host->unipro_lpm = false; instead

This statement shall stay like this for case: "lpm = true"

Thanks,
Stanley Chu



  reply	other threads:[~2020-10-27  9:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08  6:45 [PATCH 0/4] scsi: ufs-mediatek: Fixes for kernel v5.10 Stanley Chu
2020-09-08  6:45 ` [PATCH 1/4] scsi: ufs-mediatek: Eliminate error message for unbound mphy Stanley Chu
2020-09-19  7:31   ` Avri Altman
2020-09-08  6:45 ` [PATCH 2/4] scsi: ufs-mediatek: Fix HOST_PA_TACTIVATE quirk Stanley Chu
2020-09-19  7:53   ` Avri Altman
2020-09-08  6:45 ` [PATCH 3/4] scsi: ufs-mediatek: Fix flag of unipro low-power mode Stanley Chu
2020-09-19  8:08   ` Avri Altman
2020-10-27  9:52     ` Stanley Chu [this message]
2020-09-08  6:45 ` [PATCH 4/4] scsi: ufs-mediatek: Add host reset mechanism Stanley Chu
2020-09-29 11:54   ` Avri Altman
2020-09-09  2:50 ` [PATCH 0/4] scsi: ufs-mediatek: Fixes for kernel v5.10 Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1603792335.2104.12.camel@mtkswgap22 \
    --to=stanley.chu@mediatek.com \
    --cc=Avri.Altman@wdc.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andy.teng@mediatek.com \
    --cc=bvanassche@acm.org \
    --cc=cc.chou@mediatek.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=chun-hung.wu@mediatek.com \
    --cc=jejb@linux.ibm.com \
    --cc=kuohong.wang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=matthias.bgg@gmail.com \
    --cc=peter.wang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).