Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Apr 2025 08:33:30 -0400
From:      Justin Parrott <erartnqr@gmail.com>
To:        j_yoon.choi@samsung.com
Cc:        Warner Losh <imp@bsdimp.com>,  "freebsd-hackers@FreeBSD.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Universal Flash Storage Driver Proposal
Message-ID:  <CA%2B%2BEBuD%2B=YD_j14BdMrw=V07fZH1cS7gy8TX90eU0BeNSfkeHg@mail.gmail.com>
In-Reply-To: <20250314052853epcms2p77524d50719009d62188486032c30f6c5@epcms2p7>
References:  <CGME20250314052853epcms2p77524d50719009d62188486032c30f6c5@epcms2p7> <20250314052853epcms2p77524d50719009d62188486032c30f6c5@epcms2p7>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Remove

On Fri, Mar 14, 2025, 1:29 AM Jaeyoon Choi <j_yoon.choi@samsung.com> wrote:

> 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
>
>

[-- Attachment #2 --]
<div dir="auto">Remove</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Mar 14, 2025, 1:29 AM Jaeyoon Choi &lt;<a href="mailto:j_yoon.choi@samsung.com">j_yoon.choi@samsung.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Warner,<br>
I&#39;m back in the office :).<br>
<br>
&gt; I&#39;ve been studying UMASS and have a different idea. I&#39;m starting to not<br>
&gt; like the PIM flags<br>
&gt; now that I&#39;ve read it.<br>
&gt; <br>
&gt; There&#39;s about a dozen commands that different USB flash devices can&#39;t do in<br>
&gt; various ways.<br>
&gt; I&#39;ve started to convert umass to just fail the command as illegal when a<br>
&gt; bad command is<br>
&gt; sent to it. I&#39;ve also been modifying the da, cd, etc drivers to notice the<br>
&gt; illegal commands and<br>
&gt; modify its behavior. It isn&#39;t a new idea: the periph drivers have been<br>
&gt; doing it to cope with<br>
&gt; drives that don&#39;t support READ(6) commands. It&#39;s recently (in the last 5<br>
&gt; years) expanded to<br>
&gt; dealing with other commands like SYNCHRONIZE CACHE, MODE SENSE.<br>
&gt; <br>
&gt; The idea is to allow the device to reject the command as illegal. In the<br>
&gt; cases of reduced SCSI<br>
&gt; command sets, like RBC, UFS, etc the SIM should reject known bad commands<br>
&gt; at the SIM<br>
&gt; layer because history has shown that some of the<br>
&gt; lower-quality-but-still-working-enough drives<br>
&gt; can hang when unexpected commands are sent to them.<br>
&gt; <br>
&gt; Not supporting MODE SENSE(6) likely is going to be a somewhat larger change.<br>
<br>
I will follow up on your UMASS modification.<br>
And if you give me a guide, I&#39;ll follow it<br>
<br>
&gt; Test how? I&#39;m not sure I understand this question well enough to answer,<br>
&gt; so maybe a few examples will help me focus an answer.<br>
<br>
I was wondering how you do unit tests and integration tests for device drivers.<br>
Is there a framework to write unit tests when developing a device driver?<br>
Is there any tool you use for Integration test (e.g. FIO(flexible I/O tester))<br>
(I&#39;m a FreeBSD newbie, so please forgive me if this is a stupid question).<br>
<br>
&gt; In the mean time, I&#39;ll see if I can locate a copy of the UFS standard<br>
&gt; or a reasonable summary. The ones at <a href="http://jedec.org" rel="noreferrer noreferrer" target="_blank">jedec.org</a> are a bit too expensive<br>
&gt; for me to buy on my own. I&#39;ve found excerpts of it datasheets at best, which<br>
&gt; may suffice for my review needs.<br>
<br>
If you register with JEDEC, you can get the documentation for UFS 2.1 version <br>
for free, although it is not the latest spec.<br>
There are two documents to look at for the UFS specification. <br>
UFSHCI, which is the host interface, and UFS, which is the device.<br>
- UFS 2.1 spec: <a href="https://www.jedec.org/system/files/docs/JESD220C-2_1.pdf" rel="noreferrer noreferrer" target="_blank">https://www.jedec.org/system/files/docs/JESD220C-2_1.pdf</a><br>;
- UFSHCI 2.1 spec: <a href="https://www.jedec.org/sites/default/files/docs/JESD223C.pdf" rel="noreferrer noreferrer" target="_blank">https://www.jedec.org/sites/default/files/docs/JESD223C.pdf</a><br>;
<br>
My implementation will be based on UFS 4.1, but the basics are the same.<br>
The main differences between UFS 2.1 and 4.1 are as follows<br>
- I/O queue changed from single queue to multi-queue<br>
- Maximum HS-GEAR changed from 3 -&gt; 5, which improves bandwidth<br>
- Supports Write Booster (SLC caching)<br>
- Supports Host Performance Booster (HPB)<br>
<br>
I will explain the specification changes when I request a review of the<br>
features added in UFS 4.1.<br>
<br>
Thanks,<br>
Jaeyoon<br>
<br>
</blockquote></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B%2BEBuD%2B=YD_j14BdMrw=V07fZH1cS7gy8TX90eU0BeNSfkeHg>