* [PATCH 1/20] ide: fix ->io_32bit race in set_io_32bit()
@ 2007-12-09 21:06 Bartlomiej Zolnierkiewicz
2007-12-10 12:38 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-12-09 21:06 UTC (permalink / raw)
To: linux-ide
set_io_32bit() (ide_procset_t function) can race against running
PIO transfers. Fix it by using ide_spin_wait_hwgroup().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: b/drivers/ide/ide.c
===================================================================
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -791,11 +791,17 @@ int set_io_32bit(ide_drive_t *drive, int
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;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-10 12:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-09 21:06 [PATCH 1/20] ide: fix ->io_32bit race in set_io_32bit() Bartlomiej Zolnierkiewicz
2007-12-10 12:38 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).