Skip to contentSkip to conversation

2.5.29 IDE 110

PATCH In review Marcin Dalecki 2 participants 3 messages Aug 1, 2002

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.5.29 IDE 110

- Integrate patches by Adam J. Richter, Alan Cox and Andre Hedrick for CMD640 PCI configuration space register access.

- cs5530 patches by Adam J. Richter. Small indent style adjustments.

- qd65xx cli()/sti() adjustments.

- Fix bogous command in ide.c pointed out by Peter Vendroviec.

- Eliminate ide_stall_queue(). For those worried: we didn't sleep at all.

- Eliminate support for "sector remapping". loop devices can handle stuff like that. All the custom DOS high system memmory loaded BIOS workaround tricks are obsolete right now. If anywhere it should be the FAT filesystem code which should be clever enough to deal with it by adjusting it's read/write methods.

- PCI "scather gather" allocation handling revamp by Adam J. Richter.

- Simplify do_ide_request after ->sleep removal.

- Make do_ide_request preferr to handle the device matching the request queue it was called for first. RQ-queues are unique for devices. In a next step queuedata will be changed to point to the device not the channel.

Documentation/ide.txt +8 -7
diff -durNp -X /tmp/diff.V3naum linux-2.5.29/Documentation/ide.txt linux/Documentation/ide.txt
@@ -46,7 +46,7 @@ Common pitfalls:
 - If you mix devices on the same cable, please consider using similar devices
   in respect of the data transfer mode they support.
 
-- Even better tru to stick to the same vendor and device type on the same
+- Even better try to stick to the same vendor and device type on the same
   cable.
 
 ================================================================================
@@ -66,7 +66,8 @@ sixth..     ide5, usually PCI, probed
 To access devices on interfaces > ide0, device entries please make sure that
 device files for them are present in /dev.  If not, please create such
 entries, by simply running the included shell script:
-/usr/src/linux/scripts/MAKEDEV.ide
+
+	/usr/src/linux/scripts/MAKEDEV.ide
 
 This driver automatically probes for most IDE interfaces (including all PCI
 ones), for the drives/geometries attached to those interfaces, and for the IRQ
@@ -192,11 +193,10 @@ and still allows newer hardware to run o
 under control of ide.c.   To have ide.c also "take over" the primary
 IDE port in this situation, use the "command line" parameter:  ide0=0x1f0
 
-The IDE driver is partly modularized.  The high level disk/cdrom/tape/floppy
+The IDE driver is modularized.  The high level disk/CD-ROM/tape/floppy
 drivers can always be compiled as loadable modules, the chipset drivers
 can only be compiled into the kernel, and the core code (ide.c) can be
-compiled as a loadable module provided no chipset support and no special
-partition table translations are needed.
+compiled as a loadable module provided no chipset support is needed.
 
 When using ide.c/ide-tape.c as modules in combination with kerneld, add:
 
@@ -214,8 +214,9 @@ driver using the "options=" keyword to i
 
 ================================================================================
 
-Summary of ide driver parameters for kernel "command line":
-----------------------------------------------------------
+Summary of ide driver parameters for kernel command line
+--------------------------------------------------------
+
  "hdx="  is recognized for all "x" from "a" to "h", such as "hdc".
  
  "idex=" is recognized for all "x" from "0" to "3", such as "ide1".
drivers/ide/cmd640.c +64 -12

137 lines not on this page · raw message

drivers/ide/cs5530.c +47 -41

154 lines not on this page · raw message

drivers/ide/ide.c +62 -128

307 lines not on this page · raw message

drivers/ide/ide-cd.c +4 -9
diff -durNp -X /tmp/diff.V3naum linux-2.5.29/drivers/ide/ide-cd.c linux/drivers/ide/ide-cd.c
@@ -1617,16 +1617,11 @@ ide_cdrom_do_request(struct ata_device *
 
 	if (rq->flags & REQ_CMD) {
 		if (CDROM_CONFIG_FLAGS(drive)->seeking) {
-			unsigned long elpased = jiffies - info->start_seek;
-
-			if (!ata_status(drive, SEEK_STAT, 0)) {
-				if (elpased < IDECD_SEEK_TIMEOUT) {
-					ide_stall_queue(drive, IDECD_SEEK_TIMER);
-					return ATA_OP_FINISHED;
-				}
+			if (ATA_OP_READY != ata_status_poll(drive, SEEK_STAT, 0, IDECD_SEEK_TIMEOUT, rq)) {
 				printk ("%s: DSC timeout\n", drive->name);
-			}
-			CDROM_CONFIG_FLAGS(drive)->seeking = 0;
+				CDROM_CONFIG_FLAGS(drive)->seeking = 0;
+			} else
+				return ATA_OP_FINISHED;
 		}
 		if (IDE_LARGE_SEEK(info->last_block, block, IDECD_SEEK_THRESHOLD) && drive->dsc_overlap) {
 			ret = cdrom_start_seek(drive, rq, block);
drivers/ide/ide-disk.c +1 -1
diff -durNp -X /tmp/diff.V3naum linux-2.5.29/drivers/ide/ide-disk.c linux/drivers/ide/ide-disk.c
@@ -723,7 +723,7 @@ static int idedisk_check_media_change(st
 
 static sector_t idedisk_capacity(struct ata_device *drive)
 {
-	return drive->capacity - drive->sect0;
+	return drive->capacity;
 }
 
 /*
drivers/ide/ide-tape.c +5 -2
diff -durNp -X /tmp/diff.V3naum linux-2.5.29/drivers/ide/ide-tape.c linux/drivers/ide/ide-tape.c
@@ -40,6 +40,7 @@
 #include <linux/hdreg.h>
 #include <linux/ide.h>
 #include <linux/atapi.h>
+#include <linux/delay.h>
 
 #include <asm/byteorder.h>
 #include <asm/irq.h>
@@ -1067,7 +1068,8 @@ static void idetape_analyze_error(struct
 
 	if (tape->onstream && result->sense_key == 2 && result->asc == 0x53 && result->ascq == 2) {
 		clear_bit(PC_DMA_ERROR, &pc->flags);
-		ide_stall_queue(drive, HZ / 2);
+		/* FIXME: we should use timeouts here */
+		mdelay(HZ / 2 * 1000);
 		return;
 	}
 #ifdef CONFIG_BLK_DEV_IDEDMA
@@ -1434,7 +1436,8 @@ static void idetape_postpone_request(str
 		printk(KERN_INFO "ide-tape: idetape_postpone_request\n");
 #endif
 	tape->postponed_rq = rq;
-	ide_stall_queue(drive, tape->dsc_polling_frequency);
+	/* FIXME: we should use timeouts here */
+	mdelay(tape->dsc_polling_frequency * 1000);
 }
 
 /*
drivers/ide/main.c +25 -23

133 lines not on this page · raw message

drivers/ide/pcidma.c +14 -59

94 lines not on this page · raw message

drivers/ide/probe.c +5 -28
diff -durNp -X /tmp/diff.V3naum linux-2.5.29/drivers/ide/probe.c linux/drivers/ide/probe.c
@@ -41,19 +41,10 @@
 extern struct ata_device * get_info_ptr(kdev_t);
 
 /*
- * This is called from the partition-table code in pt/msdos.c.
- *
- * It has two tasks:
- *
- * (I) to handle Ontrack DiskManager by offsetting everything by 63 sectors,
- *  or to handle EZdrive by remapping sector 0 to sector 1.
- *
- * (II) to invent a translated geometry.
- *
- * Part (I) is suppressed if the user specifies the "noremap" option
- * on the command line.
+ * This is called from the partition-table code in pt/msdos.c
+ * to invent a translated geometry.
  *
- * Part (II) is suppressed if the user specifies an explicit geometry.
+ * This is suppressed if the user specifies an explicit geometry.
  *
  * The ptheads parameter is either 0 or tells about the number of
  * heads shown by the end of the first nonempty partition.
@@ -83,21 +74,6 @@ int ide_xlate_1024(kdev_t i_rdev, int xp
 	if (!drive)
 		return 0;
 
-	/* remap? */
-	if (drive->remap_0_to_1 != 2) {
-		if (xparm == 1) {		/* DM */
-			drive->sect0 = 63;
-			msg1 = " [remap +63]";
-			ret = 1;
-		} else if (xparm == -1) {	/* EZ-Drive */
-			if (drive->remap_0_to_1 == 0) {
-				drive->remap_0_to_1 = 1;
-				msg1 = " [remap 0->1]";
-				ret = 1;
-			}
-		}
-	}
-
 	/* There used to be code here that assigned drive->id->CHS to
 	 * drive->CHS and that to drive->bios_CHS. However, some disks have
 	 * id->C/H/S = 4092/16/63 but are larger than 2.1 GB.  In such cases
@@ -1007,7 +983,8 @@ static int init_irq(struct ata_channel *
 		q = &drive->queue;
 		q->queuedata = drive->channel;
 		blk_init_queue(q, do_ide_request, drive->channel->lock);
-		blk_queue_segment_boundary(q, 0xffff);
+		blk_queue_segment_boundary(q, ch->seg_boundary_mask);
+		blk_queue_max_segment_size(q, ch->max_segment_size);
 
 		/* ATA can do up to 128K per request, pdc4030 needs smaller limit */
 #ifdef CONFIG_BLK_DEV_PDC4030
drivers/ide/qd65xx.c +0 -4
diff -durNp -X /tmp/diff.V3naum linux-2.5.29/drivers/ide/qd65xx.c linux/drivers/ide/qd65xx.c
@@ -262,15 +262,11 @@ static int __init qd_testreg(int port)
 {
 	u8 savereg;
 	u8 readreg;
-	unsigned long flags;
 
-	save_flags(flags);	/* all CPUs */
-	cli();			/* all CPUs */
 	savereg = inb_p(port);
 	outb_p(QD_TESTVAL, port);	/* safe value */
 	readreg = inb_p(port);
 	outb(savereg, port);
-	restore_flags(flags);	/* all CPUs */
 
 	if (savereg == QD_TESTVAL) {
 		printk(KERN_ERR "Outch ! the probe for qd65xx isn't reliable !\n");
drivers/ide/trm290.c +1 -0
diff -durNp -X /tmp/diff.V3naum linux-2.5.29/drivers/ide/trm290.c linux/drivers/ide/trm290.c
@@ -255,6 +255,7 @@ static void __init trm290_init_channel(s
 	struct pci_dev *dev = hwif->pci_dev;
 
 	hwif->chipset = ide_trm290;
+	hwif->seg_boundary_mask = 0xffffffff;
 	cfgbase = pci_resource_start(dev, 4);
 	if ((dev->class & 5) && cfgbase)
 	{
drivers/ide/umc8672.c +0 -5
diff -durNp -X /tmp/diff.V3naum linux-2.5.29/drivers/ide/umc8672.c linux/drivers/ide/umc8672.c
@@ -108,19 +108,14 @@ static void umc_set_speeds(u8 speeds[])
 
 static void tune_umc(struct ata_device *drive, u8 pio)
 {
-	unsigned long flags;
-
 	if (pio == 255)
 		pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0;
 	else
 		pio = min_t(u8, pio, 4);
 
 	printk("%s: setting umc8672 to PIO mode%d (speed %d)\n", drive->name, pio, pio_to_umc[pio]);
-	save_flags(flags);	/* all CPUs */
-	cli();			/* all CPUs */
 	current_speeds[drive->name[2] - 'a'] = pio_to_umc[pio];
 	umc_set_speeds (current_speeds);
-	restore_flags(flags);	/* all CPUs */
 }
 
 void __init init_umc8672(void)	/* called from ide.c */
drivers/pci/access.c +2 -1
diff -durNp -X /tmp/diff.V3naum linux-2.5.29/drivers/pci/access.c linux/drivers/pci/access.c
@@ -7,7 +7,7 @@
  * configuration space.
  */
 
-static spinlock_t pci_lock = SPIN_LOCK_UNLOCKED;
+spinlock_t pci_lock = SPIN_LOCK_UNLOCKED;
 
 /*
  *  Wrappers for all PCI configuration access functions.  They just check
@@ -44,3 +44,4 @@ EXPORT_SYMBOL(pci_read_config_dword);
 EXPORT_SYMBOL(pci_write_config_byte);
 EXPORT_SYMBOL(pci_write_config_word);
 EXPORT_SYMBOL(pci_write_config_dword);
+EXPORT_SYMBOL(pci_lock);
include/linux/ide.h +2 -4
diff -durNp -X /tmp/diff.V3naum linux-2.5.29/include/linux/ide.h linux/include/linux/ide.h
@@ -764,8 +764,6 @@ struct ata_device {
 	request_queue_t	queue;		/* per device request queue */
 	struct request *rq;		/* current request */
 
-	unsigned long sleep;		/* sleep until this time */
-
 	u8	 retry_pio;		/* retrying dma capable host in pio */
 	u8	 state;			/* retry state */
 
@@ -785,7 +783,6 @@ struct ata_device {
 	unsigned atapi_overlap	: 1;	/* flag: ATAPI overlap (not supported) */
 	unsigned doorlocking	: 1;	/* flag: for removable only: door lock/unlock works */
 	unsigned autotune	: 2;	/* 1=autotune, 2=noautotune, 0=default */
-	unsigned remap_0_to_1	: 2;	/* 0=remap if ezdrive, 1=remap, 2=noremap */
 	unsigned ata_flash	: 1;	/* 1=present, 0=default */
 	unsigned	addressing;	/* : 2; 0=28-bit, 1=48-bit, 2=64-bit */
 	u8		scsi;		/* 0=default, 1=skip current ide-subdriver for ide-scsi emulation */
@@ -797,7 +794,6 @@ struct ata_device {
 	u8		mult_count;	/* current multiple sector setting */
 	u8		bad_wstat;	/* used for ignoring WRERR_STAT */
 	u8		nowerr;		/* used for ignoring WRERR_STAT */
-	u8		sect0;		/* offset of first sector for DM6:DDO */
 	u8		head;		/* "real" number of heads */
 	u8		sect;		/* "real" sectors per track */
 	u8		bios_head;	/* BIOS/fdisk/LILO number of heads */
@@ -947,6 +943,8 @@ struct ata_channel {
 	void (*udma_timeout) (struct ata_device *);
 	void (*udma_irq_lost) (struct ata_device *);
 
+	unsigned long	seg_boundary_mask;
+	unsigned int	max_segment_size;
 	unsigned int	*dmatable_cpu;	/* dma physical region descriptor table (cpu view) */
 	dma_addr_t	dmatable_dma;	/* dma physical region descriptor table (dma view) */
 	struct scatterlist *sg_table;	/* Scatter-gather list used to build the above */
include/linux/pci.h +2 -0
diff -durNp -X /tmp/diff.V3naum linux-2.5.29/include/linux/pci.h linux/include/linux/pci.h
@@ -567,6 +567,8 @@ int pci_write_config_byte(struct pci_dev
 int pci_write_config_word(struct pci_dev *dev, int where, u16 val);
 int pci_write_config_dword(struct pci_dev *dev, int where, u32 val);
 
+extern spinlock_t pci_lock;
+
 int pci_enable_device(struct pci_dev *dev);
 void pci_disable_device(struct pci_dev *dev);
 void pci_set_master(struct pci_dev *dev);
sound/oss/i810_audio.c +0 -1
diff -durNp -X /tmp/diff.V3naum linux-2.5.29/sound/oss/i810_audio.c linux/sound/oss/i810_audio.c
@@ -1733,7 +1733,6 @@ static int i810_ioctl(struct inode *inod
 		}
 
 		spin_unlock_irqrestore(&state->card->lock, flags);
-		synchronize_irq(state->card->irq);
 		dmabuf->ready = 0;
 		dmabuf->swptr = dmabuf->hwptr = 0;
 		dmabuf->count = dmabuf->total_bytes = 0;
#1 lore raw
Quoted 5 lines · Marcin Dalecki

- Eliminate support for "sector remapping". loop devices can handle stuff like that. All the custom DOS high system memmory loaded BIOS workaround tricks are obsolete right now. If anywhere it should be the FAT filesystem code which should be clever enough to deal with it by adjusting it's read/write methods.

Not suggesting this isn't too obsolete to care about, but...

I really don't think that would be right. Look at this crud as an alternate partition table format that just happens to contain something which looks like a PC partition table.

Support would best involve:

1. fdisk modified to read/write the crud
2. the kernel reading the crud

By #2 I don't mean doing an offset for the whole disk. You have a partition table that occupies 64 (?) sectors, containing values stored with offsets added to them.

BTW, you are dropping support for typical Pentium boxes. If this is OK, then the f00f check can go, etc.

#2 lore raw

Uz.ytkownik Albert D. Cahalan napisa?:

Quoted 3 lines

BTW, you are dropping support for typical Pentium boxes. If this is OK, then the f00f check can go, etc.

???! Could you elaborate on the "typical Pentium" please. I don't see the point, since I never ever needed the code in question. Neither did I ever see anybody using it.