Hi Bean, Thanks so much for review. On Mon, 2019-05-13 at 18:21 +0000, Bean Huo (beanhuo) wrote: > Hi, Stanley > > >+ > >+static inline bool ufshcd_is_auto_hibern8_error(struct ufs_hba *hba, > >+ u32 intr_mask) > >+{ > >+ return (ufshcd_is_auto_hibern8_supported(hba) && > >+ !hba->uic_async_done && > > Here check if uic_async_done is NULL, no big problem so far, but not safe enough. > How about setting a flag in ufshcd_auto_hibern8_enable(), > > I concern about how to compatible with auto_hibern8 disabled condition. Currently auto-hibern8 disabling method is not implemented in mainstream, so an "enabling" flag may looks redundant unless disabling path is really existed. I agree that checking hba->uic_async_done here does not look so intuitive. However even if auto-hibern8 is disabled, these checks could be safe enough because both "UIC_HIBERNATE_ENTER" and "UIC_HIBERNATE_EXIT" are raised only if "manual-hibernate" is performed, and in this case hba->uic_async_done shall be true. Anything else or corner case I missed? > > > //Bean Thanks, Stanley > > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@xxxxxxxxxxxxxxxxxxx > http://lists.infradead.org/mailman/listinfo/linux-mediatek