aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaeyoon Choi <jaeyoon@FreeBSD.org>2026-08-10 01:30:11 +0000
committerJaeyoon Choi <jaeyoon@FreeBSD.org>2026-08-10 02:28:46 +0000
commitcf04a05424f1a79e55303de252e5873abeae7b88 (patch)
treee71806c3f7d25d0a3aa359cac4b68e49d275e068
parent880865783d9c3b807a26f4ea8ab3ef6ce1ca6ff8 (diff)
ufshci: fix data direction encoding for read commands
The data_direction field in the UTP Transfer Request Descriptor is only 2 bits wide ([26:25]). UFSHCI_DATA_DIRECTION_FROM_TGT_TO_SYS was defined as 0x10, which truncates to 0b00 (No data transfer) when stored into the 2-bit field, so every read command was described to the controller as having no data phase. Only writes (0b01) happened to be encoded correctly. Define all values as 2-bit binary literals, matching the existing RESERVED = 0b11 entry, so read is encoded as 0b10 as required by the specification. Sponsored by: Samsung Electronics Reviewed by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D58652
-rw-r--r--sys/dev/ufshci/ufshci.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ufshci/ufshci.h b/sys/dev/ufshci/ufshci.h
index 766d8de0535b..c2bef5c9a807 100644
--- a/sys/dev/ufshci/ufshci.h
+++ b/sys/dev/ufshci/ufshci.h
@@ -154,9 +154,9 @@ enum ufshci_command_type {
};
enum ufshci_data_direction {
- UFSHCI_DATA_DIRECTION_NO_DATA_TRANSFER = 0x00,
- UFSHCI_DATA_DIRECTION_FROM_SYS_TO_TGT = 0x01,
- UFSHCI_DATA_DIRECTION_FROM_TGT_TO_SYS = 0x10,
+ UFSHCI_DATA_DIRECTION_NO_DATA_TRANSFER = 0b00,
+ UFSHCI_DATA_DIRECTION_FROM_SYS_TO_TGT = 0b01,
+ UFSHCI_DATA_DIRECTION_FROM_TGT_TO_SYS = 0b10,
UFSHCI_DATA_DIRECTION_RESERVED = 0b11,
};