From nobody Tue Jan 21 00:26:02 2025 X-Original-To: freebsd-hackers@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 4YcSg75rXYz5lBt1 for ; Tue, 21 Jan 2025 00:26:11 +0000 (UTC) (envelope-from j_yoon.choi@samsung.com) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout4.samsung.com", Issuer "DigiCert Global G2 TLS RSA SHA256 2020 CA1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSg46spFz3LvG for ; Tue, 21 Jan 2025 00:26:08 +0000 (UTC) (envelope-from j_yoon.choi@samsung.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=ufK2LcTY; spf=pass (mx1.freebsd.org: domain of j_yoon.choi@samsung.com designates 203.254.224.34 as permitted sender) smtp.mailfrom=j_yoon.choi@samsung.com; dmarc=pass (policy=none) header.from=samsung.com Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20250121002604epoutp04e96ee318b596c98563a8274a1b647dcd~cjYZzfYSq0748007480epoutp04e for ; Tue, 21 Jan 2025 00:26:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20250121002604epoutp04e96ee318b596c98563a8274a1b647dcd~cjYZzfYSq0748007480epoutp04e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1737419164; bh=5DSbXbOFjTG1ailOIhosA6rezTOvsThQUxiczaLnFuw=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=ufK2LcTYI7TuVJv6MUfDyrFNCA7IW0gjykQRvfzlvZCRKc0yujMD3lNWAE6qDpIeB hnCVdFkwJKRJ1Y96oEncP1R6dYzgz4GFcB1fHTdiEn09TVoCt7gagK3ZT5bQDHMXGp Oxmj4v2+nLdhFOhrWgE2y0P1ozKdsCuNpvEth4lU= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20250121002604epcas2p3db66d2693a6d6c85cccf07127eebdc6d~cjYZoHsID0494304943epcas2p3K; Tue, 21 Jan 2025 00:26:04 +0000 (GMT) Received: from epsmgec2p1.samsung.com (unknown [182.195.36.101]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4YcSg008nsz4x9QG; Tue, 21 Jan 2025 00:26:04 +0000 (GMT) X-AuditID: b6c32a43-0b1e27000000599a-46-678ee99a0374 Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmgec2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 31.BC.22938.A99EE876; Tue, 21 Jan 2025 09:26:02 +0900 (KST) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org Mime-Version: 1.0 Subject: Re: Universal Flash Storage Driver Proposal Reply-To: j_yoon.choi@samsung.com From: Jaeyoon Choi To: Warner Losh CC: "freebsd-hackers@FreeBSD.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20250121002602epcms2p6067990e98b8143ff596d90af0ec54492@epcms2p6> Date: Tue, 21 Jan 2025 09:26:02 +0900 X-CMS-MailID: 20250121002602epcms2p6067990e98b8143ff596d90af0ec54492 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLKsWRmVeSWpSXmKPExs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Sk34iwv0onTl1ofjE3Jhd93XOniv5q5nYsfPJvMqsjOLvj9iczb/Mvv1z x/sj2i817rYFJhU9mvxciaU4I9FQi7moOBEAqY+MrfADAAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250117045346epcms2p61099ea651d3ca3f00e3134dd00e6a9ac References: <20250117045346epcms2p61099ea651d3ca3f00e3134dd00e6a9ac@epcms2p6> X-Spamd-Result: default: False [-4.79 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DWL_DNSWL_LOW(-1.00)[samsung.com:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.991]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DMARC_POLICY_ALLOW(-0.50)[samsung.com,none]; MV_CASE(0.50)[]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_IN_DNSWL_MED(-0.20)[203.254.224.34:from]; R_DKIM_ALLOW(-0.20)[samsung.com:s=mail20170921]; R_SPF_ALLOW(-0.20)[+ip4:203.254.224.0/24]; MIME_GOOD(-0.10)[text/plain]; RWL_MAILSPIKE_GOOD(-0.10)[203.254.224.34:from]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[samsung.com:+]; HAS_X_PRIO_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; ASN(0.00)[asn:6619, ipnet:203.254.192.0/18, country:KR]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; REPLYTO_DOM_NEQ_TO_DOM(0.00)[]; MISSING_XM_UA(0.00)[]; HAS_REPLYTO(0.00)[j_yoon.choi@samsung.com] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4YcSg46spFz3LvG Hi Warner Thank you for your reply. I have learned a lot from your presentation and paper. Universal Flash Storage (UFS) only attaches one device to a single controll= er, meaning there is only one SCSI target. UFS supports a subset of SCSI commands, so the CAM periph driver may need t= o restrict requests for certain commands. (e.g. UFS does not support the MODE SENSE(6), READ(12)/WRITE(12) commands). So, I think I can just use the existing SCSI transport. Am I right? (I'm referring to sys/dev/usb/storage/umass.c and sys/dev/virtio/scsi/virti= o_scsi.c). I would greatly appreciate your advice. Thank you, Jaeyoon > Hi Jaeyoon >=20 > This sounds really cool=21 >=20 > What layering scheme did you have in mind to allow multiple storage devic= es > per > controller? Will it be a new kind of SIM in the CAM layer, or will it be > SCSI with > a different transport? Is this a full SCSI implementation, or will the CA= M > periph > drivers need to restrict the requests they send down for this? We already > have a > number of subsets that we handle in an ad-hoc way, but maybe we need to b= e > a little > more organized about it. >=20 > In the past, I've helped with the MMC and NVMe integration intro CAM, so = I > have > an interest.... >=20 > Warner >=20 > On Thu, Jan 16, 2025 at 9:54=E2=80=AFPM=20Jaeyoon=20Choi=20=0D=0A>=20wrote:=0D=0A>=20=0D=0A>=20>=20Hello,=0D=0A>=20>=0D= =0A>=20>=20As=20I=20mentioned=20in=20my=20previous=20email=20to=20the=20mai= ling=20list=20last=20year,=20I=20am=0D=0A>=20>=20planning=0D=0A>=20>=20to= =20start=20developing=20a=20Universal=20Flash=20Storage=20Driver.=0D=0A>=20= >=20-=20https://lists.freebsd.org/archives/freebsd-hackers/2024-July/003385= .html=0D=0A>=20>=20Before=20I=20begin=20working=20on=20the=20driver,=20I=20= would=20like=20to=20share=20my=20development=0D=0A>=20>=20plan=0D=0A>=20>= =20with=20you.=0D=0A>=20>=0D=0A>=20>=20Universal=20Flash=20Storage=20(UFS)= =20is=20a=20storage=20device=20for=20mobile=20devices=20which=0D=0A>=20>=20= aims=0D=0A>=20>=20for=20high=20performance=20and=20low=20power=20consumptio= n.=0D=0A>=20>=20UFS=20is=20currently=20used=20in=20most=20smartphones=20and= =20tablets,=20and=20I=20believe=20there=0D=0A>=20>=20is=20a=0D=0A>=20>=20de= mand=20for=20UFS=20support=20in=20FreeBSD.=0D=0A>=20>=0D=0A>=20>=20The=20Un= iversal=20Flash=20Storage=20Driver=20is=20named=20UFSHCI=20to=20avoid=20con= fusion=20with=0D=0A>=20>=20the=0D=0A>=20>=20UFS=20filesystem,=20and=20is=20= located=20in=20the=20/sys/dev/ufshci=20folder.=0D=0A>=20>=0D=0A>=20>=20The= =20driver=20will=20be=20developed=20based=20on=20the=20UFS=204.1=20(JESD220= G)=20and=20UFSHCI=204.1=0D=0A>=20>=20(JESD223F)=20specification=20documents= ,=20which=20are=20the=20latest=20versions=0D=0A>=20>=20available.=0D=0A>=20= >=20The=20latest=20specifications=20can=20be=20found=20at=20the=20following= =20link:=0D=0A>=20>=20-=0D=0A>=20>=20https://www.jedec.org/standards-docume= nts/focus/flash/universal-flash-storage-ufs=0D=0A>=20>=0D=0A>=20>=20My=20pl= an=20is=20to=20first=20implement=20a=20PCIe-based=20driver=20and=20then=20m= ake=20it=0D=0A>=20>=20compatible=0D=0A>=20>=20with=20various=20smartphone= =20application=20processors.=0D=0A>=20>=20Since=20UFS=20uses=20SCSI=20comma= nds,=20we=20need=20to=20use=20the=20SCSI=20I/O=20path=20of=20the=20CAM.=0D= =0A>=20>=0D=0A>=20>=20Please=20note=20that=20there=20is=20currently=20a=20U= FSHCI=20driver=20in=20development=20for=0D=0A>=20>=20OpenBSD,=0D=0A>=20>=20= but=20due=20to=20its=20low=20spec=20version=20(UFSHCI=202.1)=20and=20lack= =20of=20compatibility=20with=0D=0A>=20>=20FreeBSD,=20I=20have=20decided=20t= o=20start=20from=20scratch.=0D=0A>=20>=0D=0A>=20>=20The=20following=20platf= orms=20will=20be=20used=20for=20testing:=0D=0A>=20>=20-=20QEMU=20with=20Emu= lated=20UFS=20device=0D=0A>=20>=20-=20Samsung=20Galaxy=20Book=20S=20(Intel= =20Lakefield=20+=20eUFS)=0D=0A>=20>=20-=20Lenovo=20Duet3=2011ian8=20(Intel= =20N100=20+=20eUFS)=0D=0A>=20>=0D=0A>=20>=20After=20developing=20the=20UFSH= CI=20driver,=20I=20will=20continue=20to=20work=20on=20additional=0D=0A>=20>= =20features=20and=20keep=20the=20driver=20up-to-date=20with=20the=20latest= =20specs.=0D=0A>=20>=20The=20approximate=20development=20plan=20is=20as=20f= ollows:=0D=0A>=20>=0D=0A>=20>=20-=202025=201H:=20Implementation=20of=20init= ialization,=20basic=20operations,=20and=20single=0D=0A>=20>=20=20=20=20=20= =20=20=20=20=20=20=20doorbell-based=20read/write=20I/O=20on=20Intel=20CPU-b= ased=20platforms=0D=0A>=20>=20-=202025=202H:=20Implementation=20of=20MCQ-ba= sed=20read/write=20I/O,=20and=20implementation=0D=0A>=20>=20of=0D=0A>=20>= =20=20=20=20=20=20=20=20=20=20=20=20additional=20features=20such=20as=20wri= tebooster=0D=0A>=20>=0D=0A>=20>=20I=20look=20forward=20to=20receiving=20you= r=20feedback=20and=20suggestions.=0D=0A>=20>=0D=0A>=20>=20Best=20regards,= =0D=0A>=20>=20Jaeyoon=0D=0A>=20>=0D=0A>=20>