Bug 15481

Summary: ahci driver does not recognize drives.
Product: IO/Storage Reporter: kernel-bugzilla.20.drkshadow
Component: Serial ATAAssignee: Tejun Heo (tj)
Status: RESOLVED CODE_FIX    
Severity: normal CC: pchen, tj
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.31.6 Subsystem:
Regression: No Bisected commit-id:
Attachments: Annotated dmesg with attachments, human device identification, and error output.
ahci-nv-update.patch

Description kernel-bugzilla.20.drkshadow 2010-03-09 06:24:02 UTC
Created attachment 25418 [details]
Annotated dmesg with attachments, human device identification, and error output.

I have three Venus DS3R Pro enclosures, all of which work fine under FreeBSD. I opted to move them to Linux for better RAID and filesystem support, but was disappointed to find that none of the drives were recognized by the system.

The setup is thus:
Three Venus DS3R Pro two-drive enclosures, with a Silicon Image SII5744 (SteelVine) controller.
four onboard SATA ports, driven by the ahci driver. These ports will not work with the enclosures under Linux.
Two ports via PCI Express, sil_ata24. These ports work with the enclosures.
Two ports via PCI, sil_ata. These ports also work with the enclosures.

(ata1-4)
SATA controller: nVidia Corporation Device 0584 (rev a2)
  Subsystem: Foxconn International, Inc. Device 0d1d
  Kernel driver in use: ahci
(ata5-6)
RAID bus controller: Silicon Image, Inc. SiI 3512 [SATALink/SATARaid] Serial ATA Controller (rev 01)
  Subsystem: Silicon Image, Inc. SiI 3512 SATARaid Controller
  Kernel driver in use: sata_sil
(ata7-8)
RAID bus controller: Silicon Image, Inc. Device 0242 (rev 01)
  Subsystem: Adaptec Device 0242
  Kernel driver in use: sata_sil24

Error messages:
ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata4.00: failed to IDENTIFY (I/O error, err_mask=0x100)
ata4: limiting SATA link speed to 1.5 Gbps
ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
ata4.00: failed to IDENTIFY (I/O error, err_mask=0x100)
ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
ata4: exception Emask 0x10 SAct 0x0 SErr 0x0 action 0x1 t4
ata4: irq_stat 0x08000000, interface fatal error

Success messages, via another card:
ata6: exception Emask 0x10 SAct 0x0 SErr 0x50000 action 0xe frozen
ata6: SError: { PHYRdyChg CommWake }
ata6: hard resetting link
ata6: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
ata6.00: ATA-7: SAMSUNG HD103UJ, 1AA01113, max UDMA7
ata6.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 0/32)
ata6.00: configured for UDMA/100
ata6: EH complete
scsi 5:0:0:0: Direct-Access     ATA      SAMSUNG HD103UJ  1AA0 PQ: 0 ANSI: 5
...
Comment 1 Tejun Heo 2010-03-09 07:34:27 UTC
If you connect the 5744 to sil24, does it work?  It could be that the nvidia controller is falsely claiming PMP support.

Thanks.
Comment 2 Tejun Heo 2010-03-09 07:36:19 UTC
Oh, you already mentioned that.  Can you please post the output of lspci -nn?  Probably all that's necessary is to blacklist PMP support on the controller.
Comment 3 kernel-bugzilla.20.drkshadow 2010-03-09 08:51:35 UTC
Interesting.. indeed, the nVidia controller doesn't support port multiplication. If it's that simple, could you attach a patch, instructions to blacklist it, or a link to a commit please? :-)

I tried the following line in drivers/ata/libata-core.c, in ata_device_blacklist, before the final {}, and the issue was not resolved:
{ "nVidia Corporation Device 0584", NULL, ATA_HORKAGE_IPM, },
(also tried "a2" in place of NULL)

00:00.0 Host bridge [0600]: nVidia Corporation MCP73 Host Bridge [10de:07c1] (rev a2)
00:00.1 RAM memory [0500]: nVidia Corporation nForce 630i memory controller [10de:07cb] (rev a2)
00:01.0 RAM memory [0500]: nVidia Corporation nForce 630i memory controller [10de:07cd] (rev a1)
00:01.1 RAM memory [0500]: nVidia Corporation nForce 630i memory controller [10de:07ce] (rev a1)
00:01.2 RAM memory [0500]: nVidia Corporation nForce 630i memory controller [10de:07cf] (rev a1)
00:01.3 RAM memory [0500]: nVidia Corporation nForce 630i memory controller [10de:07d0] (rev a1)
00:01.4 RAM memory [0500]: nVidia Corporation nForce 630i memory controller [10de:07d1] (rev a1)
00:01.5 RAM memory [0500]: nVidia Corporation nForce 630i memory controller [10de:07d2] (rev a1)
00:01.6 RAM memory [0500]: nVidia Corporation nForce 630i memory controller [10de:07d3] (rev a1)
00:02.0 RAM memory [0500]: nVidia Corporation nForce 630i memory controller [10de:07d6] (rev a1)
00:03.0 ISA bridge [0601]: nVidia Corporation MCP73 LPC Bridge [10de:07d7] (rev a2)
00:03.1 SMBus [0c05]: nVidia Corporation MCP73 SMBus [10de:07d8] (rev a1)
00:03.2 RAM memory [0500]: nVidia Corporation MCP73 Memory Controller [10de:07d9] (rev a1)
00:03.3 Co-processor [0b40]: nVidia Corporation MCP73 Co-processor [10de:07da] (rev a2)
00:03.4 RAM memory [0500]: nVidia Corporation MCP73 Memory Controller [10de:07c8] (rev a1)
00:04.0 USB Controller [0c03]: nVidia Corporation GeForce 7100/nForce 630i USB [10de:07fe] (rev a1)
00:04.1 USB Controller [0c03]: nVidia Corporation MCP73 [nForce 630i] USB 2.0 Controller (EHCI) [10de:056a] (rev a1)
00:08.0 IDE interface [0101]: nVidia Corporation MCP73 IDE [10de:056c] (rev a1)
00:0a.0 PCI bridge [0604]: nVidia Corporation MCP73 PCI Express bridge [10de:056d] (rev a1)
00:0b.0 PCI bridge [0604]: nVidia Corporation MCP73 PCI Express bridge [10de:056e] (rev a1)
00:0c.0 PCI bridge [0604]: nVidia Corporation MCP73 PCI Express bridge [10de:056f] (rev a1)
00:0d.0 PCI bridge [0604]: nVidia Corporation MCP73 PCI Express bridge [10de:056f] (rev a1)
00:0e.0 SATA controller [0106]: nVidia Corporation Device [10de:0584] (rev a2)
00:0f.0 Ethernet controller [0200]: nVidia Corporation MCP73 Ethernet [10de:07dc] (rev a2)
00:10.0 VGA compatible controller [0300]: nVidia Corporation C73 [GeForce 7100 / nForce 630i] [10de:07e1] (rev a2)
01:06.0 RAID bus controller [0104]: Silicon Image, Inc. SiI 3512 [SATALink/SATARaid] Serial ATA Controller [1095:3512] (rev 01)
01:07.0 RAID bus controller [0104]: HighPoint Technologies, Inc. HPT372A/372N [1103:0005] (rev 01)
03:00.0 RAID bus controller [0104]: Silicon Image, Inc. Device [1095:0242] (rev 01)
Comment 4 Tejun Heo 2010-03-10 06:00:33 UTC
cc'd Peer Chen.  Hi!  It looks like 10de:0584 is lying about PMP support.  I'm gonna blacklist this one but if you have better list of devices which are broken, please let me know.  Thanks.
Comment 5 Tejun Heo 2010-03-10 06:13:54 UTC
Created attachment 25444 [details]
ahci-nv-update.patch

Can you please whether this patch fixes the problem?

Thanks.
Comment 6 Peer Chen 2010-03-10 06:27:35 UTC
TJ,
Only the MCP89 SATA controller support PMP, you can blacklist other controllers.
Comment 7 Tejun Heo 2010-03-10 06:29:51 UTC
Do 77 and 79 lie about the support too?
Comment 8 Peer Chen 2010-03-10 06:56:00 UTC
right.
Comment 9 kernel-bugzilla.20.drkshadow 2010-03-10 19:27:19 UTC
Looks like it works great.. thanks!

dmesg:
ahci 0000:00:0e.0: version 3.0
ahci 0000:00:0e.0: PCI INT A -> Link[APSI] -> GSI 22 (level, low) -> IRQ 22
ahci 0000:00:0e.0: controller can do NCQ, turning on CAP_NCQ
ahci 0000:00:0e.0: controller can't do PMP, turning off CAP_PMP
ahci 0000:00:0e.0: AHCI 0001.0100 32 slots 4 ports 3 Gbps 0xf impl SATA mode
ahci 0000:00:0e.0: flags: 64bit ncq sntf led clo pio
ahci 0000:00:0e.0: setting latency timer to 64
scsi0 : ahci
scsi1 : ahci
scsi2 : ahci
scsi3 : ahci
ata1: SATA max UDMA/133 abar m8192@0xefff8000 port 0xefff8100 irq 22
ata2: SATA max UDMA/133 abar m8192@0xefff8000 port 0xefff8180 irq 22
ata3: SATA max UDMA/133 irq_stat 0x00400040, connection status changed irq 22
ata4: SATA max UDMA/133 abar m8192@0xefff8000 port 0xefff8280 irq 22
ata1: SATA link down (SStatus 0 SControl 300)
ata4: SATA link down (SStatus 0 SControl 300)
ata2: SATA link down (SStatus 0 SControl 300)
ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata3.00: ATA-8: ST31000333AS, CC1F, max UDMA/133
ata3.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32)
ata3.00: configured for UDMA/133
scsi 2:0:0:0: Direct-Access     ATA      ST31000333AS     CC1F PQ: 0 ANSI: 5
sd 2:0:0:0: [sda] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB)
sd 2:0:0:0: [sda] Write Protect is off
sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda:
sd 2:0:0:0: Attached scsi generic sg0 type 0
 unknown partition table
sd 2:0:0:0: [sda] Attached SCSI disk

lspci:
00:0e.0 SATA controller [0106]: nVidia Corporation Device [10de:0584] (rev a2)
        Subsystem: Foxconn International, Inc. Device [105b:0d1d]
        Kernel driver in use: ahci
Comment 10 Tejun Heo 2010-03-11 02:42:05 UTC
Updated patches posted upstream.

  http://thread.gmane.org/gmane.linux.ide/45316

Resolving as FIXED.  Thanks.