slc90e66: 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.

* Bump driver version.
Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent e65dde71
/* /*
* linux/drivers/ide/pci/slc90e66.c Version 0.18 Aug 9, 2007 * linux/drivers/ide/pci/slc90e66.c Version 0.19 Sep 24, 2007
* *
* Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org>
* Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com> * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com>
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include <asm/io.h> #include <asm/io.h>
static DEFINE_SPINLOCK(slc90e66_lock);
static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio) static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
...@@ -40,7 +42,7 @@ static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio) ...@@ -40,7 +42,7 @@ static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio)
{ 2, 1 }, { 2, 1 },
{ 2, 3 }, }; { 2, 3 }, };
spin_lock_irqsave(&ide_lock, flags); spin_lock_irqsave(&slc90e66_lock, flags);
pci_read_config_word(dev, master_port, &master_data); pci_read_config_word(dev, master_port, &master_data);
if (pio > 1) if (pio > 1)
...@@ -71,7 +73,7 @@ static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio) ...@@ -71,7 +73,7 @@ static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio)
pci_write_config_word(dev, master_port, master_data); pci_write_config_word(dev, master_port, master_data);
if (is_slave) if (is_slave)
pci_write_config_byte(dev, slave_port, slave_data); pci_write_config_byte(dev, slave_port, slave_data);
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&slc90e66_lock, flags);
} }
static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed) static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment