Re: [PATCH V3] scsi: ufs: core: Check LSDBS cap when !mcq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/7/24 10:25 PM, Kyoungrul Kim wrote:
if the user set use_mcq_mode to 0, the host will try to activate the

set -> sets

lsdb mode unconditionally even when the lsdbs of device hci cap is 1. so
it makes timeout cmds and fail to device probing.

+	/*
+	 * UFS 3.0 has no MCQ_SUPPORT and LSDB_SUPPORT, but [31:29] as reserved
+	 * bits with reset value 0s, which means we can simply read values
+	 * regardless to version
+	 */

Please change "UFS 3.0 has no" into "The UFSHCI 3.0 specification does
not define"

  	hba->mcq_sup = FIELD_GET(MASK_MCQ_SUPPORT, hba->capabilities);
+	/*
+	 * 0h: legacy single doorbell support is available
+	 * 1h: indicate that legacy single doorbell support have been removed
+	 */

have -> has

+	hba->lsdb_sup = !FIELD_GET(MASK_LSDB_SUPPORT, hba->capabilities);
  	if (!hba->mcq_sup)
  		return 0;
@@ -10449,6 +10459,12 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
  	}
if (!is_mcq_supported(hba)) {
+		if (!hba->lsdb_sup) {
+			dev_err(hba->dev, "%s: failed to initialize (legacy doorbell mode not supported\n",
+				__func__);

A closing parenthesis is missing (")").

diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index bad88bd91995..fd391f6eee73 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -1074,6 +1074,7 @@ struct ufs_hba {
  	bool ext_iid_sup;
  	bool scsi_host_added;
  	bool mcq_sup;
+	bool lsdb_sup;
  	bool mcq_enabled;
  	struct ufshcd_res_info res[RES_MAX];
  	void __iomem *mcq_base;

Please update the kernel-doc comment above struct ufs_hba for the new
lsdb_sup member and please move the new member above mcq_sup such that
the mcq_sup and mcq_enabled definitions remain adjacent.

Thanks,

Bart.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux