Message ID | 1558361445-30994-3-git-send-email-stanley.chu@mediatek.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | scsi: ufs: Add error handling of Auto-Hibernate | expand |
> > ufshcd_is_auto_hibern8_supported() will be used elsewhere > in the driver, thus refactor it for preparation. You missed a couple of spots, e.g. in ufshcd_auto_hibern8_enable and in ufs-sysfs. Thanks, Avri
Hi Avri, On Tue, 2019-05-21 at 06:18 +0000, Avri Altman wrote: > > > > ufshcd_is_auto_hibern8_supported() will be used elsewhere > > in the driver, thus refactor it for preparation. > You missed a couple of spots, e.g. in ufshcd_auto_hibern8_enable and in ufs-sysfs. Yes... Will re-factor them as well in next version. > > Thanks, > Avri Thanks, Stanley
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index ba04d07df279..c904625d9905 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8312,7 +8312,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) UIC_LINK_HIBERN8_STATE); /* Set the default auto-hiberate idle timer value to 150 ms */ - if ((hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT) && !hba->ahit) { + if (ufshcd_is_auto_hibern8_supported(hba) && !hba->ahit) { hba->ahit = FIELD_PREP(UFSHCI_AHIBERN8_TIMER_MASK, 150) | FIELD_PREP(UFSHCI_AHIBERN8_SCALE_MASK, 3); } diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index ecfa898b9ccc..994d73d03207 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -740,6 +740,11 @@ return true; #endif } +static inline bool ufshcd_is_auto_hibern8_supported(struct ufs_hba *hba) +{ + return (hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT); +} + #define ufshcd_writel(hba, val, reg) \ writel((val), (hba)->mmio_base + (reg)) #define ufshcd_readl(hba, reg) \