]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ide: fix setting nIEN on idle devices
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 6 Jan 2009 16:20:47 +0000 (17:20 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 6 Jan 2009 16:20:47 +0000 (17:20 +0100)
Fix do_ide_request() to operate on previous device / port instead of
the current one.  The original code was wrong since at least Feb 2002
(2.4.0 timeframe).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-io.c

index c3cbe5a1e307631e4685eb6852bb7fea606cea79..1d63159fc97d0fc7b3c9bed86973d8757f71585a 100644 (file)
@@ -724,7 +724,9 @@ void do_ide_request(struct request_queue *q)
        spin_lock_irq(&hwgroup->lock);
 
        if (!ide_lock_hwgroup(hwgroup)) {
+               ide_hwif_t *prev_port;
 repeat:
+               prev_port = hwgroup->hwif;
                hwgroup->rq = NULL;
 
                if (drive->dev_flags & IDE_DFLAG_SLEEPING) {
@@ -734,13 +736,13 @@ repeat:
                        }
                }
 
-               if (hwif != hwgroup->hwif) {
+               if (hwif != prev_port) {
                        /*
-                        * set nIEN for previous hwif, drives in the
+                        * set nIEN for previous port, drives in the
                         * quirk_list may not like intr setups/cleanups
                         */
-                       if (drive->quirk_list == 0)
-                               hwif->tp_ops->set_irq(hwif, 0);
+                       if (hwgroup->drive->quirk_list == 0)
+                               prev_port->tp_ops->set_irq(prev_port, 0);
                }
                hwgroup->hwif = hwif;
                hwgroup->drive = drive;