Skip to content

Commit

Permalink
dtc2278: fix deadlock on error handling
Browse files Browse the repository at this point in the history
Stop abusing ide_lock lock (switch to a private locking).

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

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 19, 2007
1 parent 2047e15 commit a34a875
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/ide/legacy/dtc2278.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.. */
}
Expand Down

0 comments on commit a34a875

Please sign in to comment.