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 <<a href="mailto:j_yoon.choi@samsung.com">j_yoon.choi@samsung.com</a>> 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'm back in the office :).<br> <br> > I've been studying UMASS and have a different idea. I'm starting to not<br> > like the PIM flags<br> > now that I've read it.<br> > <br> > There's about a dozen commands that different USB flash devices can't do in<br> > various ways.<br> > I've started to convert umass to just fail the command as illegal when a<br> > bad command is<br> > sent to it. I've also been modifying the da, cd, etc drivers to notice the<br> > illegal commands and<br> > modify its behavior. It isn't a new idea: the periph drivers have been<br> > doing it to cope with<br> > drives that don't support READ(6) commands. It's recently (in the last 5<br> > years) expanded to<br> > dealing with other commands like SYNCHRONIZE CACHE, MODE SENSE.<br> > <br> > The idea is to allow the device to reject the command as illegal. In the<br> > cases of reduced SCSI<br> > command sets, like RBC, UFS, etc the SIM should reject known bad commands<br> > at the SIM<br> > layer because history has shown that some of the<br> > lower-quality-but-still-working-enough drives<br> > can hang when unexpected commands are sent to them.<br> > <br> > 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'll follow it<br> <br> > Test how? I'm not sure I understand this question well enough to answer,<br> > 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'm a FreeBSD newbie, so please forgive me if this is a stupid question).<br> <br> > In the mean time, I'll see if I can locate a copy of the UFS standard<br> > 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> > for me to buy on my own. I've found excerpts of it datasheets at best, which<br> > 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 -> 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>
