Bug 191810

Summary: some SSDs should use UNMAP instead of ATA_TRIM
Product: Base System Reporter: Michael Brown <michael>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Many People    
Priority: ---    
Version: 10.0-RELEASE   
Hardware: amd64   
OS: Any   

Description Michael Brown 2014-07-11 18:00:48 UTC
System: FreeBSD fearless2 10.0-RELEASE-p7 FreeBSD 10.0-RELEASE-p7 #0: Wed Jul 9 12:19:19 EDT 2014 root@fearless2:/usr/obj/usr/src/sys/CAMDEBUG amd64

On my SSDs (IBM TX21B10400GE8IBM) UNMAP should be used instead of ATA_TRIM as UNMAP seems much more reliable.

Using TRIM, I get frequent timeouts:

(da6:mps1:0:5:0): ATA COMMAND PASS THROUGH(16). CDB: 85 0d 06 00 01 00 03 00 00 00 00 00 00 40 06 00 
(da6:mps1:0:5:0): CAM status: Command timeout
(da6:mps1:0:5:0): Retrying command

Is it possible to default to using UNMAP, if not for everything than for whitelisted devices?