Skip to content

Commit

Permalink
ide: fix ->io_32bit race in set_io_32bit()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Dec 12, 2007
1 parent bbe4d6d commit 644a9d7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,11 +800,17 @@ int set_io_32bit(ide_drive_t *drive, int arg)
if (arg < 0 || arg > 1 + (SUPPORT_VLB_SYNC << 1))
return -EINVAL;

if (ide_spin_wait_hwgroup(drive))
return -EBUSY;

drive->io_32bit = arg;
#ifdef CONFIG_BLK_DEV_DTC2278
if (HWIF(drive)->chipset == ide_dtc2278)
HWIF(drive)->drives[!drive->select.b.unit].io_32bit = arg;
#endif /* CONFIG_BLK_DEV_DTC2278 */

spin_unlock_irq(&ide_lock);

return 0;
}

Expand Down

0 comments on commit 644a9d7

Please sign in to comment.