]> git.baikalelectronics.ru Git - kernel.git/commitdiff
scsi: ufs: core: Add UFSHCD_QUIRK_HIBERN_FASTAUTO
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Fri, 3 Jun 2022 11:05:20 +0000 (20:05 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 14 Jun 2022 01:57:34 +0000 (21:57 -0400)
Add UFSHCD_QUIRK_HIBERN_FASTAUTO quirk for host controllers which supports
auto-hibernate the capability but only FASTAUTO mode.

Link: https://lore.kernel.org/r/20220603110524.1997825-4-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c
include/ufs/ufshcd.h

index 88e567c3ba0b8f8920c63f1b9f808dd8ad28b1cf..bb6cbd514a69d5eaa64c65fcfcc488a595c90371 100644 (file)
@@ -4260,8 +4260,13 @@ static int ufshcd_get_max_pwr_mode(struct ufs_hba *hba)
        if (hba->max_pwr_info.is_valid)
                return 0;
 
-       pwr_info->pwr_tx = FAST_MODE;
-       pwr_info->pwr_rx = FAST_MODE;
+       if (hba->quirks & UFSHCD_QUIRK_HIBERN_FASTAUTO) {
+               pwr_info->pwr_tx = FASTAUTO_MODE;
+               pwr_info->pwr_rx = FASTAUTO_MODE;
+       } else {
+               pwr_info->pwr_tx = FAST_MODE;
+               pwr_info->pwr_rx = FAST_MODE;
+       }
        pwr_info->hs_rate = PA_HS_MODE_B;
 
        /* Get the connected lane count */
index 795c8951341d876a6549ccbbc4457c6b79c97b90..991aea081ec70f49869c362016fd5a17d575f475 100644 (file)
@@ -583,6 +583,12 @@ enum ufshcd_quirks {
         * 64-bit addressing supported capability but it doesn't work.
         */
        UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS               = 1 << 17,
+
+       /*
+        * This quirk needs to be enabled if the host controller has
+        * auto-hibernate capability but it's FASTAUTO only.
+        */
+       UFSHCD_QUIRK_HIBERN_FASTAUTO                    = 1 << 18,
 };
 
 enum ufshcd_caps {