Date: Sat, 8 Sep 2018 02:32:35 -0700 From: Mark Millard <marklmi@yahoo.com> To: Kirk McKusick <mckusick@mckusick.com> Cc: bob prohaska <fbsd@www.zefox.net>, FreeBSD Filesystems <freebsd-fs@FreeBSD.org> Subject: Re: CFT: TRIM Consolodation on UFS/FFS filesystems Message-ID: <A3FFE52A-1163-4F1C-ADD2-B842810E4D4C@yahoo.com> In-Reply-To: <D2E536B0-B278-4E76-A3A4-3444BF840722@yahoo.com> References: <201809062330.w86NUphJ027262@chez.mckusick.com> <B9914A0D-69DC-4D3F-9BA4-D180462B2FA5@yahoo.com> <D2E536B0-B278-4E76-A3A4-3444BF840722@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2018-Sep-8, at 1:36 AM, Mark Millard <marklmi at yahoo.com> wrote: > Just an FYI. > > I figured out a hack that allows the e.MMC on a microsd card > adapter to be used to boot and operate the Pine64+ 2GB, in > DDR52 mode at that. (And so shows what was missing in the > FreeBSD operation even if the code change is not the > proper form of an official fix.) > > But in the process I discovered that FreeBSD is using > (for e.MMC in this tested context): > > mmc0: REQUEST: CMD38 arg 0x1 flags 0x1d > > That "0x1" means: TRIM that forces reads of zeros: the true > Data Removal command for mmc protocol, a form of erase. 0x3 > would be DISCARD, the "performance command" that does not > guarantee what would be read afterwards: no erase required. > > TRIM is older (added in e/MCC 4.4). DISCARD is newer (added > in e.MMC 4.5). Each is mandatory when the version has the > function at all. > > Does FreeBSD have a policy of preferring erasure when > there is also the option to not require it? I looked up published SD card material and that command set encodes differently for the argument: 0x1 is DISCARD (also not requiring an erase) 0x2 is FULE when start LBA=LBA0 and end LBA=MaxLBA. Otherwise it is ERASE. (FreeBSD's mmcsd_delete uses 0x0 for ERASE selection.) (I ignore handling violations of start LBA <= end LBA <= Max LBA or out of order command sequences. FULE: Full User Area Logical Erase.) It looks like FreeBSD uses mmcsd_delete for both SD and e.MMC and it is coded for SD to be more optimal (DISCARD), not differentiating e.MMC from SD for argument values to use. In e.MMC 4.5+ 0x2 is a "discard enable" bit in the argument, and never a FULE or other such. In e.MMC the 0x0 case for CMD38's argument is for performing an erase on erase group(s) instead of sector(s). (I'm not describing Secure Request or Force Garbage Collect being 0x1 for e.MMC: apparently unused by mmcsd_delete .) === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A3FFE52A-1163-4F1C-ADD2-B842810E4D4C>