mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
ali14xx: fix deadlock on error handling
Stop abusing ide_lock lock by switching to a private locking.
Fixes same issue as fixed by Alan Cox in atiixp host driver with
commit 6c5f8cc33e
.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
8562043606
commit
2047e15be4
1 changed files with 4 additions and 2 deletions
|
@ -102,6 +102,8 @@ static void outReg (u8 data, u8 reg)
|
|||
outb_p(data, dataPort);
|
||||
}
|
||||
|
||||
static DEFINE_SPINLOCK(ali14xx_lock);
|
||||
|
||||
/*
|
||||
* Set PIO mode for the specified drive.
|
||||
* This function computes timing parameters
|
||||
|
@ -129,14 +131,14 @@ static void ali14xx_set_pio_mode(ide_drive_t *drive, const u8 pio)
|
|||
|
||||
/* stuff timing parameters into controller registers */
|
||||
driveNum = (HWIF(drive)->index << 1) + drive->select.b.unit;
|
||||
spin_lock_irqsave(&ide_lock, flags);
|
||||
spin_lock_irqsave(&ali14xx_lock, flags);
|
||||
outb_p(regOn, basePort);
|
||||
outReg(param1, regTab[driveNum].reg1);
|
||||
outReg(param2, regTab[driveNum].reg2);
|
||||
outReg(param3, regTab[driveNum].reg3);
|
||||
outReg(param4, regTab[driveNum].reg4);
|
||||
outb_p(regOff, basePort);
|
||||
spin_unlock_irqrestore(&ide_lock, flags);
|
||||
spin_unlock_irqrestore(&ali14xx_lock, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue