Hardware: One Intel G2 80GB SSD connected to a Supermicro AOC-SATA2-MV8 PCI-X controller http://www.supermicro.com/products/accessories/addon/AOC-SAT2-MV8.cfm $ sudo fdisk -lu [..] Disk /dev/sda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0002e4d7 Device Boot Start End Blocks Id System /dev/sda1 * 2048 149843967 74920960 83 Linux /dev/sda2 149846014 156301311 3227649 5 Extended /dev/sda5 149846016 156301311 3227648 82 Linux swap / Solaris $ OS: Ubuntu 10.04 w/Ubuntu 2.6.32 kernel works ok, but evidently does not support TRIM. Problem occurs when using the following (both amd64 and i386) kernels (tested so far) from: http://kernel.ubuntu.com/~kernel-ppa/mainline/ 2.6.33-02063305-generic 2.6.34-020634-generic 2.6.35-020635rc1 Problem: 1) Crash during boot when swap is mounted. From fstab: #UUID=[..] none swap sw 0 0 However, all kernels boot if swap is deactivated. 2) Crash during boot if the discard option is added to fstab (swap deactivated) From fstab: UUID[...] / ext4 errors=remount-ro,discard 0 1 Please find kernel debug messages (from serial console) enclosed. It seems that the error message produced is not always the same, even if the same kernel is rebooted without any changes. Also enclosed are output from ubuntu-bug and ver_linux. (I also tried removing the graphcis adapter and an additional network card from the system, and moving the sata controller to a different slot, to no effect.) Sample error messages: BUG at /home/kernel-ppa/mainline/build/drivers/ata/sata_mv.c:2043! invalid opcode: 0000 [#1] SMP BUG: scheduling while atomic: loadkeys/325/0x10000100
Created attachment 27188 [details] trace_and_system_info
Recategorised to ata. sata_mv is crashing.
Mmm.. two issues in one: 1. sata_mv should not crash when something BAD happens, and.. 2. Need to force BM-DMA mode for TRIM commands, rather than EDMA mode. I'm traveling on holiday right now, and cannot do much for the time being. Cheers
Created attachment 27517 [details] Fix sata_mv to handle DSM/TRIM commands Posted to linux-ide today by me.
Created attachment 27520 [details] Additional patch for 2.6.35 kernels The first patch here is sufficient for 2.6.34 kernels. But in 2.6.35, a new BUG_ON() line in libata-sff.c breaks sata_mv completely. So here is a patch to get rid of that overly aggressive BUG_ON() line, so that DSM/TRIM and ATAPI commands can work again with the chipsets controlled by the sata_mv driver.
Do you have access to necessary hardware to do all the tests that you would like to do? Would access to a Supermicro AOC-SATA2-MV8 PCI-X controller be helpful to you (assuming that you do not have access to one already), or is any controller with the given chipset good enough?
I have samples here of all of the chips known to sata_mv, except for the kirkwood (appliance/SOC) variant. Usually it's good enough to have "any controller" with the given chipset. But there are many different Marvell chips that sata_mv knows about. I have tested the patches with the latest, "generation IIe" 7042 chip, and with the earlier "generation II" 6081 chip. Another user has verified them with the very similar kirkwood chip. The earlier 5xxx chips probably don't work at all with TRIM or ATAPI --> no bus-master DMA support on them (Marvell chips normally use a fancier DMA mode known as "EDMA" instead of old-school BM-DMA). Cheers
Note: your Supermicro AOC-SATA2-MV8 PCI-X board very likely has the 6081 chip on it. Cheers