diff mbox

[v1,10/10] scsi: ufs-qcom: enable UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION

Message ID 1431878106-30579-11-git-send-email-ygardi@codeaurora.org (mailing list archive)
State New, archived
Headers show

Commit Message

Yaniv Gardi May 17, 2015, 3:55 p.m. UTC
Newer revisions of QUALCOMM Technologies UFS host controller may not
advertise the correct version information in UFS HCI VER register.
To handle this, enable UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION to let
UFS standard host controller driver call into vendor specific
operation to get right UFS HCI VER register value.

Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>

---
 drivers/scsi/ufs/ufs-qcom.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Akinobu Mita May 19, 2015, 2:41 p.m. UTC | #1
2015-05-18 0:55 GMT+09:00 Yaniv Gardi <ygardi@codeaurora.org>:
> Newer revisions of QUALCOMM Technologies UFS host controller may not
> advertise the correct version information in UFS HCI VER register.
> To handle this, enable UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION to let
> UFS standard host controller driver call into vendor specific
> operation to get right UFS HCI VER register value.
>
> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
>
> ---
>  drivers/scsi/ufs/ufs-qcom.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index de9cfb0..4cdffa4 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -694,6 +694,16 @@ out:
>         return ret;
>  }
>
> +static u32 ufs_qcom_get_ufs_hci_version(struct ufs_hba *hba)
> +{
> +       struct ufs_qcom_host *host = hba->priv;
> +
> +       if (host->hw_ver.major == 0x1)
> +               return UFSHCI_VERSION_11;
> +       else
> +               return UFSHCI_VERSION_20;

Btw, UFS driver currently lacks UFSHCI 2.0 support.  Shouldn't we also
need a change like the patch submitted by Chuanxiao Dong:

http://marc.info/?l=linux-scsi&m=140688020815020&w=2
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index de9cfb0..4cdffa4 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -694,6 +694,16 @@  out:
 	return ret;
 }
 
+static u32 ufs_qcom_get_ufs_hci_version(struct ufs_hba *hba)
+{
+	struct ufs_qcom_host *host = hba->priv;
+
+	if (host->hw_ver.major == 0x1)
+		return UFSHCI_VERSION_11;
+	else
+		return UFSHCI_VERSION_20;
+}
+
 /**
  * ufs_qcom_advertise_quirks - advertise the known QCOM UFS controller quirks
  * @hba: host controller instance
@@ -718,6 +728,7 @@  static void ufs_qcom_advertise_quirks(struct ufs_hba *hba)
 
 	if (host->hw_ver.major >= 0x2) {
 		hba->quirks |= UFSHCD_QUIRK_BROKEN_LCC;
+		hba->quirks |= UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION;
 
 		if (!ufs_qcom_cap_qunipro(host))
 			/* Legacy UniPro mode still need following quirks */
@@ -1026,6 +1037,7 @@  static const struct ufs_hba_variant_ops ufs_hba_qcom_vops = {
 	.name                   = "qcom",
 	.init                   = ufs_qcom_init,
 	.exit                   = ufs_qcom_exit,
+	.get_ufs_hci_version	= ufs_qcom_get_ufs_hci_version,
 	.clk_scale_notify	= ufs_qcom_clk_scale_notify,
 	.setup_clocks           = ufs_qcom_setup_clocks,
 	.hce_enable_notify      = ufs_qcom_hce_enable_notify,