summaryrefslogtreecommitdiff
path: root/drivers/scsi/ufs/ufshcd.c
diff options
context:
space:
mode:
authorYaniv Gardi <ygardi@codeaurora.org>2015-05-17 15:55:05 (GMT)
committerJames Bottomley <JBottomley@Odin.com>2015-06-02 20:20:14 (GMT)
commit9949e702e69718965f3c3c6787eb17d420daa7df (patch)
tree969e36fdaed3154ace03c9284c7bc5d7c54c270e /drivers/scsi/ufs/ufshcd.c
parent2c0cc2e2693b3c13cf007cfd25b6ea43a1eceb45 (diff)
downloadlinux-9949e702e69718965f3c3c6787eb17d420daa7df.tar.xz
scsi: ufs: add quirk to handle broken UFS HCI version
Some host controller hardware controllers may not advertise correct version in UFS HCI VER register. To workaround this, add new quirk and call the host controller hardware vendor specific callback to get the correct UFS HCI version register value. Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/ufs/ufshcd.c')
-rw-r--r--drivers/scsi/ufs/ufshcd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 014f1c0..b0ade73 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -271,6 +271,11 @@ static inline u32 ufshcd_get_intr_mask(struct ufs_hba *hba)
*/
static inline u32 ufshcd_get_ufs_version(struct ufs_hba *hba)
{
+ if (hba->quirks & UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION) {
+ if (hba->vops && hba->vops->get_ufs_hci_version)
+ return hba->vops->get_ufs_hci_version(hba);
+ }
+
return ufshcd_readl(hba, REG_UFS_VERSION);
}