]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.31/patches.drivers/libata-pata_hpt366-fix-cable-detection
Reenabled linux-xen, added patches for Xen Kernel Version 2.6.27.31,
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.drivers / libata-pata_hpt366-fix-cable-detection
diff --git a/src/patches/suse-2.6.27.31/patches.drivers/libata-pata_hpt366-fix-cable-detection b/src/patches/suse-2.6.27.31/patches.drivers/libata-pata_hpt366-fix-cable-detection
new file mode 100644 (file)
index 0000000..af14cad
--- /dev/null
@@ -0,0 +1,39 @@
+From: Tejun Heo <tj@kernel.org>
+Subject: pata_hpt366: fix cable detection,
+References: bnc#362159
+
+pata_hpt366 is strange in that its two channels occupy two PCI
+functions and both are primary channels and bit1 of PCI configuration
+register 0x5A indicates cable for both channels.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
+Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
+Signed-off-by: Tejun Heo <teheo@suse.de>
+---
+ drivers/ata/pata_hpt366.c |    8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+Index: work/drivers/ata/pata_hpt366.c
+===================================================================
+--- work.orig/drivers/ata/pata_hpt366.c
++++ work/drivers/ata/pata_hpt366.c
+@@ -211,11 +211,15 @@ static u32 hpt36x_find_mode(struct ata_p
+ static int hpt36x_cable_detect(struct ata_port *ap)
+ {
+-      u8 ata66;
+       struct pci_dev *pdev = to_pci_dev(ap->host->dev);
++      u8 ata66;
++      /*
++       * Each channel of pata_hpt366 occupies separate PCI function
++       * as the primary channel and bit1 indicates the cable type.
++       */
+       pci_read_config_byte(pdev, 0x5A, &ata66);
+-      if (ata66 & (1 << ap->port_no))
++      if (ata66 & 2)
+               return ATA_CBL_PATA40;
+       return ATA_CBL_PATA80;
+ }
+