FreeBSD Bugzilla – Attachment 186926 Details for
Bug 222802
[patch] QUIRK: KingDian S200 SSD which crashes when receiving a TRIM command
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
KingDian S200 quirk preventing the kernel from issuing TRIM commands
KingDian-S200-quirk.diff (text/plain), 1.17 KB, created by
Bertrand Petit
on 2017-10-05 19:53:11 UTC
(
hide
)
Description:
KingDian S200 quirk preventing the kernel from issuing TRIM commands
Filename:
MIME Type:
Creator:
Bertrand Petit
Created:
2017-10-05 19:53:11 UTC
Size:
1.17 KB
patch
obsolete
>diff -r f810f98b3e99 sys/cam/ata/ata_da.c >--- a/sys/cam/ata/ata_da.c Tue Sep 05 19:50:03 2017 +0200 >+++ b/sys/cam/ata/ata_da.c Thu Oct 05 21:21:20 2017 +0200 >@@ -93,11 +93,13 @@ > typedef enum { > ADA_Q_NONE = 0x00, > ADA_Q_4K = 0x01, >+ ADA_Q_NO_TRIM = 0x02, > } ada_quirks; > > #define ADA_Q_BIT_STRING \ > "\020" \ >- "\0014K" >+ "\0014K" \ >+ "\002NO_TRIM" > > typedef enum { > ADA_CCB_RAHEAD = 0x01, >@@ -378,6 +380,14 @@ > }, > { > /* >+ * KingDian S200 60GB P0921B >+ * Trimming crash the SSD >+ */ >+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "KingDian S200 *", "*" }, >+ /*quirks*/ADA_Q_NO_TRIM >+ }, >+ { >+ /* > * Kingston E100 Series SSDs > * 4k optimised & trim only works in 4k requests + 4k aligned > */ >@@ -1291,6 +1301,10 @@ > softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION; > if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) > softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; >+ /* Device lies about TRIM capability. */ >+ if ((softc->quirks & ADA_Q_NO_TRIM) && >+ (softc->flags & ADA_FLAG_CAN_TRIM)) >+ softc->flags &= ~ADA_FLAG_CAN_TRIM; > if (softc->flags & ADA_FLAG_CAN_TRIM) { > softc->disk->d_flags |= DISKFLAG_CANDELETE; > softc->disk->d_delmaxsize = softc->params.secsize *
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 222802
: 186926 |
187849