diff mbox series

[v3,02/17] scsi: ufs: add quirk to enable host controller without ph configuration

Message ID 20210917065436.145629-3-chanho61.park@samsung.com (mailing list archive)
State Superseded
Headers show
Series [v3,01/17] scsi: ufs: add quirk to handle broken UIC command | expand

Commit Message

Chanho Park Sept. 17, 2021, 6:54 a.m. UTC
From: jongmin jeong <jjmin.jeong@samsung.com>

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 like device management.
This patch skips the physical host interface configuration part that cannot
be performed in the virtual host.

Suggested-by: Alim Akhtar <alim.akhtar@samsung.com>
Cc: James E.J. Bottomley <jejb@linux.ibm.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: jongmin jeong <jjmin.jeong@samsung.com>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 drivers/scsi/ufs/ufshcd.c | 3 +++
 drivers/scsi/ufs/ufshcd.h | 6 ++++++
 2 files changed, 9 insertions(+)

Comments

Alim Akhtar Sept. 23, 2021, 3:48 a.m. UTC | #1
>-----Original Message-----
>From: Chanho Park [mailto:chanho61.park@samsung.com]
>Sent: Friday, September 17, 2021 12:24 PM
>To: Alim Akhtar <alim.akhtar@samsung.com>; Avri Altman
><avri.altman@wdc.com>; James E . J . Bottomley <jejb@linux.ibm.com>; Martin
>K . Petersen <martin.petersen@oracle.com>; Krzysztof Kozlowski
><krzysztof.kozlowski@canonical.com>
>Cc: Bean Huo <beanhuo@micron.com>; Bart Van Assche
><bvanassche@acm.org>; Adrian Hunter <adrian.hunter@intel.com>; Christoph
>Hellwig <hch@infradead.org>; Can Guo <cang@codeaurora.org>; Jaegeuk Kim
><jaegeuk@kernel.org>; Gyunghoon Kwon <goodjob.kwon@samsung.com>;
>linux-samsung-soc@vger.kernel.org; linux-scsi@vger.kernel.org; jongmin jeong
><jjmin.jeong@samsung.com>; Chanho Park <chanho61.park@samsung.com>
>Subject: [PATCH v3 02/17] scsi: ufs: add quirk to enable host controller without ph
>configuration
>
>From: jongmin jeong <jjmin.jeong@samsung.com>
>
>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 like device management.
>This patch skips the physical host interface configuration part that cannot be
>performed in the virtual host.
>
>Suggested-by: Alim Akhtar <alim.akhtar@samsung.com>
>Cc: James E.J. Bottomley <jejb@linux.ibm.com>
>Cc: Martin K. Petersen <martin.petersen@oracle.com>
>Cc: Bart Van Assche <bvanassche@acm.org>
>Signed-off-by: jongmin jeong <jjmin.jeong@samsung.com>
>Signed-off-by: Chanho Park <chanho61.park@samsung.com>
>---

Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>

> drivers/scsi/ufs/ufshcd.c | 3 +++
> drivers/scsi/ufs/ufshcd.h | 6 ++++++
> 2 files changed, 9 insertions(+)
>
>diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index
>8a45e8c05965..628ef8e17531 100644
>--- a/drivers/scsi/ufs/ufshcd.c
>+++ b/drivers/scsi/ufs/ufshcd.c
>@@ -8066,6 +8066,9 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool
>init_dev_params)
> 	if (ret)
> 		goto out;
>
>+	if (hba->quirks & UFSHCD_QUIRK_SKIP_PH_CONFIGURATION)
>+		goto out;
>+
> 	/* Debug counters initialization */
> 	ufshcd_clear_dbg_ufs_stats(hba);
>
>diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index
>e1d8fd432614..e547fbd19d49 100644
>--- a/drivers/scsi/ufs/ufshcd.h
>+++ b/drivers/scsi/ufs/ufshcd.h
>@@ -594,6 +594,12 @@ enum ufshcd_quirks {
> 	 * support UIC command
> 	 */
> 	UFSHCD_QUIRK_BROKEN_UIC_CMD			= 1 << 15,
>+
>+	/*
>+	 * This quirk needs to be enabled if the host controller cannot
>+	 * support physical host configuration.
>+	 */
>+	UFSHCD_QUIRK_SKIP_PH_CONFIGURATION		= 1 << 16,
> };
>
> enum ufshcd_caps {
>--
>2.33.0
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 8a45e8c05965..628ef8e17531 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -8066,6 +8066,9 @@  static int ufshcd_probe_hba(struct ufs_hba *hba, bool init_dev_params)
 	if (ret)
 		goto out;
 
+	if (hba->quirks & UFSHCD_QUIRK_SKIP_PH_CONFIGURATION)
+		goto out;
+
 	/* Debug counters initialization */
 	ufshcd_clear_dbg_ufs_stats(hba);
 
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index e1d8fd432614..e547fbd19d49 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -594,6 +594,12 @@  enum ufshcd_quirks {
 	 * support UIC command
 	 */
 	UFSHCD_QUIRK_BROKEN_UIC_CMD			= 1 << 15,
+
+	/*
+	 * This quirk needs to be enabled if the host controller cannot
+	 * support physical host configuration.
+	 */
+	UFSHCD_QUIRK_SKIP_PH_CONFIGURATION		= 1 << 16,
 };
 
 enum ufshcd_caps {