r1905 - in trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian: . patches patches/series
Andres Salomon
dilinger-guest@haydn.debian.org
Wed, 24 Nov 2004 23:02:09 -0700
Author: dilinger-guest
Date: 2004-11-24 23:02:02 -0700 (Wed, 24 Nov 2004)
New Revision: 1905
Added:
trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian/patches/ata_piix-combinde-mode-fix-2.dpatch
Modified:
trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian/changelog
trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian/patches/series/2.6.9-3
Log:
horms' PIIX legacy fix (hey, it rhymes)
Modified: trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian/changelog
===================================================================
--- trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian/changelog 2004-11-25 05:58:22 UTC (rev 1904)
+++ trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian/changelog 2004-11-25 06:02:02 UTC (rev 1905)
@@ -18,6 +18,9 @@
Williamson that prevents setserial from crashing the kernel. See:
http://marc.theaimsgroup.com/?l=linux-kernel&m=109913237604338&w=2
(Dann Frazier)
+
+ * PCI IDE legacy mode fix for ata_piix
+ (Possible fix for: #279902, #273171) (Simon Horman)
-- Andres Salomon <dilinger@voxel.net> Thu, 25 Nov 2004 00:20:47 -0500
Added: trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian/patches/ata_piix-combinde-mode-fix-2.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian/patches/ata_piix-combinde-mode-fix-2.dpatch 2004-11-25 05:58:22 UTC (rev 1904)
+++ trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian/patches/ata_piix-combinde-mode-fix-2.dpatch 2004-11-25 06:02:02 UTC (rev 1905)
@@ -0,0 +1,171 @@
+#! /bin/sh -e
+## <PATCHNAME>.dpatch by <PATCH_AUTHOR@EMAI>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Description: libata: PCI IDE legacy mode fix
+## DP: Patch author: Bartlomiej Zolnierkiewicz
+## DP: Upstream status: included
+
+. $(dirname $0)/DPATCH
+
+@DPATCH@
+# origin: bzolnier (BitKeeper)
+# cset: 1.1988.91.1 (2.6) key=416b214bV7CwIRgRqoomLi6qTfcGmw
+# inclusion: upstream
+# descrition: [PATCH] libata: PCI IDE legacy mode fix
+# revision date: Mon, 08 Nov 2004 16:12:47 +0900
+#
+# rset: ChangeSet|1.1988.89.2..1.1988.91.1
+# rset: drivers/scsi/libata-core.c|1.100..1.101
+# rset: include/linux/libata.h|1.55..1.56
+# rset: drivers/scsi/ata_piix.c|1.31..1.32
+#
+# This is a BitKeeper generated diff -Nru style patch.
+#
+# ChangeSet
+# 2004/10/11 20:11:55-04:00 bzolnier@elka.pw.edu.pl
+# [PATCH] libata: PCI IDE legacy mode fix
+#
+# In PCI IDE legacy mode ap->port_no is incorrectly set to zero for
+# the second port. Fix it by adding ->hard_port_no to struct ata_probe_ent
+# and struct ata_port (per Jeff's suggestion) and teaching ata_piix.c
+# to use it instead of ->port_no.
+#
+# Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
+#
+# include/linux/libata.h
+# 2004/10/11 15:52:22-04:00 bzolnier@elka.pw.edu.pl +2 -0
+# PCI IDE legacy mode fix
+#
+# drivers/scsi/libata-core.c
+# 2004/10/11 15:52:22-04:00 bzolnier@elka.pw.edu.pl +8 -0
+# PCI IDE legacy mode fix
+#
+# drivers/scsi/ata_piix.c
+# 2004/10/11 15:52:22-04:00 bzolnier@elka.pw.edu.pl +10 -10
+# PCI IDE legacy mode fix
+#
+diff -Nru a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
+--- a/drivers/scsi/ata_piix.c 2004-11-08 16:12:47 +09:00
++++ b/drivers/scsi/ata_piix.c 2004-11-08 16:12:47 +09:00
+@@ -268,7 +268,7 @@
+ goto cbl40;
+
+ /* check BIOS cable detect results */
+- mask = ap->port_no == 0 ? PIIX_80C_PRI : PIIX_80C_SEC;
++ mask = ap->hard_port_no == 0 ? PIIX_80C_PRI : PIIX_80C_SEC;
+ pci_read_config_byte(pdev, PIIX_IOCFG, &tmp);
+ if ((tmp & mask) == 0)
+ goto cbl40;
+@@ -294,7 +294,7 @@
+ static void piix_pata_phy_reset(struct ata_port *ap)
+ {
+ if (!pci_test_config_bits(ap->host_set->pdev,
+- &piix_enable_bits[ap->port_no])) {
++ &piix_enable_bits[ap->hard_port_no])) {
+ ata_port_disable(ap);
+ printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
+ return;
+@@ -327,8 +327,8 @@
+ int orig_mask, mask, i;
+ u8 pcs;
+
+- mask = (PIIX_PORT_PRESENT << ap->port_no) |
+- (PIIX_PORT_ENABLED << ap->port_no);
++ mask = (PIIX_PORT_PRESENT << ap->hard_port_no) |
++ (PIIX_PORT_ENABLED << ap->hard_port_no);
+
+ pci_read_config_byte(pdev, ICH5_PCS, &pcs);
+ orig_mask = (int) pcs & 0xff;
+@@ -345,7 +345,7 @@
+ mask = (PIIX_PORT_PRESENT << i) | (PIIX_PORT_ENABLED << i);
+
+ if ((orig_mask & mask) == mask)
+- if (combined || (i == ap->port_no))
++ if (combined || (i == ap->hard_port_no))
+ return 1;
+ }
+
+@@ -373,7 +373,7 @@
+ {
+ struct pci_dev *dev = ap->host_set->pdev;
+ unsigned int is_slave = (adev->flags & ATA_DFLAG_MASTER) ? 0 : 1;
+- unsigned int master_port= ap->port_no ? 0x42 : 0x40;
++ unsigned int master_port= ap->hard_port_no ? 0x42 : 0x40;
+ unsigned int slave_port = 0x44;
+ u16 master_data;
+ u8 slave_data;
+@@ -412,10 +412,10 @@
+ /* enable PPE, IE and TIME */
+ master_data |= 0x0070;
+ pci_read_config_byte(dev, slave_port, &slave_data);
+- slave_data &= (ap->port_no ? 0x0f : 0xf0);
++ slave_data &= (ap->hard_port_no ? 0x0f : 0xf0);
+ slave_data |=
+ (timings[pio][0] << 2) |
+- (timings[pio][1] << (ap->port_no ? 4 : 0));
++ (timings[pio][1] << (ap->hard_port_no ? 4 : 0));
+ } else {
+ master_data &= 0xccf8;
+ /* enable PPE, IE and TIME */
+@@ -445,9 +445,9 @@
+ {
+ unsigned int udma = adev->dma_mode; /* FIXME: MWDMA too */
+ struct pci_dev *dev = ap->host_set->pdev;
+- u8 maslave = ap->port_no ? 0x42 : 0x40;
++ u8 maslave = ap->hard_port_no ? 0x42 : 0x40;
+ u8 speed = udma;
+- unsigned int drive_dn = (ap->port_no ? 2 : 0) + adev->devno;
++ unsigned int drive_dn = (ap->hard_port_no ? 2 : 0) + adev->devno;
+ int a_speed = 3 << (drive_dn * 4);
+ int u_flag = 1 << drive_dn;
+ int v_flag = 0x01 << drive_dn;
+diff -Nru a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
+--- a/drivers/scsi/libata-core.c 2004-11-08 16:12:47 +09:00
++++ b/drivers/scsi/libata-core.c 2004-11-08 16:12:47 +09:00
+@@ -3032,6 +3032,8 @@
+ ap->ctl = ATA_DEVCTL_OBS;
+ ap->host_set = host_set;
+ ap->port_no = port_no;
++ ap->hard_port_no =
++ ent->legacy_mode ? ent->hard_port_no : port_no;
+ ap->pio_mask = ent->pio_mask;
+ ap->mwdma_mask = ent->mwdma_mask;
+ ap->udma_mask = ent->udma_mask;
+@@ -3163,6 +3163,8 @@
+ probe_ent->port[0].ctl_addr = 0x3f6;
+ probe_ent->n_ports = 1;
+ probe_ent->irq = 14;
++ probe_ent->hard_port_no = 0;
++ probe_ent->legacy_mode = 1;
+ ata_std_ports(&probe_ent->port[0]);
+
+ probe_ent2->port[0].cmd_addr = 0x170;
+@@ -3171,6 +3173,8 @@
+ probe_ent2->port[0].bmdma_addr = pci_resource_start(pdev, 4)+8;
+ probe_ent2->n_ports = 1;
+ probe_ent2->irq = 15;
++ probe_ent->hard_port_no = 1;
++ probe_ent->legacy_mode = 1;
+ ata_std_ports(&probe_ent2->port[0]);
+
+ probe_ent2->sht = port1->sht;
+diff -Nru a/include/linux/libata.h b/include/linux/libata.h
+--- a/include/linux/libata.h 2004-11-08 16:12:47 +09:00
++++ b/include/linux/libata.h 2004-11-08 16:12:47 +09:00
+@@ -189,6 +189,7 @@
+ Scsi_Host_Template *sht;
+ struct ata_ioports port[ATA_MAX_PORTS];
+ unsigned int n_ports;
++ unsigned int hard_port_no;
+ unsigned int pio_mask;
+ unsigned int mwdma_mask;
+ unsigned int udma_mask;
+@@ -273,6 +274,7 @@
+ unsigned long flags; /* ATA_FLAG_xxx */
+ unsigned int id; /* unique id req'd by scsi midlyr */
+ unsigned int port_no; /* unique port #; from zero */
++ unsigned int hard_port_no; /* hardware port #; from zero */
+
+ struct ata_prd *prd; /* our SG list */
+ dma_addr_t prd_dma; /* and its DMA mapping */
Modified: trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian/patches/series/2.6.9-3
===================================================================
--- trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian/patches/series/2.6.9-3 2004-11-25 05:58:22 UTC (rev 1904)
+++ trunk/kernel/source/kernel-source-2.6.9-2.6.9/debian/patches/series/2.6.9-3 2004-11-25 06:02:02 UTC (rev 1905)
@@ -6,3 +6,4 @@
+ smbfs-overflow-fixes.dpatch
+ tty-locking-fixes9.dpatch
+ drivers-serial-8250-ioremap-fix.dpatch
++ ata_piix-combinde-mode-fix-2.dpatch