git: 0f515c0a9748 - main - ufshci: Remove UIC error during initialization

From: Jaeyoon Choi <jaeyoon_at_FreeBSD.org>
Date: Thu, 05 Feb 2026 00:10:56 UTC
The branch main has been updated by jaeyoon:

URL: https://cgit.FreeBSD.org/src/commit/?id=0f515c0a97489d8d35aca7f5e28c28b22f217dc9

commit 0f515c0a97489d8d35aca7f5e28c28b22f217dc9
Author:     Jaeyoon Choi <jaeyoon@FreeBSD.org>
AuthorDate: 2026-02-04 23:53:01 +0000
Commit:     Jaeyoon Choi <jaeyoon@FreeBSD.org>
CommitDate: 2026-02-05 00:05:14 +0000

    ufshci: Remove UIC error during initialization
    
    This patch removes the UIC error caused by QEMU not supporting certain
    UIC command. Additionally, it removes the unused unipro_version.
    
    Reviewed by:            imp (mentor)
    Sponsored by:           Samsung Electronics
    Differential Revision:  https://reviews.freebsd.org/D54513
---
 sys/dev/ufshci/ufshci_dev.c     | 55 +++++++++++++++++------------------------
 sys/dev/ufshci/ufshci_private.h |  3 ---
 2 files changed, 23 insertions(+), 35 deletions(-)

diff --git a/sys/dev/ufshci/ufshci_dev.c b/sys/dev/ufshci/ufshci_dev.c
index 406130c537a7..3167945b53b6 100644
--- a/sys/dev/ufshci/ufshci_dev.c
+++ b/sys/dev/ufshci/ufshci_dev.c
@@ -273,40 +273,31 @@ ufshci_dev_init_unipro(struct ufshci_controller *ctrlr)
 	uint32_t pa_granularity, peer_pa_granularity;
 	uint32_t t_activate, pear_t_activate;
 
-	/*
-	 * Unipro Version:
-	 * - 7~15 = Above 2.0, 6 = 2.0, 5 = 1.8, 4 = 1.61, 3 = 1.6, 2 = 1.41,
-	 * 1 = 1.40, 0 = Reserved
-	 */
-	if (ufshci_uic_send_dme_get(ctrlr, PA_LocalVerInfo,
-		&ctrlr->unipro_version))
-		return (ENXIO);
-	if (ufshci_uic_send_dme_get(ctrlr, PA_RemoteVerInfo,
-		&ctrlr->ufs_dev.unipro_version))
-		return (ENXIO);
-
-	/*
-	 * PA_Granularity: Granularity for PA_TActivate and PA_Hibern8Time
-	 * - 1=1us, 2=4us, 3=8us, 4=16us, 5=32us, 6=100us
-	 */
-	if (ufshci_uic_send_dme_get(ctrlr, PA_Granularity, &pa_granularity))
-		return (ENXIO);
-	if (ufshci_uic_send_dme_peer_get(ctrlr, PA_Granularity,
-		&peer_pa_granularity))
-		return (ENXIO);
+	if (ctrlr->quirks & UFSHCI_QUIRK_LONG_PEER_PA_TACTIVATE) {
+		/*
+		 * PA_Granularity: Granularity for PA_TActivate and
+		 * PA_Hibern8Time
+		 * - 1=1us, 2=4us, 3=8us, 4=16us, 5=32us, 6=100us
+		 */
+		if (ufshci_uic_send_dme_get(ctrlr, PA_Granularity,
+			&pa_granularity))
+			return (ENXIO);
+		if (ufshci_uic_send_dme_peer_get(ctrlr, PA_Granularity,
+			&peer_pa_granularity))
+			return (ENXIO);
 
-	/*
-	 * PA_TActivate: Time to wait before activating a burst in order to
-	 * wake-up peer M-RX
-	 * UniPro automatically sets timing information such as PA_TActivate
-	 * through the PACP_CAP_EXT1_ind command during Link Startup operation.
-	 */
-	if (ufshci_uic_send_dme_get(ctrlr, PA_TActivate, &t_activate))
-		return (ENXIO);
-	if (ufshci_uic_send_dme_peer_get(ctrlr, PA_TActivate, &pear_t_activate))
-		return (ENXIO);
+		/*
+		 * PA_TActivate: Time to wait before activating a burst in order
+		 * to wake-up peer M-RX UniPro automatically sets timing
+		 * information such as PA_TActivate through the
+		 * PACP_CAP_EXT1_ind command during Link Startup operation.
+		 */
+		if (ufshci_uic_send_dme_get(ctrlr, PA_TActivate, &t_activate))
+			return (ENXIO);
+		if (ufshci_uic_send_dme_peer_get(ctrlr, PA_TActivate,
+			&pear_t_activate))
+			return (ENXIO);
 
-	if (ctrlr->quirks & UFSHCI_QUIRK_LONG_PEER_PA_TACTIVATE) {
 		/*
 		 * Intel Lake-field UFSHCI has a quirk. We need to add 200us to
 		 * the PEER's PA_TActivate.
diff --git a/sys/dev/ufshci/ufshci_private.h b/sys/dev/ufshci/ufshci_private.h
index b57142bf58fc..1634cf51c9fb 100644
--- a/sys/dev/ufshci/ufshci_private.h
+++ b/sys/dev/ufshci/ufshci_private.h
@@ -278,8 +278,6 @@ struct ufshci_device {
 	struct ufshci_device_descriptor dev_desc;
 	struct ufshci_geometry_descriptor geo_desc;
 
-	uint32_t unipro_version;
-
 	/* WriteBooster */
 	bool is_wb_enabled;
 	bool is_wb_flush_enabled;
@@ -398,7 +396,6 @@ struct ufshci_controller {
 
 	/* UFS Interconnect Layer (UIC) */
 	struct mtx uic_cmd_lock;
-	uint32_t unipro_version;
 	uint8_t hs_gear;
 	uint32_t tx_lanes;
 	uint32_t rx_lanes;