aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:36 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:36 -0400
commitd393aa0326436efd3cb800916b08cdac4dd1091a (patch)
tree2fae9665c336a40d9a20a77612cac61daf107dce /drivers/ide
parent69e88d2a754fcaf7ef8ca465586b811cf40dc479 (diff)
ide: take ide_lock for prefetch disable/enable in do_special()
Take ide_lock for prefetch disable/enable in do_special(), then cleanup cmd640 and ht6560b host drivers. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-io.c15
-rw-r--r--drivers/ide/legacy/ht6560b.c5
-rw-r--r--drivers/ide/pci/cmd640.c6
3 files changed, 14 insertions, 12 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 32eaa3f80515..e2eb408a8a18 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -800,7 +800,20 @@ static ide_startstop_t do_special (ide_drive_t *drive)
800 s->b.set_tune = 0; 800 s->b.set_tune = 0;
801 801
802 if (set_pio_mode_abuse(drive->hwif, req_pio)) { 802 if (set_pio_mode_abuse(drive->hwif, req_pio)) {
803 if (hwif->set_pio_mode) 803
804 if (hwif->set_pio_mode == NULL)
805 return ide_stopped;
806
807 /*
808 * take ide_lock for drive->[no_]unmask/[no_]io_32bit
809 */
810 if (req_pio == 8 || req_pio == 9) {
811 unsigned long flags;
812
813 spin_lock_irqsave(&ide_lock, flags);
814 hwif->set_pio_mode(drive, req_pio);
815 spin_unlock_irqrestore(&ide_lock, flags);
816 } else
804 hwif->set_pio_mode(drive, req_pio); 817 hwif->set_pio_mode(drive, req_pio);
805 } else { 818 } else {
806 int keep_dma = drive->using_dma; 819 int keep_dma = drive->using_dma;
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index 4a93adbab1de..a4245d13f11b 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -286,12 +286,7 @@ static void ht6560b_set_pio_mode(ide_drive_t *drive, const u8 pio)
286 switch (pio) { 286 switch (pio) {
287 case 8: /* set prefetch off */ 287 case 8: /* set prefetch off */
288 case 9: /* set prefetch on */ 288 case 9: /* set prefetch on */
289 /*
290 * take ide_lock for drive->[no_]unmask
291 */
292 spin_lock_irqsave(&ide_lock, flags);
293 ht_set_prefetch(drive, pio & 1); 289 ht_set_prefetch(drive, pio & 1);
294 spin_unlock_irqrestore(&ide_lock, flags);
295 return; 290 return;
296 } 291 }
297 292
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
index 0e9275d7459c..4aa48104e0c1 100644
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -632,7 +632,6 @@ static void cmd640_set_mode (unsigned int index, u8 pio_mode, unsigned int cycle
632 632
633static void cmd640_set_pio_mode(ide_drive_t *drive, const u8 pio) 633static void cmd640_set_pio_mode(ide_drive_t *drive, const u8 pio)
634{ 634{
635 unsigned long flags;
636 unsigned int index = 0, cycle_time; 635 unsigned int index = 0, cycle_time;
637 u8 b; 636 u8 b;
638 637
@@ -655,12 +654,7 @@ static void cmd640_set_pio_mode(ide_drive_t *drive, const u8 pio)
655 654
656 case 8: /* set prefetch off */ 655 case 8: /* set prefetch off */
657 case 9: /* set prefetch on */ 656 case 9: /* set prefetch on */
658 /*
659 * take ide_lock for drive->[no_]unmask/[no_]io_32bit
660 */
661 spin_lock_irqsave(&ide_lock, flags);
662 set_prefetch_mode(index, pio & 1); 657 set_prefetch_mode(index, pio & 1);
663 spin_unlock_irqrestore(&ide_lock, flags);
664 printk("%s: %sabled cmd640 prefetch\n", drive->name, (pio & 1) ? "en" : "dis"); 658 printk("%s: %sabled cmd640 prefetch\n", drive->name, (pio & 1) ? "en" : "dis");
665 return; 659 return;
666 } 660 }