mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
dtc2278: fix deadlock on error handling
Stop abusing ide_lock lock (switch to a private locking).
Fixes same issue as fixed by Alan Cox in atiixp host driver with
commit 6c5f8cc33e
.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
2047e15be4
commit
a34a8751f3
1 changed files with 4 additions and 2 deletions
|
@ -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.. */
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue