[kernel] r8306 - in dists/sid/linux-2.6/debian: . patches/bugfix patches/series

Dann Frazier dannf at alioth.debian.org
Fri Feb 16 03:20:50 UTC 2007


Author: dannf
Date: Fri Feb 16 04:20:49 2007
New Revision: 8306

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/atiixp-cable-detection-support.patch
   dists/sid/linux-2.6/debian/patches/bugfix/atiixp-old-ide-layer-hang.patch
   dists/sid/linux-2.6/debian/patches/bugfix/atiixp-only-one-channel.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/11
Log:
* atiixp: fix hang w/ old IDE layer calls
* atiixp: fix bug that restricts controller to a single channel.
  (closes: #411023)
* atiixp: add cable detection support, fixing breakage w/ 40-pin cable
  (closes: #411024)

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	(original)
+++ dists/sid/linux-2.6/debian/changelog	Fri Feb 16 04:20:49 2007
@@ -10,7 +10,14 @@
     in Sid may not load on sparc32 before the corresponding packages
     are rebuilt. Sorry for the inconvenience. (closes: #410497)
 
- -- Bastian Blank <waldi at debian.org>  Sat, 10 Feb 2007 11:17:30 +0100
+  [ dann frazier ]
+  * atiixp: fix hang w/ old IDE layer calls
+  * atiixp: fix bug that restricts controller to a single channel.
+    (closes: #411023)
+  * atiixp: add cable detection support, fixing breakage w/ 40-pin cable
+    (closes: #411024)
+
+ -- dann frazier <dannf at debian.org>  Thu, 15 Feb 2007 19:34:51 -0700
 
 linux-2.6 (2.6.18.dfsg.1-10) unstable; urgency=low
 

Added: dists/sid/linux-2.6/debian/patches/bugfix/atiixp-cable-detection-support.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/atiixp-cable-detection-support.patch	Fri Feb 16 04:20:49 2007
@@ -0,0 +1,51 @@
+From: Conke Hu <conke.hu at amd.com>
+Date: Sat, 27 Jan 2007 12:46:40 +0000 (+0100)
+Subject: atiixp.c: add cable detection support for ATI IDE
+X-Git-Tag: v2.6.20^0~56^2~5
+X-Git-Url: http://www.kernel.org/git/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=e5c073ff24604d4dbb2fbcedb17da6df768468d3
+
+atiixp.c: add cable detection support for ATI IDE
+
+IDE HDD does not work if it uses a 40-pin PATA cable on ATI chipset.
+This patch fixes the bug.
+
+Signed-off-by: Conke Hu <conke.hu at amd.com>
+Cc: Alan Cox <alan at lxorguk.ukuu.org.uk>
+Cc: Greg KH <greg at kroah.com>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier at gmail.com>
+---
+
+diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
+index 5b7e000..7e1d070 100644
+--- a/drivers/ide/pci/atiixp.c
++++ b/drivers/ide/pci/atiixp.c
+@@ -291,8 +291,12 @@ fast_ata_pio:
+ 
+ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
+ {
++	u8 udma_mode = 0;
++	u8 ch = hwif->channel;
++	struct pci_dev *pdev = hwif->pci_dev;
++
+ 	if (!hwif->irq)
+-		hwif->irq = hwif->channel ? 15 : 14;
++		hwif->irq = ch ? 15 : 14;
+ 
+ 	hwif->autodma = 0;
+ 	hwif->tuneproc = &atiixp_tuneproc;
+@@ -308,8 +312,12 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
+ 	hwif->mwdma_mask = 0x06;
+ 	hwif->swdma_mask = 0x04;
+ 
+-	/* FIXME: proper cable detection needed */
+-	hwif->udma_four = 1;
++	pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, &udma_mode);
++	if ((udma_mode & 0x07) >= 0x04 || (udma_mode & 0x70) >= 0x40)
++		hwif->udma_four = 1;
++	else
++		hwif->udma_four = 0;
++
+ 	hwif->ide_dma_host_on = &atiixp_ide_dma_host_on;
+ 	hwif->ide_dma_host_off = &atiixp_ide_dma_host_off;
+ 	hwif->ide_dma_check = &atiixp_dma_check;

Added: dists/sid/linux-2.6/debian/patches/bugfix/atiixp-old-ide-layer-hang.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/atiixp-old-ide-layer-hang.patch	Fri Feb 16 04:20:49 2007
@@ -0,0 +1,105 @@
+From: Alan <alan at lxorguk.ukuu.org.uk>
+Date: Sat, 6 Jan 2007 00:36:27 +0000 (-0800)
+Subject: [PATCH] atiixp: Old drivers/ide layer driver for the ATIIXP hang fix
+X-Git-Tag: v2.6.20-rc4^0~70
+X-Git-Url: http://www.kernel.org/git/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=6c5f8cc33eb2e10b6ab788bbe259fc142a068627
+
+[PATCH] atiixp: Old drivers/ide layer driver for the ATIIXP hang fix
+
+When the old IDE layer calls into methods in the driver during error
+handling it is essentially random whether ide_lock is already held.  This
+causes a deadlock in the atiixp driver which also uses ide_lock internally
+for locking.
+
+Switch to a private lock instead.
+
+[akpm at osl.org: cleanup]
+Signed-off-by: Alan Cox <alan at redhat.com>
+Acked-by: Bartlomiej Zolnierkiewicz <bzolnier at gmail.com>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+Signed-off-by: Linus Torvalds <torvalds at osdl.org>
+---
+
+diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
+index ffdffb6..524e65d 100644
+--- a/drivers/ide/pci/atiixp.c
++++ b/drivers/ide/pci/atiixp.c
+@@ -46,6 +46,8 @@ static atiixp_ide_timing mdma_timing[] = {
+ 
+ static int save_mdma_mode[4];
+ 
++static DEFINE_SPINLOCK(atiixp_lock);
++
+ /**
+  *	atiixp_ratemask		-	compute rate mask for ATIIXP IDE
+  *	@drive: IDE drive to compute for
+@@ -105,7 +107,7 @@ static int atiixp_ide_dma_host_on(ide_drive_t *drive)
+ 	unsigned long flags;
+ 	u16 tmp16;
+ 
+-	spin_lock_irqsave(&ide_lock, flags);
++	spin_lock_irqsave(&atiixp_lock, flags);
+ 
+ 	pci_read_config_word(dev, ATIIXP_IDE_UDMA_CONTROL, &tmp16);
+ 	if (save_mdma_mode[drive->dn])
+@@ -114,7 +116,7 @@ static int atiixp_ide_dma_host_on(ide_drive_t *drive)
+ 		tmp16 |= (1 << drive->dn);
+ 	pci_write_config_word(dev, ATIIXP_IDE_UDMA_CONTROL, tmp16);
+ 
+-	spin_unlock_irqrestore(&ide_lock, flags);
++	spin_unlock_irqrestore(&atiixp_lock, flags);
+ 
+ 	return __ide_dma_host_on(drive);
+ }
+@@ -125,13 +127,13 @@ static int atiixp_ide_dma_host_off(ide_drive_t *drive)
+ 	unsigned long flags;
+ 	u16 tmp16;
+ 
+-	spin_lock_irqsave(&ide_lock, flags);
++	spin_lock_irqsave(&atiixp_lock, flags);
+ 
+ 	pci_read_config_word(dev, ATIIXP_IDE_UDMA_CONTROL, &tmp16);
+ 	tmp16 &= ~(1 << drive->dn);
+ 	pci_write_config_word(dev, ATIIXP_IDE_UDMA_CONTROL, tmp16);
+ 
+-	spin_unlock_irqrestore(&ide_lock, flags);
++	spin_unlock_irqrestore(&atiixp_lock, flags);
+ 
+ 	return __ide_dma_host_off(drive);
+ }
+@@ -152,7 +154,7 @@ static void atiixp_tuneproc(ide_drive_t *drive, u8 pio)
+ 	u32 pio_timing_data;
+ 	u16 pio_mode_data;
+ 
+-	spin_lock_irqsave(&ide_lock, flags);
++	spin_lock_irqsave(&atiixp_lock, flags);
+ 
+ 	pci_read_config_word(dev, ATIIXP_IDE_PIO_MODE, &pio_mode_data);
+ 	pio_mode_data &= ~(0x07 << (drive->dn * 4));
+@@ -165,7 +167,7 @@ static void atiixp_tuneproc(ide_drive_t *drive, u8 pio)
+ 		 (pio_timing[pio].command_width << (timing_shift + 4));
+ 	pci_write_config_dword(dev, ATIIXP_IDE_PIO_TIMING, pio_timing_data);
+ 
+-	spin_unlock_irqrestore(&ide_lock, flags);
++	spin_unlock_irqrestore(&atiixp_lock, flags);
+ }
+ 
+ /**
+@@ -189,7 +191,7 @@ static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed)
+ 
+ 	speed = ide_rate_filter(atiixp_ratemask(drive), xferspeed);
+ 
+-	spin_lock_irqsave(&ide_lock, flags);
++	spin_lock_irqsave(&atiixp_lock, flags);
+ 
+ 	save_mdma_mode[drive->dn] = 0;
+ 	if (speed >= XFER_UDMA_0) {
+@@ -208,7 +210,7 @@ static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed)
+ 		}
+ 	}
+ 
+-	spin_unlock_irqrestore(&ide_lock, flags);
++	spin_unlock_irqrestore(&atiixp_lock, flags);
+ 
+ 	if (speed >= XFER_SW_DMA_0)
+ 		pio = atiixp_dma_2_pio(speed);

Added: dists/sid/linux-2.6/debian/patches/bugfix/atiixp-only-one-channel.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/atiixp-only-one-channel.patch	Fri Feb 16 04:20:49 2007
@@ -0,0 +1,47 @@
+From: Conke Hu <conke.hu at amd.com>
+Date: Sat, 27 Jan 2007 12:46:30 +0000 (+0100)
+Subject: atiixp.c: sb600 ide only has one channel
+X-Git-Tag: v2.6.20^0~56^2~6
+X-Git-Url: http://www.kernel.org/git/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=b25168dfdc162b4198fa6395cd191a20dddc6d34
+
+atiixp.c: sb600 ide only has one channel
+
+AMD/ATI SB600 IDE/PATA controller only has one channel.
+
+Signed-off-by: Conke Hu <conke.hu at amd.com>
+Cc: Alan Cox <alan at lxorguk.ukuu.org.uk>
+Cc: Greg KH <greg at kroah.com>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier at gmail.com>
+---
+
+Backported to Debian's 2.6.18 by dann frazier <dannf at debian.org>
+
+diff -urN linux-source-2.6.18.orig/drivers/ide/pci/atiixp.c linux-source-2.6.18/drivers/ide/pci/atiixp.c
+--- linux-source-2.6.18.orig/drivers/ide/pci/atiixp.c	2007-02-15 19:49:40.000000000 -0700
++++ linux-source-2.6.18/drivers/ide/pci/atiixp.c	2007-02-15 19:51:43.000000000 -0700
+@@ -328,7 +328,14 @@
+ 		.autodma	= AUTODMA,
+ 		.enablebits	= {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
+ 		.bootable	= ON_BOARD,
+-	}
++	},{	/* 1 */
++		.name		= "SB600_PATA",
++		.init_hwif	= init_hwif_atiixp,
++		.channels	= 1,
++		.autodma	= AUTODMA,
++		.enablebits	= {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
++ 		.bootable	= ON_BOARD,
++ 	},
+ };
+ 
+ /**
+@@ -349,7 +356,7 @@
+ 	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+ 	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+ 	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+-	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
++	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
+ 	{ 0, },
+ };
+ MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);

Modified: dists/sid/linux-2.6/debian/patches/series/11
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/11	(original)
+++ dists/sid/linux-2.6/debian/patches/series/11	Fri Feb 16 04:20:49 2007
@@ -7,3 +7,6 @@
 - bugfix/2.6.16.37
 - bugfix/2.6.16.38
 - bugfix/2.6.16.39
++ bugfix/atiixp-old-ide-layer-hang.patch
++ bugfix/atiixp-only-one-channel.patch
++ bugfix/atiixp-cable-detection-support.patch



More information about the Kernel-svn-changes mailing list