Bug 16434 - Crash during boot - swap - ssd trim - MV88SX6081 8-port SATA II PCI-X Intel SSD
Summary: Crash during boot - swap - ssd trim - MV88SX6081 8-port SATA II PCI-X Intel SSD
Status: RESOLVED OBSOLETE
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: Serial ATA (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Jeff Garzik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-21 18:38 UTC by jodds
Modified: 2012-08-09 14:30 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.33 - 2.6.35
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
trace_and_system_info (992.05 KB, text/plain)
2010-07-21 18:45 UTC, jodds
Details
Fix sata_mv to handle DSM/TRIM commands (2.91 KB, patch)
2010-08-20 01:53 UTC, Mark Lord
Details | Diff
Additional patch for 2.6.35 kernels (746 bytes, patch)
2010-08-20 18:35 UTC, Mark Lord
Details | Diff

Description jodds 2010-07-21 18:38:54 UTC
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
Comment 1 jodds 2010-07-21 18:45:46 UTC
Created attachment 27188 [details]
trace_and_system_info
Comment 2 Andrew Morton 2010-07-23 21:41:21 UTC
Recategorised to ata.  sata_mv is crashing.
Comment 3 Mark Lord 2010-07-25 15:21:31 UTC
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
Comment 4 Mark Lord 2010-08-20 01:53:16 UTC
Created attachment 27517 [details]
Fix sata_mv to handle DSM/TRIM commands

Posted to linux-ide today by me.
Comment 5 Mark Lord 2010-08-20 18:35:28 UTC
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.
Comment 6 jodds 2010-08-21 11:19:52 UTC
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?
Comment 7 Mark Lord 2010-08-21 15:21:11 UTC
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
Comment 8 Mark Lord 2010-08-21 15:23:15 UTC
Note: your Supermicro AOC-SATA2-MV8 PCI-X board very likely has the 6081 chip on it.

Cheers

Note You need to log in before you can comment on or make changes to this bug.