From nobody Fri Mar 14 05:28:53 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 4ZDXwY15dDz5qYf1 for ; Fri, 14 Mar 2025 05:29:01 +0000 (UTC) (envelope-from j_yoon.choi@samsung.com) Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout3.samsung.com", Issuer "DigiCert Global G2 TLS RSA SHA256 2020 CA1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZDXwW6qvkz4FZh for ; Fri, 14 Mar 2025 05:28:59 +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=n3gWYheX; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (mx1.freebsd.org: domain of j_yoon.choi@samsung.com designates 203.254.224.33 as permitted sender) smtp.mailfrom=j_yoon.choi@samsung.com Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20250314052855epoutp037a7a18b1c58957a6b82dab91efa22c5b~slDquE-ro1805618056epoutp03W for ; Fri, 14 Mar 2025 05:28:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20250314052855epoutp037a7a18b1c58957a6b82dab91efa22c5b~slDquE-ro1805618056epoutp03W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1741930135; bh=b/oWXvoJ39n7VvE+jnKPi1pEoKfRO/0pRxkKZZTLmWs=; h=Subject:Reply-To:From:To:CC:Date:References:From; b=n3gWYheXDF93NhqFkGquyvgqvGdO26lhawHDTVTItzPNZCKaOcirA2XwtEaFlM44O ZQXxFsyDEZTPJzUY/2u+kBDzZAtfAIQhtwnQX6jmI3RjNx7xLpthLdDaTrRn8hf1K5 mftn9UpxkSQD+9T3zTTOMIHD6RmhwtOXPZb1ARgE= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20250314052855epcas2p420da023abca27e4f35bc5febe6008e7b~slDqd-Eo01192811928epcas2p4g; Fri, 14 Mar 2025 05:28:55 +0000 (GMT) Received: from epsmgec2p1.samsung.com (unknown [182.195.36.100]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4ZDXwQ5q9dz4x9Pt; Fri, 14 Mar 2025 05:28:54 +0000 (GMT) X-AuditID: b6c32a43-0d1e67000000599a-1d-67d3be9562ca Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmgec2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 51.00.22938.59EB3D76; Fri, 14 Mar 2025 14:28:53 +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 , "freebsd-hackers@FreeBSD.org" CC: Jaeyoon Choi X-Priority: 3 X-Content-Kind-Code: NORMAL 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: <20250314052853epcms2p77524d50719009d62188486032c30f6c5@epcms2p7> Date: Fri, 14 Mar 2025 14:28:53 +0900 X-CMS-MailID: 20250314052853epcms2p77524d50719009d62188486032c30f6c5 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGKsWRmVeSWpSXmKPExsWy7bC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9gYZdraVM3ufg2FLmHxohU5jq Fn+xPPLrc6nE7EuX5mV+bttjdXy9wpOpfmxKLMUZiYZazEXFiQC8Z3ek+QMAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250314052853epcms2p77524d50719009d62188486032c30f6c5 References: X-Spamd-Result: default: False [-4.77 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; DWL_DNSWL_LOW(-1.00)[samsung.com:dkim]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; NEURAL_HAM_SHORT(-0.97)[-0.970]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; MID_RHS_NOT_FQDN(0.50)[]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[samsung.com,none]; RCVD_IN_DNSWL_MED(-0.20)[203.254.224.33: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.33:from]; RCVD_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; REPLYTO_DOM_NEQ_TO_DOM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; HAS_X_PRIO_THREE(0.00)[3]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; ASN(0.00)[asn:6619, ipnet:203.254.224.0/24, country:KR]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; DKIM_TRACE(0.00)[samsung.com:+]; MISSING_XM_UA(0.00)[]; HAS_REPLYTO(0.00)[j_yoon.choi@samsung.com] X-Rspamd-Queue-Id: 4ZDXwW6qvkz4FZh X-Spamd-Bar: ---- Hi Warner, I'm back in the office :). > I've been studying UMASS and have a different idea. I'm starting to not > like the PIM flags > now that I've read it. > > There's about a dozen commands that different USB flash devices can't do in > various ways. > I've started to convert umass to just fail the command as illegal when a > bad command is > sent to it. I've also been modifying the da, cd, etc drivers to notice the > illegal commands and > modify its behavior. It isn't a new idea: the periph drivers have been > doing it to cope with > drives that don't support READ(6) commands. It's recently (in the last 5 > years) expanded to > dealing with other commands like SYNCHRONIZE CACHE, MODE SENSE. > > The idea is to allow the device to reject the command as illegal. In the > cases of reduced SCSI > command sets, like RBC, UFS, etc the SIM should reject known bad commands > at the SIM > layer because history has shown that some of the > lower-quality-but-still-working-enough drives > can hang when unexpected commands are sent to them. > > Not supporting MODE SENSE(6) likely is going to be a somewhat larger change. I will follow up on your UMASS modification. And if you give me a guide, I'll follow it > Test how? I'm not sure I understand this question well enough to answer, > so maybe a few examples will help me focus an answer. I was wondering how you do unit tests and integration tests for device drivers. Is there a framework to write unit tests when developing a device driver? Is there any tool you use for Integration test (e.g. FIO(flexible I/O tester)) (I'm a FreeBSD newbie, so please forgive me if this is a stupid question). > In the mean time, I'll see if I can locate a copy of the UFS standard > or a reasonable summary. The ones at jedec.org are a bit too expensive > for me to buy on my own. I've found excerpts of it datasheets at best, which > may suffice for my review needs. If you register with JEDEC, you can get the documentation for UFS 2.1 version for free, although it is not the latest spec. There are two documents to look at for the UFS specification. UFSHCI, which is the host interface, and UFS, which is the device. - UFS 2.1 spec: https://www.jedec.org/system/files/docs/JESD220C-2_1.pdf - UFSHCI 2.1 spec: https://www.jedec.org/sites/default/files/docs/JESD223C.pdf My implementation will be based on UFS 4.1, but the basics are the same. The main differences between UFS 2.1 and 4.1 are as follows - I/O queue changed from single queue to multi-queue - Maximum HS-GEAR changed from 3 -> 5, which improves bandwidth - Supports Write Booster (SLC caching) - Supports Host Performance Booster (HPB) I will explain the specification changes when I request a review of the features added in UFS 4.1. Thanks, Jaeyoon