From nobody Sun Jun 15 11:53:41 2025 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 4bKs471Xj8z5y16V; Sun, 15 Jun 2025 11:54:15 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from smtp6.goneo.de (smtp6.goneo.de [85.220.129.31]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKs462L6gz4Knr; Sun, 15 Jun 2025 11:54:14 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Authentication-Results: mx1.freebsd.org; none Received: from hub2.goneo.de (hub2.goneo.de [85.220.129.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp6.goneo.de (Postfix) with ESMTPS id D6C81240202; Sun, 15 Jun 2025 13:54:11 +0200 (CEST) Received: from hub2.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPS id 01FF7240165; Sun, 15 Jun 2025 13:54:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walstatt-de.de; s=DKIM001; t=1749988450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ik8pTO1oryJbHyq+R57e0bhZikjtsRcqkspKsyguMUE=; b=IXeI/AhOOSVqPjFX8y7SVsbef1jJvaR+61v23sIMEe9G7kWlTDPR9OQ6LtRTk19bSc7+iW boMvp5oMNtyAE1irzqYYH4o4C0VlWvBrVgkLhx3SGkXwl4IjBiCnFSI4np8umhbZAev37t OVods8bPs4j7UNLc9Zlxs2lB07bi3hAfqCJBZHYKyV0HEQ7GuSeQ+KSr5fmocKCJqTE+iS ULpUrx6aiXrQ4Bi4a3smhYoC3x8e31BKPi37j5tZb4yw3ZsUeX3ObSiOiXir9u+GDq5T0t XOpaEnPcVAPcHS6nqn/3RUFWSFYsHcLsiXikPO8yOqlm72gOwZH5jCAkYHD1jQ== Received: from thor.sb211.local (dynamic-2a02-3100-2981-4302-1dbb-139c-3164-c63c.310.pool.telefonica.de [IPv6:2a02:3100:2981:4302:1dbb:139c:3164:c63c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPSA id 9B338240126; Sun, 15 Jun 2025 13:54:09 +0200 (CEST) Date: Sun, 15 Jun 2025 13:53:41 +0200 From: A FreeBSD User To: "Bjoern A. Zeeb" Cc: Warner Losh , Jaeyoon Choi , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 1349a733cf28 - main - ufshci: Introduce the ufshci(4) driver Message-ID: <20250615135324.2fa38fba@thor.sb211.local> In-Reply-To: <95r7ros1-5296-8orq-sqp5-s7p4935p6039@SerrOFQ.bet> References: <202506150609.55F69dn3021406@gitrepo.freebsd.org> <20250615103251.2221265b@thor.sb211.local> <95r7ros1-5296-8orq-sqp5-s7p4935p6039@SerrOFQ.bet> 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 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/OtID_maiV.OnA.ILW47oRd8"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Rspamd-UID: 377ca1 X-Rspamd-UID: 9af511 X-Rspamd-Queue-Id: 4bKs462L6gz4Knr X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:25394, ipnet:85.220.128.0/17, country:DE] --Sig_/OtID_maiV.OnA.ILW47oRd8 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Am Tage des Herren Sun, 15 Jun 2025 09:28:38 +0000 (UTC) "Bjoern A. Zeeb" schrieb: > On Sun, 15 Jun 2025, A FreeBSD User wrote: >=20 > > Am Tage des Herren Sun, 15 Jun 2025 06:09:39 GMT > > Warner Losh schrieb: > > =20 > >> The branch main has been updated by imp: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D1349a733cf2828e0040cabe= f89eeadc3ff00c40b > >> > >> commit 1349a733cf2828e0040cabef89eeadc3ff00c40b > >> Author: Jaeyoon Choi > >> AuthorDate: 2025-06-13 18:33:01 +0000 > >> Commit: Warner Losh > >> CommitDate: 2025-06-15 06:08:56 +0000 > >> > >> 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 devi= ce > >> that replaces eMMC, aiming for high performance with low power. Th= e 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/jesd2= 23f > >> > >> The ufshci(4) driver implements controller/device initialization, > >> interrupt, single-doorbell(SDB) queue based IO requests. Support f= or > >> 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=3Dblk1g.bin,format=3Draw,if=3Dnone,id=3Dluimg -device ufs-lu,driv= e=3Dluimg,lun=3D0 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 > >> --- > >> sbin/camcontrol/camcontrol.c | 13 + =20 > > > > It seems changes to sources breaks buildkernel (at least for me) on cus= tomized kernel > > config: > > > > [...] > > --- camcontrol.pieo --- > > /usr/src/sbin/camcontrol/camcontrol.c:5407:23: error: use of undeclared= identifier > > 'CTS_UFSHCI_VALID_MODE' --- all_subdir_bin --- > > --- all_subdir_bin/sleep --- =20 > > =3D=3D=3D> bin/sleep (all) =20 > > --- all_subdir_sbin --- > > 5407 | if (ufshci->valid & CTS_UFSHCI_VALID_MODE) { > > | ^ > > [...] > > > > Kind regards, =20 >=20 >=20 > I am running a test build just to be sure but I think this should do: >=20 > commit 78f12afc38eabea82fd247c157d340e289dceeb8 > Author: Bjoern A. Zeeb > AuthorDate: Sun Jun 15 09:25:56 2025 +0000 > Commit: Bjoern A. Zeeb > CommitDate: Sun Jun 15 09:25:56 2025 +0000 >=20 > ufshci: camcontrol: use correct define to fix the build >=20 > Fixes: 1349a733cf28 >=20 > diff --git sbin/camcontrol/camcontrol.c sbin/camcontrol/camcontrol.c > index 19684c044ef5..15a5d42a2ba5 100644 > --- sbin/camcontrol/camcontrol.c > +++ sbin/camcontrol/camcontrol.c > @@ -5404,7 +5404,7 @@ cts_print(struct cam_device *device, struct ccb_tra= ns_settings *cts) > struct ccb_trans_settings_ufshci *ufshci =3D > &cts->xport_specific.ufshci; >=20 > - if (ufshci->valid & CTS_UFSHCI_VALID_MODE) { > + if (ufshci->valid & CTS_UFSHCI_VALID_LINK) { > fprintf(stdout, "%sHigh Speed Gear: %d (%d max)\= n", > pathstr, ufshci->hs_gear, ufshci->max_hs= _gear); > fprintf(stdout, "%sUnipro TX lanes: %d (%d max)\= n", pathstr, >=20 >=20 >=20 >=20 Thank you very much, seems to work, at least, for me. Kind regards, oh --=20 A FreeBSD user --Sig_/OtID_maiV.OnA.ILW47oRd8 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRQheDybVktG5eW/1Kxzvs8OqokrwUCaE60YAAKCRCxzvs8Oqok r9CUAP9cWLJ7JqSN8dcfV50ElSVe11pb65pCcClM07c2BKFOBAEAtBYGrs2ZIDrL VLsyeSUF5RZuQ93spMUYoH0s5z55GwU= =WpPt -----END PGP SIGNATURE----- --Sig_/OtID_maiV.OnA.ILW47oRd8--