AHCI PATCH
Hi all Linux ATA developers,
using the latest stable kernel 2.6.17.7 in conjunction with the AHCI SATA driver it can happen that the driver tries to identify a drive although no drive is present at the corrosponding channel and the
physical link is down. This causes command timeouts on every unconnected
SATA channel and unnecessarily stalls the kernel boot-process.
The problem is related to an interaction issue between the generic
(libata-core) and the chip-specific (AHCI) driver and the fact,
that the ahci_dev_classify function returns a wrong class in case
of a not established physical link (at least on my ATI/ULi chipset
of my ASUS A8R32-MVP board). The issue can be removed by applying the
following patch to the ahci_hardreset method of the AHCI driver.
Regards
Steve
static int ahci_hardreset(struct ata_port *ap, int verbose,
unsigned int *class)
{
int rc;
DPRINTK("ENTER\n");
ahci_stop_engine(ap);
rc = sata_std_hardreset(ap, verbose, class);
ahci_start_engine(ap);- if (rc == 0)
+ if ((rc == 0) && sata_dev_present(ap))
*class = ahci_dev_classify(ap);
if (*class == ATA_DEV_UNKNOWN)
*class = ATA_DEV_NONE;
DPRINTK("EXIT, rc=%d, class=%u\n", rc, *class);
return rc;
}Tejun Heo
Acked-byReview
Quoted 13 lines · Steffen Koehler
static int ahci_hardreset(struct
ata_port*ap, int verbose,
unsigned int *class){ int rc; DPRINTK("ENTER\n"); ahci_stop_engine(ap); rc = sata_std_hardreset(ap, verbose, class); ahci_start_engine(ap);(quoted diff) +1
-1- if (rc == 0) + if ((rc == 0) && sata_dev_present(ap))
The corresponding fix is already in libata-dev#upstream and Linus's tree, so this fix is just for -stable.
Thanks.
Signature · 1 line
tejun