]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
scsi: ufs: introduce a broken PA_RXHSUNTERMCAP quirk
authorYaniv Gardi <ygardi@codeaurora.org>
Sun, 17 May 2015 15:55:01 +0000 (18:55 +0300)
committerJames Bottomley <JBottomley@Odin.com>
Tue, 2 Jun 2015 20:15:47 +0000 (13:15 -0700)
The attribute PA_RXHSUNTERMCAP specifies whether or not the
inbound Link supports unterminated line in HS mode. enabling this
attribute to 1 fixes moving to HS gear.

Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h

index 3e57cca1ef33a7f4e9b84ebf0bb1093bb23de657..a274df98ddf095fc0df1b989ce23cba1eeec0d24 100644 (file)
@@ -2258,6 +2258,16 @@ static int ufshcd_uic_change_pwr_mode(struct ufs_hba *hba, u8 mode)
        struct uic_command uic_cmd = {0};
        int ret;
 
+       if (hba->quirks & UFSHCD_QUIRK_BROKEN_PA_RXHSUNTERMCAP) {
+               ret = ufshcd_dme_set(hba,
+                               UIC_ARG_MIB_SEL(PA_RXHSUNTERMCAP, 0), 1);
+               if (ret) {
+                       dev_err(hba->dev, "%s: failed to enable PA_RXHSUNTERMCAP ret %d\n",
+                                               __func__, ret);
+                       goto out;
+               }
+       }
+
        uic_cmd.command = UIC_CMD_DME_SET;
        uic_cmd.argument1 = UIC_ARG_MIB(PA_PWRMODE);
        uic_cmd.argument3 = mode;
@@ -2265,6 +2275,7 @@ static int ufshcd_uic_change_pwr_mode(struct ufs_hba *hba, u8 mode)
        ret = ufshcd_uic_pwr_ctrl(hba, &uic_cmd);
        ufshcd_release(hba);
 
+out:
        return ret;
 }
 
index b845f1535f29216fed7bc3726675163c147c16a2..8636ec97094600a3117ed164fd9833f96fa174fc 100644 (file)
@@ -435,6 +435,13 @@ struct ufs_hba {
         */
        #define UFSHCD_QUIRK_BROKEN_LCC                         UFS_BIT(2)
 
+       /*
+        * The attribute PA_RXHSUNTERMCAP specifies whether or not the
+        * inbound Link supports unterminated line in HS mode. Setting this
+        * attribute to 1 fixes moving to HS gear.
+        */
+       #define UFSHCD_QUIRK_BROKEN_PA_RXHSUNTERMCAP            UFS_BIT(3)
+
        unsigned int quirks;    /* Deviations from standard UFSHCI spec. */
 
        wait_queue_head_t tm_wq;