]> pilppa.org Git - linux-2.6-omap-h63xx.git/commit
ahci: reimplement port_map handling
authorTejun Heo <htejun@gmail.com>
Mon, 3 Sep 2007 03:44:57 +0000 (12:44 +0900)
committerJeff Garzik <jeff@garzik.org>
Fri, 12 Oct 2007 18:55:39 +0000 (14:55 -0400)
commit7a234aff3d83728fd83cf19df32d3df52566d2ac
treed991844bf7a7882eacd72a57a1465b25dc55e95d
parent05027adccc09401a7e31d5ef51040dc75ab03c22
ahci: reimplement port_map handling

Reimplement port_map handling such that

1. Non-zero PORTS_IMPL value is always examined and used if consistent
   with cap.n_ports.

2. When PI and cat.n_ports are inconsistent, honor cap.n_ports and
   force port_map to be ((1 << cap.n_ports) - 1).

3. There were two separate places dealing with port_map.  Unify them
   to one.

As all newer ahci chips seem to get PI correct and older ones usually
have zero PI.  Controllers with holes in PI are very unlikely to screw
up PI, so #2 makes more sense than following inconsistent PI.

Without this change, not setting ATA_FLAG_HONOR_PI when it's needed
results in weird detection failure.  This changed logic should be able
to handle all known cases correctly automatically.

Verified on ICH6 (reports 0 PI), ICH8 (with holes in port_map), ICH9,
JMB360 and JMB363.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/ahci.c