aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-01-06 11:20:48 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-01-06 11:20:48 -0500
commitbd53cbcce501b61921a1af2dddfa87c5b9923dfd (patch)
tree73ffd27a76dd2594fc93073f663a96df505a282f /drivers/ide/ide-io.c
parent42cf2611b28602cf4c9dc7c22bc8653a10dff60d (diff)
ide: add ->cur_port to struct ide_host and use it for serialized hosts
* Pass 'ide_hwif_t *' instead of 'ide_hwgroup_t *' to unexpected_intr(). * Cache pointer to the port currently being serviced in ->cur_port and use it instead of hwif->hwgroup on serialized hosts. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 1d63159fc97d..43bf43d802c3 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -726,7 +726,7 @@ void do_ide_request(struct request_queue *q)
726 if (!ide_lock_hwgroup(hwgroup)) { 726 if (!ide_lock_hwgroup(hwgroup)) {
727 ide_hwif_t *prev_port; 727 ide_hwif_t *prev_port;
728repeat: 728repeat:
729 prev_port = hwgroup->hwif; 729 prev_port = hwif->host->cur_port;
730 hwgroup->rq = NULL; 730 hwgroup->rq = NULL;
731 731
732 if (drive->dev_flags & IDE_DFLAG_SLEEPING) { 732 if (drive->dev_flags & IDE_DFLAG_SLEEPING) {
@@ -736,15 +736,17 @@ repeat:
736 } 736 }
737 } 737 }
738 738
739 if (hwif != prev_port) { 739 if ((hwif->host->host_flags & IDE_HFLAG_SERIALIZE) &&
740 hwif != prev_port) {
740 /* 741 /*
741 * set nIEN for previous port, drives in the 742 * set nIEN for previous port, drives in the
742 * quirk_list may not like intr setups/cleanups 743 * quirk_list may not like intr setups/cleanups
743 */ 744 */
744 if (hwgroup->drive->quirk_list == 0) 745 if (prev_port && hwgroup->drive->quirk_list == 0)
745 prev_port->tp_ops->set_irq(prev_port, 0); 746 prev_port->tp_ops->set_irq(prev_port, 0);
747
748 hwif->host->cur_port = hwif;
746 } 749 }
747 hwgroup->hwif = hwif;
748 hwgroup->drive = drive; 750 hwgroup->drive = drive;
749 drive->dev_flags &= ~(IDE_DFLAG_SLEEPING | IDE_DFLAG_PARKED); 751 drive->dev_flags &= ~(IDE_DFLAG_SLEEPING | IDE_DFLAG_PARKED);
750 752
@@ -976,7 +978,7 @@ void ide_timer_expiry (unsigned long data)
976/** 978/**
977 * unexpected_intr - handle an unexpected IDE interrupt 979 * unexpected_intr - handle an unexpected IDE interrupt
978 * @irq: interrupt line 980 * @irq: interrupt line
979 * @hwgroup: hwgroup being processed 981 * @hwif: port being processed
980 * 982 *
981 * There's nothing really useful we can do with an unexpected interrupt, 983 * There's nothing really useful we can do with an unexpected interrupt,
982 * other than reading the status register (to clear it), and logging it. 984 * other than reading the status register (to clear it), and logging it.
@@ -1005,11 +1007,11 @@ void ide_timer_expiry (unsigned long data)
1005 * is doing the current command, but we don't know which hwif burped 1007 * is doing the current command, but we don't know which hwif burped
1006 * mysteriously. 1008 * mysteriously.
1007 */ 1009 */
1008 1010
1009static void unexpected_intr (int irq, ide_hwgroup_t *hwgroup) 1011static void unexpected_intr(int irq, ide_hwif_t *hwif)
1010{ 1012{
1013 ide_hwgroup_t *hwgroup = hwif->hwgroup;
1011 u8 stat; 1014 u8 stat;
1012 ide_hwif_t *hwif = hwgroup->hwif;
1013 1015
1014 /* 1016 /*
1015 * handle the unexpected interrupt 1017 * handle the unexpected interrupt
@@ -1044,7 +1046,7 @@ static void unexpected_intr (int irq, ide_hwgroup_t *hwgroup)
1044 * not need to override it. If you do be aware it is subtle in 1046 * not need to override it. If you do be aware it is subtle in
1045 * places 1047 * places
1046 * 1048 *
1047 * hwgroup->hwif is the interface in the group currently performing 1049 * hwif is the interface in the group currently performing
1048 * a command. hwgroup->drive is the drive and hwgroup->handler is 1050 * a command. hwgroup->drive is the drive and hwgroup->handler is
1049 * the IRQ handler to call. As we issue a command the handlers 1051 * the IRQ handler to call. As we issue a command the handlers
1050 * step through multiple states, reassigning the handler to the 1052 * step through multiple states, reassigning the handler to the
@@ -1070,6 +1072,9 @@ irqreturn_t ide_intr (int irq, void *dev_id)
1070 irqreturn_t irq_ret = IRQ_NONE; 1072 irqreturn_t irq_ret = IRQ_NONE;
1071 int plug_device = 0; 1073 int plug_device = 0;
1072 1074
1075 if (hwif->host->host_flags & IDE_HFLAG_SERIALIZE)
1076 hwif = hwif->host->cur_port;
1077
1073 spin_lock_irqsave(&hwgroup->lock, flags); 1078 spin_lock_irqsave(&hwgroup->lock, flags);
1074 1079
1075 if (!ide_ack_intr(hwif)) 1080 if (!ide_ack_intr(hwif))
@@ -1099,7 +1104,7 @@ irqreturn_t ide_intr (int irq, void *dev_id)
1099 * Probably not a shared PCI interrupt, 1104 * Probably not a shared PCI interrupt,
1100 * so we can safely try to do something about it: 1105 * so we can safely try to do something about it:
1101 */ 1106 */
1102 unexpected_intr(irq, hwgroup); 1107 unexpected_intr(irq, hwif);
1103#ifdef CONFIG_BLK_DEV_IDEPCI 1108#ifdef CONFIG_BLK_DEV_IDEPCI
1104 } else { 1109 } else {
1105 /* 1110 /*