linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chanho Park <chanho61.park@samsung.com>
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>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Gyunghoon Kwon <goodjob.kwon@samsung.com>,
	Sowon Na <sowon.na@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 v5 01/15] scsi: ufs: add quirk to handle broken UIC command
Date: Mon, 18 Oct 2021 21:42:02 +0900	[thread overview]
Message-ID: <20211018124216.153072-2-chanho61.park@samsung.com> (raw)
In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com>

From: jongmin jeong <jjmin.jeong@samsung.com>

samsung ExynosAuto9 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.

Cc: 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>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
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(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index bd5a088f12c4..3dbfae32599c 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2323,6 +2323,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 64ce723327b9..5d39aeb2bccb 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -589,6 +589,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 {
-- 
2.33.0


  parent reply	other threads:[~2021-10-18 12:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20211018124505epcas2p31437a0fae6711edeb9db5b49eb420e56@epcas2p3.samsung.com>
2021-10-18 12:42 ` [PATCH v5 00/15] introduce exynosauto v9 ufs driver Chanho Park
     [not found]   ` <CGME20211018124505epcas2p2d149a4f26d3475830a36c47049591bb2@epcas2p2.samsung.com>
2021-10-18 12:42     ` Chanho Park [this message]
2021-10-28  3:18       ` [PATCH v5 01/15] scsi: ufs: add quirk to handle broken UIC command Martin K. Petersen
2021-10-28  4:32         ` Chanho Park
     [not found]   ` <CGME20211018124505epcas2p143bb8374e3399e2670ced625862a8653@epcas2p1.samsung.com>
2021-10-18 12:42     ` [PATCH v5 02/15] scsi: ufs: add quirk to enable host controller without ph configuration Chanho Park
     [not found]   ` <CGME20211018124505epcas2p4f96cd4d9ea01a030d07fdf25c5a3d163@epcas2p4.samsung.com>
2021-10-18 12:42     ` [PATCH v5 03/15] scsi: ufs: ufs-exynos: change pclk available max value Chanho Park
     [not found]   ` <CGME20211018124505epcas2p22a463738c9ee028274be7ad06ed97a0d@epcas2p2.samsung.com>
2021-10-18 12:42     ` [PATCH v5 04/15] scsi: ufs: ufs-exynos: simplify drv_data retrieval Chanho Park
     [not found]   ` <CGME20211018124505epcas2p32c65e409d95954c4995f8a1c22842509@epcas2p3.samsung.com>
2021-10-18 12:42     ` [PATCH v5 05/15] scsi: ufs: ufs-exynos: add refclkout_stop control Chanho Park
     [not found]   ` <CGME20211018124505epcas2p1d58eebe57563823e4768962342477a35@epcas2p1.samsung.com>
2021-10-18 12:42     ` [PATCH v5 06/15] scsi: ufs: ufs-exynos: add setup_clocks callback Chanho Park
     [not found]   ` <CGME20211018124505epcas2p2c68234b4e04cd3149eb21c987d474755@epcas2p2.samsung.com>
2021-10-18 12:42     ` [PATCH v5 07/15] scsi: ufs: ufs-exynos: support custom version of ufs_hba_variant_ops Chanho Park
     [not found]   ` <CGME20211018124505epcas2p4bf7f7fe8419a03d5510c9adf67aee5ab@epcas2p4.samsung.com>
2021-10-18 12:42     ` [PATCH v5 08/15] scsi: ufs: ufs-exynos: add EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR option Chanho Park
     [not found]   ` <CGME20211018124505epcas2p38f13fa432c4f6e5ca4898a8f41c2b041@epcas2p3.samsung.com>
2021-10-18 12:42     ` [PATCH v5 09/15] scsi: ufs: ufs-exynos: factor out priv data init Chanho Park
     [not found]   ` <CGME20211018124505epcas2p37bd15e319f80e82d321f85565afd7712@epcas2p3.samsung.com>
2021-10-18 12:42     ` [PATCH v5 10/15] scsi: ufs: ufs-exynos: add pre/post_hce_enable drv callbacks Chanho Park
     [not found]   ` <CGME20211018124506epcas2p27ae65b5e8ee4919cde0d989708c24ca6@epcas2p2.samsung.com>
2021-10-18 12:42     ` [PATCH v5 11/15] scsi: ufs: ufs-exynos: support exynosauto v9 ufs driver Chanho Park
     [not found]   ` <CGME20211018124506epcas2p25100e2163029de4ee8b8b87e7ff0f2a3@epcas2p2.samsung.com>
2021-10-18 12:42     ` [PATCH v5 12/15] dt-bindings: ufs: exynos-ufs: add io-coherency property Chanho Park
2021-10-18 17:54       ` Rob Herring
     [not found]   ` <CGME20211018124506epcas2p4cadea8f87fde299c22317496a2d29f14@epcas2p4.samsung.com>
2021-10-18 12:42     ` [PATCH v5 13/15] scsi: ufs: ufs-exynos: multi-host configuration for exynosauto Chanho Park
     [not found]   ` <CGME20211018124506epcas2p3a014f68fb3d6cdfa43a3562c74bb6895@epcas2p3.samsung.com>
2021-10-18 12:42     ` [PATCH v5 14/15] scsi: ufs: ufs-exynos: introduce exynosauto v9 virtual host Chanho Park
     [not found]   ` <CGME20211018124506epcas2p190b89643fbb14d99d7ab52f5ab97bf38@epcas2p1.samsung.com>
2021-10-18 12:42     ` [PATCH v5 15/15] dt-bindings: ufs: exynos-ufs: add exynosautov9 compatible Chanho Park
2021-10-28 13:26   ` [PATCH v5 00/15] introduce exynosauto v9 ufs driver Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211018124216.153072-2-chanho61.park@samsung.com \
    --to=chanho61.park@samsung.com \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=goodjob.kwon@samsung.com \
    --cc=hch@infradead.org \
    --cc=jaegeuk@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=jh80.chung@samsung.com \
    --cc=jjmin.jeong@samsung.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sowon.na@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).