History log of /src/sys/dev/ufshci/ufshci_req_queue.c (Results 1 – 18 of 18)
Revision Date Author Comments
# ece6e062 05-Jan-2026 Jaeyoon Choi <jaeyoon@FreeBSD.org>

ufshci: Enable admin command retry

Also, This patch fixes an issue where the admin command flag was not
passed through.

Sponsored by: Samsung Electronic

Reviewed by: imp
Differential Rev

ufshci: Enable admin command retry

Also, This patch fixes an issue where the admin command flag was not
passed through.

Sponsored by: Samsung Electronic

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54244

show more ...


# ef2d7cc1 05-Jan-2026 Jaeyoon Choi <jaeyoon@FreeBSD.org>

ufshci: Fix task management queue num_trackers on failure path

Fix a kernel panic caused by the task management queue using
the transfer request queue’s num_entries value.

Sponsored by: S

ufshci: Fix task management queue num_trackers on failure path

Fix a kernel panic caused by the task management queue using
the transfer request queue’s num_entries value.

Sponsored by: Samsung Electronic

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54243

show more ...


# 3a99f31f 03-Dec-2025 Jaeyoon Choi <jaeyoon@FreeBSD.org>

ufshci: Support suspend/resume

Handle system power events and issue START STOP UNIT (SSU) to the
UFS Device WLUN (0x50).

Reviewed by: imp (mentor)
Sponsored by: Samsung Electronics
Differential R

ufshci: Support suspend/resume

Handle system power events and issue START STOP UNIT (SSU) to the
UFS Device WLUN (0x50).

Reviewed by: imp (mentor)
Sponsored by: Samsung Electronics
Differential Revision: https://reviews.freebsd.org/D54002

show more ...


# 6b841d70 18-Sep-2025 Jaeyoon Choi <jaeyoon@FreeBSD.org>

ufshci: revisit controller reset path and add I/O timeout handling

This patch revisits the controller reset path and introduces timeout
handling for I/O commands.

To support controller reset during

ufshci: revisit controller reset path and add I/O timeout handling

This patch revisits the controller reset path and introduces timeout
handling for I/O commands.

To support controller reset during driver operation, the controller’s
construct, destruct, enable, and disable functions are clearly
separated in ufshci_ctrlr.c. ufshci_ctrlr_hw_reset() function is
added to leverage enable/disable.

After initialization, ufshci_ctrlr_reset_task() is also introduced to
ensure controller resets are performed via the task queue.

Timeout handling is designed in five steps. This patch implements
Step 1 and Step 5, while the remaining steps will be added later.
The timeout mechanism follows the same shared timeout model used in
the NVMe driver.

Test: Intentionally delayed UPIU I/O in QEMU to trigger a timeout and
verify timeout handling.

Sponsored by: Samsung Electronics
Reviewed by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D52440

show more ...


# 2be8ce84 16-Aug-2025 Jaeyoon Choi <j_yoon.choi@samsung.com>

ufshci: Add functions for UTP Task Management

This commit adds UTP Task Management Request functions and revisits the
UTR/UTRM construction logic.
It also introduces ufshci_ctrlr_cmd_send_task_mgmt_

ufshci: Add functions for UTP Task Management

This commit adds UTP Task Management Request functions and revisits the
UTR/UTRM construction logic.
It also introduces ufshci_ctrlr_cmd_send_task_mgmt_request(), which
will be used for timeout handling in a follow-up commit.

Test: I temporarily added the code below to the ufshci_ctrlr_start()
function to test it on a Galaxy Book S.
```
static void
ufshci_ctrlr_start(struct ufshci_controller *ctrlr)
{
...
/* Test: Task Mangement Request */
ufshci_printf(ctrlr,
"Test: Task Mangement Request\n");
struct ufshci_completion_poll_status status;
status.done = 0;
ufshci_ctrlr_cmd_send_task_mgmt_request(ctrlr,
ufshci_completion_poll_cb, &status,
UFSHCI_TASK_MGMT_FUNCTION_QUERY_TASK, 0, 0, 0);
ufshci_completion_poll(&status);
if (status.error) {
ufshci_printf(ctrlr,
"ufshci_ctrlr_cmd_send_task_mgmt_request failed!\n");
return;
}
uint32_t service_response;
service_response =
status.cpl.response_upiu.task_mgmt_response_upiu.output_param1;
ufshci_printf(ctrlr, "Task Management Service Response = 0x%x\n",
service_response);
...
}
```

Sponsored by: Samsung Electronics
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D51506

show more ...


# 1349a733 13-Jun-2025 Jaeyoon Choi <j_yoon.choi@samsung.com>

ufshci: Introduce the ufshci(4) driver

This commit adds a storage driver that supports the Universal Flash
Storage Host Controller Interface (UFSHCI) on FreeBSD.

Universal Flash Storage (UFS) is a

ufshci: Introduce the ufshci(4) driver

This commit adds a storage driver that supports the Universal Flash
Storage Host Controller Interface (UFSHCI) on FreeBSD.

Universal Flash Storage (UFS) is a flash-based mobile storage device
that replaces eMMC, aiming for high performance with low power. The UFS
Host Controller Interface (UFSHCI) is the host side controller and
connects UFS device to a system bus, such as PCIe.

The code targets the latest standards:
- UFS 4.1: https://www.jedec.org/standards-documents/docs/jesd220g
- UFSHCI 4.1: https://www.jedec.org/standards-documents/docs/jesd223f

The ufshci(4) driver implements controller/device initialization,
interrupt, single-doorbell(SDB) queue based IO requests. Support for
multi-queue (MCQ) IO requests is planned for a later commit.

Implemented features:
- PCIe bus support
- legacy(INTx) Interrupt Handling
- UIC command support
- UTP Transfer Request (UTR) support
- UTP Task Management Request (UTMR) support
- single doorbell queue (SDB) with multiple queue depth
- SCSI command set support
- sysctl

Work in progress:
- multi-Circular Queue (per-CPU IO queues)
- MSI-X interrupt Support
- write booster
- write Protect
- Host Performance Booster (HPB)
- interrupt aggregation
- ARM based system bus support
- ufs-utils port

Tests were performed on QEMU and an Intel-based laptop.
Since QEMU has an emulated UFS device, I tested on QEMU.

How to test on QEMU:
1. Run QEMU
$ qemu-system-x86_64 ... -device ufs -drive file=blk1g.bin,format=raw,if=none,id=luimg -device ufs-lu,drive=luimg,lun=0
2. Loading/unloading the ufshci module on QEMU
$ kldload /usr/obj/usr/src/amd64.amd64/sys/modules/ufshci/ufshci.ko
$ kldunload ufshci

Testing on real hardware:
- Samsung Galaxy Book S (Intel Lakefield) with UFS 3.0
- Lenovo duet 3 11ian8 (Intel N100) with UFS 2.1

Sponsored by: Samsung Electronics
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D50370

show more ...


# ece6e062 05-Jan-2026 Jaeyoon Choi <jaeyoon@FreeBSD.org>

ufshci: Enable admin command retry

Also, This patch fixes an issue where the admin command flag was not
passed through.

Sponsored by: Samsung Electronic

Reviewed by: imp
Differential Rev

ufshci: Enable admin command retry

Also, This patch fixes an issue where the admin command flag was not
passed through.

Sponsored by: Samsung Electronic

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54244

show more ...


# ef2d7cc1 05-Jan-2026 Jaeyoon Choi <jaeyoon@FreeBSD.org>

ufshci: Fix task management queue num_trackers on failure path

Fix a kernel panic caused by the task management queue using
the transfer request queue’s num_entries value.

Sponsored by: S

ufshci: Fix task management queue num_trackers on failure path

Fix a kernel panic caused by the task management queue using
the transfer request queue’s num_entries value.

Sponsored by: Samsung Electronic

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54243

show more ...


# 3a99f31f 03-Dec-2025 Jaeyoon Choi <jaeyoon@FreeBSD.org>

ufshci: Support suspend/resume

Handle system power events and issue START STOP UNIT (SSU) to the
UFS Device WLUN (0x50).

Reviewed by: imp (mentor)
Sponsored by: Samsung Electronics
Differential R

ufshci: Support suspend/resume

Handle system power events and issue START STOP UNIT (SSU) to the
UFS Device WLUN (0x50).

Reviewed by: imp (mentor)
Sponsored by: Samsung Electronics
Differential Revision: https://reviews.freebsd.org/D54002

show more ...


# 6b841d70 18-Sep-2025 Jaeyoon Choi <jaeyoon@FreeBSD.org>

ufshci: revisit controller reset path and add I/O timeout handling

This patch revisits the controller reset path and introduces timeout
handling for I/O commands.

To support controller reset during

ufshci: revisit controller reset path and add I/O timeout handling

This patch revisits the controller reset path and introduces timeout
handling for I/O commands.

To support controller reset during driver operation, the controller’s
construct, destruct, enable, and disable functions are clearly
separated in ufshci_ctrlr.c. ufshci_ctrlr_hw_reset() function is
added to leverage enable/disable.

After initialization, ufshci_ctrlr_reset_task() is also introduced to
ensure controller resets are performed via the task queue.

Timeout handling is designed in five steps. This patch implements
Step 1 and Step 5, while the remaining steps will be added later.
The timeout mechanism follows the same shared timeout model used in
the NVMe driver.

Test: Intentionally delayed UPIU I/O in QEMU to trigger a timeout and
verify timeout handling.

Sponsored by: Samsung Electronics
Reviewed by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D52440

show more ...


# 2be8ce84 16-Aug-2025 Jaeyoon Choi <j_yoon.choi@samsung.com>

ufshci: Add functions for UTP Task Management

This commit adds UTP Task Management Request functions and revisits the
UTR/UTRM construction logic.
It also introduces ufshci_ctrlr_cmd_send_task_mgmt_

ufshci: Add functions for UTP Task Management

This commit adds UTP Task Management Request functions and revisits the
UTR/UTRM construction logic.
It also introduces ufshci_ctrlr_cmd_send_task_mgmt_request(), which
will be used for timeout handling in a follow-up commit.

Test: I temporarily added the code below to the ufshci_ctrlr_start()
function to test it on a Galaxy Book S.
```
static void
ufshci_ctrlr_start(struct ufshci_controller *ctrlr)
{
...
/* Test: Task Mangement Request */
ufshci_printf(ctrlr,
"Test: Task Mangement Request\n");
struct ufshci_completion_poll_status status;
status.done = 0;
ufshci_ctrlr_cmd_send_task_mgmt_request(ctrlr,
ufshci_completion_poll_cb, &status,
UFSHCI_TASK_MGMT_FUNCTION_QUERY_TASK, 0, 0, 0);
ufshci_completion_poll(&status);
if (status.error) {
ufshci_printf(ctrlr,
"ufshci_ctrlr_cmd_send_task_mgmt_request failed!\n");
return;
}
uint32_t service_response;
service_response =
status.cpl.response_upiu.task_mgmt_response_upiu.output_param1;
ufshci_printf(ctrlr, "Task Management Service Response = 0x%x\n",
service_response);
...
}
```

Sponsored by: Samsung Electronics
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D51506

show more ...


# 1349a733 13-Jun-2025 Jaeyoon Choi <j_yoon.choi@samsung.com>

ufshci: Introduce the ufshci(4) driver

This commit adds a storage driver that supports the Universal Flash
Storage Host Controller Interface (UFSHCI) on FreeBSD.

Universal Flash Storage (UFS) is a

ufshci: Introduce the ufshci(4) driver

This commit adds a storage driver that supports the Universal Flash
Storage Host Controller Interface (UFSHCI) on FreeBSD.

Universal Flash Storage (UFS) is a flash-based mobile storage device
that replaces eMMC, aiming for high performance with low power. The UFS
Host Controller Interface (UFSHCI) is the host side controller and
connects UFS device to a system bus, such as PCIe.

The code targets the latest standards:
- UFS 4.1: https://www.jedec.org/standards-documents/docs/jesd220g
- UFSHCI 4.1: https://www.jedec.org/standards-documents/docs/jesd223f

The ufshci(4) driver implements controller/device initialization,
interrupt, single-doorbell(SDB) queue based IO requests. Support for
multi-queue (MCQ) IO requests is planned for a later commit.

Implemented features:
- PCIe bus support
- legacy(INTx) Interrupt Handling
- UIC command support
- UTP Transfer Request (UTR) support
- UTP Task Management Request (UTMR) support
- single doorbell queue (SDB) with multiple queue depth
- SCSI command set support
- sysctl

Work in progress:
- multi-Circular Queue (per-CPU IO queues)
- MSI-X interrupt Support
- write booster
- write Protect
- Host Performance Booster (HPB)
- interrupt aggregation
- ARM based system bus support
- ufs-utils port

Tests were performed on QEMU and an Intel-based laptop.
Since QEMU has an emulated UFS device, I tested on QEMU.

How to test on QEMU:
1. Run QEMU
$ qemu-system-x86_64 ... -device ufs -drive file=blk1g.bin,format=raw,if=none,id=luimg -device ufs-lu,drive=luimg,lun=0
2. Loading/unloading the ufshci module on QEMU
$ kldload /usr/obj/usr/src/amd64.amd64/sys/modules/ufshci/ufshci.ko
$ kldunload ufshci

Testing on real hardware:
- Samsung Galaxy Book S (Intel Lakefield) with UFS 3.0
- Lenovo duet 3 11ian8 (Intel N100) with UFS 2.1

Sponsored by: Samsung Electronics
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D50370

show more ...


# ece6e062 05-Jan-2026 Jaeyoon Choi <jaeyoon@FreeBSD.org>

ufshci: Enable admin command retry

Also, This patch fixes an issue where the admin command flag was not
passed through.

Sponsored by: Samsung Electronic

Reviewed by: imp
Differential Rev

ufshci: Enable admin command retry

Also, This patch fixes an issue where the admin command flag was not
passed through.

Sponsored by: Samsung Electronic

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54244

show more ...


# ef2d7cc1 05-Jan-2026 Jaeyoon Choi <jaeyoon@FreeBSD.org>

ufshci: Fix task management queue num_trackers on failure path

Fix a kernel panic caused by the task management queue using
the transfer request queue’s num_entries value.

Sponsored by: S

ufshci: Fix task management queue num_trackers on failure path

Fix a kernel panic caused by the task management queue using
the transfer request queue’s num_entries value.

Sponsored by: Samsung Electronic

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54243

show more ...


# 3a99f31f 03-Dec-2025 Jaeyoon Choi <jaeyoon@FreeBSD.org>

ufshci: Support suspend/resume

Handle system power events and issue START STOP UNIT (SSU) to the
UFS Device WLUN (0x50).

Reviewed by: imp (mentor)
Sponsored by: Samsung Electronics
Differential R

ufshci: Support suspend/resume

Handle system power events and issue START STOP UNIT (SSU) to the
UFS Device WLUN (0x50).

Reviewed by: imp (mentor)
Sponsored by: Samsung Electronics
Differential Revision: https://reviews.freebsd.org/D54002

show more ...


# 6b841d70 18-Sep-2025 Jaeyoon Choi <jaeyoon@FreeBSD.org>

ufshci: revisit controller reset path and add I/O timeout handling

This patch revisits the controller reset path and introduces timeout
handling for I/O commands.

To support controller reset during

ufshci: revisit controller reset path and add I/O timeout handling

This patch revisits the controller reset path and introduces timeout
handling for I/O commands.

To support controller reset during driver operation, the controller’s
construct, destruct, enable, and disable functions are clearly
separated in ufshci_ctrlr.c. ufshci_ctrlr_hw_reset() function is
added to leverage enable/disable.

After initialization, ufshci_ctrlr_reset_task() is also introduced to
ensure controller resets are performed via the task queue.

Timeout handling is designed in five steps. This patch implements
Step 1 and Step 5, while the remaining steps will be added later.
The timeout mechanism follows the same shared timeout model used in
the NVMe driver.

Test: Intentionally delayed UPIU I/O in QEMU to trigger a timeout and
verify timeout handling.

Sponsored by: Samsung Electronics
Reviewed by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D52440

show more ...


# 2be8ce84 16-Aug-2025 Jaeyoon Choi <j_yoon.choi@samsung.com>

ufshci: Add functions for UTP Task Management

This commit adds UTP Task Management Request functions and revisits the
UTR/UTRM construction logic.
It also introduces ufshci_ctrlr_cmd_send_task_mgmt_

ufshci: Add functions for UTP Task Management

This commit adds UTP Task Management Request functions and revisits the
UTR/UTRM construction logic.
It also introduces ufshci_ctrlr_cmd_send_task_mgmt_request(), which
will be used for timeout handling in a follow-up commit.

Test: I temporarily added the code below to the ufshci_ctrlr_start()
function to test it on a Galaxy Book S.
```
static void
ufshci_ctrlr_start(struct ufshci_controller *ctrlr)
{
...
/* Test: Task Mangement Request */
ufshci_printf(ctrlr,
"Test: Task Mangement Request\n");
struct ufshci_completion_poll_status status;
status.done = 0;
ufshci_ctrlr_cmd_send_task_mgmt_request(ctrlr,
ufshci_completion_poll_cb, &status,
UFSHCI_TASK_MGMT_FUNCTION_QUERY_TASK, 0, 0, 0);
ufshci_completion_poll(&status);
if (status.error) {
ufshci_printf(ctrlr,
"ufshci_ctrlr_cmd_send_task_mgmt_request failed!\n");
return;
}
uint32_t service_response;
service_response =
status.cpl.response_upiu.task_mgmt_response_upiu.output_param1;
ufshci_printf(ctrlr, "Task Management Service Response = 0x%x\n",
service_response);
...
}
```

Sponsored by: Samsung Electronics
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D51506

show more ...


# 1349a733 13-Jun-2025 Jaeyoon Choi <j_yoon.choi@samsung.com>

ufshci: Introduce the ufshci(4) driver

This commit adds a storage driver that supports the Universal Flash
Storage Host Controller Interface (UFSHCI) on FreeBSD.

Universal Flash Storage (UFS) is a

ufshci: Introduce the ufshci(4) driver

This commit adds a storage driver that supports the Universal Flash
Storage Host Controller Interface (UFSHCI) on FreeBSD.

Universal Flash Storage (UFS) is a flash-based mobile storage device
that replaces eMMC, aiming for high performance with low power. The UFS
Host Controller Interface (UFSHCI) is the host side controller and
connects UFS device to a system bus, such as PCIe.

The code targets the latest standards:
- UFS 4.1: https://www.jedec.org/standards-documents/docs/jesd220g
- UFSHCI 4.1: https://www.jedec.org/standards-documents/docs/jesd223f

The ufshci(4) driver implements controller/device initialization,
interrupt, single-doorbell(SDB) queue based IO requests. Support for
multi-queue (MCQ) IO requests is planned for a later commit.

Implemented features:
- PCIe bus support
- legacy(INTx) Interrupt Handling
- UIC command support
- UTP Transfer Request (UTR) support
- UTP Task Management Request (UTMR) support
- single doorbell queue (SDB) with multiple queue depth
- SCSI command set support
- sysctl

Work in progress:
- multi-Circular Queue (per-CPU IO queues)
- MSI-X interrupt Support
- write booster
- write Protect
- Host Performance Booster (HPB)
- interrupt aggregation
- ARM based system bus support
- ufs-utils port

Tests were performed on QEMU and an Intel-based laptop.
Since QEMU has an emulated UFS device, I tested on QEMU.

How to test on QEMU:
1. Run QEMU
$ qemu-system-x86_64 ... -device ufs -drive file=blk1g.bin,format=raw,if=none,id=luimg -device ufs-lu,drive=luimg,lun=0
2. Loading/unloading the ufshci module on QEMU
$ kldload /usr/obj/usr/src/amd64.amd64/sys/modules/ufshci/ufshci.ko
$ kldunload ufshci

Testing on real hardware:
- Samsung Galaxy Book S (Intel Lakefield) with UFS 3.0
- Lenovo duet 3 11ian8 (Intel N100) with UFS 2.1

Sponsored by: Samsung Electronics
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D50370

show more ...