android_kernel_xiaomi_sdm845/drivers
Tejun Heo 837f5f8fb9 ahci: fix CAP.NP and PI handling
AHCI uses CAP.NP to indicate the number of ports and PI to tell which
ports are enabled.  The only requirement is that the number of ports
indicated by CAP.NP should equal or be higher than the number of
enabled ports in PI.

CAP.NP and PI carry duplicate information and there have been some
interesting cases.  Some early AHCI controllers didn't set PI at all
and just implement from port 0 to CAP.NP.  An ICH8 board which wired
four out of six available ports had 3 (4 ports) for CAP.NP and 0x33
for PI.  While ESB2 has less bits set in PI than the value in CAP.NP.

Till now, ahci driver assumed that PI is invalid if it doesn't match
CAP.NP exactly.  This violates AHCI standard and the driver ends up
accessing unmimplemented ports on ESB2.

This patch updates CAP.NP and PI handling such that PI can have less
number of bits set than indicated in CAP.NP and the highest port is
determined as the maximum port of what CAP.NP and PI indicate.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-06 06:59:27 -05:00
..
acorn/char
acpi latency.c: use QoS infrastructure 2008-02-05 09:44:22 -08:00
amba
ata ahci: fix CAP.NP and PI handling 2008-02-06 06:59:27 -05:00
atm [ATM]: [he] fixing compilation when you define USE_RBPS_POOL/USE_RBPL_POOL 2008-01-28 15:00:15 -08:00
auxdisplay
base Merge branch 'dmapool' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc 2008-02-05 19:05:48 -08:00
block Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus 2008-02-04 08:00:54 -08:00
bluetooth Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-02-05 10:09:07 -08:00
cdrom ide-cd: move lba_to_msf() and msf_to_lba() to <linux/cdrom.h> 2008-02-01 23:09:24 +01:00
char Merge branch 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6 2008-02-05 09:54:10 -08:00
clocksource
connector [NETNS]: Consolidate kernel netlink socket destruction. 2008-01-28 15:08:07 -08:00
cpufreq cpufreq: fix obvious condition statement error 2008-01-30 13:33:34 +01:00
cpuidle pm qos infrastructure and interface 2008-02-05 09:44:22 -08:00
crypto [S390] crypto: move s390 Kconfig options. 2008-01-26 14:11:17 +01:00
dca
dio dio: ARRAY_SIZE() cleanup 2008-02-05 09:44:23 -08:00
dma DMA: Convert from class_device to device for DMA engine 2008-01-24 20:40:05 -08:00
edac drivers/edac/: Spelling fixes 2008-02-03 17:12:34 +02:00
eisa
firewire firewire: fw-sbp2: Use sbp2 device-provided mgt orb timeout for logins 2008-01-30 22:22:29 +01:00
firmware drivers/firmware/: Spelling fixes 2008-02-03 17:13:40 +02:00
gpio gpiolib: pca9539 i2c gpio expander support 2008-02-05 09:44:13 -08:00
hid HID: ADS/Tech Radio si470x needs blacklist entry 2008-01-28 14:51:23 +01:00
hwmon
i2c deprecate obsolete pca9539 driver 2008-02-05 09:44:13 -08:00
ide Rename: linux/pata_platform.h to linux/ata_platform.h 2008-02-06 06:54:17 -05:00
ieee1394 ieee1394: sbp2: fix bogus s/g access change 2008-02-02 13:48:16 +01:00
infiniband RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
input drivers/input/: Spelling fixes 2008-02-03 17:15:20 +02:00
isdn drivers/isdn/: Spelling fixes 2008-02-03 17:16:28 +02:00
leds leds: add possibility to remove leds classdevs during suspend/resume 2008-02-05 09:44:23 -08:00
lguest virtio: reset function 2008-02-04 23:50:03 +11:00
macintosh ppc: fix #ifdef-s in mediabay driver (take 2) 2008-02-06 02:57:50 +01:00
mca
md Kobject: convert drivers/* from kobject_unregister() to kobject_put() 2008-01-24 20:40:40 -08:00
media drivers/media/: Spelling fixes 2008-02-03 17:18:59 +02:00
message drivers/message/: Spelling fixes 2008-02-03 17:21:01 +02:00
mfd [ARM] Fix class_device damage caused by 0c55445f20 2008-01-28 10:59:09 +00:00
misc kobject: convert ibmasm to use kref, not kobject 2008-01-24 20:40:08 -08:00
mmc Merge branch 'blk-end-request' of git://git.kernel.dk/linux-2.6-block 2008-01-29 08:51:32 +11:00
mtd drivers/mtd/: Spelling fixes 2008-02-03 17:22:34 +02:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-02-05 10:09:07 -08:00
nubus nubus: kill drivers/nubus/nubus_syms.c 2008-02-05 09:44:23 -08:00
of
oprofile
parisc iommu sg merging: parisc: make iommu respect the segment size limits 2008-02-05 09:44:10 -08:00
parport Spelling fixes: lenght->length 2008-02-03 15:42:53 +02:00
pci iommu sg merging: PCI: add dma segment boundary support 2008-02-05 09:44:12 -08:00
pcmcia drivers/pcmcia: add missing pci_dev_get 2008-02-05 09:44:09 -08:00
pnp git-x86: drivers/pnp/pnpbios/bioscalls.c build fix 2008-01-30 13:32:31 +01:00
power apm_power: check I.intval for zero value, we use it as the divisor 2008-02-02 02:44:34 +03:00
ps3 [POWERPC] PS3: Vuart: change semaphore to mutex 2008-01-25 22:52:53 +11:00
rapidio Merge branch 'linux-2.6' 2008-01-31 11:25:51 +11:00
rtc Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2008-01-29 08:52:50 +11:00
s390 [S390] dcss: Initialize workqueue before using it. 2008-02-05 16:51:01 +01:00
sbus
scsi ide: add ide_read_[alt]status() inline helpers 2008-02-06 02:57:51 +01:00
serial m68knommu: use ARRAY_SIZE in ColdFire serial driver 2008-02-05 09:44:21 -08:00
sh
sn
spi Spelling fixes: lenght->length 2008-02-03 15:42:53 +02:00
ssb drivers/ssb/: Spelling fixes 2008-02-03 17:30:25 +02:00
tc
telephony
uio UIO: constify function pointer tables 2008-01-24 20:40:43 -08:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6 2008-02-02 14:29:33 +11:00
video drivers/video/: Spelling fixes 2008-02-03 17:31:49 +02:00
virtio virtio: balloon driver 2008-02-04 23:50:13 +11:00
w1 i2c: normal_i2c can be made const (remaining drivers) 2008-01-27 18:14:47 +01:00
watchdog drivers/watchdog/: Spelling fixes 2008-02-03 17:32:52 +02:00
xen
zorro
Kconfig gpiolib: add drivers/gpio directory 2008-02-05 09:44:12 -08:00
Makefile gpiolib: add drivers/gpio directory 2008-02-05 09:44:12 -08:00