Page MenuHomeFreeBSD

ufshci: Add functions for UTP Task Management
ClosedPublic

Authored by jaeyoon on Jul 25 2025, 3:45 AM.
Tags
None
Referenced Files
F135863537: D51506.diff
Thu, Nov 13, 3:48 PM
Unknown Object (File)
Tue, Nov 11, 2:29 AM
Unknown Object (File)
Sat, Nov 1, 9:59 AM
Unknown Object (File)
Wed, Oct 29, 6:02 AM
Unknown Object (File)
Wed, Oct 29, 3:45 AM
Unknown Object (File)
Tue, Oct 28, 5:36 PM
Unknown Object (File)
Sun, Oct 19, 1:35 AM
Unknown Object (File)
Thu, Oct 16, 10:33 PM
Subscribers

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This looks good to my eye. I don't know if the hardware interactions are good, but nothing stood out.

This revision is now accepted and ready to land.Aug 7 2025, 3:43 AM

Could you please submit this patch? Thanks!

This revision was automatically updated to reflect the committed changes.
sys/dev/ufshci/ufshci_ctrlr.c
373

So this request contains a mix of simple renaming (it seems to me, I've not looked super closely) as well as adding the functionality. That makes it a little harder to review since there's noise like that that I have to puzzle out. Can you separate out those two parts of this into two reviews? Sorry it took me a few days to realize it, but I put off looking at the review in large part due to its size. Splitting those elements out will help me look at it faster and be more confident of my review.

jaeyoon added inline comments.
sys/dev/ufshci/ufshci_ctrlr.c
373

I apologize for mixing renaming with functional changes in that patch. Since it’s already been merged, I can’t revise it now, but I’ll be more careful to separate them in future submissions.