Message ID | 20230818193546.2014874-13-bvanassche@acm.org |
---|---|
State | Superseded |
Headers | show |
Series | Improve performance for zoned UFS devices | expand |
On 8/18/2023 12:34 PM, Bart Van Assche wrote: > The host driver link startup callback is called indirectly by > ufshcd_probe_hba(). That function applies the auto-hibernation > settings by writing hba->ahit into the auto-hibernation control > register. Simplify the code for disabling auto-hibernation by > setting hba->ahit instead of writing into the auto-hibernation > control register. This patch is part of an effort to move all > auto-hibernation register changes into the UFSHCI driver core. ... > /* disable auto H8 */ > - reg = ufshcd_readl(hba, REG_AUTO_HIBERNATE_IDLE_TIMER); > - reg = reg & (~UFS_AHIT_AH8ITV_MASK); > - ufshcd_writel(hba, reg, REG_AUTO_HIBERNATE_IDLE_TIMER); > + hba->ahit = 0; The original code only clears the timer value, not the scale. However, I think it is safe to assume that it meant to clear both. Reviewed-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
diff --git a/drivers/ufs/host/ufs-hisi.c b/drivers/ufs/host/ufs-hisi.c index 5b3060cd0ab8..f2ec687121bb 100644 --- a/drivers/ufs/host/ufs-hisi.c +++ b/drivers/ufs/host/ufs-hisi.c @@ -142,7 +142,6 @@ static int ufs_hisi_link_startup_pre_change(struct ufs_hba *hba) struct ufs_hisi_host *host = ufshcd_get_variant(hba); int err; uint32_t value; - uint32_t reg; /* Unipro VS_mphy_disable */ ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xD0C1, 0x0), 0x1); @@ -232,9 +231,7 @@ static int ufs_hisi_link_startup_pre_change(struct ufs_hba *hba) ufshcd_writel(hba, UFS_HCLKDIV_NORMAL_VALUE, UFS_REG_HCLKDIV); /* disable auto H8 */ - reg = ufshcd_readl(hba, REG_AUTO_HIBERNATE_IDLE_TIMER); - reg = reg & (~UFS_AHIT_AH8ITV_MASK); - ufshcd_writel(hba, reg, REG_AUTO_HIBERNATE_IDLE_TIMER); + hba->ahit = 0; /* Unipro PA_Local_TX_LCC_Enable */ ufshcd_disable_host_tx_lcc(hba);
The host driver link startup callback is called indirectly by ufshcd_probe_hba(). That function applies the auto-hibernation settings by writing hba->ahit into the auto-hibernation control register. Simplify the code for disabling auto-hibernation by setting hba->ahit instead of writing into the auto-hibernation control register. This patch is part of an effort to move all auto-hibernation register changes into the UFSHCI driver core. Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: Can Guo <quic_cang@quicinc.com> Cc: Avri Altman <avri.altman@wdc.com> Cc: Bao D. Nguyen <quic_nguyenb@quicinc.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> --- drivers/ufs/host/ufs-hisi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)