From 47df7e7a36c269a3a62f97af1b8a6324eabd40b7 Mon Sep 17 00:00:00 2001 From: Subhash Jadavani Date: Fri, 10 Jan 2014 14:07:26 -0800 Subject: [PATCH] scsi: ufs: provide the quirk to disable the LCC LCC (Line Control Command) are being used for communication between UFS host and UFS device. But some hosts might have the issue with issuing the LCC commands to UFS device and in this case LCC could be explicitly disabled from the host side. Change-Id: I7b4d4a46d8d4e70bde088a5652decc7ba86a5617 Signed-off-by: Subhash Jadavani --- drivers/scsi/ufs/ufshcd.c | 2 +- drivers/scsi/ufs/ufshcd.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 9d30b431dd12..68ec3613173b 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3043,7 +3043,7 @@ static int ufshcd_link_startup(struct ufs_hba *hba) if (ret) { /* failed to get the link up... retire */ goto out; - } else { + } else if (hba->quirks & UFSHCD_BROKEN_LCC) { int hc_tx_lanes; int i; diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index c5427a3e6d36..8b3d7da4e31d 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -506,6 +506,13 @@ struct ufs_hba { #define UFSHCD_QUIRK_BROKEN_2_TX_LANES (1 << 8) + /* + * If LCC (Line Control Command) are having issue on the host + * controller then enable this quirk. Note that connected UFS device + * should also have workaround to not expect LCC commands from host. + */ + #define UFSHCD_BROKEN_LCC (1 << 9) + wait_queue_head_t tm_wq; wait_queue_head_t tm_tag_wq; unsigned long tm_condition;