ayufan-rock64 / linux-build

Rock64 Linux build scripts, tools and instructions
MIT License
563 stars 100 forks source link

ssd TRIM over Pcie to sata adapter does not work #394

Open bavay opened 5 years ago

bavay commented 5 years ago

Hi!

I've just received and installed the PCIe Sata adapter into my RockPro64. It is connected to a Samsung Evo860 Sata SSD. The problem is that when I do a trim (for exmaple, "fstrim -va") it takes a long time and generates lots of error messages (see https://pastebin.com/5EARFYTk). Has anybody experienced this? I am using the latest Ayufan 5.2 kernel and the ssd works properly (if I connect it through a JMicron usb3 to sata adapter, the trim works fine and the performances are very similar to the one I can see with the PCIe to sata adapter).

Thanks for any feedback and suggestions!

bavay commented 5 years ago

By the way, the bug is also present with kernel 5.3.0-rc4, this time with some filesystem corruption:

Aug 28 14:19:21 localhost kernel: [ 562.212595] ata1: hard resetting link Aug 28 14:19:21 localhost kernel: [ 562.688717] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300) Aug 28 14:19:21 localhost kernel: [ 562.689144] ata1.00: supports DRM functions and may not be fully accessible Aug 28 14:19:21 localhost kernel: [ 562.693764] ata1.00: supports DRM functions and may not be fully accessible Aug 28 14:19:21 localhost kernel: [ 562.697815] ata1.00: configured for UDMA/133 Aug 28 14:19:21 localhost kernel: [ 562.697840] ata1: EH complete Aug 28 14:19:21 localhost kernel: [ 562.697960] ata1.00: Enabling discard_zeroes_data Aug 28 14:20:00 localhost kernel: [ 601.892701] ata1: hard resetting link Aug 28 14:20:01 localhost kernel: [ 602.368822] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300) Aug 28 14:20:01 localhost kernel: [ 602.369244] ata1.00: supports DRM functions and may not be fully accessible Aug 28 14:20:01 localhost kernel: [ 602.373614] ata1.00: supports DRM functions and may not be fully accessible Aug 28 14:20:01 localhost kernel: [ 602.377421] ata1.00: configured for UDMA/133 Aug 28 14:20:01 localhost kernel: [ 602.377455] ata1.00: device reported invalid CHS sector 0 Aug 28 14:20:01 localhost kernel: [ 602.377477] sd 0:0:0:0: [sda] tag#12 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08 Aug 28 14:20:01 localhost kernel: [ 602.377482] sd 0:0:0:0: [sda] tag#12 Sense Key : 0x5 [current] Aug 28 14:20:01 localhost kernel: [ 602.377485] sd 0:0:0:0: [sda] tag#12 ASC=0x21 ASCQ=0x4 Aug 28 14:20:01 localhost kernel: [ 602.377489] sd 0:0:0:0: [sda] tag#12 CDB: opcode=0x28 28 00 71 80 09 00 00 01 08 00 Aug 28 14:20:01 localhost kernel: [ 602.377550] ata1: EH complete Aug 28 14:20:01 localhost kernel: [ 602.378721] ata1.00: Enabling discard_zeroes_data Aug 28 14:20:32 localhost kernel: [ 633.892759] ata1: hard resetting link Aug 28 14:20:33 localhost kernel: [ 634.368742] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300) Aug 28 14:20:33 localhost kernel: [ 634.369347] ata1.00: supports DRM functions and may not be fully accessible Aug 28 14:20:33 localhost kernel: [ 634.373464] ata1.00: supports DRM functions and may not be fully accessible Aug 28 14:20:33 localhost kernel: [ 634.376839] ata1.00: configured for UDMA/133 Aug 28 14:20:33 localhost kernel: [ 634.376848] ata1.00: device reported invalid CHS sector 0 Aug 28 14:20:33 localhost kernel: [ 634.376869] ata1: EH complete Aug 28 14:20:33 localhost kernel: [ 634.376957] ata1.00: Enabling discard_zeroes_data Aug 28 14:21:03 localhost kernel: [ 664.604795] ata1.00: NCQ disabled due to excessive errors Aug 28 14:21:03 localhost kernel: [ 664.604829] ata1: hard resetting link Aug 28 14:21:03 localhost kernel: [ 665.080855] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300) Aug 28 14:21:03 localhost kernel: [ 665.081431] ata1.00: supports DRM functions and may not be fully accessible Aug 28 14:21:03 localhost kernel: [ 665.085378] ata1.00: supports DRM functions and may not be fully accessible Aug 28 14:21:03 localhost kernel: [ 665.088688] ata1.00: configured for UDMA/133 Aug 28 14:21:03 localhost kernel: [ 665.088696] ata1.00: device reported invalid CHS sector 0 Aug 28 14:21:03 localhost kernel: [ 665.088711] ata1: EH complete Aug 28 14:21:03 localhost kernel: [ 665.093662] ata1.00: Enabling discard_zeroes_data

bavay commented 5 years ago

And Yesterday, I had a major filesystem corruption. I had ran iozone on my ssd to compare with your numbers for the rock64 and I noticed just after this test that my ssd had many errors and was remounted ro. I rebooted to make sure I would have a sane system and after rebooting, the whole root of the ssd had disappeared (but the content could be found in the lost+found folder created by fsck after pages and pages of issues that had to be fixed). At the same time, my sdcard got totally corrupt (it was using the f2fs filesystem and fsck could not even run on it). I unfortunately don't have any logs that survived. I wonder what could have produced it, if this is another kind of under-voltage issue...