diff mbox series

[1/3] scsi: ufs: add quirk to handle broken UIC command

Message ID 20210527030901.88403-2-jjmin.jeong@samsung.com (mailing list archive)
State Changes Requested
Headers show
Series Add quirk to support exynos ufshci | expand

Commit Message

정종민 May 27, 2021, 3:08 a.m. UTC
samsung ExynosAuto SoC has two types of host controller interface to
support the virtualization of UFS Device.
One is the physical host(PH) that the same as conventaional UFSHCI,
and the other is the virtual host(VH) that support data transfer function only.

In this structure, the virtual host does not support UIC command.
To support this, we add the quirk and return 0 when the UIC command
send function is called.

Change-Id: Ie528726b29bcb643149440bf1c90eaa5995c5ac1
Signed-off-by: jongmin jeong <jjmin.jeong@samsung.com>
---
 drivers/scsi/ufs/ufshcd.c | 3 +++
 drivers/scsi/ufs/ufshcd.h | 6 ++++++
 2 files changed, 9 insertions(+)

Comments

Christoph Hellwig May 27, 2021, 8 a.m. UTC | #1
On Thu, May 27, 2021 at 12:08:59PM +0900, jongmin jeong wrote:
> samsung ExynosAuto SoC has two types of host controller interface to
> support the virtualization of UFS Device.
> One is the physical host(PH) that the same as conventaional UFSHCI,
> and the other is the virtual host(VH) that support data transfer function only.

You forgot to include the hunk that actually sets the quirk.

Also please work on the commit log formatting.

> Change-Id: Ie528726b29bcb643149440bf1c90eaa5995c5ac1

This kind of crap has no business in a commit log.
정종민 June 3, 2021, 3:08 a.m. UTC | #2
> > samsung ExynosAuto SoC has two types of host controller interface to
> > support the virtualization of UFS Device.
> > One is the physical host(PH) that the same as conventaional UFSHCI,
> > and the other is the virtual host(VH) that support data transfer
> function only.
> 
> You forgot to include the hunk that actually sets the quirk.

thanks for your review.
We will set up the quirk in exynos ufs driver.
I will upload the patch together in v2 patchs.

> 
> Also please work on the commit log formatting.

I'll erase the change-id log next patch too. Thank you.

> 
> > Change-Id: Ie528726b29bcb643149440bf1c90eaa5995c5ac1
> 
> This kind of crap has no business in a commit log.

Best Regards,
Jongmin jeong
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 4ba3bbf14df0..ec663cb58233 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2318,6 +2318,9 @@  int ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd)
 	int ret;
 	unsigned long flags;
 
+	if (hba->quirks & UFSHCD_QUIRK_BROKEN_UIC_CMD)
+		return 0;
+
 	ufshcd_hold(hba, false);
 	mutex_lock(&hba->uic_cmd_mutex);
 	ufshcd_add_delay_before_dme_cmd(hba);
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 0f0e62bfdafd..4a929bf7cf8e 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -569,6 +569,12 @@  enum ufshcd_quirks {
 	 * This quirk allows only sg entries aligned with page size.
 	 */
 	UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE		= 1 << 14,
+
+	/*
+	 * This quirk needs to be enabled if the host controller does not
+	 * support UIC command
+	 */
+	UFSHCD_QUIRK_BROKEN_UIC_CMD			= 1 << 15,
 };
 
 enum ufshcd_caps {