From nobody Tue Oct 06 07:51:36 2026 X-Original-To: dev-commits-src-branches@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 4hzT3Y3gJFz6cWcc for ; Tue, 06 Oct 2026 07:51:37 +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 4hzT3X6DlHz4HL3 for ; Tue, 06 Oct 2026 07:51:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791273096; 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=5q5zBR7JKANFjBWPWxJbkgInriKK4wOLTU6EjCzLhH8=; b=REXPbIeKDdsnh3JrMl7fuqHfphrvNqq4z7tItTAd87fovyjRlgZ/sBghmzEImcrLPQuffo 5V1pt0dya6guPj2YYYpbfsCIeLEU+QBL3N8uPvfqjL09OXd0PgKyoFFqBk3UVxrODtH1NG pwwStsMHTqy+h3S3F89WpCuIu395tejtjcMVfhkQWJjsV/bU2r8owCVdHtcS4jvzNcC5r+ VPEbgZOa5+4nytmh3WAii1hrVMdxEsTZ7kxjQsXsqcnRxagtsLc5TQ02WqGa1O9z0b7BKD uzh+1QeQ9y2vDkbCIW7FjFoLB0z/8apRjL44gcpkdZCrAUGrPbz9v15TcB8leA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791273096; b=tZi8xmOIFB8AhJfPydzNNgnguja/nIYHmGKidGDPf8e3WeD43+6KH0iaPGBAeN60gqP/Kr 7/t9YlGbxDhHcTb022HVT3bWzSAV33qgVM3wqJeJt3TiwGM0x8WCxlgv4HaFEn+Skn3yqS Wk4E4CMar6Tg/A/ca+J/d4eGZL3oGa4L5ZQVDiu2tXd0T4gcw2i4J90M/whIZQFUVChb0D x+OchWG+L+18P3u+O4238k9lwxFPaU4MMTRF53ZXZA2m3ZSzVQC3Hwc4NPZlQgRHBswPqN nR48flH8EnZQuNauvyzZaunMp2tfFVulMGohYD1hWopWmJnMc4GumwZXswdSHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791273096; 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=5q5zBR7JKANFjBWPWxJbkgInriKK4wOLTU6EjCzLhH8=; b=DF0g3JgGt7QnjwXnEhqFbxWcmSaqiZV0QJRm9AZxHiuuzJdW9IfuZ/g9KDOZYy0wUMmJEG hPLnmom9Igk68Bc19wqvZbim9qmwrK6gjj9TpAVeK+g4/icnqRV6APznUaRVg31vsL2fJ/ +J4ag89PHxsi/m8tmnFXw1A3qvGIfi30UQPFXqn3uIFcQD5/R/5sQCA9eGaslN1Opi3cLJ GC7+7P0uJZVKDLOZBB5qssX1BIyP4DAsKxv5o68hkDoMHZKyA9gKJZLqLXFdLzWd+Rtqx3 KQalv6gudcsFd0Fds7fQ/ox9rwejWAh8Oqi98XG0jElvMrjN5KpogzX+hz82Uw== 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 4hzT3X5CLhzx0G for ; Tue, 06 Oct 2026 07:51:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1852d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 06 Oct 2026 07:51:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jaeyoon Choi Subject: git: ac1ad37b7d84 - stable/15 - ufshci: tell the controller how long the EHS is List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: ac1ad37b7d84d19625c887d89034d6291a3e03d4 Auto-Submitted: auto-generated Date: Tue, 06 Oct 2026 07:51:36 +0000 Message-Id: <6ac4a888.1852d.775233d3@gitrepo.freebsd.org> The branch stable/15 has been updated by jaeyoon: URL: https://cgit.FreeBSD.org/src/commit/?id=ac1ad37b7d84d19625c887d89034d6291a3e03d4 commit ac1ad37b7d84d19625c887d89034d6291a3e03d4 Author: Jaeyoon Choi AuthorDate: 2026-09-15 01:37:30 +0000 Commit: Jaeyoon Choi CommitDate: 2026-10-06 06:28:08 +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 (cherry picked from commit d3e5082ce4dcb154cbf50cba05d8f1dbbd55a5fc) --- 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);