From 2d5ae6b787cd1a56aaf53496a8362dae395dab3e Mon Sep 17 00:00:00 2001 From: jongmin jeong Date: Tue, 23 Feb 2021 18:35:45 +0900 Subject: [PATCH] FROMLIST: scsi: ufs: add quirk to handle broken UIC command 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. Signed-off-by: jongmin jeong Link: https://lore.kernel.org/linux-scsi/20210709065711.25195-2-chanho61.park@samsung.com/ Bug: 190689163 Signed-off-by: Chanho Park Change-Id: Ie528726b29bcb643149440bf1c90eaa5995c5ac1 --- 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 ad19187c8185..d2226800c65b 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 e8683aa64b78..0719df84d5bb 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -565,6 +565,12 @@ enum ufshcd_quirks { */ 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, + /* * This quirk needs to be enabled if the host controller supports inline * encryption, but it needs to initialize the crypto capabilities in a