]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge branch 'misc' into for-linus
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 22 Dec 2016 20:32:33 +0000 (12:32 -0800)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 22 Dec 2016 20:32:33 +0000 (12:32 -0800)
1  2 
drivers/scsi/ufs/ufshcd.c

index ef8548c3a423d213dd04537753190b48f820cb83,af7e0285f00423a78b4ab6f99e967b6e9ce6a5e5..a2c2817fc566911e59f019d91639260d2df2fa09
@@@ -185,6 -185,30 +185,30 @@@ ufs_get_pm_lvl_to_link_pwr_state(enum u
        return ufs_pm_lvl_states[lvl].link_state;
  }
  
+ static struct ufs_dev_fix ufs_fixups[] = {
+       /* UFS cards deviations table */
+       UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
+               UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM),
+       UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL, UFS_DEVICE_NO_VCCQ),
+       UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
+               UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS),
+       UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
+               UFS_DEVICE_NO_FASTAUTO),
+       UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
+               UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE),
+       UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL,
+               UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM),
+       UFS_FIX(UFS_VENDOR_TOSHIBA, "THGLF2G9C8KBADG",
+               UFS_DEVICE_QUIRK_PA_TACTIVATE),
+       UFS_FIX(UFS_VENDOR_TOSHIBA, "THGLF2G9D8KBADG",
+               UFS_DEVICE_QUIRK_PA_TACTIVATE),
+       UFS_FIX(UFS_VENDOR_SKHYNIX, UFS_ANY_MODEL, UFS_DEVICE_NO_VCCQ),
+       UFS_FIX(UFS_VENDOR_SKHYNIX, UFS_ANY_MODEL,
+               UFS_DEVICE_QUIRK_HOST_PA_SAVECONFIGTIME),
+       END_FIX
+ };
  static void ufshcd_tmc_handler(struct ufs_hba *hba);
  static void ufshcd_async_scan(void *data, async_cookie_t cookie);
  static int ufshcd_reset_and_restore(struct ufs_hba *hba);
@@@ -288,10 -312,24 +312,24 @@@ int ufshcd_wait_for_register(struct ufs
   */
  static inline u32 ufshcd_get_intr_mask(struct ufs_hba *hba)
  {
-       if (hba->ufs_version == UFSHCI_VERSION_10)
-               return INTERRUPT_MASK_ALL_VER_10;
-       else
-               return INTERRUPT_MASK_ALL_VER_11;
+       u32 intr_mask = 0;
+       switch (hba->ufs_version) {
+       case UFSHCI_VERSION_10:
+               intr_mask = INTERRUPT_MASK_ALL_VER_10;
+               break;
+       /* allow fall through */
+       case UFSHCI_VERSION_11:
+       case UFSHCI_VERSION_20:
+               intr_mask = INTERRUPT_MASK_ALL_VER_11;
+               break;
+       /* allow fall through */
+       case UFSHCI_VERSION_21:
+       default:
+               intr_mask = INTERRUPT_MASK_ALL_VER_21;
+       }
+       return intr_mask;
  }
  
  /**
@@@ -5199,6 -5237,8 +5237,8 @@@ static void ufshcd_tune_unipro_params(s
  
        if (hba->dev_quirks & UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE)
                ufshcd_quirk_tune_host_pa_tactivate(hba);
+       ufshcd_vops_apply_dev_quirks(hba);
  }
  
  /**
@@@ -5821,7 -5861,7 +5861,7 @@@ ufshcd_send_request_sense(struct ufs_hb
  
        ret = scsi_execute_req_flags(sdp, cmd, DMA_FROM_DEVICE, buffer,
                                UFSHCD_REQ_SENSE_SIZE, NULL,
 -                              msecs_to_jiffies(1000), 3, NULL, REQ_PM);
 +                              msecs_to_jiffies(1000), 3, NULL, 0, RQF_PM);
        if (ret)
                pr_err("%s: failed with err %d\n", __func__, ret);
  
@@@ -5883,11 -5923,11 +5923,11 @@@ static int ufshcd_set_dev_pwr_mode(stru
  
        /*
         * Current function would be generally called from the power management
 -       * callbacks hence set the REQ_PM flag so that it doesn't resume the
 +       * callbacks hence set the RQF_PM flag so that it doesn't resume the
         * already suspended childs.
         */
        ret = scsi_execute_req_flags(sdp, cmd, DMA_NONE, NULL, 0, &sshdr,
 -                                   START_STOP_TIMEOUT, 0, NULL, REQ_PM);
 +                                   START_STOP_TIMEOUT, 0, NULL, 0, RQF_PM);
        if (ret) {
                sdev_printk(KERN_WARNING, sdp,
                            "START_STOP failed for power mode: %d, result %x\n",
@@@ -6667,6 -6707,13 +6707,13 @@@ int ufshcd_init(struct ufs_hba *hba, vo
        /* Get UFS version supported by the controller */
        hba->ufs_version = ufshcd_get_ufs_version(hba);
  
+       if ((hba->ufs_version != UFSHCI_VERSION_10) &&
+           (hba->ufs_version != UFSHCI_VERSION_11) &&
+           (hba->ufs_version != UFSHCI_VERSION_20) &&
+           (hba->ufs_version != UFSHCI_VERSION_21))
+               dev_err(hba->dev, "invalid UFS version 0x%x\n",
+                       hba->ufs_version);
        /* Get Interrupt bit mask per version */
        hba->intr_mask = ufshcd_get_intr_mask(hba);