IDE Fixes for PCI, SMP

mlord (mlord@pobox.com)
Wed, 08 Apr 1998 10:46:48 -0400


This is a multi-part message in MIME format.

--------------1821FE737673FE337BF268B1
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Linus,

This patch fixes PCI IRQ sharing in the IDE driver
(been broken forever), and tries very hard to make
the IDE stuff SMP aware/friendly (was broken).

I don't have SMP to test with, but it all works very
well on my otherwise complex testbed.

Cheers!

-- 
mlord@pobox.com
The Linux IDE guy

--------------1821FE737673FE337BF268B1 Content-Type: text/plain; charset=us-ascii; name="ide-2.1.93+.pat1" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ide-2.1.93+.pat1"

diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ali14xx.c linux/drivers/block/ali14xx.c --- linux-2.1.93/drivers/block/ali14xx.c Mon Dec 29 12:25:29 1997 +++ linux/drivers/block/ali14xx.c Wed Apr 8 09:59:10 1998 @@ -134,15 +134,15 @@ /* stuff timing parameters into controller registers */ driveNum = (HWIF(drive)->index << 1) + drive->select.b.unit; - save_flags(flags); - cli(); + save_flags(flags); /* all CPUs */ + cli(); /* all CPUs */ outb_p(regOn, basePort); outReg(param1, regTab[driveNum].reg1); outReg(param2, regTab[driveNum].reg2); outReg(param3, regTab[driveNum].reg3); outReg(param4, regTab[driveNum].reg4); outb_p(regOff, basePort); - restore_flags(flags); + restore_flags(flags); /* all CPUs */ } /* @@ -154,8 +154,8 @@ byte t; unsigned long flags; - save_flags(flags); - cli(); + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only */ for (i = 0; i < ALI_NUM_PORTS; ++i) { basePort = ports[i]; regOff = inb(basePort); @@ -166,7 +166,7 @@ dataPort = basePort + 8; t = inReg(0) & 0xf0; outb_p(regOff, basePort); - restore_flags(flags); + __restore_flags(flags); /* local CPU only */ if (t != 0x50) return 0; return 1; /* success */ @@ -174,7 +174,7 @@ } outb_p(regOff, basePort); } - restore_flags(flags); + __restore_flags(flags); /* local CPU only */ return 0; } @@ -186,15 +186,15 @@ byte t; unsigned long flags; - save_flags(flags); - cli(); + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only */ outb_p(regOn, basePort); for (p = initData; p->reg != 0; ++p) outReg(p->data, p->reg); outb_p(0x01, regPort); t = inb(regPort) & 0x01; outb_p(regOff, basePort); - restore_flags(flags); + __restore_flags(flags); /* local CPU only */ return t; } diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/dtc2278.c linux/drivers/block/dtc2278.c --- linux-2.1.93/drivers/block/dtc2278.c Mon Dec 29 12:25:29 1997 +++ linux/drivers/block/dtc2278.c Wed Apr 8 09:45:42 1998 @@ -74,14 +74,14 @@ pio = ide_get_best_pio_mode(drive, pio, 4, NULL); if (pio >= 3) { - save_flags(flags); - cli(); + save_flags(flags); /* all CPUs */ + cli(); /* all CPUs */ /* * This enables PIO mode4 (3?) on the first interface */ sub22(1,0xc3); sub22(0,0xa0); - restore_flags(flags); + restore_flags(flags); /* all CPUs */ } else { /* we don't know how to set it back again.. */ } @@ -97,8 +97,8 @@ { unsigned long flags; - save_flags(flags); - cli(); + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only */ /* * This enables the second interface */ @@ -114,7 +114,7 @@ sub22(1,0xc3); sub22(0,0xa0); #endif - restore_flags(flags); + __restore_flags(flags); /* local CPU only */ ide_hwifs[0].serialized = 1; ide_hwifs[1].serialized = 1; diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ht6560b.c linux/drivers/block/ht6560b.c --- linux-2.1.93/drivers/block/ht6560b.c Mon Dec 29 12:25:29 1997 +++ linux/drivers/block/ht6560b.c Wed Apr 8 09:44:41 1998 @@ -133,8 +133,8 @@ if (select != current_select || timing != current_timing) { current_select = select; current_timing = timing; - save_flags (flags); - cli(); + __save_flags (flags); /* local CPU only */ + __cli(); /* local CPU only */ (void) inb(HT_SELECT_PORT); (void) inb(HT_SELECT_PORT); (void) inb(HT_SELECT_PORT); @@ -150,7 +150,7 @@ */ outb (timing, IDE_SELECT_REG); (void) inb (IDE_STATUS_REG); - restore_flags (flags); + __restore_flags (flags); /* local CPU only */ #ifdef DEBUG printk("ht6560b: %s: select=%#x timing=%#x\n", drive->name, t, timing); #endif diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c --- linux-2.1.93/drivers/block/ide-cd.c Wed Apr 1 21:24:31 1998 +++ linux/drivers/block/ide-cd.c Tue Apr 7 09:52:02 1998 @@ -276,7 +276,7 @@ #if VERBOSE_IDE_CD_ERRORS { int i; - char *s; + const char *s; char buf[80]; printk ("ATAPI device %s:\n", drive->name); @@ -1020,7 +1020,7 @@ #define IDECD_SEEK_THRESHOLD (1000) /* 1000 blocks */ #define IDECD_SEEK_TIMER (2 * WAIT_MIN_SLEEP) /* 40 ms */ -#define IDECD_SEEK_TIMEOUT (20 * IDECD_SEEK_TIMER) /* 0.8 sec */ +#define IDECD_SEEK_TIMEOUT WAIT_CMD /* 10 sec */ static void cdrom_seek_intr (ide_drive_t *drive) { diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ide-cd.h linux/drivers/block/ide-cd.h --- linux-2.1.93/drivers/block/ide-cd.h Wed Apr 1 21:24:31 1998 +++ linux/drivers/block/ide-cd.h Tue Apr 7 09:52:02 1998 @@ -415,7 +415,7 @@ /* From Table 124 of the ATAPI 1.2 spec. Unchanged in Table 140 of the ATAPI 2.6 draft standard. */ -char *sense_key_texts[16] = { +const char *sense_key_texts[16] = { "No sense data", "Recovered error", "Not ready", @@ -438,7 +438,7 @@ /* From Table 37 of the ATAPI 2.6 draft standard. */ struct { unsigned short packet_command; - char *text; + const char *text; } packet_command_texts[] = { { TEST_UNIT_READY, "Test Unit Ready" }, { REQUEST_SENSE, "Request Sense" }, @@ -473,7 +473,7 @@ struct { unsigned short asc_ascq; - char *text; + const char *text; } sense_data_texts[] = { { 0x0000, "No additional sense information" }, diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ide-disk.c linux/drivers/block/ide-disk.c --- linux-2.1.93/drivers/block/ide-disk.c Wed Apr 1 21:24:31 1998 +++ linux/drivers/block/ide-disk.c Wed Apr 8 09:30:24 1998 @@ -120,7 +120,6 @@ } msect = drive->mult_count; - spin_lock_irqsave(&io_request_lock,flags); read_next: rq = HWGROUP(drive)->rq; if (msect) { @@ -145,14 +144,16 @@ rq->buffer += nsect<<9; rq->errors = 0; i = (rq->nr_sectors -= nsect); - if ((rq->current_nr_sectors -= nsect) <= 0) + if ((rq->current_nr_sectors -= nsect) <= 0) { + spin_lock_irqsave(&io_request_lock, flags); ide_end_request(1, HWGROUP(drive)); + spin_unlock_irqrestore(&io_request_lock, flags); + } if (i > 0) { if (msect) goto read_next; ide_set_handler (drive, &read_intr, WAIT_CMD); } - spin_unlock_irqrestore(&io_request_lock,flags); } /* @@ -167,7 +168,6 @@ unsigned long flags; int error = 0; - spin_lock_irqsave(&io_request_lock,flags); if (OK_STAT(stat=GET_STAT(),DRIVE_READY,drive->bad_wstat)) { #ifdef DEBUG printk("%s: write: sector %ld, buffer=0x%08lx, remaining=%ld\n", @@ -180,8 +180,11 @@ rq->errors = 0; i = --rq->nr_sectors; --rq->current_nr_sectors; - if (rq->current_nr_sectors <= 0) + if (rq->current_nr_sectors <= 0) { + spin_lock_irqsave(&io_request_lock, flags); ide_end_request(1, hwgroup); + spin_unlock_irqrestore(&io_request_lock, flags); + } if (i > 0) { idedisk_output_data (drive, rq->buffer, SECTOR_WORDS); ide_set_handler (drive, &write_intr, WAIT_CMD); @@ -190,10 +193,7 @@ } } else error = 1; - out: - spin_unlock_irqrestore(&io_request_lock,flags); - if (error) ide_error(drive, "write_intr", stat); } @@ -246,7 +246,6 @@ unsigned long flags; int error = 0; - spin_lock_irqsave(&io_request_lock,flags); if (OK_STAT(stat=GET_STAT(),DRIVE_READY,drive->bad_wstat)) { if (stat & DRQ_STAT) { if (rq->nr_sectors) { @@ -257,19 +256,18 @@ } else { if (!rq->nr_sectors) { /* all done? */ rq = hwgroup->rq; + spin_lock_irqsave(&io_request_lock, flags); for (i = rq->nr_sectors; i > 0;){ i -= rq->current_nr_sectors; ide_end_request(1, hwgroup); } + spin_unlock_irqrestore(&io_request_lock, flags); goto out; } } } else error = 1; - out: - spin_unlock_irqrestore(&io_request_lock,flags); - if (error) ide_error(drive, "multwrite_intr", stat); } @@ -319,6 +317,7 @@ */ static void do_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block) { + unsigned long flags; #ifdef CONFIG_BLK_DEV_PDC4030 ide_hwif_t *hwif = HWIF(drive); int use_pdc4030_io = 0; @@ -389,7 +388,7 @@ return; } if (!drive->unmask) - __cli(); + __cli(); /* local CPU only */ if (drive->mult_count) { HWGROUP(drive)->wrq = *rq; /* scratchpad */ ide_set_handler (drive, &multwrite_intr, WAIT_CMD); @@ -401,7 +400,9 @@ return; } printk(KERN_ERR "%s: bad command: %d\n", drive->name, rq->cmd); + spin_lock_irqsave(&io_request_lock, flags); ide_end_request(0, HWGROUP(drive)); + spin_unlock_irqrestore(&io_request_lock, flags); } static int idedisk_open (struct inode *inode, struct file *filp, ide_drive_t *drive) diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ide-dma.c linux/drivers/block/ide-dma.c --- linux-2.1.93/drivers/block/ide-dma.c Mon Apr 6 22:16:07 1998 +++ linux/drivers/block/ide-dma.c Wed Apr 8 09:37:28 1998 @@ -84,7 +84,7 @@ */ const char *good_dma_drives[] = {"Micropolis 2112A", "CONNER CTMA 4000", - "ST34342A", + "ST34342A", /* for Sun Ultra */ NULL}; /* @@ -128,7 +128,7 @@ } printk("%s: dma_intr: bad DMA status\n", drive->name); } - sti(); + ide__sti(); /* local CPU only */ ide_error(drive, "dma_intr", stat); } @@ -210,7 +210,7 @@ struct hd_driveid *id = drive->id; ide_hwif_t *hwif = HWIF(drive); - if (id && (id->capability & 1) && !HWIF(drive)->no_autodma) { + if (id && (id->capability & 1) && !hwif->no_autodma) { /* Enable DMA on any drive that has UltraDMA (mode 0/1/2) enabled */ if (id->field_valid & 4) /* UltraDMA */ if ((id->dma_ultra & (id->dma_ultra >> 8) & 7)) @@ -250,6 +250,7 @@ ide_hwif_t *hwif = HWIF(drive); unsigned long dma_base = hwif->dma_base; unsigned int count, reading = 0; + byte dma_stat; switch (func) { case ide_dma_off: @@ -273,16 +274,18 @@ ide_set_handler(drive, &ide_dma_intr, WAIT_CMD);/* issue cmd to drive */ OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG); case ide_dma_begin: + drive->waiting_for_dma = 1; outb(inb(dma_base)|1, dma_base); /* start DMA */ return 0; case ide_dma_end: /* returns 1 on error, 0 otherwise */ - { - byte dma_stat = inb(dma_base+2); - int rc = (dma_stat & 7) != 4; + drive->waiting_for_dma = 0; + dma_stat = inb(dma_base+2); outb(inb(dma_base)&~1, dma_base); /* stop DMA */ outb(dma_stat|6, dma_base+2); /* clear the INTR & ERROR bits */ - return rc; /* verify good DMA status */ - } + return (dma_stat & 7) != 4; /* verify good DMA status */ + case ide_dma_irq: /* returns 1 if dma irq issued, 0 otherwise */ + dma_stat = inb(dma_base+2); + return (dma_stat & 4) == 4; /* return 1 if INTR asserted */ default: printk("ide_dmaproc: unsupported func: %d\n", func); return 1; @@ -331,9 +334,10 @@ /* * Fetch the DMA Bus-Master-I/O-Base-Address (BMIBA) from PCI space: */ -__initfunc(unsigned long ide_get_or_set_dma_base (struct pci_dev *dev, ide_hwif_t *hwif, int extra, const char *name)) +__initfunc(unsigned long ide_get_or_set_dma_base (ide_hwif_t *hwif, int extra, const char *name)) { - unsigned long new, dma_base = 0; + unsigned long new, dma_base = 0; + struct pci_dev *dev = hwif->pci_dev; if (hwif->mate && hwif->mate->dma_base) { dma_base = hwif->mate->dma_base - (hwif->channel ? 0 : 8); diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ide-floppy.c linux/drivers/block/ide-floppy.c --- linux-2.1.93/drivers/block/ide-floppy.c Wed Apr 1 21:24:31 1998 +++ linux/drivers/block/ide-floppy.c Wed Apr 8 09:36:57 1998 @@ -713,7 +713,7 @@ #endif /* IDEFLOPPY_DEBUG_LOG */ clear_bit (PC_DMA_IN_PROGRESS, &pc->flags); - ide_sti(); + ide__sti(); /* local CPU only */ if (status.b.check || test_bit (PC_DMA_ERROR, &pc->flags)) { /* Error detected */ #if IDEFLOPPY_DEBUG_LOG diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ide-pci.c linux/drivers/block/ide-pci.c --- linux-2.1.93/drivers/block/ide-pci.c Mon Apr 6 22:16:07 1998 +++ linux/drivers/block/ide-pci.c Tue Apr 7 09:52:02 1998 @@ -43,6 +43,7 @@ #define DEVID_NS87415 ((ide_pci_devid_t){PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415}) #define DEVID_HT6565 ((ide_pci_devid_t){PCI_VENDOR_ID_HOLTEK, PCI_DEVICE_ID_HOLTEK_6565}) #define DEVID_AEC6210 ((ide_pci_devid_t){0x1191, 0x0005}) +#define DEVID_W82C105 ((ide_pci_devid_t){PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105}) #define IDE_IGNORE ((void *)-1) @@ -74,6 +75,13 @@ #define INIT_CMD646 IDE_IGNORE #endif +#ifdef CONFIG_BLK_DEV_SL82C105 +extern void ide_init_sl82c105(ide_hwif_t *); +#define INIT_W82C105 &ide_init_sl82c105 +#else +#define INIT_W82C105 IDE_IGNORE +#endif + #ifdef CONFIG_BLK_DEV_RZ1000 extern void ide_init_rz1000(ide_hwif_t *); #define INIT_RZ1000 &ide_init_rz1000 @@ -113,6 +121,7 @@ {DEVID_TRM290, "TRM290", INIT_TRM290, {{0x00,0x00,0x00}, {0x00,0x00,0x00}} }, {DEVID_NS87415, "NS87415", INIT_NS87415, {{0x00,0x00,0x00}, {0x00,0x00,0x00}} }, {DEVID_AEC6210, "AEC6210", NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}} }, + {DEVID_W82C105, "W82C105", INIT_W82C105, {{0x40,0x01,0x01}, {0x40,0x10,0x10}} }, {IDE_PCI_DEVID_NULL, "PCI_IDE", NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}} }}; /* @@ -300,7 +309,7 @@ ide_pci_enablebit_t *e = &(d->enablebits[port]); if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || (tmp & e->mask) != e->val)) continue; /* port not enabled */ - ctl = dev->base_address[1+2*port] & PCI_BASE_ADDRESS_IO_MASK; + ctl = dev->base_address[(2*port)+1] & PCI_BASE_ADDRESS_IO_MASK; if (!ctl) ctl = port ? 0x374 : 0x3f4; /* use default value */ base = dev->base_address[2*port] & ~7; @@ -330,7 +339,7 @@ if (IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20246) || ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 0x80))) { unsigned int extra = (!mate && IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20246)) ? 16 : 0; - unsigned long dma_base = ide_get_or_set_dma_base(dev, hwif, extra, d->name); + unsigned long dma_base = ide_get_or_set_dma_base(hwif, extra, d->name); if (dma_base && !(pcicmd & PCI_COMMAND_MASTER)) { /* * Set up BM-DMA capability (PnP BIOS should have done this) diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ide-probe.c linux/drivers/block/ide-probe.c --- linux-2.1.93/drivers/block/ide-probe.c Wed Apr 1 21:24:32 1998 +++ linux/drivers/block/ide-probe.c Wed Apr 8 10:00:27 1998 @@ -47,7 +47,7 @@ id = drive->id = kmalloc (SECTOR_WORDS*4, GFP_KERNEL); ide_input_data(drive, id, SECTOR_WORDS); /* read 512 bytes of id info */ - sti(); + ide__sti(); /* local CPU only */ ide_fix_driveid(id); #if defined (CONFIG_SCSI_EATA_DMA) || defined (CONFIG_SCSI_EATA_PIO) || defined (CONFIG_SCSI_EATA) @@ -195,12 +195,12 @@ delay_50ms(); /* wait for IRQ and DRQ_STAT */ if (OK_STAT(GET_STAT(),DRQ_STAT,BAD_R_STAT)) { unsigned long flags; - save_flags(flags); - cli(); /* some systems need this */ + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only; some systems need this */ do_identify(drive, cmd); /* drive returned ID */ rc = 0; /* drive responded with ID */ (void) GET_STAT(); /* clear drive IRQ */ - restore_flags(flags); + __restore_flags(flags); /* local CPU only */ } else rc = 2; /* drive refused ID */ if (!HWIF(drive)->irq) { @@ -398,8 +398,8 @@ return; } - save_flags(flags); - sti(); /* needed for jiffies and irq probing */ + __save_flags(flags); /* local CPU only */ + __sti(); /* local CPU only; needed for jiffies and irq probing */ /* * Second drive should only exist if first drive was found, * but a lot of cdrom drives are configured as single slaves. @@ -429,7 +429,7 @@ } while ((stat & BUSY_STAT) && 0 < (signed long)(timeout - jiffies)); } - restore_flags(flags); + __restore_flags(flags); /* local CPU only */ for (unit = 0; unit < MAX_DRIVES; ++unit) { ide_drive_t *drive = &hwif->drives[unit]; if (drive->present) { @@ -486,8 +486,8 @@ ide_hwgroup_t *hwgroup; ide_hwif_t *match = NULL; - save_flags(flags); - cli(); + save_flags(flags); /* all CPUs */ + cli(); /* all CPUs */ hwif->hwgroup = NULL; #if MAX_HWIFS > 1 @@ -499,7 +499,9 @@ if (h->hwgroup) { /* scan only initialized hwif's */ if (hwif->irq == h->irq) { hwif->sharing_irq = h->sharing_irq = 1; - save_match(hwif, h, &match); + if (hwif->chipset != ide_pci || h->chipset != ide_pci) { + save_match(hwif, h, &match); + } } if (hwif->serialized) { if (hwif->mate && hwif->mate->irq == h->irq) @@ -524,6 +526,7 @@ hwgroup->rq = NULL; hwgroup->handler = NULL; hwgroup->drive = NULL; + hwgroup->spinlock= (spinlock_t)SPIN_LOCK_UNLOCKED; init_timer(&hwgroup->timer); hwgroup->timer.function = &ide_timer_expiry; hwgroup->timer.data = (unsigned long) hwgroup; @@ -533,10 +536,11 @@ * Allocate the irq, if not already obtained for another hwif */ if (!match || match->irq != hwif->irq) { - if (ide_request_irq(hwif->irq, &ide_intr, SA_INTERRUPT, hwif->name, hwgroup)) { + int sa = (hwif->chipset == ide_pci) ? SA_INTERRUPT|SA_SHIRQ : SA_INTERRUPT; + if (ide_request_irq(hwif->irq, &ide_intr, sa, hwif->name, hwgroup)) { if (!match) kfree(hwgroup); - restore_flags(flags); + restore_flags(flags); /* all CPUs */ return 1; } } @@ -558,7 +562,7 @@ hwgroup->drive->next = drive; } hwgroup->hwif = HWIF(hwgroup->drive); - restore_flags(flags); /* safe now that hwif->hwgroup is set up */ + restore_flags(flags); /* all CPUs; safe now that hwif->hwgroup is set up */ #ifndef __mc68000__ printk("%s at 0x%03x-0x%03x,0x%03x on irq %d", hwif->name, @@ -688,10 +692,7 @@ return hwif->present; } - -int ideprobe_init(void); - - +int ideprobe_init (void); static ide_module_t ideprobe_module = { IDE_PROBE_MODULE, ideprobe_init, diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ide-proc.c linux/drivers/block/ide-proc.c --- linux-2.1.93/drivers/block/ide-proc.c Mon Apr 6 22:16:07 1998 +++ linux/drivers/block/ide-proc.c Wed Apr 8 09:30:56 1998 @@ -124,7 +124,7 @@ * Do one full pass to verify all parameters, * then do another to actually write the regs. */ - save_flags(flags); + save_flags(flags); /* all CPUs */ do { const char *p; if (for_real) { @@ -133,14 +133,15 @@ ide_hwgroup_t *mategroup = NULL; if (hwif->mate && hwif->mate->hwgroup) mategroup = (ide_hwgroup_t *)(hwif->mate->hwgroup); - cli(); /* ensure all writes are done together */ + cli(); /* all CPUs; ensure all writes are done together */ while (mygroup->active || (mategroup && mategroup->active)) { - restore_flags(flags); + sti(); /* all CPUs */ if (0 < (signed long)(jiffies - timeout)) { printk("/proc/ide/%s/config: channel(s) busy, cannot write\n", hwif->name); + restore_flags(flags); /* all CPUs */ return -EBUSY; } - cli(); + cli(); /* all CPUs */ } } p = buffer; @@ -174,7 +175,7 @@ msg = "bad/missing register number"; goto parse_error; } - if (--n < 0 || *p++ != ':') { + if (n-- == 0 || *p++ != ':') { msg = "missing ':'"; goto parse_error; } @@ -223,7 +224,7 @@ break; } if (rc) { - restore_flags(flags); + restore_flags(flags); /* all CPUs */ printk("proc_ide_write_config: error writing %s at bus %02x dev %02x reg 0x%x value 0x%x\n", msg, dev->bus->number, dev->devfn, reg, val); printk("proc_ide_write_config: %s\n", pcibios_strerror(rc)); @@ -243,10 +244,10 @@ } } } while (!for_real++); - restore_flags(flags); + restore_flags(flags); /* all CPUs */ return count; parse_error: - restore_flags(flags); + restore_flags(flags); /* all CPUs */ printk("parse error\n"); return xx_xx_parse_error(start, startn, msg); } @@ -443,7 +444,7 @@ * Do one full pass to verify all parameters, * then do another to actually write the pci regs. */ - save_flags(flags); + save_flags(flags); /* all CPUs */ do { const char *p; if (for_real) { @@ -452,14 +453,15 @@ ide_hwgroup_t *mategroup = NULL; if (hwif->mate && hwif->mate->hwgroup) mategroup = (ide_hwgroup_t *)(hwif->mate->hwgroup); - cli(); /* ensure all writes are done together */ + cli(); /* all CPUs; ensure all writes are done together */ while (mygroup->active || (mategroup && mategroup->active)) { - restore_flags(flags); + sti(); /* all CPUs */ if (0 < (signed long)(jiffies - timeout)) { printk("/proc/ide/%s/settings: channel(s) busy, cannot write\n", drive->name); + restore_flags(flags); /* all CPUs */ return -EBUSY; } - cli(); + cli(); /* all CPUs */ } } p = buffer; @@ -506,10 +508,10 @@ ide_write_setting(drive, setting, val * setting->div_factor / setting->mul_factor); } } while (!for_real++); - restore_flags(flags); + restore_flags(flags); /* all CPUs */ return count; parse_error: - restore_flags(flags); + restore_flags(flags); /* all CPUs */ printk("proc_ide_write_settings(): parse error\n"); return -EINVAL; } diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ide-tape.c linux/drivers/block/ide-tape.c --- linux-2.1.93/drivers/block/ide-tape.c Wed Apr 1 21:24:32 1998 +++ linux/drivers/block/ide-tape.c Wed Apr 8 09:42:39 1998 @@ -1432,8 +1432,8 @@ #if IDETAPE_DEBUG_LOG printk (KERN_INFO "Reached idetape_add_stage_tail\n"); #endif /* IDETAPE_DEBUG_LOG */ - save_flags (flags); - cli (); + save_flags (flags); /* all CPUs (overkill?) */ + cli(); /* all CPUs (overkill?) */ stage->next=NULL; if (tape->last_stage != NULL) tape->last_stage->next=stage; @@ -1444,7 +1444,7 @@ tape->next_stage=tape->last_stage; tape->nr_stages++; tape->nr_pending_stages++; - restore_flags (flags); + restore_flags (flags); /* all CPUs (overkill?) */ } /* @@ -1754,7 +1754,7 @@ #endif /* IDETAPE_DEBUG_LOG */ clear_bit (PC_DMA_IN_PROGRESS, &pc->flags); - ide_sti(); + ide__sti(); /* local CPU only */ if (status.b.check || test_bit (PC_DMA_ERROR, &pc->flags)) { /* Error detected */ #if IDETAPE_DEBUG_LOG @@ -2398,11 +2398,11 @@ */ return (idetape_queue_rw_tail (drive, IDETAPE_READ_RQ, blocks, tape->merge_stage->bh)); } - save_flags (flags); - cli (); + save_flags (flags); /* all CPUs (overkill?) */ + cli(); /* all CPUs (overkill?) */ if (tape->active_stage == tape->first_stage) idetape_wait_for_request (tape->active_data_request); - restore_flags (flags); + restore_flags (flags); /* all CPUs (overkill?) */ rq_ptr = &tape->first_stage->rq; bytes_read = tape->tape_block_size * (rq_ptr->nr_sectors - rq_ptr->current_nr_sectors); @@ -2451,13 +2451,13 @@ * Pay special attention to possible race conditions. */ while ((new_stage = idetape_kmalloc_stage (tape)) == NULL) { - save_flags (flags); - cli (); + save_flags (flags); /* all CPUs (overkill?) */ + cli(); /* all CPUs (overkill?) */ if (idetape_pipeline_active (tape)) { idetape_wait_for_request (tape->active_data_request); - restore_flags (flags); + restore_flags (flags); /* all CPUs (overkill?) */ } else { - restore_flags (flags); + restore_flags (flags); /* all CPUs (overkill?) */ idetape_insert_pipeline_into_queue (drive); if (idetape_pipeline_active (tape)) continue; @@ -2514,12 +2514,12 @@ if (tape->first_stage == NULL) return; - save_flags (flags); - cli (); + save_flags (flags); /* all CPUs (overkill?) */ + cli(); /* all CPUs (overkill?) */ tape->next_stage = NULL; if (idetape_pipeline_active (tape)) idetape_wait_for_request (tape->active_data_request); - restore_flags (flags); + restore_flags (flags); /* all CPUs (overkill?) */ while (tape->first_stage != NULL) idetape_remove_stage_head (drive); @@ -2539,8 +2539,8 @@ if (!idetape_pipeline_active (tape)) idetape_insert_pipeline_into_queue (drive); - save_flags (flags); - cli (); + save_flags (flags); /* all CPUs (overkill?) */ + cli(); /* all CPUs (overkill?) */ if (!idetape_pipeline_active (tape)) goto abort; #if IDETAPE_DEBUG_BUGS @@ -2550,7 +2550,7 @@ #endif /* IDETAPE_DEBUG_BUGS */ idetape_wait_for_request (&tape->last_stage->rq); abort: - restore_flags (flags); + restore_flags (flags); /* all CPUs (overkill?) */ } static void idetape_pad_zeros (ide_drive_t *drive, int bcount) @@ -2795,11 +2795,11 @@ * Wait until the first read-ahead request * is serviced. */ - save_flags (flags); - cli (); + save_flags (flags); /* all CPUs (overkill?) */ + cli(); /* all CPUs (overkill?) */ if (tape->active_stage == tape->first_stage) idetape_wait_for_request (tape->active_data_request); - restore_flags (flags); + restore_flags (flags); /* all CPUs (overkill?) */ if (tape->first_stage->rq.errors == IDETAPE_ERROR_FILEMARK) count++; @@ -3620,14 +3620,14 @@ int minor = tape->minor; unsigned long flags; - save_flags (flags); - cli (); + save_flags (flags); /* all CPUs (overkill?) */ + cli(); /* all CPUs (overkill?) */ if (test_bit (IDETAPE_BUSY, &tape->flags) || tape->first_stage != NULL || tape->merge_stage_size || drive->usage) { - restore_flags(flags); + restore_flags(flags); /* all CPUs (overkill?) */ return 1; } idetape_chrdevs[minor].drive = NULL; - restore_flags (flags); + restore_flags (flags); /* all CPUs (overkill?) */ DRIVER(drive)->busy = 0; (void) ide_unregister_subdriver (drive); drive->driver_data = NULL; diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ide.c linux/drivers/block/ide.c --- linux-2.1.93/drivers/block/ide.c Mon Apr 6 22:16:07 1998 +++ linux/drivers/block/ide.c Wed Apr 8 10:34:44 1998 @@ -86,6 +86,8 @@ * Version 6.12 integrate ioctl and proc interfaces * fix parsing of "idex=" command line parameter * Version 6.13 add support for ide4/ide5 courtesy rjones@orchestream.com + * Version 6.14 fixed IRQ sharing among PCI devices + * Version 6.15 added SMP awareness to IDE drivers * * Some additional driver compile-time options are in ide.h * @@ -155,13 +157,13 @@ unsigned long t, flags; int i; - __save_flags(flags); - __cli(); + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only */ t = jiffies * 11932; outb_p(0, 0x43); i = inb_p(0x40); i |= inb(0x40) << 8; - __restore_flags(flags); + __restore_flags(flags); /* local CPU only */ return (t - i); } #endif /* DISK_RECOVERY_TIME */ @@ -178,15 +180,11 @@ */ static void init_hwif_data (unsigned int index) { - byte *p; unsigned int unit; ide_hwif_t *hwif = &ide_hwifs[index]; /* bulk initialize hwif & drive info with zeros */ - p = ((byte *) hwif) + sizeof(ide_hwif_t); - do { - *--p = 0; - } while (p > (byte *) hwif); + memset(hwif, 0, sizeof(ide_hwif_t)); /* fill in any non-zero initial values */ hwif->index = index; @@ -299,11 +297,11 @@ #if SUPPORT_VLB_SYNC if (io_32bit & 2) { unsigned long flags; - __save_flags(flags); - __cli(); + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only */ do_vlb_sync(IDE_NSECTOR_REG); insl(IDE_DATA_REG, buffer, wcount); - __restore_flags(flags); + __restore_flags(flags); /* local CPU only */ } else #endif /* SUPPORT_VLB_SYNC */ insl(IDE_DATA_REG, buffer, wcount); @@ -332,11 +330,11 @@ #if SUPPORT_VLB_SYNC if (io_32bit & 2) { unsigned long flags; - __save_flags(flags); - __cli(); + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only */ do_vlb_sync(IDE_NSECTOR_REG); outsl(IDE_DATA_REG, buffer, wcount); - __restore_flags(flags); + __restore_flags(flags); /* local CPU only */ } else #endif /* SUPPORT_VLB_SYNC */ outsl(IDE_DATA_REG, buffer, wcount); @@ -392,6 +390,21 @@ } /* + * Needed for PCI irq sharing + */ +static inline int irq_pending (ide_drive_t *drive) +{ + if (drive->waiting_for_dma) + return HWIF(drive)->dmaproc(ide_dma_irq, drive); +#if 0 + udelay(1); /* need to guarantee 400ns since last command was issued */ +#endif + if (GET_STAT() & BUSY_STAT) + return 0; + return 1; +} + +/* * This should get invoked any time we exit the driver to * wait for an interrupt response from a drive. handler() points * at the appropriate code to handle the next interrupt, and a @@ -558,8 +571,8 @@ ide_hwif_t *hwif = HWIF(drive); ide_hwgroup_t *hwgroup = HWGROUP(drive); - __save_flags(flags); - __cli(); /* Why ? */ + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only */ /* For an ATAPI device, first try an ATAPI SRST. */ if (drive->media != ide_disk && !do_not_try_atapi) { @@ -569,7 +582,7 @@ OUT_BYTE (WIN_SRST, IDE_COMMAND_REG); hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; ide_set_handler (drive, &atapi_reset_pollfunc, HZ/20); - __restore_flags (flags); + __restore_flags (flags); /* local CPU only */ return; } @@ -597,7 +610,7 @@ ide_set_handler (drive, &reset_pollfunc, HZ/20); #endif /* OK_TO_RESET_CONTROLLER */ - __restore_flags (flags); + __restore_flags (flags); /* local CPU only */ } /* @@ -613,7 +626,7 @@ */ void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err) { - unsigned long flags; + unsigned long flags, iflags; struct request *rq = HWGROUP(drive)->rq; if (rq->cmd == IDE_DRIVE_CMD) { @@ -625,15 +638,17 @@ args[2] = IN_BYTE(IDE_NSECTOR_REG); } } - __save_flags(flags); - __cli(); + save_flags(flags); /* all CPUs */ + cli(); /* all CPUs */ drive->queue = rq->next; + spin_lock_irqsave(&io_request_lock,iflags); blk_dev[MAJOR(rq->rq_dev)].current_request = NULL; + spin_unlock_irqrestore(&io_request_lock,iflags); HWGROUP(drive)->rq = NULL; rq->rq_status = RQ_INACTIVE; if (rq->sem != NULL) up(rq->sem); - __restore_flags(flags); + restore_flags(flags); /* all CPUs */ } /* @@ -644,8 +659,8 @@ unsigned long flags; byte err = 0; - __save_flags (flags); - /* ide_sti(); HACK */ + __save_flags (flags); /* local CPU only */ + ide__sti(); /* local CPU only */ printk("%s: %s: status=0x%02x", drive->name, msg, stat); #if FANCY_STATUS_DUMPS printk(" { "); @@ -698,7 +713,7 @@ #endif /* FANCY_STATUS_DUMPS */ printk("\n"); } - __restore_flags (flags); + __restore_flags (flags); /* local CPU only */ return err; } @@ -799,7 +814,7 @@ byte stat = GET_STAT(); int retries = 10; - /* ide_sti(); HACK */ + ide__sti(); /* local CPU only */ if ((stat & DRQ_STAT) && args && args[3]) { byte io_32bit = drive->io_32bit; drive->io_32bit = 0; @@ -857,17 +872,17 @@ udelay(1); /* spec allows drive 400ns to assert "BUSY" */ if ((stat = GET_STAT()) & BUSY_STAT) { - __save_flags(flags); - /* ide_sti(); HACK */ + __save_flags(flags); /* local CPU only */ + ide__sti(); /* local CPU only */ timeout += jiffies; while ((stat = GET_STAT()) & BUSY_STAT) { if (0 < (signed long)(jiffies - timeout)) { - __restore_flags(flags); + __restore_flags(flags); /* local CPU only */ ide_error(drive, "status timeout", stat); return 1; } } - __restore_flags(flags); + __restore_flags(flags); /* local CPU only */ } udelay(1); /* allow status to settle, then read it again */ if (OK_STAT((stat = GET_STAT()), good, bad)) @@ -917,7 +932,7 @@ struct request *rq = drive->queue; unsigned int minor = MINOR(rq->rq_dev), unit = minor >> PARTN_BITS; - /* ide_sti(); HACK */ + ide__sti(); /* local CPU only */ #ifdef DEBUG printk("%s: do_request: current=0x%08lx\n", hwif->name, (unsigned long) rq); #endif @@ -1041,7 +1056,10 @@ hwgroup->rq = NULL; do { + unsigned long flags; + spin_lock_irqsave(&io_request_lock, flags); blk_dev[HWIF(drive)->major].current_request = NULL; + spin_unlock_irqrestore(&io_request_lock, flags); if (!drive->sleep) continue; if (!sleep) { @@ -1057,7 +1075,7 @@ hwgroup->timer.expires = sleep; add_timer(&hwgroup->timer); } else /* Ugly, but how can we sleep for the lock otherwise? perhaps from tq_scheduler? */ - ide_release_lock(&ide_lock); + ide_release_lock(&ide_lock); /* for atari only */ hwgroup->active = 0; } @@ -1078,7 +1096,6 @@ */ void ide_do_request (ide_hwgroup_t *hwgroup) { - __cli(); /* paranoia */ if (hwgroup->handler != NULL) { printk("%s: EEeekk!! handler not NULL in ide_do_request()\n", hwgroup->hwif->name); return; @@ -1086,14 +1103,16 @@ do { ide_drive_t *drive = choose_drive(hwgroup); if (drive != NULL) { + unsigned long flags; ide_hwif_t *hwif = HWIF(drive); if (hwgroup->hwif->sharing_irq && hwif != hwgroup->hwif) OUT_BYTE(hwgroup->drive->ctl|2, hwgroup->hwif->io_ports[IDE_CONTROL_OFFSET]); drive->sleep = 0; + spin_lock_irqsave(&io_request_lock, flags); blk_dev[hwif->major].current_request = hwgroup->rq = drive->queue; + spin_unlock_irqrestore(&io_request_lock, flags); drive->service_start = jiffies; do_request(hwgroup, hwif, drive); - __cli(); } else { ide_leave_hwgroup(hwgroup); /* no work left for this hwgroup */ return; @@ -1113,8 +1132,8 @@ } /* - * do_hwgroup_request() invokes ide_do_request() after first masking - * all possible interrupts for the current hwgroup. This prevents race + * do_hwgroup_request() invokes ide_do_request() after first claiming + * the spinlock for the current hwgroup. This prevents race * conditions in the event that an unexpected interrupt occurs while * we are in the driver. * @@ -1130,7 +1149,7 @@ ide_hwif_t *hwif = hgif; del_timer(&hwgroup->timer); - ide_get_lock(&ide_lock, ide_intr, hwgroup); + ide_get_lock(&ide_lock, ide_intr, hwgroup); /* for atari only */ hwgroup->active = 1; do { disable_irq(hwif->irq); @@ -1142,43 +1161,52 @@ } } -void do_ide0_request (void) /* invoked with __cli() */ +static void do_hwgroup_request_spinlock (ide_hwgroup_t *hwgroup) { - do_hwgroup_request (ide_hwifs[0].hwgroup); + unsigned long flags; + + spin_lock_irqsave(&hwgroup->spinlock, flags); + do_hwgroup_request(hwgroup); + spin_unlock_irqrestore(&hwgroup->spinlock, flags); +} + +void do_ide0_request (void) +{ + do_hwgroup_request_spinlock (ide_hwifs[0].hwgroup); } #if MAX_HWIFS > 1 -void do_ide1_request (void) /* invoked with __cli() */ +void do_ide1_request (void) { - do_hwgroup_request (ide_hwifs[1].hwgroup); + do_hwgroup_request_spinlock (ide_hwifs[1].hwgroup); } #endif /* MAX_HWIFS > 1 */ #if MAX_HWIFS > 2 -void do_ide2_request (void) /* invoked with __cli() */ +void do_ide2_request (void) { - do_hwgroup_request (ide_hwifs[2].hwgroup); + do_hwgroup_request_spinlock (ide_hwifs[2].hwgroup); } #endif /* MAX_HWIFS > 2 */ #if MAX_HWIFS > 3 -void do_ide3_request (void) /* invoked with __cli() */ +void do_ide3_request (void) { - do_hwgroup_request (ide_hwifs[3].hwgroup); + do_hwgroup_request_spinlock (ide_hwifs[3].hwgroup); } #endif /* MAX_HWIFS > 3 */ #if MAX_HWIFS > 4 -void do_ide4_request (void) /* invoked with cli() */ +void do_ide4_request (void) { - do_hwgroup_request (ide_hwifs[4].hwgroup); + do_hwgroup_request_spinlock (ide_hwifs[4].hwgroup); } #endif /* MAX_HWIFS > 4 */ #if MAX_HWIFS > 5 -void do_ide5_request (void) /* invoked with cli() */ +void do_ide5_request (void) { - do_hwgroup_request (ide_hwifs[5].hwgroup); + do_hwgroup_request_spinlock (ide_hwifs[5].hwgroup); } #endif /* MAX_HWIFS > 5 */ @@ -1189,27 +1217,25 @@ ide_handler_t *handler; unsigned long flags; - __save_flags(flags); - __cli(); - - if ((handler = hwgroup->handler) != NULL) { + spin_lock_irqsave(&hwgroup->spinlock, flags); + if ((handler = hwgroup->handler) == NULL) { + do_hwgroup_request (hwgroup); + } else { hwgroup->handler = NULL; - if (hwgroup->poll_timeout != 0) /* polling in progress? */ + if (hwgroup->poll_timeout != 0) { /* polling in progress? */ handler(drive); - else { /* abort the operation */ + } else { /* abort the operation */ if (hwgroup->hwif->dmaproc) (void) hwgroup->hwif->dmaproc (ide_dma_end, drive); ide_error(drive, "irq timeout", GET_STAT()); } - __cli(); if (hwgroup->handler == NULL) { set_recovery_timer(HWIF(drive)); drive->service_time = jiffies - drive->service_start; - do_hwgroup_request (hwgroup); + do_hwgroup_request(hwgroup); } - } else - do_hwgroup_request (hwgroup); - __restore_flags(flags); + } + spin_unlock_irqrestore(&hwgroup->spinlock, flags); } /* @@ -1248,23 +1274,18 @@ stat = IN_BYTE(hwif->io_ports[IDE_STATUS_OFFSET]); if (!OK_STAT(stat, READY_STAT, BAD_STAT)) { /* Try to not flood the console with msgs */ - static unsigned long last_msgtime = 0; + static unsigned long last_msgtime = 0, count = 0; + ++count; if (0 < (signed long)(jiffies - (last_msgtime + HZ))) { last_msgtime = jiffies; - printk("%s%s: unexpected interrupt, status=0x%02x\n", - hwif->name, (hwif->next == hwgroup->hwif) ? "" : "(?)", stat); + printk("%s%s: unexpected interrupt, status=0x%02x, count=%ld\n", + hwif->name, (hwif->next == hwgroup->hwif) ? "" : "(?)", stat, count); } } } } while ((hwif = hwif->next) != hwgroup->hwif); } -#ifdef __sparc_v9__ -#define IDE_IRQ_EQUAL(irq1, irq2) (1) -#else -#define IDE_IRQ_EQUAL(irq1, irq2) ((irq1) == (irq2)) -#endif - /* * entry point for all interrupts, caller does __cli() for us */ @@ -1275,50 +1296,43 @@ ide_hwif_t *hwif = hwgroup->hwif; ide_handler_t *handler; - if (!ide_ack_intr (hwif->io_ports[IDE_STATUS_OFFSET], hwif->io_ports[IDE_IRQ_OFFSET])) - return; - - do { - if (!IDE_IRQ_EQUAL(irq, hwgroup->hwif->irq)) - disable_irq(hwif->irq); - } while ((hwif = hwif->next) != hwgroup->hwif); - if (IDE_IRQ_EQUAL(irq, hwif->irq) - && (handler = hwgroup->handler) != NULL) { + /* + * email mlord@pobox.com if broken for __sparc_v9__ + */ + spin_lock_irqsave(&hwgroup->spinlock, flags); + if (irq == hwif->irq && (handler = hwgroup->handler) != NULL) { ide_drive_t *drive = hwgroup->drive; -#if 1 /* temporary, remove later -- FIXME */ - { - struct request *rq = hwgroup->rq; - if (rq != NULL - &&( MAJOR(rq->rq_dev) != HWIF(drive)->major - || (MINOR(rq->rq_dev) >> PARTN_BITS) != drive->select.b.unit)) - { - printk("ide_intr: got IRQ from wrong device: email mlord@pobox.com!!\n"); - return; - } + if (!drive || !irq_pending(drive)) { + spin_unlock_irqrestore(&hwgroup->spinlock, flags); + return; } -#endif /* temporary */ + (void)ide_ack_intr (hwif->io_ports[IDE_STATUS_OFFSET], hwif->io_ports[IDE_IRQ_OFFSET]); hwgroup->handler = NULL; del_timer(&(hwgroup->timer)); - /* if (drive->unmask) - ide_sti(); HACK */ + do { + if (irq != hwif->irq) + disable_irq(hwif->irq); + } while ((hwif = hwif->next) != hwgroup->hwif); + if (drive->unmask) + ide__sti(); /* local CPU only */ handler(drive); - /* this is necessary, as next rq may be different irq */ - spin_lock_irqsave(&io_request_lock,flags); + __cli(); /* local CPU only */ + /* note: next rq may be different irq */ if (hwgroup->handler == NULL) { set_recovery_timer(HWIF(drive)); drive->service_time = jiffies - drive->service_start; ide_do_request(hwgroup); } - spin_unlock_irqrestore(&io_request_lock,flags); + __cli(); /* local CPU only */ + hwif = hwgroup->hwif; + do { + if (irq != hwif->irq) + enable_irq(hwif->irq); + } while ((hwif = hwif->next) != hwgroup->hwif); } else { - unexpected_intr(irq, hwgroup); + unexpected_intr(irq, hwgroup); /* Mmm... need to think about this */ } - __cli(); - hwif = hwgroup->hwif; - do { - if (!IDE_IRQ_EQUAL(hwif->irq, irq)) - enable_irq(hwif->irq); - } while ((hwif = hwif->next) != hwgroup->hwif); + spin_unlock_irqrestore(&hwgroup->spinlock, flags); } /* @@ -1402,10 +1416,8 @@ if (action == ide_wait) rq->sem = &sem; - __save_flags(flags); - __cli(); + spin_lock_irqsave(&hwgroup->spinlock, flags); cur_rq = drive->queue; - if (cur_rq == NULL || action == ide_preempt) { rq->next = cur_rq; drive->queue = rq; @@ -1419,13 +1431,11 @@ rq->next = cur_rq->next; cur_rq->next = rq; } - if (!hwgroup->active) { + if (!hwgroup->active) do_hwgroup_request(hwgroup); - __cli(); - } if (action == ide_wait && rq->rq_status != RQ_INACTIVE) down(&sem); /* wait for it to be serviced */ - __restore_flags(flags); + spin_unlock_irqrestore(&hwgroup->spinlock, flags); return rq->errors ? -EIO : 0; /* return -EIO if errors */ } @@ -1440,6 +1450,7 @@ int ide_revalidate_disk(kdev_t i_rdev) { ide_drive_t *drive; + ide_hwgroup_t *hwgroup; unsigned int p, major, minor; long flags; @@ -1447,15 +1458,15 @@ return -ENODEV; major = MAJOR(i_rdev); minor = drive->select.b.unit << PARTN_BITS; - __save_flags(flags); - __cli(); + hwgroup = HWGROUP(drive); + spin_lock_irqsave(&hwgroup->spinlock, flags); if (drive->busy || (drive->usage > 1)) { - __restore_flags(flags); + spin_unlock_irqrestore(&hwgroup->spinlock, flags); return -EBUSY; }; drive->busy = 1; MOD_INC_USE_COUNT; - __restore_flags(flags); + spin_unlock_irqrestore(&hwgroup->spinlock, flags); for (p = 0; p < (1<<PARTN_BITS); ++p) { if (drive->part[p].nr_sects > 0) { @@ -1601,8 +1612,8 @@ if (index >= MAX_HWIFS) return; - __save_flags(flags); - __cli(); + save_flags(flags); /* all CPUs */ + cli(); /* all CPUs */ hwif = &ide_hwifs[index]; if (!hwif->present) goto abort; @@ -1692,7 +1703,7 @@ } init_hwif_data (index); /* restore hwif data to pristine status */ abort: - __restore_flags(flags); + restore_flags(flags); /* all CPUs */ } int ide_register (int arg1, int arg2, int irq) @@ -1731,7 +1742,7 @@ return hwif->present ? index : -1; } -void ide_add_setting(ide_drive_t *drive, char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set) +void ide_add_setting(ide_drive_t *drive, const char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set) { ide_settings_t **p = (ide_settings_t **) &drive->settings, *setting = NULL; @@ -1827,6 +1838,7 @@ int ide_write_setting(ide_drive_t *drive, ide_settings_t *setting, int val) { + ide_hwgroup_t *hwgroup = HWGROUP(drive); unsigned long flags; int i, rc = 0; u32 *p; @@ -1837,8 +1849,7 @@ return -EPERM; if (val < setting->min || val > setting->max) return -EINVAL; - __save_flags(flags); - __cli(); + spin_lock_irqsave(&hwgroup->spinlock, flags); if (setting->set) rc = setting->set(drive, val); else switch (setting->data_type) { @@ -1857,7 +1868,7 @@ *p = val; break; } - __restore_flags(flags); + spin_unlock_irqrestore(&hwgroup->spinlock, flags); return rc; } @@ -2323,7 +2334,7 @@ goto bad_option; /* chipset already specified */ if (i <= -7 && hw != 0) goto bad_hwif; /* chipset drivers are for "ide0=" only */ - if (ide_hwifs[hw^1].chipset != ide_unknown) + if (i <= -7 && ide_hwifs[hw^1].chipset != ide_unknown) goto bad_option; /* chipset for 2nd port already specified */ printk("\n"); } @@ -2540,12 +2551,6 @@ ide_probe_for_rz100x(); } #endif /* CONFIG_BLK_DEV_RZ1000 */ -#ifdef CONFIG_BLK_DEV_SL82C105 - { - extern void ide_probe_for_sl82c105(void); - ide_probe_for_sl82c105(); - } -#endif /* CONFIG_BLK_DEV_SL82C105 */ #endif /* CONFIG_BLK_DEV_IDEPCI */ } #endif /* CONFIG_PCI */ @@ -2574,7 +2579,7 @@ #ifdef CONFIG_BLK_DEV_IDE #ifdef __mc68000__ if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) { - ide_get_lock(&ide_lock, NULL, NULL); + ide_get_lock(&ide_lock, NULL, NULL); /* for atari only */ disable_irq(ide_hwifs[0].irq); } #endif /* __mc68000__ */ @@ -2584,7 +2589,7 @@ #ifdef __mc68000__ if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) { enable_irq(ide_hwifs[0].irq); - ide_release_lock(&ide_lock); + ide_release_lock(&ide_lock); /* for atari only */ } #endif /* __mc68000__ */ #endif /* CONFIG_BLK_DEV_IDE */ @@ -2717,16 +2722,15 @@ { unsigned long flags; - __save_flags(flags); - __cli(); - if (version != IDE_SUBDRIVER_VERSION || !drive->present || drive->driver != NULL || - drive->busy || drive->usage) { - __restore_flags(flags); + save_flags(flags); /* all CPUs */ + cli(); /* all CPUs */ + if (version != IDE_SUBDRIVER_VERSION || !drive->present || drive->driver != NULL || drive->busy || drive->usage) { + restore_flags(flags); /* all CPUs */ return 1; } drive->driver = driver; setup_driver_defaults(drive); - __restore_flags(flags); + restore_flags(flags); /* all CPUs */ if (drive->autotune != 2) { if (driver->supports_dma && HWIF(drive)->dmaproc != NULL) (void) (HWIF(drive)->dmaproc(ide_dma_check, drive)); @@ -2745,10 +2749,10 @@ { unsigned long flags; - __save_flags(flags); - __cli(); + save_flags(flags); /* all CPUs */ + cli(); /* all CPUs */ if (drive->usage || drive->busy || drive->driver == NULL || DRIVER(drive)->busy) { - __restore_flags(flags); + restore_flags(flags); /* all CPUs */ return 1; } #ifdef CONFIG_PROC_FS @@ -2757,7 +2761,7 @@ #endif auto_remove_settings(drive); drive->driver = NULL; - __restore_flags(flags); + restore_flags(flags); /* all CPUs */ return 0; } diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ide.h linux/drivers/block/ide.h --- linux-2.1.93/drivers/block/ide.h Mon Apr 6 22:16:07 1998 +++ linux/drivers/block/ide.h Wed Apr 8 02:04:59 1998 @@ -204,26 +204,27 @@ unsigned long service_start; /* time we started last request */ unsigned long service_time; /* service time of last request */ special_t special; /* special action flags */ + byte keep_settings; /* restore settings after drive reset */ + byte using_dma; /* disk is using dma for read/write */ + byte waiting_for_dma; /* dma currently in progress */ + byte unmask; /* flag: okay to unmask other irqs */ + byte slow; /* flag: slow data port */ + byte bswap; /* flag: byte swap data */ + byte dsc_overlap; /* flag: DSC overlap */ + byte nice1; /* flag: give potential excess bandwidth */ unsigned present : 1; /* drive is physically present */ unsigned noprobe : 1; /* from: hdx=noprobe */ - byte keep_settings; /* restore settings after drive reset */ unsigned busy : 1; /* currently doing revalidate_disk() */ unsigned removable : 1; /* 1 if need to do check_media_change */ - byte using_dma; /* disk is using dma for read/write */ unsigned forced_geom : 1; /* 1 if hdx=c,h,s was given at boot */ - byte unmask; /* flag: okay to unmask other irqs */ unsigned no_unmask : 1; /* disallow setting unmask bit */ unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */ unsigned nobios : 1; /* flag: do not probe bios for drive */ - byte slow; /* flag: slow data port */ - unsigned autotune : 2; /* 1=autotune, 2=noautotune, 0=default */ unsigned revalidate : 1; /* request revalidation */ - byte bswap; /* flag: byte swap data */ - byte dsc_overlap; /* flag: DSC overlap */ unsigned atapi_overlap : 1; /* flag: ATAPI overlap (not supported) */ unsigned nice0 : 1; /* flag: give obvious excess bandwidth */ - byte nice1; /* flag: give potential excess bandwidth */ unsigned nice2 : 1; /* flag: give a share in our own bandwidth */ + unsigned autotune : 2; /* 1=autotune, 2=noautotune, 0=default */ #if FAKE_FDISK_FOR_EZDRIVE unsigned remap_0_to_1 : 1; /* flag: partitioned with ezdrive */ #endif /* FAKE_FDISK_FOR_EZDRIVE */ @@ -270,7 +271,8 @@ * should either try again later, or revert to PIO for the current request. */ typedef enum { ide_dma_read, ide_dma_write, ide_dma_begin, ide_dma_end, - ide_dma_check, ide_dma_on, ide_dma_off, ide_dma_off_quietly + ide_dma_check, ide_dma_on, ide_dma_off, ide_dma_off_quietly, + ide_dma_irq } ide_dma_action_t; typedef int (ide_dmaproc_t)(ide_dma_action_t, ide_drive_t *); @@ -340,7 +342,7 @@ unsigned reset : 1; /* reset after probe */ unsigned no_autodma : 1; /* don't automatically enable DMA at boot */ byte channel; /* for dual-port chips: 0=primary, 1=secondary */ - struct pci_dev *pci_dev; /* for pci chipsets */ + struct pci_dev *pci_dev; /* for pci chipsets */ ide_pci_devid_t pci_devid; /* for pci chipsets: {VID,DID} */ #if (DISK_RECOVERY_TIME > 0) unsigned long last_time; /* time when previous rq was done */ @@ -361,6 +363,7 @@ struct request wrq; /* local copy of current write rq */ unsigned long poll_timeout; /* timeout value during long polls */ int active; /* set when servicing requests */ + spinlock_t spinlock; /* for MT/MP safe operation */ } ide_hwgroup_t; /* @@ -393,7 +396,7 @@ struct ide_settings_s *next; } ide_settings_t; -void ide_add_setting(ide_drive_t *drive, char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set); +void ide_add_setting(ide_drive_t *drive, const char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set); void ide_remove_setting(ide_drive_t *drive, char *name); ide_settings_t *ide_find_setting_by_name(ide_drive_t *drive, char *name); int ide_read_setting(ide_drive_t *t, ide_settings_t *setting); @@ -689,6 +692,9 @@ #endif #ifdef _IDE_C +#ifdef CONFIG_BLK_DEV_IDE +int ideprobe_init (void); +#endif /* CONFIG_BLK_DEV_IDE */ #ifdef CONFIG_BLK_DEV_IDEDISK int idedisk_init (void); #endif /* CONFIG_BLK_DEV_IDEDISK */ @@ -722,12 +728,8 @@ void ide_dma_intr (ide_drive_t *drive); int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive); void ide_setup_dma (ide_hwif_t *hwif, unsigned long dmabase, unsigned int num_ports) __init; -unsigned long ide_get_or_set_dma_base (struct pci_dev *dev, ide_hwif_t *hwif, int extra, const char *name) __init; +unsigned long ide_get_or_set_dma_base (ide_hwif_t *hwif, int extra, const char *name) __init; #endif - -#ifdef CONFIG_BLK_DEV_IDE -int ideprobe_init (void); -#endif /* CONFIG_BLK_DEV_IDE */ #ifdef CONFIG_BLK_DEV_PDC4030 #include "pdc4030.h" diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/ns87415.c linux/drivers/block/ns87415.c --- linux-2.1.93/drivers/block/ns87415.c Mon Apr 6 22:16:07 1998 +++ linux/drivers/block/ns87415.c Wed Apr 8 09:46:17 1998 @@ -35,7 +35,8 @@ struct pci_dev *dev = hwif->pci_dev; unsigned long flags; - save_flags(flags); cli(); + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only */ new = *old; /* adjust IRQ enable bit */ @@ -56,7 +57,7 @@ *old = new; (void) pci_write_config_dword(dev, 0x40, new); } - restore_flags(flags); + restore_flags(flags); /* local CPU only */ } static void ns87415_selectproc (ide_drive_t *drive) @@ -66,33 +67,25 @@ static int ns87415_dmaproc(ide_dma_action_t func, ide_drive_t *drive) { - ide_hwif_t *hwif = HWIF(drive); + ide_hwif_t *hwif = HWIF(drive); + byte dma_stat; switch (func) { case ide_dma_end: /* returns 1 on error, 0 otherwise */ - { - byte dma_stat = inb(hwif->dma_base+2); - int rc = (dma_stat & 7) != 4; - /* from errata: stop DMA, clear INTR & ERROR */ - outb(7, hwif->dma_base); - /* clear the INTR & ERROR bits */ - outb(dma_stat|6, hwif->dma_base+2); - /* verify good DMA status */ - return rc; - } + drive->waiting_for_dma = 0; + dma_stat = inb(hwif->dma_base+2); + outb(7, hwif->dma_base); /* from errata: stop DMA, clear INTR & ERROR */ + outb(dma_stat|6, hwif->dma_base+2); /* clear the INTR & ERROR bits */ + return (dma_stat & 7) != 4; /* verify good DMA status */ case ide_dma_write: case ide_dma_read: - /* select DMA xfer */ - ns87415_prepare_drive(drive, 1); - /* use standard DMA stuff */ - if (!ide_dmaproc(func, drive)) + ns87415_prepare_drive(drive, 1); /* select DMA xfer */ + if (!ide_dmaproc(func, drive)) /* use standard DMA stuff */ return 0; - /* DMA failed: select PIO xfer */ - ns87415_prepare_drive(drive, 0); + ns87415_prepare_drive(drive, 0); /* DMA failed: select PIO xfer */ return 1; default: - /* use standard DMA stuff */ - return ide_dmaproc(func, drive); + return ide_dmaproc(func, drive); /* use standard DMA stuff */ } } @@ -100,8 +93,7 @@ { struct pci_dev *dev = hwif->pci_dev; unsigned int ctrl, using_inta; - byte progif, stat; - int timeout; + byte progif; /* * We cannot probe for IRQ: both ports share common IRQ on INTA. @@ -134,6 +126,9 @@ pci_write_config_byte(dev, 0x55, 0xee); #ifdef __sparc_v9__ +{ + int timeout; + byte stat; /* * XXX: Reset the device, if we don't it will not respond * to SELECT_DRIVE() properly during first probe_hwif(). @@ -148,6 +143,7 @@ if (stat == 0xff) break; } while ((stat & BUSY_STAT) && --timeout); +} #endif } if (!using_inta) diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/opti621.c linux/drivers/block/opti621.c --- linux-2.1.93/drivers/block/opti621.c Mon Apr 6 22:16:07 1998 +++ linux/drivers/block/opti621.c Wed Apr 8 09:46:50 1998 @@ -242,8 +242,8 @@ hwif->name, ax, second.data_time, second.recovery_time, drdy); #endif - save_flags(flags); - cli(); + save_flags(flags); /* all CPUs */ + cli(); /* all CPUs */ reg_base = hwif->io_ports[IDE_DATA_OFFSET]; outb(0xc0, reg_base+CNTRL_REG); /* allow Register-B */ @@ -268,7 +268,7 @@ write_reg(misc, MISC_REG); /* set address setup, DRDY timings, */ /* and read prefetch for both drives */ - restore_flags(flags); + restore_flags(flags); /* all CPUs */ } /* diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/pdc4030.c linux/drivers/block/pdc4030.c --- linux-2.1.93/drivers/block/pdc4030.c Mon Dec 29 12:25:29 1997 +++ linux/drivers/block/pdc4030.c Wed Apr 8 09:53:14 1998 @@ -327,15 +327,9 @@ do { stat=GET_STAT(); if(stat & DRQ_STAT) { -/* unsigned long flags; - save_flags(flags); - cli(); disable_irq(HWIF(drive)->irq); -*/ ide_intr(HWIF(drive)->irq,HWGROUP(drive),NULL); -/* enable_irq(HWIF(drive)->irq); - restore_flags(flags); -*/ + enable_irq(HWIF(drive)->irq); return; } if(IN_BYTE(IDE_SELECT_REG) & 0x01) @@ -353,7 +347,7 @@ return; } if (!drive->unmask) - cli(); + __cli(); /* local CPU only */ HWGROUP(drive)->wrq = *rq; /* scratchpad */ promise_write(drive); return; diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/qd6580.c linux/drivers/block/qd6580.c --- linux-2.1.93/drivers/block/qd6580.c Mon Dec 29 12:25:29 1997 +++ linux/drivers/block/qd6580.c Wed Apr 8 09:49:27 1998 @@ -49,13 +49,13 @@ pio = ide_get_best_pio_mode(drive, pio, 3, NULL); - save_flags(flags); - cli(); + save_flags(flags); /* all CPUs */ + cli(); /* all CPUs */ outb_p(0x8d,0xb0); outb_p(0x0 ,0xb2); outb_p(((pio+1)<<4)|0x0f,0xb3); inb(0x3f6); - restore_flags(flags); + restore_flags(flags); /* all CPUs */ } void init_qd6580 (void) diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/sl82c105.c linux/drivers/block/sl82c105.c --- linux-2.1.93/drivers/block/sl82c105.c Mon Apr 6 22:16:07 1998 +++ linux/drivers/block/sl82c105.c Tue Apr 7 09:52:02 1998 @@ -19,8 +19,9 @@ ide_ioreg_t chrp_ide_regbase[MAX_HWIFS]; ide_ioreg_t chrp_idedma_regbase; -void ide_init_sl82c105(struct pci_dev *dev) { - +void ide_init_sl82c105(ide_hwif_t *hwif) +{ + struct pci_dev *dev = hwif->pci_dev; unsigned short t16; unsigned int t32; @@ -37,15 +38,7 @@ pci_write_config_dword(dev, 0x40, 0x10ff08a1); } - -void ide_probe_for_sl82c105(void) -{ - struct pci_dev *dev = NULL; - - while ((dev = pci_find_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, dev))) - ide_init_sl82c105(dev); -} - +#if 0 /* nobody ever calls these.. ?? */ void chrp_ide_probe(void) { struct pci_dev *pdev = pci_find_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, NULL); @@ -75,4 +68,4 @@ if (irq != NULL) *irq = chrp_ide_irq; } - +#endif diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/trm290.c linux/drivers/block/trm290.c --- linux-2.1.93/drivers/block/trm290.c Mon Apr 6 22:16:07 1998 +++ linux/drivers/block/trm290.c Wed Apr 8 09:52:23 1998 @@ -148,8 +148,8 @@ /* select PIO or DMA */ reg = use_dma ? (0x21 | 0x82) : (0x21 & ~0x82); - save_flags(flags); - cli(); + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only */ if (reg != hwif->select_data) { hwif->select_data = reg; @@ -164,7 +164,7 @@ outw(reg, hwif->config_data+3); } - restore_flags(flags); + __restore_flags(flags); /* local CPU only */ } static void trm290_selectproc (ide_drive_t *drive) @@ -195,8 +195,10 @@ ide_set_handler(drive, &ide_dma_intr, WAIT_CMD); OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG); case ide_dma_begin: + drive->waiting_for_dma = 1; return 0; case ide_dma_end: + drive->waiting_for_dma = 0; return (inw(hwif->dma_base+2) != 0x00ff); default: return ide_dmaproc(func, drive); @@ -226,8 +228,8 @@ printk("TRM290: using default config base at 0x%04lx\n", hwif->config_data); } - save_flags(flags); - cli(); + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only */ /* put config reg into first byte of hwif->select_data */ outb(0x51|(hwif->channel<<3), hwif->config_data+1); hwif->select_data = 0x21; /* select PIO as default */ @@ -235,7 +237,7 @@ reg = inb(hwif->config_data+3); /* get IRQ info */ reg = (reg & 0x10) | 0x03; /* mask IRQs for both ports */ outb(reg, hwif->config_data+3); - restore_flags(flags); + __restore_flags(flags); /* local CPU only */ if ((reg & 0x10)) hwif->irq = hwif->channel ? 15 : 14; /* legacy mode */ diff -u --recursive --new-file --exclude=.* linux-2.1.93/drivers/block/umc8672.c linux/drivers/block/umc8672.c --- linux-2.1.93/drivers/block/umc8672.c Mon Dec 29 12:25:30 1997 +++ linux/drivers/block/umc8672.c Wed Apr 8 09:52:43 1998 @@ -112,39 +112,39 @@ pio = ide_get_best_pio_mode(drive, pio, 4, NULL); printk("%s: setting umc8672 to PIO mode%d (speed %d)\n", drive->name, pio, pio_to_umc[pio]); - save_flags(flags); - cli(); + save_flags(flags); /* all CPUs */ + cli(); /* all CPUs */ if (hwgroup && hwgroup->handler != NULL) { printk("umc8672: other interface is busy: exiting tune_umc()\n"); } else { current_speeds[drive->name[2] - 'a'] = pio_to_umc[pio]; umc_set_speeds (current_speeds); } - restore_flags(flags); + restore_flags(flags); /* all CPUs */ } void init_umc8672 (void) /* called from ide.c */ { unsigned long flags; - save_flags(flags); - cli (); + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only */ if (check_region(0x108, 2)) { - restore_flags(flags); + __restore_flags(flags); printk("\numc8672: PORTS 0x108-0x109 ALREADY IN USE\n"); return; } outb_p (0x5A,0x108); /* enable umc */ if (in_umc (0xd5) != 0xa0) { - restore_flags(flags); + __restore_flags(flags); /* local CPU only */ printk ("umc8672: not found\n"); return; } outb_p (0xa5,0x108); /* disable umc */ umc_set_speeds (current_speeds); - restore_flags(flags); + __restore_flags(flags); /* local CPU only */ request_region(0x108, 2, "umc8672"); ide_hwifs[0].chipset = ide_umc8672; diff -u --recursive --new-file --exclude=.* linux-2.1.93/include/asm-alpha/ide.h linux/include/asm-alpha/ide.h --- linux-2.1.93/include/asm-alpha/ide.h Thu Mar 27 17:40:06 1997 +++ linux/include/asm-alpha/ide.h Wed Apr 8 01:20:15 1998 @@ -19,7 +19,7 @@ #define MAX_HWIFS 4 #endif -#define ide_sti() sti() +#define ide__sti() __sti() static __inline__ int ide_default_irq(ide_ioreg_t base) { diff -u --recursive --new-file --exclude=.* linux-2.1.93/include/asm-arm/ide.h linux/include/asm-arm/ide.h --- linux-2.1.93/include/asm-arm/ide.h Mon Jan 26 19:32:12 1998 +++ linux/include/asm-arm/ide.h Wed Apr 8 01:20:45 1998 @@ -19,7 +19,7 @@ #define MAX_HWIFS 4 #endif -#define ide_sti() sti() +#define ide__sti() __sti() #include <asm/arch/ide.h> diff -u --recursive --new-file --exclude=.* linux-2.1.93/include/asm-i386/ide.h linux/include/asm-i386/ide.h --- linux-2.1.93/include/asm-i386/ide.h Wed Apr 1 21:24:41 1998 +++ linux/include/asm-i386/ide.h Wed Apr 8 01:20:53 1998 @@ -19,7 +19,7 @@ #define MAX_HWIFS 6 #endif -#define ide_sti() sti() +#define ide__sti() __sti() static __inline__ int ide_default_irq(ide_ioreg_t base) { diff -u --recursive --new-file --exclude=.* linux-2.1.93/include/asm-m68k/ide.h linux/include/asm-m68k/ide.h --- linux-2.1.93/include/asm-m68k/ide.h Thu Mar 26 22:30:30 1998 +++ linux/include/asm-m68k/ide.h Wed Apr 8 01:21:14 1998 @@ -424,17 +424,17 @@ * works. (Roman) */ #if defined(CONFIG_ATARI) && !defined(CONFIG_AMIGA) -#define ide_sti() \ +#define ide__sti() \ do { \ - if (!in_interrupt()) sti(); \ + if (!in_interrupt()) __sti(); \ } while(0) #elif defined(CONFIG_ATARI) -#define ide_sti() \ +#define ide__sti() \ do { \ if (!MACH_IS_ATARI || !in_interrupt()) sti(); \ } while(0) #else /* !defined(CONFIG_ATARI) */ -#define ide_sti() sti() +#define ide__sti() __sti() #endif #endif /* __KERNEL__ */ diff -u --recursive --new-file --exclude=.* linux-2.1.93/include/asm-mips/ide.h linux/include/asm-mips/ide.h --- linux-2.1.93/include/asm-mips/ide.h Thu Jun 26 15:33:39 1997 +++ linux/include/asm-mips/ide.h Wed Apr 8 01:21:24 1998 @@ -19,7 +19,7 @@ #define MAX_HWIFS 4 #endif -#define ide_sti() sti() +#define ide__sti() __sti() static __inline__ int ide_default_irq(ide_ioreg_t base) { diff -u --recursive --new-file --exclude=.* linux-2.1.93/include/asm-ppc/ide.h linux/include/asm-ppc/ide.h --- linux-2.1.93/include/asm-ppc/ide.h Sun Jan 18 16:58:56 1998 +++ linux/include/asm-ppc/ide.h Wed Apr 8 01:21:30 1998 @@ -26,7 +26,7 @@ #define SUPPORT_VLB_SYNC 0 -#define ide_sti() sti() +#define ide__sti() __sti() typedef unsigned long ide_ioreg_t; void ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq); diff -u --recursive --new-file --exclude=.* linux-2.1.93/include/asm-sparc64/ide.h linux/include/asm-sparc64/ide.h --- linux-2.1.93/include/asm-sparc64/ide.h Thu Sep 4 15:54:49 1997 +++ linux/include/asm-sparc64/ide.h Wed Apr 8 01:21:33 1998 @@ -21,7 +21,7 @@ extern void sparc64_ide_probe(void); -#define ide_sti() sti() +#define ide__sti() __sti() static __inline__ int ide_default_irq(ide_ioreg_t base) { diff -u --recursive --new-file --exclude=.* linux-2.1.93/include/linux/proc_fs.h linux/include/linux/proc_fs.h --- linux-2.1.93/include/linux/proc_fs.h Mon Apr 6 22:16:17 1998 +++ linux/include/linux/proc_fs.h Tue Apr 7 17:29:00 1998 @@ -364,7 +364,6 @@ extern struct inode_operations proc_file_inode_operations; extern struct inode_operations proc_net_inode_operations; extern struct inode_operations proc_netdir_inode_operations; -extern struct inode_operations proc_scsi_inode_operations; extern struct inode_operations proc_openprom_inode_operations; extern struct inode_operations proc_mem_inode_operations; extern struct inode_operations proc_sys_inode_operations; @@ -381,8 +380,6 @@ extern struct inode_operations proc_omirr_inode_operations; extern struct inode_operations proc_ppc_htab_inode_operations; -#endif - /* * generic.c */ @@ -401,3 +398,5 @@ * proc_devtree.c */ extern void proc_device_tree_init(void); + +#endif /* _LINUX_PROC_FS_H */

--------------1821FE737673FE337BF268B1--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu