dtc2278: fix deadlock on error handling
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 19 Oct 2007 22:32:35 +0000 (00:32 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 19 Oct 2007 22:32:35 +0000 (00:32 +0200)
Stop abusing ide_lock lock (switch to a private locking).

Fixes same issue as fixed by Alan Cox in atiixp host driver with
commit 6c5f8cc33eb2e10b6ab788bbe259fc142a068627.

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

index 253a20fc8061f3c2dae16bebe849ddb743f111c5..acd72836877191824de4d379b72295e5e41a3ebb 100644 (file)
@@ -67,18 +67,20 @@ static void sub22 (char b, char c)
        }
 }
 
+static DEFINE_SPINLOCK(dtc2278_lock);
+
 static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
 {
        unsigned long flags;
 
        if (pio >= 3) {
-               spin_lock_irqsave(&ide_lock, flags);
+               spin_lock_irqsave(&dtc2278_lock, flags);
                /*
                 * This enables PIO mode4 (3?) on the first interface
                 */
                sub22(1,0xc3);
                sub22(0,0xa0);
-               spin_unlock_irqrestore(&ide_lock, flags);
+               spin_unlock_irqrestore(&dtc2278_lock, flags);
        } else {
                /* we don't know how to set it back again.. */
        }