From owner-freebsd-bugs@freebsd.org Thu Oct 5 19:53:11 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAFF1E4115E for ; Thu, 5 Oct 2017 19:53:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C952984835 for ; Thu, 5 Oct 2017 19:53:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v95JrBe9068734 for ; Thu, 5 Oct 2017 19:53:11 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 222802] [patch] QUIRK: KingDian S200 SSD which crashes when receiving a TRIM command Date: Thu, 05 Oct 2017 19:53:11 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.3-STABLE X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: bsdpr@phoe.frmug.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 19:53:12 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D222802 Bug ID: 222802 Summary: [patch] QUIRK: KingDian S200 SSD which crashes when receiving a TRIM command Product: Base System Version: 10.3-STABLE Hardware: Any OS: Any Status: New Keywords: patch Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: bsdpr@phoe.frmug.org Keywords: patch Created attachment 186926 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D186926&action= =3Dedit KingDian S200 quirk preventing the kernel from issuing TRIM commands Inexpensive KingDian SATA SSDs are experiencing failures when issued a TRIM command. This can be observed when adding such a device as part of a zpool. Kernel reports a timeout on the TRIM command; then a timeout on the INQUIRY command; them the device reapears. It looks the SSD is crashing. The comman= d is retried, the SSD crash again, etc. The device identifies itself as ada1: ACS-2 ATA SATA 3.x device ada1: Serial Number ada1: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 512bytes) ada1: 57241MB (117231408 512 byte sectors) I was unable to keep track of the error messages as the system is unrespons= ive while he tries to handle this situation which ultimately require powering t= he host off to recover control. To resolve this I had to add a new kind of quirk to ata_da.c, I called it NO_TRIM. It simply clears the device's CAN_TRIM flag. When the quirk is in effect for that device it can then succesfully be used as part of a zpool. The quirk is applied to devices matching the "KingDian S200 *" pattern, the= re is currently two models in that line only differing in capacity: 60 and 120= GB. See http://web.archive.org/web/20171005194459/https://www.king-dian.com/product= -category/sata/s200/ The attached diff was made against svn revision 323189. --=20 You are receiving this mail because: You are the assignee for the bug.=