[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221102053058.21021-2-lijiaming3@xiaomi.corp-partner.google.com>
Date: Wed, 2 Nov 2022 13:30:55 +0800
From: Jiaming Li <lijiaming3@...omi.corp-partner.google.com>
To: alim.akhtar@...sung.com, avri.altman@....com, bvanassche@....org
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
lijiaming3 <lijiaming3@...omi.com>
Subject: [RESEND PATCH 1/4] scsi:ufs:remove sanity check
From: lijiaming3 <lijiaming3@...omi.com>
UFS descriptors assumed to have a 2 bytes header:
- Offset 0 - descriptor size
- Offset 1 - descriptor id
However, the ufs spec does not mandates this, and as a matter of
fact, QUERY_DESC_DESC_TYPE_OFFSET is not being used anymore now.
And future descriptors no longer follow this assumption. So
remove this as preparation of introducing the FBO descriptor.
Signed-off-by: lijiaming3 <lijiaming3@...omi.com>
---
drivers/ufs/core/ufshcd.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index b1f59a5fe632..4bc5b8563a62 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -3458,14 +3458,6 @@ int ufshcd_read_desc_param(struct ufs_hba *hba,
goto out;
}
- /* Sanity check */
- if (desc_buf[QUERY_DESC_DESC_TYPE_OFFSET] != desc_id) {
- dev_err(hba->dev, "%s: invalid desc_id %d in descriptor header\n",
- __func__, desc_buf[QUERY_DESC_DESC_TYPE_OFFSET]);
- ret = -EINVAL;
- goto out;
- }
-
/* Update descriptor length */
buff_len = desc_buf[QUERY_DESC_LENGTH_OFFSET];
ufshcd_update_desc_length(hba, desc_id, desc_index, buff_len);
--
2.38.1
Powered by blists - more mailing lists