Bug 6760

Summary: very slow ahci-device detection since 2.6.17
Product: IO/Storage Reporter: Armin Krieg (warcomp)
Component: Serial ATAAssignee: Tejun Heo (htejun)
Status: CLOSED PATCH_ALREADY_AVAILABLE    
Severity: low CC: htejun
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.17 Subsystem:
Regression: --- Bisected commit-id:
Attachments: ahci-check-phy-status-in-srst

Description Armin Krieg 2006-06-28 05:28:28 UTC
Most recent kernel where this bug did not occur:
Distribution: Slamd64
Hardware Environment: Asus A8R-MVP
Software Environment:
Problem Description:

Since 2.6.17 the device detection of AHCI devices is very slow. More
specifically, detection of existing devices is no problem, but it takes
minutes for probing SATA-links that are down. If a link is down, there
should be no device, so why is it probing anyway (until there is a timeout)?

From dmesg:

ahci 0000:00:1f.1: AHCI 0001.0000 32 slots 4 ports 3 Gbps 0xf impl SATA mode
ahci 0000:00:1f.1: flags: ncq ilck pm led clo pmp pio slum part
ata1: SATA max UDMA/133 cmd 0xFFFFC20000004900 ctl 0x0 bmdma 0x0 irq 201
ata2: SATA max UDMA/133 cmd 0xFFFFC20000004980 ctl 0x0 bmdma 0x0 irq 201
ata3: SATA max UDMA/133 cmd 0xFFFFC20000004A00 ctl 0x0 bmdma 0x0 irq 201
ata4: SATA max UDMA/133 cmd 0xFFFFC20000004A80 ctl 0x0 bmdma 0x0 irq 201
ata1: SATA link up 1.5 Gbps (SStatus 113)
ata1: dev 0 cfg 49:2f00 82:7c6b 83:7f09 84:4673 85:7c69 86:3e21 87:4663 
88:007f
ata1: dev 0 ATA-7, max UDMA/133, 490234752 sectors: LBA48
ata1: dev 0 configured for UDMA/133
scsi0 : ahci
ata2: SATA link up 3.0 Gbps (SStatus 123)
ata2: dev 0 cfg 49:2f00 82:746b 83:7f01 84:4023 85:7469 86:3c01 87:4023 
88:40ff
ata2: dev 0 ATA-7, max UDMA7, 488397168 sectors: LBA48
ata2: dev 0 configured for UDMA/133
Losing some ticks... checking if CPU frequency changed.
scsi1 : ahci
ata3: SATA link down (SStatus 0)
ata3: qc timeout (cmd 0xec)
ata3: dev 0 failed to IDENTIFY (I/O error)
scsi2 : ahci
ata4: SATA link down (SStatus 0)
ata4: qc timeout (cmd 0xec)
ata4: dev 0 failed to IDENTIFY (I/O error)
scsi3 : ahci
  Vendor: ATA       Model: Maxtor 6L250S0    Rev: BACE
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: ATA       Model: SAMSUNG SP2504C   Rev: VT10
  Type:   Direct-Access                      ANSI SCSI revision: 05

Steps to reproduce:

Just boot 2.6.17 with AHCI-drivers on Asus A8R-MVP.
This board uses an ATI RS480 chipset.
Comment 1 Tejun Heo 2006-06-28 12:05:49 UTC
Created attachment 8441 [details]
ahci-check-phy-status-in-srst

This should fix it.  It's already fixed in devel tree but didn't get included
into 2.6.17.