aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-12-12 17:32:00 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-12-12 17:32:00 -0500
commit644a9d764b4747af057b3db73ccba28a168b1f4f (patch)
tree0f692a2e67433b4072856f38a489e0d6fe3c2338 /drivers/ide/ide.c
parentbbe4d6d86565bfd9edbc3f19bc23f816af66240d (diff)
ide: fix ->io_32bit race in set_io_32bit()
set_io_32bit() (ide_procset_t function) can race against running PIO transfers. Fix it by using ide_spin_wait_hwgroup(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r--drivers/ide/ide.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 85740ae5d689..54943da6e4e5 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -800,11 +800,17 @@ int set_io_32bit(ide_drive_t *drive, int arg)
800 if (arg < 0 || arg > 1 + (SUPPORT_VLB_SYNC << 1)) 800 if (arg < 0 || arg > 1 + (SUPPORT_VLB_SYNC << 1))
801 return -EINVAL; 801 return -EINVAL;
802 802
803 if (ide_spin_wait_hwgroup(drive))
804 return -EBUSY;
805
803 drive->io_32bit = arg; 806 drive->io_32bit = arg;
804#ifdef CONFIG_BLK_DEV_DTC2278 807#ifdef CONFIG_BLK_DEV_DTC2278
805 if (HWIF(drive)->chipset == ide_dtc2278) 808 if (HWIF(drive)->chipset == ide_dtc2278)
806 HWIF(drive)->drives[!drive->select.b.unit].io_32bit = arg; 809 HWIF(drive)->drives[!drive->select.b.unit].io_32bit = arg;
807#endif /* CONFIG_BLK_DEV_DTC2278 */ 810#endif /* CONFIG_BLK_DEV_DTC2278 */
811
812 spin_unlock_irq(&ide_lock);
813
808 return 0; 814 return 0;
809} 815}
810 816