Commit 5ff49f70 authored by Martin Dalecki's avatar Martin Dalecki Committed by Linus Torvalds

[PATCH] 2.5.15 IDE 62a

- Streamline device detection reporting to always use ->slot_name.

- Apply 64 bit sector size fixes to the overall code.

- Push ->handler down to the struct ata_channel.

- Introduce channel group based locking instead of a single global lock for all
   operations. There are still some places where we have preserved the ide_lock.
   We can't lock for queues during device probe and we protect global data
   structures during device registration and unregistration in ide.c with it.

- Start replacement of serialized access to the registers of
   channels which share them with proper host chip driver specific locking.
   This affects the following host chip drivers:

   cmd640.c, rz1000, ... ?

   Seems some are setting the serialize flag just in case. So better let's do it
   gradually over time.

   Well, I still have to think whatever we really need to put channels sharing
   an IRQ line in the same locking group.

   From now on the sick concept of a hw group is gone now. We have full blown
   per channel request queues! Hopefully I will be able soon to get my hands on
   a dual Athlon machine to check how this all behaves on a multi SMP machine.

- Move the whole SUPPORT_VLB_SYNC stuff to the only place where it is used: the
   pdc4030 host chip driver.  Eliminate it from the global driver part.

- Eliminate pseudo portability macros from pdc4030. This is a host chip firmly
   based on VLB.
parent 938f5b72
This diff is collapsed.
...@@ -316,7 +316,7 @@ static ide_startstop_t idedisk_do_request(struct ata_device *drive, struct reque ...@@ -316,7 +316,7 @@ static ide_startstop_t idedisk_do_request(struct ata_device *drive, struct reque
unsigned long flags; unsigned long flags;
int ret; int ret;
spin_lock_irqsave(&ide_lock, flags); spin_lock_irqsave(drive->channel->lock, flags);
ret = blk_queue_start_tag(&drive->queue, rq); ret = blk_queue_start_tag(&drive->queue, rq);
...@@ -325,7 +325,7 @@ static ide_startstop_t idedisk_do_request(struct ata_device *drive, struct reque ...@@ -325,7 +325,7 @@ static ide_startstop_t idedisk_do_request(struct ata_device *drive, struct reque
if (ata_pending_commands(drive) > drive->max_last_depth) if (ata_pending_commands(drive) > drive->max_last_depth)
drive->max_last_depth = ata_pending_commands(drive); drive->max_last_depth = ata_pending_commands(drive);
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(drive->channel->lock, flags);
if (ret) { if (ret) {
BUG_ON(!ata_pending_commands(drive)); BUG_ON(!ata_pending_commands(drive));
...@@ -438,13 +438,6 @@ static int set_multcount(struct ata_device *drive, int arg) ...@@ -438,13 +438,6 @@ static int set_multcount(struct ata_device *drive, int arg)
if (!drive->id) if (!drive->id)
return -EIO; return -EIO;
/* FIXME: Hmm... just bailing out my be problematic, since there *is*
* activity during boot. For now the same problem persists in
* set_pio_mode() we will have to do something about it soon.
*/
if (HWGROUP(drive)->handler)
return -EBUSY;
if (arg > drive->id->max_multsect) if (arg > drive->id->max_multsect)
arg = drive->id->max_multsect; arg = drive->id->max_multsect;
...@@ -466,9 +459,6 @@ static int set_multcount(struct ata_device *drive, int arg) ...@@ -466,9 +459,6 @@ static int set_multcount(struct ata_device *drive, int arg)
static int set_nowerr(struct ata_device *drive, int arg) static int set_nowerr(struct ata_device *drive, int arg)
{ {
if (HWGROUP(drive)->handler)
return -EBUSY;
drive->nowerr = arg; drive->nowerr = arg;
drive->bad_wstat = arg ? BAD_R_STAT : BAD_W_STAT; drive->bad_wstat = arg ? BAD_R_STAT : BAD_W_STAT;
...@@ -576,8 +566,8 @@ static int idedisk_suspend(struct device *dev, u32 state, u32 level) ...@@ -576,8 +566,8 @@ static int idedisk_suspend(struct device *dev, u32 state, u32 level)
return 0; return 0;
/* wait until all commands are finished */ /* wait until all commands are finished */
printk("ide_disk_suspend()\n"); /* FIXME: waiting for spinlocks should be done instead. */
while (HWGROUP(drive)->handler) while (drive->channel->handler)
yield(); yield();
/* set the drive to standby */ /* set the drive to standby */
...@@ -1022,7 +1012,7 @@ static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct f ...@@ -1022,7 +1012,7 @@ static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct f
return -EBUSY; return -EBUSY;
val = set_lba_addressing(drive, arg); val = set_lba_addressing(drive, arg);
spin_unlock_irq(&ide_lock); spin_unlock_irq(drive->channel->lock);
return val; return val;
} }
...@@ -1048,7 +1038,7 @@ static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct f ...@@ -1048,7 +1038,7 @@ static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct f
return -EBUSY; return -EBUSY;
val = set_multcount(drive, arg); val = set_multcount(drive, arg);
spin_unlock_irq(&ide_lock); spin_unlock_irq(drive->channel->lock);
return val; return val;
} }
...@@ -1072,7 +1062,7 @@ static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct f ...@@ -1072,7 +1062,7 @@ static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct f
return -EBUSY; return -EBUSY;
val = set_nowerr(drive, arg); val = set_nowerr(drive, arg);
spin_unlock_irq(&ide_lock); spin_unlock_irq(drive->channel->lock);
return val; return val;
} }
...@@ -1096,7 +1086,7 @@ static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct f ...@@ -1096,7 +1086,7 @@ static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct f
return -EBUSY; return -EBUSY;
val = write_cache(drive, arg); val = write_cache(drive, arg);
spin_unlock_irq(&ide_lock); spin_unlock_irq(drive->channel->lock);
return val; return val;
} }
...@@ -1119,7 +1109,7 @@ static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct f ...@@ -1119,7 +1109,7 @@ static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct f
return -EBUSY; return -EBUSY;
val = set_acoustic(drive, arg); val = set_acoustic(drive, arg);
spin_unlock_irq(&ide_lock); spin_unlock_irq(drive->channel->lock);
return val; return val;
} }
...@@ -1144,7 +1134,7 @@ static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct f ...@@ -1144,7 +1134,7 @@ static int idedisk_ioctl(struct ata_device *drive, struct inode *inode, struct f
return -EBUSY; return -EBUSY;
val = set_using_tcq(drive, arg); val = set_using_tcq(drive, arg);
spin_unlock_irq(&ide_lock); spin_unlock_irq(drive->channel->lock);
return val; return val;
} }
......
...@@ -553,15 +553,14 @@ static void __init pdc20270_device_order_fixup (struct pci_dev *dev, struct ata_ ...@@ -553,15 +553,14 @@ static void __init pdc20270_device_order_fixup (struct pci_dev *dev, struct ata_
} }
} }
} }
printk(KERN_INFO "ATA: %s: controller on PCI slot %s dev %02x\n",
printk("ATA: %s: controller on PCI bus %02x dev %02x\n", dev->name, dev->slot_name, dev->devfn);
dev->name, dev->bus->number, dev->devfn);
setup_pci_device(dev, d); setup_pci_device(dev, d);
if (!dev2) if (!dev2)
return; return;
d2 = d; d2 = d;
printk("ATA: %s: controller on PCI bus %02x dev %02x\n", printk(KERN_INFO "ATA: %s: controller on PCI slot %s dev %02x\n",
dev2->name, dev2->bus->number, dev2->devfn); dev2->name, dev2->slot_name, dev2->devfn);
setup_pci_device(dev2, d2); setup_pci_device(dev2, d2);
} }
...@@ -584,8 +583,8 @@ static void __init hpt374_device_order_fixup (struct pci_dev *dev, struct ata_pc ...@@ -584,8 +583,8 @@ static void __init hpt374_device_order_fixup (struct pci_dev *dev, struct ata_pc
} }
} }
printk("%s: IDE controller on PCI bus %02x dev %02x\n", printk(KERN_INFO "ATA: %s: controller on PCI slot %s dev %02x\n",
dev->name, dev->bus->number, dev->devfn); dev->name, dev->slot_name, dev->devfn);
setup_pci_device(dev, d); setup_pci_device(dev, d);
if (!dev2) { if (!dev2) {
return; return;
...@@ -601,8 +600,8 @@ static void __init hpt374_device_order_fixup (struct pci_dev *dev, struct ata_pc ...@@ -601,8 +600,8 @@ static void __init hpt374_device_order_fixup (struct pci_dev *dev, struct ata_pc
} }
} }
d2 = d; d2 = d;
printk("%s: IDE controller on PCI bus %02x dev %02x\n", printk(KERN_INFO "ATA: %s: controller on PCI slot %s dev %02x\n",
dev2->name, dev2->bus->number, dev2->devfn); dev2->name, dev2->slot_name, dev2->devfn);
setup_pci_device(dev2, d2); setup_pci_device(dev2, d2);
} }
...@@ -623,7 +622,7 @@ static void __init hpt366_device_order_fixup (struct pci_dev *dev, struct ata_pc ...@@ -623,7 +622,7 @@ static void __init hpt366_device_order_fixup (struct pci_dev *dev, struct ata_pc
switch(class_rev) { switch(class_rev) {
case 5: case 5:
case 4: case 4:
case 3: printk("%s: IDE controller on PCI slot %s\n", dev->name, dev->slot_name); case 3: printk(KERN_INFO "ATA: %s: controller on PCI slot %s\n", dev->name, dev->slot_name);
setup_pci_device(dev, d); setup_pci_device(dev, d);
return; return;
default: break; default: break;
...@@ -639,17 +638,17 @@ static void __init hpt366_device_order_fixup (struct pci_dev *dev, struct ata_pc ...@@ -639,17 +638,17 @@ static void __init hpt366_device_order_fixup (struct pci_dev *dev, struct ata_pc
pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin2); pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin2);
if ((pin1 != pin2) && (dev->irq == dev2->irq)) { if ((pin1 != pin2) && (dev->irq == dev2->irq)) {
d->bootable = ON_BOARD; d->bootable = ON_BOARD;
printk("%s: onboard version of chipset, pin1=%d pin2=%d\n", dev->name, pin1, pin2); printk(KERN_INFO "ATAL: %s: onboard version of chipset, pin1=%d pin2=%d\n", dev->name, pin1, pin2);
} }
break; break;
} }
} }
printk("%s: IDE controller on PCI slot %s\n", dev->name, dev->slot_name); printk(KERN_INFO "ATA: %s: controller on PCI slot %s\n", dev->name, dev->slot_name);
setup_pci_device(dev, d); setup_pci_device(dev, d);
if (!dev2) if (!dev2)
return; return;
d2 = d; d2 = d;
printk("%s: IDE controller on PCI slot %s\n", dev2->name, dev2->slot_name); printk(KERN_INFO "ATA: %s: controller on PCI slot %s\n", dev2->name, dev2->slot_name);
setup_pci_device(dev2, d2); setup_pci_device(dev2, d2);
} }
...@@ -679,6 +678,10 @@ static void __init scan_pcidev(struct pci_dev *dev) ...@@ -679,6 +678,10 @@ static void __init scan_pcidev(struct pci_dev *dev)
} }
if (!d) { if (!d) {
/* Only check the device calls, if it wasn't listed, since
* there are in esp. some pdc202xx chips which "work around"
* beeing grabbed by generic drivers.
*/
if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) { if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
printk(KERN_INFO "ATA: unknown interface: %s, on PCI slot %s\n", printk(KERN_INFO "ATA: unknown interface: %s, on PCI slot %s\n",
dev->name, dev->slot_name); dev->name, dev->slot_name);
......
This diff is collapsed.
...@@ -578,15 +578,15 @@ static int init_irq(struct ata_channel *ch) ...@@ -578,15 +578,15 @@ static int init_irq(struct ata_channel *ch)
{ {
unsigned long flags; unsigned long flags;
int i; int i;
ide_hwgroup_t *hwgroup; spinlock_t *lock;
ide_hwgroup_t *new_hwgroup; spinlock_t *new_lock;
struct ata_channel *match = NULL; struct ata_channel *match = NULL;
/* Spare allocation before sleep. */ /* Spare allocation before sleep. */
new_hwgroup = kmalloc(sizeof(*hwgroup), GFP_KERNEL); new_lock = kmalloc(sizeof(*lock), GFP_KERNEL);
spin_lock_irqsave(&ide_lock, flags); spin_lock_irqsave(&ide_lock, flags);
ch->hwgroup = NULL; ch->lock = NULL;
#if MAX_HWIFS > 1 #if MAX_HWIFS > 1
/* /*
...@@ -596,7 +596,7 @@ static int init_irq(struct ata_channel *ch) ...@@ -596,7 +596,7 @@ static int init_irq(struct ata_channel *ch)
struct ata_channel *h = &ide_hwifs[i]; struct ata_channel *h = &ide_hwifs[i];
/* scan only initialized channels */ /* scan only initialized channels */
if (!h->hwgroup) if (!h->lock)
continue; continue;
if (ch->irq != h->irq) if (ch->irq != h->irq)
...@@ -606,7 +606,7 @@ static int init_irq(struct ata_channel *ch) ...@@ -606,7 +606,7 @@ static int init_irq(struct ata_channel *ch)
if (ch->chipset != ide_pci || h->chipset != ide_pci || if (ch->chipset != ide_pci || h->chipset != ide_pci ||
ch->serialized || h->serialized) { ch->serialized || h->serialized) {
if (match && match->hwgroup && match->hwgroup != h->hwgroup) if (match && match->lock && match->lock != h->lock)
printk("%s: potential irq problem with %s and %s\n", ch->name, h->name, match->name); printk("%s: potential irq problem with %s and %s\n", ch->name, h->name, match->name);
/* don't undo a prior perfect match */ /* don't undo a prior perfect match */
if (!match || match->irq != ch->irq) if (!match || match->irq != ch->irq)
...@@ -615,19 +615,20 @@ static int init_irq(struct ata_channel *ch) ...@@ -615,19 +615,20 @@ static int init_irq(struct ata_channel *ch)
} }
#endif #endif
/* /*
* If we are still without a hwgroup, then form a new one * If we are still without a lock group, then form a new one
*/ */
if (match) { if (!match) {
hwgroup = match->hwgroup; lock = new_lock;
if(new_hwgroup) if (!lock) {
kfree(new_hwgroup);
} else {
hwgroup = new_hwgroup;
if (!hwgroup) {
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
return 1; return 1;
} }
memset(hwgroup, 0, sizeof(*hwgroup)); spin_lock_init(lock);
} else {
lock = match->lock;
if(new_lock)
kfree(new_lock);
} }
/* /*
...@@ -645,7 +646,8 @@ static int init_irq(struct ata_channel *ch) ...@@ -645,7 +646,8 @@ static int init_irq(struct ata_channel *ch)
if (request_irq(ch->irq, &ata_irq_request, sa, ch->name, ch)) { if (request_irq(ch->irq, &ata_irq_request, sa, ch->name, ch)) {
if (!match) if (!match)
kfree(hwgroup); kfree(lock);
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
return 1; return 1;
...@@ -653,9 +655,9 @@ static int init_irq(struct ata_channel *ch) ...@@ -653,9 +655,9 @@ static int init_irq(struct ata_channel *ch)
} }
/* /*
* Everything is okay. Tag us as member of this hardware group. * Everything is okay. Tag us as member of this lock group.
*/ */
ch->hwgroup = hwgroup; ch->lock = lock;
init_timer(&ch->timer); init_timer(&ch->timer);
ch->timer.function = &ide_timer_expiry; ch->timer.function = &ide_timer_expiry;
...@@ -678,7 +680,7 @@ static int init_irq(struct ata_channel *ch) ...@@ -678,7 +680,7 @@ static int init_irq(struct ata_channel *ch)
q = &drive->queue; q = &drive->queue;
q->queuedata = drive->channel; q->queuedata = drive->channel;
blk_init_queue(q, do_ide_request, &ide_lock); blk_init_queue(q, do_ide_request, drive->channel->lock);
blk_queue_segment_boundary(q, 0xffff); blk_queue_segment_boundary(q, 0xffff);
/* ATA can do up to 128K per request, pdc4030 needs smaller limit */ /* ATA can do up to 128K per request, pdc4030 needs smaller limit */
......
...@@ -61,41 +61,6 @@ static inline void ide_unmap_rq(struct request *rq, char *to, ...@@ -61,41 +61,6 @@ static inline void ide_unmap_rq(struct request *rq, char *to,
* Data transfer functions for polled IO. * Data transfer functions for polled IO.
*/ */
#if SUPPORT_VLB_SYNC
/*
* Some localbus EIDE interfaces require a special access sequence
* when using 32-bit I/O instructions to transfer data. We call this
* the "vlb_sync" sequence, which consists of three successive reads
* of the sector count register location, with interrupts disabled
* to ensure that the reads all happen together.
*/
static void ata_read_vlb(struct ata_device *drive, void *buffer, unsigned int wcount)
{
unsigned long flags;
__save_flags(flags); /* local CPU only */
__cli(); /* local CPU only */
IN_BYTE(IDE_NSECTOR_REG);
IN_BYTE(IDE_NSECTOR_REG);
IN_BYTE(IDE_NSECTOR_REG);
insl(IDE_DATA_REG, buffer, wcount);
__restore_flags(flags); /* local CPU only */
}
static void ata_write_vlb(struct ata_device *drive, void *buffer, unsigned int wcount)
{
unsigned long flags;
__save_flags(flags); /* local CPU only */
__cli(); /* local CPU only */
IN_BYTE(IDE_NSECTOR_REG);
IN_BYTE(IDE_NSECTOR_REG);
IN_BYTE(IDE_NSECTOR_REG);
outsl(IDE_DATA_REG, buffer, wcount);
__restore_flags(flags); /* local CPU only */
}
#endif
static void ata_read_32(struct ata_device *drive, void *buffer, unsigned int wcount) static void ata_read_32(struct ata_device *drive, void *buffer, unsigned int wcount)
{ {
insl(IDE_DATA_REG, buffer, wcount); insl(IDE_DATA_REG, buffer, wcount);
...@@ -157,12 +122,7 @@ void ata_read(struct ata_device *drive, void *buffer, unsigned int wcount) ...@@ -157,12 +122,7 @@ void ata_read(struct ata_device *drive, void *buffer, unsigned int wcount)
io_32bit = drive->channel->io_32bit; io_32bit = drive->channel->io_32bit;
if (io_32bit) { if (io_32bit) {
#if SUPPORT_VLB_SYNC ata_read_32(drive, buffer, wcount);
if (io_32bit & 2)
ata_read_vlb(drive, buffer, wcount);
else
#endif
ata_read_32(drive, buffer, wcount);
} else { } else {
#if SUPPORT_SLOW_DATA_PORTS #if SUPPORT_SLOW_DATA_PORTS
if (drive->channel->slow) if (drive->channel->slow)
...@@ -188,12 +148,7 @@ void ata_write(struct ata_device *drive, void *buffer, unsigned int wcount) ...@@ -188,12 +148,7 @@ void ata_write(struct ata_device *drive, void *buffer, unsigned int wcount)
io_32bit = drive->channel->io_32bit; io_32bit = drive->channel->io_32bit;
if (io_32bit) { if (io_32bit) {
#if SUPPORT_VLB_SYNC ata_write_32(drive, buffer, wcount);
if (io_32bit & 2)
ata_write_vlb(drive, buffer, wcount);
else
#endif
ata_write_32(drive, buffer, wcount);
} else { } else {
#if SUPPORT_SLOW_DATA_PORTS #if SUPPORT_SLOW_DATA_PORTS
if (drive->channel->slow) if (drive->channel->slow)
...@@ -320,7 +275,6 @@ static ide_startstop_t pre_task_mulout_intr(struct ata_device *drive, struct req ...@@ -320,7 +275,6 @@ static ide_startstop_t pre_task_mulout_intr(struct ata_device *drive, struct req
static ide_startstop_t task_mulout_intr(struct ata_device *drive, struct request *rq) static ide_startstop_t task_mulout_intr(struct ata_device *drive, struct request *rq)
{ {
u8 stat = GET_STAT(); u8 stat = GET_STAT();
ide_hwgroup_t *hwgroup = HWGROUP(drive);
int mcount = drive->mult_count; int mcount = drive->mult_count;
ide_startstop_t startstop; ide_startstop_t startstop;
...@@ -349,7 +303,7 @@ static ide_startstop_t task_mulout_intr(struct ata_device *drive, struct request ...@@ -349,7 +303,7 @@ static ide_startstop_t task_mulout_intr(struct ata_device *drive, struct request
} }
/* no data yet, so wait for another interrupt */ /* no data yet, so wait for another interrupt */
if (hwgroup->handler == NULL) if (!drive->channel->handler)
ide_set_handler(drive, task_mulout_intr, WAIT_CMD, NULL); ide_set_handler(drive, task_mulout_intr, WAIT_CMD, NULL);
return ide_started; return ide_started;
...@@ -392,7 +346,7 @@ static ide_startstop_t task_mulout_intr(struct ata_device *drive, struct request ...@@ -392,7 +346,7 @@ static ide_startstop_t task_mulout_intr(struct ata_device *drive, struct request
} while (mcount); } while (mcount);
rq->errors = 0; rq->errors = 0;
if (hwgroup->handler == NULL) if (!drive->channel->handler)
ide_set_handler(drive, task_mulout_intr, WAIT_CMD, NULL); ide_set_handler(drive, task_mulout_intr, WAIT_CMD, NULL);
return ide_started; return ide_started;
......
This diff is collapsed.
This diff is collapsed.
...@@ -83,7 +83,6 @@ static ide_startstop_t tcq_nop_handler(struct ata_device *drive, struct request ...@@ -83,7 +83,6 @@ static ide_startstop_t tcq_nop_handler(struct ata_device *drive, struct request
static void tcq_invalidate_queue(struct ata_device *drive) static void tcq_invalidate_queue(struct ata_device *drive)
{ {
struct ata_channel *ch = drive->channel; struct ata_channel *ch = drive->channel;
ide_hwgroup_t *hwgroup = ch->hwgroup;
request_queue_t *q = &drive->queue; request_queue_t *q = &drive->queue;
struct ata_taskfile *args; struct ata_taskfile *args;
struct request *rq; struct request *rq;
...@@ -104,7 +103,7 @@ static void tcq_invalidate_queue(struct ata_device *drive) ...@@ -104,7 +103,7 @@ static void tcq_invalidate_queue(struct ata_device *drive)
drive->queue_depth = 1; drive->queue_depth = 1;
clear_bit(IDE_BUSY, &ch->active); clear_bit(IDE_BUSY, &ch->active);
clear_bit(IDE_DMA, &ch->active); clear_bit(IDE_DMA, &ch->active);
hwgroup->handler = NULL; ch->handler = NULL;
/* /*
* Do some internal stuff -- we really need this command to be * Do some internal stuff -- we really need this command to be
...@@ -153,7 +152,6 @@ static void ata_tcq_irq_timeout(unsigned long data) ...@@ -153,7 +152,6 @@ static void ata_tcq_irq_timeout(unsigned long data)
{ {
struct ata_device *drive = (struct ata_device *) data; struct ata_device *drive = (struct ata_device *) data;
struct ata_channel *ch = drive->channel; struct ata_channel *ch = drive->channel;
ide_hwgroup_t *hwgroup = HWGROUP(drive);
unsigned long flags; unsigned long flags;
printk(KERN_ERR "ATA: %s: timeout waiting for interrupt...\n", __FUNCTION__); printk(KERN_ERR "ATA: %s: timeout waiting for interrupt...\n", __FUNCTION__);
...@@ -161,9 +159,9 @@ static void ata_tcq_irq_timeout(unsigned long data) ...@@ -161,9 +159,9 @@ static void ata_tcq_irq_timeout(unsigned long data)
spin_lock_irqsave(&ide_lock, flags); spin_lock_irqsave(&ide_lock, flags);
if (test_and_set_bit(IDE_BUSY, &ch->active)) if (test_and_set_bit(IDE_BUSY, &ch->active))
printk(KERN_ERR "ATA: %s: hwgroup not busy\n", __FUNCTION__); printk(KERN_ERR "ATA: %s: IRQ handler not busy\n", __FUNCTION__);
if (hwgroup->handler == NULL) if (!ch->handler)
printk(KERN_ERR "ATA: %s: missing isr!\n", __FUNCTION__); printk(KERN_ERR "ATA: %s: missing ISR!\n", __FUNCTION__);
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
...@@ -181,7 +179,6 @@ static void ata_tcq_irq_timeout(unsigned long data) ...@@ -181,7 +179,6 @@ static void ata_tcq_irq_timeout(unsigned long data)
static void set_irq(struct ata_device *drive, ata_handler_t *handler) static void set_irq(struct ata_device *drive, ata_handler_t *handler)
{ {
struct ata_channel *ch = drive->channel; struct ata_channel *ch = drive->channel;
ide_hwgroup_t *hwgroup = HWGROUP(drive);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&ide_lock, flags); spin_lock_irqsave(&ide_lock, flags);
...@@ -197,8 +194,8 @@ static void set_irq(struct ata_device *drive, ata_handler_t *handler) ...@@ -197,8 +194,8 @@ static void set_irq(struct ata_device *drive, ata_handler_t *handler)
ch->timer.function = ata_tcq_irq_timeout; ch->timer.function = ata_tcq_irq_timeout;
ch->timer.data = (unsigned long) ch->drive; ch->timer.data = (unsigned long) ch->drive;
mod_timer(&ch->timer, jiffies + 5 * HZ); mod_timer(&ch->timer, jiffies + 5 * HZ);
ch->handler = handler;
hwgroup->handler = handler;
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
} }
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
*/ */
/* /*
* VLB Controller Support from * VLB Controller Support from
* Wolfram Podien * Wolfram Podien
* Rohoefe 3 * Rohoefe 3
* D28832 Achim * D28832 Achim
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* #define UMC_DRIVE0 11 * #define UMC_DRIVE0 11
* in the beginning of the driver, which sets the speed of drive 0 to 11 (there * in the beginning of the driver, which sets the speed of drive 0 to 11 (there
* are some lines present). 0 - 11 are allowed speed values. These values are * are some lines present). 0 - 11 are allowed speed values. These values are
* the results from the DOS speed test program supplied from UMC. 11 is the * the results from the DOS speed test program supplied from UMC. 11 is the
* highest speed (about PIO mode 3) * highest speed (about PIO mode 3)
*/ */
#define REALLY_SLOW_IO /* some systems can safely undef this */ #define REALLY_SLOW_IO /* some systems can safely undef this */
...@@ -92,13 +92,11 @@ static void umc_set_speeds (byte speeds[]) ...@@ -92,13 +92,11 @@ static void umc_set_speeds (byte speeds[])
out_umc (0xd7,(speedtab[0][speeds[2]] | (speedtab[0][speeds[3]]<<4))); out_umc (0xd7,(speedtab[0][speeds[2]] | (speedtab[0][speeds[3]]<<4)));
out_umc (0xd6,(speedtab[0][speeds[0]] | (speedtab[0][speeds[1]]<<4))); out_umc (0xd6,(speedtab[0][speeds[0]] | (speedtab[0][speeds[1]]<<4)));
tmp = 0; tmp = 0;
for (i = 3; i >= 0; i--) for (i = 3; i >= 0; i--) {
{
tmp = (tmp << 2) | speedtab[1][speeds[i]]; tmp = (tmp << 2) | speedtab[1][speeds[i]];
} }
out_umc (0xdc,tmp); out_umc (0xdc,tmp);
for (i = 0;i < 4; i++) for (i = 0;i < 4; i++) {
{
out_umc (0xd0+i,speedtab[2][speeds[i]]); out_umc (0xd0+i,speedtab[2][speeds[i]]);
out_umc (0xd8+i,speedtab[2][speeds[i]]); out_umc (0xd8+i,speedtab[2][speeds[i]]);
} }
...@@ -108,10 +106,9 @@ static void umc_set_speeds (byte speeds[]) ...@@ -108,10 +106,9 @@ static void umc_set_speeds (byte speeds[])
speeds[0], speeds[1], speeds[2], speeds[3]); speeds[0], speeds[1], speeds[2], speeds[3]);
} }
static void tune_umc (ide_drive_t *drive, byte pio) static void tune_umc(struct ata_device *drive, byte pio)
{ {
unsigned long flags; unsigned long flags;
ide_hwgroup_t *hwgroup = ide_hwifs[drive->channel->index ^ 1].hwgroup;
if (pio == 255) if (pio == 255)
pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0; pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0;
...@@ -121,16 +118,12 @@ static void tune_umc (ide_drive_t *drive, byte pio) ...@@ -121,16 +118,12 @@ static void tune_umc (ide_drive_t *drive, byte pio)
printk("%s: setting umc8672 to PIO mode%d (speed %d)\n", drive->name, pio, pio_to_umc[pio]); printk("%s: setting umc8672 to PIO mode%d (speed %d)\n", drive->name, pio, pio_to_umc[pio]);
save_flags(flags); /* all CPUs */ save_flags(flags); /* all CPUs */
cli(); /* all CPUs */ cli(); /* all CPUs */
if (hwgroup && hwgroup->handler != NULL) { current_speeds[drive->name[2] - 'a'] = pio_to_umc[pio];
printk("umc8672: other interface is busy: exiting tune_umc()\n"); umc_set_speeds (current_speeds);
} else {
current_speeds[drive->name[2] - 'a'] = pio_to_umc[pio];
umc_set_speeds (current_speeds);
}
restore_flags(flags); /* all CPUs */ restore_flags(flags); /* all CPUs */
} }
void __init init_umc8672 (void) /* called from ide.c */ void __init init_umc8672(void) /* called from ide.c */
{ {
unsigned long flags; unsigned long flags;
......
...@@ -90,9 +90,6 @@ static __inline__ void ide_init_default_hwifs(void) ...@@ -90,9 +90,6 @@ static __inline__ void ide_init_default_hwifs(void)
/* some configuration options we don't need */ /* some configuration options we don't need */
#undef SUPPORT_VLB_SYNC
#define SUPPORT_VLB_SYNC 0
#undef SUPPORT_SLOW_DATA_PORTS #undef SUPPORT_SLOW_DATA_PORTS
#define SUPPORT_SLOW_DATA_PORTS 0 #define SUPPORT_SLOW_DATA_PORTS 0
......
...@@ -83,9 +83,6 @@ static __inline__ void ide_init_default_hwifs(void) ...@@ -83,9 +83,6 @@ static __inline__ void ide_init_default_hwifs(void)
#undef SUPPORT_SLOW_DATA_PORTS #undef SUPPORT_SLOW_DATA_PORTS
#define SUPPORT_SLOW_DATA_PORTS 0 #define SUPPORT_SLOW_DATA_PORTS 0
#undef SUPPORT_VLB_SYNC
#define SUPPORT_VLB_SYNC 0
/* this definition is used only on startup .. */ /* this definition is used only on startup .. */
#undef HD_DATA #undef HD_DATA
#define HD_DATA NULL #define HD_DATA NULL
......
...@@ -65,9 +65,6 @@ static __inline__ void ide_init_default_hwifs(void) ...@@ -65,9 +65,6 @@ static __inline__ void ide_init_default_hwifs(void)
#endif #endif
} }
#undef SUPPORT_VLB_SYNC
#define SUPPORT_VLB_SYNC 0
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* __ASM_IDE_H */ #endif /* __ASM_IDE_H */
...@@ -43,8 +43,6 @@ extern struct ide_machdep_calls ppc_ide_md; ...@@ -43,8 +43,6 @@ extern struct ide_machdep_calls ppc_ide_md;
#undef SUPPORT_SLOW_DATA_PORTS #undef SUPPORT_SLOW_DATA_PORTS
#define SUPPORT_SLOW_DATA_PORTS 0 #define SUPPORT_SLOW_DATA_PORTS 0
#undef SUPPORT_VLB_SYNC
#define SUPPORT_VLB_SYNC 0
#define ide__sti() __sti() #define ide__sti() __sti()
......
...@@ -76,9 +76,6 @@ static __inline__ void ide_init_default_hwifs(void) ...@@ -76,9 +76,6 @@ static __inline__ void ide_init_default_hwifs(void)
#undef SUPPORT_SLOW_DATA_PORTS #undef SUPPORT_SLOW_DATA_PORTS
#define SUPPORT_SLOW_DATA_PORTS 0 #define SUPPORT_SLOW_DATA_PORTS 0
#undef SUPPORT_VLB_SYNC
#define SUPPORT_VLB_SYNC 0
#undef HD_DATA #undef HD_DATA
#define HD_DATA ((ide_ioreg_t)0) #define HD_DATA ((ide_ioreg_t)0)
......
...@@ -72,9 +72,6 @@ static __inline__ void ide_init_default_hwifs(void) ...@@ -72,9 +72,6 @@ static __inline__ void ide_init_default_hwifs(void)
#undef SUPPORT_SLOW_DATA_PORTS #undef SUPPORT_SLOW_DATA_PORTS
#define SUPPORT_SLOW_DATA_PORTS 0 #define SUPPORT_SLOW_DATA_PORTS 0
#undef SUPPORT_VLB_SYNC
#define SUPPORT_VLB_SYNC 0
#undef HD_DATA #undef HD_DATA
#define HD_DATA ((ide_ioreg_t)0) #define HD_DATA ((ide_ioreg_t)0)
......
...@@ -40,9 +40,6 @@ ...@@ -40,9 +40,6 @@
/* Right now this is only needed by a promise controlled. /* Right now this is only needed by a promise controlled.
*/ */
#ifndef SUPPORT_VLB_SYNC /* 1 to support weird 32-bit chips */
# define SUPPORT_VLB_SYNC 1 /* 0 to reduce kernel size */
#endif
#ifndef DISK_RECOVERY_TIME /* off=0; on=access_delay_time */ #ifndef DISK_RECOVERY_TIME /* off=0; on=access_delay_time */
# define DISK_RECOVERY_TIME 0 /* for hardware that needs it */ # define DISK_RECOVERY_TIME 0 /* for hardware that needs it */
#endif #endif
...@@ -74,8 +71,6 @@ typedef unsigned char byte; /* used everywhere */ ...@@ -74,8 +71,6 @@ typedef unsigned char byte; /* used everywhere */
*/ */
#define DMA_PIO_RETRY 1 /* retrying in PIO */ #define DMA_PIO_RETRY 1 /* retrying in PIO */
#define HWGROUP(drive) (drive->channel->hwgroup)
/* /*
* Definitions for accessing IDE controller registers * Definitions for accessing IDE controller registers
*/ */
...@@ -444,18 +439,16 @@ enum { ...@@ -444,18 +439,16 @@ enum {
IDE_DMA /* DMA in progress */ IDE_DMA /* DMA in progress */
}; };
typedef struct hwgroup_s {
/* FIXME: We should look for busy request queues instead of looking at
* the !NULL state of this field.
*/
ide_startstop_t (*handler)(struct ata_device *, struct request *); /* irq handler, if active */
} ide_hwgroup_t;
struct ata_channel { struct ata_channel {
struct device dev; /* device handle */ struct device dev; /* device handle */
int unit; /* channel number */ int unit; /* channel number */
struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ /* This lock is used to serialize requests on the same device queue or
* between differen queues sharing the same irq line.
*/
spinlock_t *lock;
ide_startstop_t (*handler)(struct ata_device *, struct request *); /* irq handler, if active */
struct timer_list timer; /* failsafe timer */ struct timer_list timer; /* failsafe timer */
int (*expiry)(struct ata_device *, struct request *); /* irq handler, if active */ int (*expiry)(struct ata_device *, struct request *); /* irq handler, if active */
unsigned long poll_timeout; /* timeout value during polled operations */ unsigned long poll_timeout; /* timeout value during polled operations */
...@@ -777,11 +770,7 @@ extern int set_transfer(struct ata_device *, struct ata_taskfile *); ...@@ -777,11 +770,7 @@ extern int set_transfer(struct ata_device *, struct ata_taskfile *);
extern int system_bus_speed; extern int system_bus_speed;
/* extern void ide_stall_queue(struct ata_device *, unsigned long);
* ide_stall_queue() can be used by a drive to give excess bandwidth back
* to the hwgroup by sleeping for timeout jiffies.
*/
void ide_stall_queue(struct ata_device *, unsigned long);
/* /*
* CompactFlash cards and their brethern pretend to be removable hard disks, * CompactFlash cards and their brethern pretend to be removable hard disks,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment