]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.drivers/libata-pata_hpt366-fix-cable-detection
Revert "Move xen patchset to new version's subdir."
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / libata-pata_hpt366-fix-cable-detection
CommitLineData
00e5a55c
BS
1From: Tejun Heo <tj@kernel.org>
2Subject: pata_hpt366: fix cable detection,
3References: bnc#362159
4
5pata_hpt366 is strange in that its two channels occupy two PCI
6functions and both are primary channels and bit1 of PCI configuration
7register 0x5A indicates cable for both channels.
8
9Signed-off-by: Tejun Heo <tj@kernel.org>
10Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
11Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
12Signed-off-by: Tejun Heo <teheo@suse.de>
13---
14 drivers/ata/pata_hpt366.c | 8 ++++++--
15 1 file changed, 6 insertions(+), 2 deletions(-)
16
17Index: work/drivers/ata/pata_hpt366.c
18===================================================================
19--- work.orig/drivers/ata/pata_hpt366.c
20+++ work/drivers/ata/pata_hpt366.c
21@@ -211,11 +211,15 @@ static u32 hpt36x_find_mode(struct ata_p
22
23 static int hpt36x_cable_detect(struct ata_port *ap)
24 {
25- u8 ata66;
26 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
27+ u8 ata66;
28
29+ /*
30+ * Each channel of pata_hpt366 occupies separate PCI function
31+ * as the primary channel and bit1 indicates the cable type.
32+ */
33 pci_read_config_byte(pdev, 0x5A, &ata66);
34- if (ata66 & (1 << ap->port_no))
35+ if (ata66 & 2)
36 return ATA_CBL_PATA40;
37 return ATA_CBL_PATA80;
38 }
39