scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Fri, 3 Jun 2022 11:05:19 +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_BROKEN_64BIT_ADDRESS for host controllers which do not
support 64-bit addressing.

Link: https://lore.kernel.org/r/20220603110524.1997825-3-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 01fb4ba..88e567c 100644 (file)
@@ -2216,6 +2216,8 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba)
        int err;
 
        hba->capabilities = ufshcd_readl(hba, REG_CONTROLLER_CAPABILITIES);
+       if (hba->quirks & UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS)
+               hba->capabilities &= ~MASK_64_ADDRESSING_SUPPORT;
 
        /* nutrs and nutmrs are 0 based values */
        hba->nutrs = (hba->capabilities & MASK_TRANSFER_REQUESTS_SLOTS) + 1;
index a922714..795c895 100644 (file)
@@ -577,6 +577,12 @@ enum ufshcd_quirks {
         * support physical host configuration.
         */
        UFSHCD_QUIRK_SKIP_PH_CONFIGURATION              = 1 << 16,
+
+       /*
+        * This quirk needs to be enabled if the host controller has
+        * 64-bit addressing supported capability but it doesn't work.
+        */
+       UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS               = 1 << 17,
 };
 
 enum ufshcd_caps {