diff mbox series

[v2,3/3] scsi: ufs-mediatek: enable auto suspend capability

Message ID 1568270135-32442-4-git-send-email-stanley.chu@mediatek.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/3] scsi: core: allow auto suspend override by low-level driver | expand

Commit Message

Stanley Chu Sept. 12, 2019, 6:35 a.m. UTC
Enable auto suspend capability in MediaTek UFS driver.

Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
---
 drivers/scsi/ufs/ufs-mediatek.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Bart Van Assche Sept. 12, 2019, 1:46 p.m. UTC | #1
On 9/12/19 7:35 AM, Stanley Chu wrote:
> Enable auto suspend capability in MediaTek UFS driver.
> 
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> Reviewed-by: Avri Altman <avri.altman@wdc.com>
> ---
>  drivers/scsi/ufs/ufs-mediatek.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
> index 0f6ff33ce52e..b7b177c6194c 100644
> --- a/drivers/scsi/ufs/ufs-mediatek.c
> +++ b/drivers/scsi/ufs/ufs-mediatek.c
> @@ -117,6 +117,11 @@ static int ufs_mtk_setup_clocks(struct ufs_hba *hba, bool on,
>  	return ret;
>  }
>  
> +static void ufs_mtk_set_caps(struct ufs_hba *hba)
> +{
> +	hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
> +}
> +
>  /**
>   * ufs_mtk_init - find other essential mmio bases
>   * @hba: host controller instance
> @@ -147,6 +152,8 @@ static int ufs_mtk_init(struct ufs_hba *hba)
>  	if (err)
>  		goto out_variant_clear;
>  
> +	ufs_mtk_set_caps(hba);
> +
>  	/*
>  	 * ufshcd_vops_init() is invoked after
>  	 * ufshcd_setup_clock(true) in ufshcd_hba_init() thus

Please inline the ufs_mtk_set_caps() function. Introducing single line
functions like is done in this patch doesn't improve readability.

Thanks,

Bart.
Stanley Chu Sept. 16, 2019, 6:29 a.m. UTC | #2
Hi Bart,


> > @@ -147,6 +152,8 @@ static int ufs_mtk_init(struct ufs_hba *hba)
> >  	if (err)
> >  		goto out_variant_clear;
> >  
> > +	ufs_mtk_set_caps(hba);
> > +
> >  	/*
> >  	 * ufshcd_vops_init() is invoked after
> >  	 * ufshcd_setup_clock(true) in ufshcd_hba_init() thus
> 
> Please inline the ufs_mtk_set_caps() function. Introducing single line
> functions like is done in this patch doesn't improve readability.
> 

OK! Will be fixed in next version.

Thanks,
Stanley
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
index 0f6ff33ce52e..b7b177c6194c 100644
--- a/drivers/scsi/ufs/ufs-mediatek.c
+++ b/drivers/scsi/ufs/ufs-mediatek.c
@@ -117,6 +117,11 @@  static int ufs_mtk_setup_clocks(struct ufs_hba *hba, bool on,
 	return ret;
 }
 
+static void ufs_mtk_set_caps(struct ufs_hba *hba)
+{
+	hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
+}
+
 /**
  * ufs_mtk_init - find other essential mmio bases
  * @hba: host controller instance
@@ -147,6 +152,8 @@  static int ufs_mtk_init(struct ufs_hba *hba)
 	if (err)
 		goto out_variant_clear;
 
+	ufs_mtk_set_caps(hba);
+
 	/*
 	 * ufshcd_vops_init() is invoked after
 	 * ufshcd_setup_clock(true) in ufshcd_hba_init() thus