You are not logged in.

#1 2012-06-07 02:49:32

Malstrond
Member
From: Germany
Registered: 2009-06-03
Posts: 87

Disabling TRIM on the kernel level

I'm currently trying to use Arch on an older SSD (OCZ Vertex 1 30GB, FW 1.7) installed in an external eSATA + USB 3.0 enclosure.
The enclosure uses a JMicron JMS551/JMS539 controller. I'm currently using it in SATA mode. but it does not seem to passthrough TRIM commands. The SSD is however is reporting TRIM capability ("Data Set Management TRIM supported" in hdparm).

The problem is when I'm trying to set up the SSD in any way, in this case trying to make an ext4 partition, I get the following kernel error:

Jun  6 17:34:16 localhost kernel: [  277.650791] ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
Jun  6 17:34:16 localhost kernel: [  277.651912] ata4.00: failed command: DATA SET MANAGEMENT
Jun  6 17:34:16 localhost kernel: [  277.653034] ata4.00: cmd 06/01:01:00:00:00/00:00:00:00:00/a0 tag 0 dma 512 out
Jun  6 17:34:16 localhost kernel: [  277.653035]          res 40/00:01:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
Jun  6 17:34:16 localhost kernel: [  277.655332] ata4.00: status: { DRDY }
Jun  6 17:34:16 localhost kernel: [  277.656494] ata4: hard resetting link
Jun  6 17:34:16 localhost kernel: [  277.973960] ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Jun  6 17:34:16 localhost kernel: [  277.976185] ata4.00: configured for UDMA/133
Jun  6 17:34:16 localhost kernel: [  277.976192] ata4.00: device reported invalid CHS sector 0
Jun  6 17:34:16 localhost kernel: [  277.976200] sd 3:0:0:0: [sdc]  Result: hostbyte=0x00 driverbyte=0x08
Jun  6 17:34:16 localhost kernel: [  277.976203] sd 3:0:0:0: [sdc]  Sense Key : 0xb [current] [descriptor]
Jun  6 17:34:16 localhost kernel: [  277.976208] Descriptor sense data with sense descriptors (in hex):
Jun  6 17:34:16 localhost kernel: [  277.976210]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00 
Jun  6 17:34:16 localhost kernel: [  277.976218]         00 00 00 00 
Jun  6 17:34:16 localhost kernel: [  277.976222] sd 3:0:0:0: [sdc]  ASC=0x0 ASCQ=0x0
Jun  6 17:34:16 localhost kernel: [  277.976225] sd 3:0:0:0: [sdc] CDB: cdb[0]=0x93: 93 08 00 00 00 00 00 3f ff ff 00 3f ff c0 00 00
Jun  6 17:34:16 localhost kernel: [  277.976236] end_request: I/O error, dev sdc, sector 4194303
Jun  6 17:34:16 localhost kernel: [  277.977422] ata4: EH complete
Jun  6 17:34:47 localhost kernel: [  308.672837] ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
Jun  6 17:34:47 localhost kernel: [  308.674226] ata4.00: failed command: DATA SET MANAGEMENT
Jun  6 17:34:47 localhost kernel: [  308.675606] ata4.00: cmd 06/01:01:00:00:00/00:00:00:00:00/a0 tag 0 dma 512 out
Jun  6 17:34:47 localhost kernel: [  308.675607]          res 40/00:01:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
Jun  6 17:34:47 localhost kernel: [  308.678428] ata4.00: status: { DRDY }
Jun  6 17:34:47 localhost kernel: [  308.679848] ata4: hard resetting link
Jun  6 17:34:47 localhost kernel: [  308.999299] ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Jun  6 17:34:47 localhost kernel: [  309.000499] ata4.00: configured for UDMA/133
Jun  6 17:34:47 localhost kernel: [  309.000506] ata4.00: device reported invalid CHS sector 0
Jun  6 17:34:47 localhost kernel: [  309.000514] sd 3:0:0:0: [sdc]  Result: hostbyte=0x00 driverbyte=0x08
Jun  6 17:34:47 localhost kernel: [  309.000517] sd 3:0:0:0: [sdc]  Sense Key : 0xb [current] [descriptor]
Jun  6 17:34:47 localhost kernel: [  309.000521] Descriptor sense data with sense descriptors (in hex):
Jun  6 17:34:47 localhost kernel: [  309.000524]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00 
Jun  6 17:34:47 localhost kernel: [  309.000532]         00 00 00 00 
Jun  6 17:34:47 localhost kernel: [  309.000536] sd 3:0:0:0: [sdc]  ASC=0x0 ASCQ=0x0
Jun  6 17:34:47 localhost kernel: [  309.000539] sd 3:0:0:0: [sdc] CDB: cdb[0]=0x93: 93 08 00 00 00 00 00 7f ff bf 00 3f ff c0 00 00
Jun  6 17:34:47 localhost kernel: [  309.000550] end_request: I/O error, dev sdc, sector 8388543
Jun  6 17:34:47 localhost kernel: [  309.002000] ata4: EH complete
Jun  6 17:35:18 localhost kernel: [  339.588285] ata4: limiting SATA link speed to 1.5 Gbps
Jun  6 17:35:18 localhost kernel: [  339.588290] ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
Jun  6 17:35:18 localhost kernel: [  339.589762] ata4.00: failed command: DATA SET MANAGEMENT
Jun  6 17:35:18 localhost kernel: [  339.591226] ata4.00: cmd 06/01:01:00:00:00/00:00:00:00:00/a0 tag 0 dma 512 out
Jun  6 17:35:18 localhost kernel: [  339.591227]          res 40/00:01:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
Jun  6 17:35:18 localhost kernel: [  339.594179] ata4.00: status: { DRDY }
Jun  6 17:35:18 localhost kernel: [  339.595659] ata4: hard resetting link
Jun  6 17:35:18 localhost kernel: [  339.914740] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Jun  6 17:35:18 localhost kernel: [  339.915940] ata4.00: configured for UDMA/133
Jun  6 17:35:18 localhost kernel: [  339.915946] ata4.00: device reported invalid CHS sector 0
Jun  6 17:35:18 localhost kernel: [  339.915954] sd 3:0:0:0: [sdc]  Result: hostbyte=0x00 driverbyte=0x08
Jun  6 17:35:18 localhost kernel: [  339.915958] sd 3:0:0:0: [sdc]  Sense Key : 0xb [current] [descriptor]
Jun  6 17:35:18 localhost kernel: [  339.915962] Descriptor sense data with sense descriptors (in hex):
Jun  6 17:35:18 localhost kernel: [  339.915964]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00 
Jun  6 17:35:18 localhost kernel: [  339.915973]         00 00 00 00 
Jun  6 17:35:18 localhost kernel: [  339.915976] sd 3:0:0:0: [sdc]  ASC=0x0 ASCQ=0x0
Jun  6 17:35:18 localhost kernel: [  339.915980] sd 3:0:0:0: [sdc] CDB: cdb[0]=0x93: 93 08 00 00 00 00 00 bf ff 7f 00 3f ff c0 00 00
Jun  6 17:35:18 localhost kernel: [  339.915991] end_request: I/O error, dev sdc, sector 12582783
Jun  6 17:35:18 localhost kernel: [  339.917481] ata4: EH complete
Jun  6 17:35:41 localhost kernel: [  362.325119] INFO: task mkfs.ext4:2382 blocked for more than 120 seconds.
Jun  6 17:35:41 localhost kernel: [  362.326787] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Jun  6 17:35:41 localhost kernel: [  362.328471] mkfs.ext4       D 00000000ffff9cca     0  2382   1319 0x00000004
Jun  6 17:35:41 localhost kernel: [  362.328473]  ffff880211067c58 0000000000000082 ffff880200000000 ffff88020f109b30
Jun  6 17:35:41 localhost kernel: [  362.328476]  ffff880212a1e4a0 ffff880211067fd8 ffff880211067fd8 ffff880211067fd8
Jun  6 17:35:41 localhost kernel: [  362.328478]  ffffffff8169b020 ffff880212a1e4a0 ffff880211067b98 ffffffff8121c087
Jun  6 17:35:41 localhost kernel: [  362.328480] Call Trace:
Jun  6 17:35:41 localhost kernel: [  362.328484]  [<ffffffff8121c087>] ? kobject_put+0x27/0x60
Jun  6 17:35:41 localhost kernel: [  362.328486]  [<ffffffff812e5b67>] ? put_device+0x17/0x20
Jun  6 17:35:41 localhost kernel: [  362.328497]  [<ffffffffa00e21cb>] ? scsi_request_fn+0xab/0x3d0 [scsi_mod]
Jun  6 17:35:41 localhost kernel: [  362.328501]  [<ffffffff81204105>] ? __make_request+0x115/0x3b0
Jun  6 17:35:41 localhost kernel: [  362.328503]  [<ffffffff813f1385>] schedule_timeout+0x305/0x390
Jun  6 17:35:41 localhost kernel: [  362.328505]  [<ffffffff81201d3e>] ? generic_make_request+0x30e/0x5c0
Jun  6 17:35:41 localhost kernel: [  362.328507]  [<ffffffff813efee8>] wait_for_common+0xc8/0x160
Jun  6 17:35:41 localhost kernel: [  362.328509]  [<ffffffff81055b00>] ? try_to_wake_up+0x280/0x280
Jun  6 17:35:41 localhost kernel: [  362.328512]  [<ffffffff813eff9d>] wait_for_completion+0x1d/0x20
Jun  6 17:35:41 localhost kernel: [  362.328516]  [<ffffffff81209874>] blkdev_issue_discard+0x1b4/0x1c0
Jun  6 17:35:41 localhost kernel: [  362.328520]  [<ffffffff81209c99>] blkdev_ioctl+0x109/0x750
Jun  6 17:35:41 localhost kernel: [  362.328524]  [<ffffffff8118b5f0>] block_ioctl+0x40/0x50
Jun  6 17:35:41 localhost kernel: [  362.328527]  [<ffffffff8116939f>] do_vfs_ioctl+0x8f/0x500
Jun  6 17:35:41 localhost kernel: [  362.328530]  [<ffffffff811416cf>] ? kmem_cache_free+0x2f/0x160
Jun  6 17:35:41 localhost kernel: [  362.328534]  [<ffffffff81163263>] ? putname+0x33/0x50
Jun  6 17:35:41 localhost kernel: [  362.328537]  [<ffffffff811698a1>] sys_ioctl+0x91/0xa0
Jun  6 17:35:41 localhost kernel: [  362.328540]  [<ffffffff813f4402>] system_call_fastpath+0x16/0x1b
Jun  6 17:35:49 localhost kernel: [  370.610302] ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
Jun  6 17:35:49 localhost kernel: [  370.612039] ata4.00: failed command: DATA SET MANAGEMENT
Jun  6 17:35:49 localhost kernel: [  370.613779] ata4.00: cmd 06/01:01:00:00:00/00:00:00:00:00/a0 tag 0 dma 512 out
Jun  6 17:35:49 localhost kernel: [  370.613780]          res 40/00:01:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
Jun  6 17:35:49 localhost kernel: [  370.617264] ata4.00: status: { DRDY }
Jun  6 17:35:49 localhost kernel: [  370.618990] ata4: hard resetting link
Jun  6 17:35:49 localhost kernel: [  370.936782] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Jun  6 17:35:49 localhost kernel: [  370.939252] ata4.00: configured for UDMA/133
Jun  6 17:35:49 localhost kernel: [  370.939259] ata4.00: device reported invalid CHS sector 0
Jun  6 17:35:49 localhost kernel: [  370.939267] sd 3:0:0:0: [sdc]  Result: hostbyte=0x00 driverbyte=0x08
Jun  6 17:35:49 localhost kernel: [  370.939270] sd 3:0:0:0: [sdc]  Sense Key : 0xb [current] [descriptor]
Jun  6 17:35:49 localhost kernel: [  370.939274] Descriptor sense data with sense descriptors (in hex):
Jun  6 17:35:49 localhost kernel: [  370.939277]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00 
Jun  6 17:35:49 localhost kernel: [  370.939285]         00 00 00 00 
Jun  6 17:35:49 localhost kernel: [  370.939289] sd 3:0:0:0: [sdc]  ASC=0x0 ASCQ=0x0
Jun  6 17:35:49 localhost kernel: [  370.939292] sd 3:0:0:0: [sdc] CDB: cdb[0]=0x93: 93 08 00 00 00 00 00 ff ff 3f 00 3f ff c0 00 00
Jun  6 17:35:49 localhost kernel: [  370.939304] end_request: I/O error, dev sdc, sector 16777023
Jun  6 17:35:49 localhost kernel: [  370.941058] ata4: EH complete
Jun  6 17:36:20 localhost kernel: [  401.632342] ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
Jun  6 17:36:20 localhost kernel: [  401.633539] ata4.00: failed command: DATA SET MANAGEMENT
Jun  6 17:36:20 localhost kernel: [  401.634711] ata4.00: cmd 06/01:01:00:00:00/00:00:00:00:00/a0 tag 0 dma 512 out
Jun  6 17:36:20 localhost kernel: [  401.634711]          res 40/00:01:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
Jun  6 17:36:20 localhost kernel: [  401.637103] ata4.00: status: { DRDY }
Jun  6 17:36:20 localhost kernel: [  401.638315] ata4: hard resetting link
Jun  6 17:36:20 localhost kernel: [  401.955488] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Jun  6 17:36:20 localhost kernel: [  401.957735] ata4.00: configured for UDMA/133
Jun  6 17:36:20 localhost kernel: [  401.957741] ata4.00: device reported invalid CHS sector 0
Jun  6 17:36:20 localhost kernel: [  401.957750] sd 3:0:0:0: [sdc]  Result: hostbyte=0x00 driverbyte=0x08
Jun  6 17:36:20 localhost kernel: [  401.957753] sd 3:0:0:0: [sdc]  Sense Key : 0xb [current] [descriptor]
Jun  6 17:36:20 localhost kernel: [  401.957758] Descriptor sense data with sense descriptors (in hex):
Jun  6 17:36:20 localhost kernel: [  401.957760]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00 
Jun  6 17:36:20 localhost kernel: [  401.957769]         00 00 00 00 
Jun  6 17:36:20 localhost kernel: [  401.957772] sd 3:0:0:0: [sdc]  ASC=0x0 ASCQ=0x0
Jun  6 17:36:20 localhost kernel: [  401.957776] sd 3:0:0:0: [sdc] CDB: cdb[0]=0x93: 93 08 00 00 00 00 01 3f fe ff 00 3f ff c0 00 00
Jun  6 17:36:20 localhost kernel: [  401.957787] end_request: I/O error, dev sdc, sector 20971263
Jun  6 17:36:20 localhost kernel: [  401.959015] ata4: EH complete

As you can see, the errors repeats. It does so indefinitely, blocking the disk completely. The disk I/O LED stays lit. Only a hard reset helps.
The "failed command: DATA SET MANAGEMENT" shows that the kernel hangs while trying to issue a TRIM command, so I would like to disable it. This also happens when trying to use swapon.

The only thing I found when googling for my error is an unresolved Fedora bug report. The only information I can find on TRIM is to not enable it on the filesystem level, i.e. not setting -o discard on ext4. But how can I do that if there is no filesystem yet?  According to some forum posts the kernel shouldn't even issue any TRIM commands when no filesystem with support is used.

I can circumvent the issue by using the enclosure in USB 3.0 mode as the SSD can't report TRIM capabilities then and the kernel doesn't try to issue them, setting up the partition, and then rebooting and using it in eSATA mode again. But the swap problem remains.

Offline

#2 2012-08-23 19:31:33

olaf.the.lost.viking
Member
Registered: 2011-07-19
Posts: 21

Re: Disabling TRIM on the kernel level

Hi,

did you have any success? I'm currently trying to put a Samsung 830 SSD into a DELL Mini 10 and it seems the Poulsbo chipset is not able to forward the TRIM command either. So I have the same problem as you that I cannot even create a filesystem on the SSD. Creating one on another computer works, mounting on the DELL Mini too. But writing to it will break with the error messages you described.

Thanks

Last edited by olaf.the.lost.viking (2012-08-23 19:32:22)


I switched to OlafLostViking to match the IRC alias.

Offline

#3 2012-09-01 18:23:41

Malstrond
Member
From: Germany
Registered: 2009-06-03
Posts: 87

Re: Disabling TRIM on the kernel level

No, so far I'm still stuck.

I can use ext4 by creating the filesystem using USB instead of eSATA and then mounting it with the nodiscard option. But I still can't use swap because activating the swap partition generates ATA DATA SET MANAGEMENT commands for reasons unkown to me.

Last edited by Malstrond (2012-09-02 04:30:52)

Offline

#4 2012-09-01 18:32:14

olaf.the.lost.viking
Member
Registered: 2011-07-19
Posts: 21

Re: Disabling TRIM on the kernel level

OK, thank you. That's exactly my status. And since this machine is very slow and has only around 1GB of memory (minus memory for the GPU!), a swap partition seems pretty important - and be it only for hibernating.

For the records: I recently thought about trying out a swap file on a dedicated non-journaled partition (ext2 f.ex.) mounted with nodiscard. I don't know how much performance I would lose or if hibernating really works flawlessly. But since I'm now using a different harddrive for the netbook and it's running, I don't want to setup everything again at the moment. If anybody tries the swap file variant, it would be nice to report back in this thread :-)


I switched to OlafLostViking to match the IRC alias.

Offline

#5 2012-09-25 13:17:35

AndyE
Member
Registered: 2012-09-25
Posts: 1

Re: Disabling TRIM on the kernel level

Did some poking around in old kernel ML threads when TRIM was introduced. Have you tried:

ide_core.trim=0

as a kernel boot-time parameter? You used to have to set it to "1" to enable TRIM at all; perhaps inverting the logic will disable it.

Last edited by AndyE (2012-09-25 13:18:14)

Offline

#6 2012-09-27 16:07:05

olaf.the.lost.viking
Member
Registered: 2011-07-19
Posts: 21

Re: Disabling TRIM on the kernel level

Hi Andy,

thank you for taking the time to propose a solution. Unfortunately I used the SSD for another notebook and put an "old" harddrive into the netbook. So I cannot try out your suggestion at the moment. But I will keep this on my mind in case I get another SSD for the machine!


I switched to OlafLostViking to match the IRC alias.

Offline

#7 2012-11-09 05:09:57

Malstrond
Member
From: Germany
Registered: 2009-06-03
Posts: 87

Re: Disabling TRIM on the kernel level

I tried this AndyE's suggestion, but sadly ide_core.trim=0 does not fix the problem either, it doesn't have any effect. I also grepped the kernel soruces for "ide_core.trim" and didn't get any results, which leads me to believe this argument doesn't exist anymore.

Offline

Board footer

Powered by FluxBB