提交 a34a8751 编写于 作者: B Bartlomiej Zolnierkiewicz

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 6c5f8cc3.
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 2047e15b
...@@ -67,18 +67,20 @@ static void sub22 (char b, char c) ...@@ -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) static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
{ {
unsigned long flags; unsigned long flags;
if (pio >= 3) { if (pio >= 3) {
spin_lock_irqsave(&ide_lock, flags); spin_lock_irqsave(&dtc2278_lock, flags);
/* /*
* This enables PIO mode4 (3?) on the first interface * This enables PIO mode4 (3?) on the first interface
*/ */
sub22(1,0xc3); sub22(1,0xc3);
sub22(0,0xa0); sub22(0,0xa0);
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&dtc2278_lock, flags);
} else { } else {
/* we don't know how to set it back again.. */ /* we don't know how to set it back again.. */
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册