HomeFreeBSD

ufshci: Add functions for UTP Task Management

Description

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

Details

Provenance
jaeyoonAuthored on Aug 16 2025, 5:40 PM
impCommitted on Aug 16 2025, 6:09 PM
Reviewer
imp
Differential Revision
D51506: ufshci: Add functions for UTP Task Management
Parents
rGdd22a6853d92: Belatedly bump __FreeBSD_version for setgroups/getgroups revisions
Branches
Unknown
Tags
Unknown