[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/kernel/devel linux-2.6.12-ac-ide-fixes.patch, NONE, 1.1 linux-2.6.12rc-ac-ide-fixes.patch, 1.4, NONE



Author: davej

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv13739

Added Files:
	linux-2.6.12-ac-ide-fixes.patch 
Removed Files:
	linux-2.6.12rc-ac-ide-fixes.patch 
Log Message:
rename file


linux-2.6.12-ac-ide-fixes.patch:
 drivers/cdrom/cdrom.c         |    3 
 drivers/ide/Kconfig           |    6 
 drivers/ide/ide-cd.c          |  114 ++++-
 drivers/ide/ide-disk.c        |   12 
 drivers/ide/ide-dma.c         |    1 
 drivers/ide/ide-io.c          |    8 
 drivers/ide/ide-iops.c        |   97 ++---
 drivers/ide/pci/Makefile      |    1 
 drivers/ide/pci/cs5520.c      |    2 
 drivers/ide/pci/generic.c     |   73 ++-
 drivers/ide/pci/hpt366.c      |  472 +++++++++++-------------
 drivers/ide/pci/it821x.c      |  812 ++++++++++++++++++++++++++++++++++++++++++
 drivers/ide/pci/serverworks.c |   10 
 drivers/ide/pci/siimage.c     |    8 
 drivers/ide/pci/trm290.c      |    1 
 drivers/scsi/libata-core.c    |    1 
 include/asm-i386/ide.h        |   14 
 include/linux/ide.h           |    4 
 include/linux/pci_ids.h       |    2 
 19 files changed, 1277 insertions(+), 364 deletions(-)

--- NEW FILE linux-2.6.12-ac-ide-fixes.patch ---
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.12/drivers/cdrom/cdrom.c linux-2.6.12/drivers/cdrom/cdrom.c
--- linux.vanilla-2.6.12/drivers/cdrom/cdrom.c	2005-06-19 11:30:47.000000000 +0100
+++ linux-2.6.12/drivers/cdrom/cdrom.c	2005-06-21 13:46:29.000000000 +0100
@@ -1131,7 +1131,8 @@
 	This ensures that the drive gets unlocked after a mount fails.  This 
 	is a goto to avoid bloating the driver with redundant code. */ 
 clean_up_and_return:
-	cdinfo(CD_WARNING, "open failed.\n"); 
+	/* Don't log this, its a perfectly normal user occurence */
+	/* cdinfo(CD_WARNING, "open failed.\n");  */
 	if (CDROM_CAN(CDC_LOCK) && cdi->options & CDO_LOCK) {
 			cdo->lock_door(cdi, 0);
 			cdinfo(CD_OPEN, "door unlocked.\n");
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.12/drivers/ide/ide-cd.c linux-2.6.12/drivers/ide/ide-cd.c
--- linux.vanilla-2.6.12/drivers/ide/ide-cd.c	2005-06-19 11:30:47.000000000 +0100
+++ linux-2.6.12/drivers/ide/ide-cd.c	2005-06-22 16:32:49.419755488 +0100
@@ -394,7 +394,8 @@
 			 * we cannot reliably check if drive can auto-close
 			 */
 			if (rq->cmd[0] == GPCMD_START_STOP_UNIT && sense->asc == 0x24)
-				log = 0;
+				break;
+			log = 1;
 			break;
 		case UNIT_ATTENTION:
 			/*
@@ -416,6 +417,11 @@
 			      struct request *failed_command,
 			      struct request_sense *sense)
 {
+	unsigned long sector;
+	unsigned long bio_sectors;
+	unsigned long valid;
+	struct cdrom_info *info = drive->driver_data;
+	
 	if (!cdrom_log_sense(drive, failed_command, sense))
 		return;
 
@@ -428,13 +434,43 @@
 		if (sense->sense_key == 0x05 && sense->asc == 0x24)
 			return;
 
+	if (sense->error_code == 0x70) {	/* Current Error */
+		switch(sense->sense_key) {
+			case MEDIUM_ERROR:
+			case VOLUME_OVERFLOW:
+			case ILLEGAL_REQUEST:
+				if(!sense->valid)
+					break;
+				if(failed_command == NULL || !blk_fs_request(failed_command))
+					break;
+				sector = (sense->information[0] << 24) |
+					 (sense->information[1] << 16) |
+					 (sense->information[2] <<  8) |
+					 (sense->information[3]);
+					 
+				bio_sectors = bio_sectors(failed_command->bio);
+				if(bio_sectors < 4)
+					bio_sectors = 4;
+				if(drive->queue->hardsect_size == 2048)
+					sector <<= 2;	/* Device sector size is 2K */
+				sector &= ~(bio_sectors -1);
+				valid = (sector - failed_command->sector) << 9;
+				
+				if(valid < 0)
+					valid = 0;
+				if(sector < get_capacity(info->disk) &&
+					drive->probed_capacity - sector < 4 * 75) {
+					set_capacity(info->disk, sector);
+				}
+		}
+	}
 #if VERBOSE_IDE_CD_ERRORS
 	{
 		int i;
 		const char *s;
 		char buf[80];
 
-		printk ("ATAPI device %s:\n", drive->name);
+		printk (KERN_ERR "ATAPI device %s:\n", drive->name);
 		if (sense->error_code==0x70)
 			printk("  Error: ");
 		else if (sense->error_code==0x71)
@@ -610,17 +646,22 @@
 				sense = failed->sense;
 				failed->sense_len = rq->sense_len;
 			}
-
+			cdrom_analyze_sense_data(drive, failed, sense);
 			/*
 			 * now end failed request
 			 */
 			spin_lock_irqsave(&ide_lock, flags);
-			end_that_request_chunk(failed, 0, failed->data_len);
-			end_that_request_last(failed);
+			if(blk_fs_request(failed)) {
+				if(__ide_end_request(drive, failed, 0, failed->hard_nr_sectors))
+					BUG();
+			} else {
+				end_that_request_chunk(failed, 0, failed->data_len);
+				end_that_request_last(failed);
+			}
 			spin_unlock_irqrestore(&ide_lock, flags);
 		}
-
-		cdrom_analyze_sense_data(drive, failed, sense);
+		else
+			cdrom_analyze_sense_data(drive, NULL , sense);
 	}
 
 	if (!rq->current_nr_sectors && blk_fs_request(rq))
@@ -634,6 +675,13 @@
 	ide_end_request(drive, uptodate, nsectors);
 }
 
+static void ide_dump_status_no_sense(ide_drive_t *drive, const char *msg, u8 stat)
+{
+	if(stat & 0x80)
+		return;
+	ide_dump_status(drive, msg, stat);
+}
+
 /* Returns 0 if the request should be continued.
    Returns 1 if the request was ended. */
 static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
@@ -762,16 +810,16 @@
 			   sense_key == DATA_PROTECT) {
 			/* No point in retrying after an illegal
 			   request or data protect error.*/
-			ide_dump_status (drive, "command error", stat);
+			ide_dump_status_no_sense (drive, "command error", stat);
 			do_end_request = 1;
 		} else if (sense_key == MEDIUM_ERROR) {
 			/* No point in re-trying a zillion times on a bad 
 			 * sector...  If we got here the error is not correctable */
-			ide_dump_status (drive, "media error (bad sector)", stat);
+			ide_dump_status_no_sense (drive, "media error (bad sector)", stat);
 			do_end_request = 1;
 		} else if (sense_key == BLANK_CHECK) {
 			/* Disk appears blank ?? */
-			ide_dump_status (drive, "media error (blank)", stat);
+			ide_dump_status_no_sense (drive, "media error (blank)", stat);
 			do_end_request = 1;
 		} else if ((err & ~ABRT_ERR) != 0) {
 			/* Go to the default handler
@@ -783,13 +831,27 @@
 			do_end_request = 1;
 		}
 
-		if (do_end_request)
-			cdrom_end_request(drive, 0);
+		/* End a request through request sense analysis when we have
+		   sense data. We need this in order to perform end of media
+		   processing */
+		   
+		if (do_end_request) {
+			if (stat & ERR_STAT) {
+				unsigned long flags;
+				spin_lock_irqsave(&ide_lock, flags);
+				blkdev_dequeue_request(rq);
+				HWGROUP(drive)->rq = NULL;
+				spin_unlock_irqrestore(&ide_lock, flags);
 
-		/* If we got a CHECK_CONDITION status,
-		   queue a request sense command. */
-		if ((stat & ERR_STAT) != 0)
-			cdrom_queue_request_sense(drive, NULL, NULL);
+				cdrom_queue_request_sense(drive, rq->sense, rq);
+			}
+			else cdrom_end_request(drive, 0);
+		} else {
+			/* If we got a CHECK_CONDITION status,
+			   queue a request sense command. */
+			if (stat & ERR_STAT)
+				cdrom_queue_request_sense(drive, NULL, NULL);
+		}
 	} else {
 		blk_dump_rq_flags(rq, "ide-cd: bad rq");
 		cdrom_end_request(drive, 0);
@@ -1495,8 +1557,7 @@
 }
 
 
-static
-int cdrom_queue_packet_command(ide_drive_t *drive, struct request *rq)
+static int cdrom_queue_packet_command(ide_drive_t *drive, struct request *rq)
 {
 	struct request_sense sense;
 	int retries = 10;
@@ -2236,6 +2297,9 @@
 		toc->capacity = 0x1fffff;
 
 	set_capacity(info->disk, toc->capacity * sectors_per_frame);
+	/* Save a private copy of te TOC capacity for error handling */
+	drive->probed_capacity = toc->capacity * sectors_per_frame;
+	
 	blk_queue_hardsect_size(drive->queue,
 				sectors_per_frame << SECTOR_BITS);
 
[...2147 lines suppressed...]
+	.name		= "ITE821x IDE",
+	.id_table	= it821x_pci_tbl,
+	.probe		= it821x_init_one,
+};
+
+static int __init it821x_ide_init(void)
+{
+	return ide_pci_register_driver(&driver);
+}
+
+module_init(it821x_ide_init);
+
+module_param_named(noraid, it8212_noraid, int, S_IRUGO);
+MODULE_PARM_DESC(it8212_noraid, "Force card into bypass mode");
+
+MODULE_AUTHOR("Alan Cox");
+MODULE_DESCRIPTION("PCI driver module for the ITE 821x");
+MODULE_LICENSE("GPL");
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.12/drivers/ide/pci/Makefile linux-2.6.12/drivers/ide/pci/Makefile
--- linux.vanilla-2.6.12/drivers/ide/pci/Makefile	2005-06-19 11:21:23.000000000 +0100
+++ linux-2.6.12/drivers/ide/pci/Makefile	2005-06-20 20:41:44.000000000 +0100
@@ -12,6 +12,7 @@
 obj-$(CONFIG_BLK_DEV_HPT366)		+= hpt366.o
 #obj-$(CONFIG_BLK_DEV_HPT37X)		+= hpt37x.o
 obj-$(CONFIG_BLK_DEV_IT8172)		+= it8172.o
+obj-$(CONFIG_BLK_DEV_IT821X)		+= it821x.o
 obj-$(CONFIG_BLK_DEV_NS87415)		+= ns87415.o
 obj-$(CONFIG_BLK_DEV_OPTI621)		+= opti621.o
 obj-$(CONFIG_BLK_DEV_PDC202XX_OLD)	+= pdc202xx_old.o
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.12/drivers/ide/pci/serverworks.c linux-2.6.12/drivers/ide/pci/serverworks.c
--- linux.vanilla-2.6.12/drivers/ide/pci/serverworks.c	2005-06-19 11:30:47.000000000 +0100
+++ linux-2.6.12/drivers/ide/pci/serverworks.c	2005-06-20 20:45:50.000000000 +0100
@@ -442,7 +442,7 @@
 	return (dev->irq) ? dev->irq : 0;
 }
 
-static unsigned int __init ata66_svwks_svwks (ide_hwif_t *hwif)
+static unsigned int __devinit ata66_svwks_svwks (ide_hwif_t *hwif)
 {
 	return 1;
 }
@@ -454,7 +454,7 @@
  * Bit 14 clear = primary IDE channel does not have 80-pin cable.
  * Bit 14 set   = primary IDE channel has 80-pin cable.
  */
-static unsigned int __init ata66_svwks_dell (ide_hwif_t *hwif)
+static unsigned int __devinit ata66_svwks_dell (ide_hwif_t *hwif)
 {
 	struct pci_dev *dev = hwif->pci_dev;
 	if (dev->subsystem_vendor == PCI_VENDOR_ID_DELL &&
@@ -472,7 +472,7 @@
  *
  * WARNING: this only works on Alpine hardware!
  */
-static unsigned int __init ata66_svwks_cobalt (ide_hwif_t *hwif)
+static unsigned int __devinit ata66_svwks_cobalt (ide_hwif_t *hwif)
 {
 	struct pci_dev *dev = hwif->pci_dev;
 	if (dev->subsystem_vendor == PCI_VENDOR_ID_SUN &&
@@ -483,7 +483,7 @@
 	return 0;
 }
 
-static unsigned int __init ata66_svwks (ide_hwif_t *hwif)
+static unsigned int __devinit ata66_svwks (ide_hwif_t *hwif)
 {
 	struct pci_dev *dev = hwif->pci_dev;
 
@@ -573,7 +573,7 @@
 	return ide_setup_pci_device(dev, d);
 }
 
-static int __init init_setup_csb6 (struct pci_dev *dev, ide_pci_device_t *d)
+static int __devinit init_setup_csb6 (struct pci_dev *dev, ide_pci_device_t *d)
 {
 	if (!(PCI_FUNC(dev->devfn) & 1)) {
 		d->bootable = NEVER_BOARD;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.12/drivers/ide/pci/siimage.c linux-2.6.12/drivers/ide/pci/siimage.c
--- linux.vanilla-2.6.12/drivers/ide/pci/siimage.c	2005-06-19 11:21:23.000000000 +0100
+++ linux-2.6.12/drivers/ide/pci/siimage.c	2005-06-20 20:42:03.000000000 +0100
@@ -48,6 +48,8 @@
 	{
 		case PCI_DEVICE_ID_SII_3112:
 		case PCI_DEVICE_ID_SII_1210SA:
+		case PCI_DEVICE_ID_ATI_IXP300_SATA:
+		case PCI_DEVICE_ID_ATI_IXP400_SATA:
 			return 1;
 		case PCI_DEVICE_ID_SII_680:
 			return 0;
@@ -1088,7 +1090,9 @@
 static ide_pci_device_t siimage_chipsets[] __devinitdata = {
 	/* 0 */ DECLARE_SII_DEV("SiI680"),
 	/* 1 */ DECLARE_SII_DEV("SiI3112 Serial ATA"),
-	/* 2 */ DECLARE_SII_DEV("Adaptec AAR-1210SA")
+	/* 2 */ DECLARE_SII_DEV("Adaptec AAR-1210SA"),
+	/* 3 */ DECLARE_SII_DEV("ATI IXP300"),
+	/* 4 */ DECLARE_SII_DEV("ATI IXP400")
 };
 
 /**
@@ -1110,6 +1114,8 @@
 #ifdef CONFIG_BLK_DEV_IDE_SATA
 	{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
 	{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_1210SA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
+	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
+	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
 #endif
 	{ 0, },
 };
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.12/drivers/ide/pci/trm290.c linux-2.6.12/drivers/ide/pci/trm290.c
--- linux.vanilla-2.6.12/drivers/ide/pci/trm290.c	2005-06-19 11:21:23.000000000 +0100
+++ linux-2.6.12/drivers/ide/pci/trm290.c	2005-06-22 16:36:37.616064376 +0100
@@ -256,6 +256,7 @@
 	u8 reg = 0;
 	struct pci_dev *dev = hwif->pci_dev;
 
+	/* FIXME: does this device support PIO LBA48 ? */
 	hwif->no_lba48 = 1;
 	hwif->chipset = ide_trm290;
 	cfgbase = pci_resource_start(dev, 4);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.12/drivers/scsi/libata-core.c linux-2.6.12/drivers/scsi/libata-core.c
--- linux.vanilla-2.6.12/drivers/scsi/libata-core.c	2005-06-19 11:30:52.000000000 +0100
+++ linux-2.6.12/drivers/scsi/libata-core.c	2005-06-21 10:34:00.000000000 +0100
@@ -1897,7 +1897,6 @@
 	"SAMSUNG CD-ROM SC-148C",
 	"SAMSUNG CD-ROM SC",
 	"SanDisk SDP3B-64",
-	"SAMSUNG CD-ROM SN-124",
 	"ATAPI CD-ROM DRIVE 40X MAXIMUM",
 	"_NEC DV5800A",
 };
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.12/include/asm-i386/ide.h linux-2.6.12/include/asm-i386/ide.h
--- linux.vanilla-2.6.12/include/asm-i386/ide.h	2005-06-19 11:21:43.000000000 +0100
+++ linux-2.6.12/include/asm-i386/ide.h	2005-06-21 13:22:13.000000000 +0100
@@ -41,16 +41,20 @@
 
 static __inline__ unsigned long ide_default_io_base(int index)
 {
+	if(pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) {
+		switch(index) {
+			case 2: return 0x1e8;
+			case 3: return 0x168;
+			case 4: return 0x1e0;
+			case 5: return 0x160;
+			}
+	}
 	switch (index) {
 		case 0:	return 0x1f0;
 		case 1:	return 0x170;
-		case 2: return 0x1e8;
-		case 3: return 0x168;
-		case 4: return 0x1e0;
-		case 5: return 0x160;
 		default:
 			return 0;
-	}
+	}		
 }
 
 #define IDE_ARCH_OBSOLETE_INIT
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.12/include/linux/ide.h linux-2.6.12/include/linux/ide.h
--- linux.vanilla-2.6.12/include/linux/ide.h	2005-06-19 11:30:59.000000000 +0100
+++ linux-2.6.12/include/linux/ide.h	2005-06-22 16:39:34.019247016 +0100
@@ -190,7 +190,7 @@
 #define WAIT_READY	(5*HZ)		/* 5sec - some laptops are very slow */
 #define WAIT_PIDENTIFY	(10*HZ)	/* 10sec  - should be less than 3ms (?), if all ATAPI CD is closed at boot */
 #define WAIT_WORSTCASE	(30*HZ)	/* 30sec  - worst case when spinning up */
-#define WAIT_CMD	(10*HZ)	/* 10sec  - maximum wait for an IRQ to happen */
+#define WAIT_CMD	(15*HZ)	/* 15sec  - maximum wait for an IRQ to happen */
 #define WAIT_MIN_SLEEP	(2*HZ/100)	/* 20msec - minimum sleep time */
 
 #define HOST(hwif,chipset)					\
@@ -747,6 +747,7 @@
 	unsigned int	usage;		/* current "open()" count for drive */
 	unsigned int	failures;	/* current failure count */
 	unsigned int	max_failures;	/* maximum allowed failure count */
+	u64		probed_capacity;/* initial reported media capacity (ide-cd only currently) */
 
 	u64		capacity64;	/* total number of sectors */
 
@@ -908,6 +909,7 @@
 	unsigned	no_dsc     : 1;	/* 0 default, 1 dsc_overlap disabled */
 	unsigned	auto_poll  : 1; /* supports nop auto-poll */
 	unsigned	sg_mapped  : 1;	/* sg_table and sg_nents are ready */
+	unsigned 	polling    : 1; /* doing a polled command ignore irqs */
 
 	struct device	gendev;
 	struct semaphore gendev_rel_sem; /* To deal with device release() */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.12/include/linux/pci_ids.h linux-2.6.12/include/linux/pci_ids.h
--- linux.vanilla-2.6.12/include/linux/pci_ids.h	2005-06-19 11:30:59.000000000 +0100
+++ linux-2.6.12/include/linux/pci_ids.h	2005-06-20 21:25:36.000000000 +0100
@@ -1810,6 +1810,8 @@
 #define PCI_VENDOR_ID_ITE		0x1283
 #define PCI_DEVICE_ID_ITE_IT8172G	0x8172
 #define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801
+#define PCI_DEVICE_ID_ITE_8211		0x8211
+#define PCI_DEVICE_ID_ITE_8212		0x8212
 #define PCI_DEVICE_ID_ITE_8872		0x8872
 #define PCI_DEVICE_ID_ITE_IT8330G_0	0xe886
 


--- linux-2.6.12rc-ac-ide-fixes.patch DELETED ---


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]