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>,
"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>,
"jiajie.hao@mediatek.com" <jiajie.hao@mediatek.com>,
"alice.chao@mediatek.com" <alice.chao@mediatek.com>
Subject: RE: [PATCH v1 1/6] scsi: ufs-mediatek: Assign arguments with correct type
Date: Tue, 3 Nov 2020 15:39:44 +0800 [thread overview]
Message-ID: <1604389184.13152.9.camel@mtkswgap22> (raw)
In-Reply-To: <DM6PR04MB6575F51915ED4E904ED82EC1FC110@DM6PR04MB6575.namprd04.prod.outlook.com>
Hi Avri,
On Tue, 2020-11-03 at 07:12 +0000, Avri Altman wrote:
> >
> > In ufs_mtk_unipro_set_lpm(), use specific unsigned values
> > as the argument to invoke ufshcd_dme_set().
> >
> > In the same time, change the name of ufs_mtk_unipro_set_pm()
> > to ufs_mtk_unipro_set_lpm() to align the naming convention
> > in MediaTek UFS driver.
> >
> > Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> Looks like this patch is gilding the lily?
Thanks for the review.
Please see explanation below.
>
> > ---
> > drivers/scsi/ufs/ufs-mediatek.c | 12 ++++++------
> > 1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
> > index 8df73bc2f8cb..0196a89055b5 100644
> > --- a/drivers/scsi/ufs/ufs-mediatek.c
> > +++ b/drivers/scsi/ufs/ufs-mediatek.c
> > @@ -639,14 +639,14 @@ static int ufs_mtk_pwr_change_notify(struct
> > ufs_hba *hba,
> > return ret;
> > }
> >
> > -static int ufs_mtk_unipro_set_pm(struct ufs_hba *hba, bool lpm)
> > +static int ufs_mtk_unipro_set_lpm(struct ufs_hba *hba, bool lpm)
> > {
> > int ret;
> > struct ufs_mtk_host *host = ufshcd_get_variant(hba);
> >
> > ret = ufshcd_dme_set(hba,
> > UIC_ARG_MIB_SEL(VS_UNIPROPOWERDOWNCONTROL, 0),
> > - lpm);
> > + lpm ? 1 : 0);
> bool is implicitly converted to int anyway?
This change is the echo of your suggestion in
https://patchwork.kernel.org/project/linux-scsi/patch/20200908064507.30774-4-stanley.chu@mediatek.com/
Actually I think your suggestion is constructive that the accepted
values of VS_UNIPROPOWERDOWNCONTROL are better clearly defined so I use
the casting here in this patch.
>
> > if (!ret || !lpm) {
> > /*
> > * Forcibly set as non-LPM mode if UIC commands is failed
> > @@ -664,7 +664,7 @@ static int ufs_mtk_pre_link(struct ufs_hba *hba)
> > int ret;
> > u32 tmp;
> >
> > - ret = ufs_mtk_unipro_set_pm(hba, false);
> > + ret = ufs_mtk_unipro_set_lpm(hba, false);
> > if (ret)
> > return ret;
> >
> > @@ -774,7 +774,7 @@ static int ufs_mtk_link_set_hpm(struct ufs_hba
> > *hba)
> > if (err)
> > return err;
> >
> > - err = ufs_mtk_unipro_set_pm(hba, false);
> > + err = ufs_mtk_unipro_set_lpm(hba, false);
> > if (err)
> > return err;
> >
> > @@ -795,10 +795,10 @@ static int ufs_mtk_link_set_lpm(struct ufs_hba
> > *hba)
> > {
> > int err;
> >
> > - err = ufs_mtk_unipro_set_pm(hba, true);
> > + err = ufs_mtk_unipro_set_lpm(hba, true);
> > if (err) {
> > /* Resume UniPro state for following error recovery */
> > - ufs_mtk_unipro_set_pm(hba, false);
> > + ufs_mtk_unipro_set_lpm(hba, false);
> > return err;
> > }
> >
> > --
> > 2.18.0
Thanks,
Stanley Chu
next prev parent reply other threads:[~2020-11-03 7:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-29 11:57 [PATCH v1 0/6] scsi: ufs: Add some proprietary features in MediaTek UFS platforms Stanley Chu
2020-10-29 11:57 ` [PATCH v1 1/6] scsi: ufs-mediatek: Assign arguments with correct type Stanley Chu
2020-11-03 7:12 ` Avri Altman
2020-11-03 7:39 ` Stanley Chu [this message]
2020-11-03 8:55 ` Avri Altman
2020-10-29 11:57 ` [PATCH v1 2/6] scsi: ufs-mediatek: Support VA09 regulator operations Stanley Chu
2020-10-29 11:57 ` [PATCH v1 3/6] scsi: ufs-mediatek: Decouple features from platform bindings Stanley Chu
2020-10-29 11:57 ` [PATCH v1 4/6] scsi: ufs-mediatek: Support option to disable auto-hibern8 Stanley Chu
2020-10-29 11:57 ` [PATCH v1 5/6] scsi: ufs: Add enums for UniPro version higher than 1.6 Stanley Chu
2020-10-29 11:57 ` [PATCH v1 6/6] scsi: ufs-mediatek: Add HS-G4 support Stanley Chu
2020-11-06 6:10 ` [PATCH v1 0/6] scsi: ufs: Add some proprietary features in MediaTek UFS platforms Stanley Chu
2020-11-11 4:04 ` 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=1604389184.13152.9.camel@mtkswgap22 \
--to=stanley.chu@mediatek.com \
--cc=Avri.Altman@wdc.com \
--cc=alice.chao@mediatek.com \
--cc=alim.akhtar@samsung.com \
--cc=andy.teng@mediatek.com \
--cc=cc.chou@mediatek.com \
--cc=chaotian.jing@mediatek.com \
--cc=chun-hung.wu@mediatek.com \
--cc=jejb@linux.ibm.com \
--cc=jiajie.hao@mediatek.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).