From nobody Tue Sep 15 01:47:46 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hkPzQ6SNsz6sL5b for ; Tue, 15 Sep 2026 01:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hkPzQ5qJ3z4TbT for ; Tue, 15 Sep 2026 01:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789436866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FSk7VE6ncWZFhO0Flsttavh8XZ9REb/Y1DIQsIwK7WI=; b=K5zhtO+hj+sWVXrNvrbQMbBsv0LUthDZyz4SJ3brdCUgQkQkX7P6QJxyUdXxecYWhCAYU9 8WE420Q/3+uvJFnC5zLXJuCF7rxiVn6eX++gzEe1xslOcHBPB9bmBvBbdT0DcKpXAQqTje 7yzdgRSyOD8fRhThHvjeQhnIQ66rtJAcVc6Kjy5BPTCE5raj+SlXLmhTQB/PDmI4XRLTHx 7dPf60+HCErQhKdn1hf7KrBoBo9KWK1voz3X6HFpORC9tHE0OcfnYcb7Yy4L1agSQgBOn+ LXl9zRsTY5YdR98RqvtGuetOj9GvUrf5w9s3nBYd+QcZiwpJ2eo8upcH9XlQxg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789436866; b=ifc2enn55hI1LaS3wy6DkUIytVBwWBPZ7cdHPtBdQs53I8vLPI2w7hGKMbREo6CyTDvArK jvPUPkoR/yjs01JaPswuNV05viWR6ZkYXS2Na2O5yqHgn3vL/8VV6QMQprFoRH0MKtxB75 aZF9MPl2otufIFmFVYLtBqaj5u/I4rvZO2FclRwXefCImcNCQeCzMSq3KEQbidUuvNhn3u hhKdyNVPA38H6aGPsyNMrJCaiku1u+KY7Nn2p/7v30i/x3oiRXW1EA99TF5PzXWiwecT5F wPqmanBixe5weeXDJLPzM5StoM1D3tiMOZ6RlObN6eXIdM4T+9kAoT2qoOnXbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789436866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FSk7VE6ncWZFhO0Flsttavh8XZ9REb/Y1DIQsIwK7WI=; b=EgKOK4donSkyayncx36X82jz7zdsI1ep0QFjXcfqEH7SVBLcG+rZJWqr7fsW5r//tdYT6J fmHUFPBb5LneuJGGrzEjClLob+xoXxkWVoGz81Ku64od6y9IjuMBeDW5h8QtpC5V3l31rJ MCNY8x2qezJ/nbBOsipCg2nF59n7fubhnZefCmpX8MsrvAaikMEbuSqCVfus80nNEvNxof 3/mAi0ii/hTEvffohaw2ZCKzZQsoddgajb5jkLxsokNcWGpMXLNlQxb5SZg0Kc6Ek62CXw Ybs6O2jQ5NhA21UQGtJav0NZMooAvLzBD7sV6qzUXCvz9wSbO4NgvLtFHxv2rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hkPzQ4txTzgC4 for ; Tue, 15 Sep 2026 01:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23d0a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 15 Sep 2026 01:47:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jaeyoon Choi Subject: git: d3e5082ce4dc - main - ufshci: tell the controller how long the EHS is List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jaeyoon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3e5082ce4dcb154cbf50cba05d8f1dbbd55a5fc Auto-Submitted: auto-generated Date: Tue, 15 Sep 2026 01:47:46 +0000 Message-Id: <6aa8a3c2.23d0a.32e36ddc@gitrepo.freebsd.org> The branch main has been updated by jaeyoon: URL: https://cgit.FreeBSD.org/src/commit/?id=d3e5082ce4dcb154cbf50cba05d8f1dbbd55a5fc commit d3e5082ce4dcb154cbf50cba05d8f1dbbd55a5fc Author: Jaeyoon Choi AuthorDate: 2026-09-15 01:37:30 +0000 Commit: Jaeyoon Choi CommitDate: 2026-09-15 01:44:32 +0000 ufshci: tell the controller how long the EHS is The transfer request descriptor has a field for the total Extra Header Segment length. The driver left it at zero. A request that carried an EHS went out as the bare command UPIU, and the device answered a request it had only seen part of. Fill the field from the request UPIU header, which already carries the same length. Every other path sets it to zero, so nothing else changes. An EHS is the first thing that makes a request vary in size, so assert that the request and the response still fit in the command descriptor. Reviewed by: imp (mentor) Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D59557 --- sys/dev/ufshci/ufshci_req_queue.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/ufshci/ufshci_req_queue.c b/sys/dev/ufshci/ufshci_req_queue.c index 886cf9aff77f..f1b145f9791b 100644 --- a/sys/dev/ufshci/ufshci_req_queue.c +++ b/sys/dev/ufshci/ufshci_req_queue.c @@ -425,7 +425,7 @@ static void ufshci_req_queue_fill_utr_descriptor(struct ufshci_utp_xfer_req_desc *desc, uint8_t data_direction, const uint64_t paddr, const uint16_t response_off, const uint16_t response_len, const uint16_t prdt_off, - const uint16_t prdt_entry_cnt) + const uint16_t prdt_entry_cnt, const uint8_t total_ehs_length) { uint8_t command_type; /* Value to convert bytes to dwords */ @@ -441,6 +441,7 @@ ufshci_req_queue_fill_utr_descriptor(struct ufshci_utp_xfer_req_desc *desc, desc->command_type = command_type; desc->data_direction = data_direction; desc->interrupt = true; + desc->total_ehs_length = total_ehs_length; /* Set the initial value to Invalid. */ desc->overall_command_status = UFSHCI_UTR_OCS_INVALID; desc->utp_command_descriptor_base_address = (uint32_t)(paddr & @@ -719,6 +720,9 @@ ufshci_req_queue_submit_tracker(struct ufshci_req_queue *req_queue, ufshci_req_queue_fill_utmr_descriptor(&tr->hwq->utmrd[slot_num], req); } else { + KASSERT(req->request_size <= UFSHCI_UTP_XFER_REQ_SIZE && + req->response_size <= UFSHCI_UTP_XFER_RESP_SIZE, + ("UPIU does not fit in the UTP command descriptor")); request_len = req->request_size; response_off = UFSHCI_UTP_XFER_REQ_SIZE; response_len = req->response_size; @@ -741,7 +745,8 @@ ufshci_req_queue_submit_tracker(struct ufshci_req_queue *req_queue, ucd_paddr = tr->ucd_bus_addr; ufshci_req_queue_fill_utr_descriptor(&tr->hwq->utrd[slot_num], data_direction, ucd_paddr, response_off, response_len, - tr->prdt_off, tr->prdt_entry_cnt); + tr->prdt_off, tr->prdt_entry_cnt, + req->request_upiu.header.ehs_length); bus_dmamap_sync(req_queue->dma_tag_ucd, req_queue->ucdmem_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);