diff options
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-floppy.c | 7 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 15 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 4 |
3 files changed, 19 insertions, 7 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 0039789b0eb9..f05fbc2bd7a8 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -262,10 +262,7 @@ static void ide_floppy_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
262 | if (bcount) { | 262 | if (bcount) { |
263 | printk(KERN_ERR "%s: leftover data in %s, bcount == %d\n", | 263 | printk(KERN_ERR "%s: leftover data in %s, bcount == %d\n", |
264 | drive->name, __func__, bcount); | 264 | drive->name, __func__, bcount); |
265 | if (direction) | 265 | ide_pad_transfer(drive, direction, bcount); |
266 | ide_atapi_write_zeros(drive, bcount); | ||
267 | else | ||
268 | ide_atapi_discard_data(drive, bcount); | ||
269 | } | 266 | } |
270 | } | 267 | } |
271 | 268 | ||
@@ -491,7 +488,7 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) | |||
491 | printk(KERN_ERR "ide-floppy: The floppy wants " | 488 | printk(KERN_ERR "ide-floppy: The floppy wants " |
492 | "to send us more data than expected " | 489 | "to send us more data than expected " |
493 | "- discarding data\n"); | 490 | "- discarding data\n"); |
494 | ide_atapi_discard_data(drive, bcount); | 491 | ide_pad_transfer(drive, 0, bcount); |
495 | 492 | ||
496 | ide_set_handler(drive, | 493 | ide_set_handler(drive, |
497 | &idefloppy_pc_intr, | 494 | &idefloppy_pc_intr, |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 8d7c1a09e1e7..788783da9025 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -1642,3 +1642,18 @@ void ide_pktcmd_tf_load(ide_drive_t *drive, u32 tf_flags, u16 bcount, u8 dma) | |||
1642 | } | 1642 | } |
1643 | 1643 | ||
1644 | EXPORT_SYMBOL_GPL(ide_pktcmd_tf_load); | 1644 | EXPORT_SYMBOL_GPL(ide_pktcmd_tf_load); |
1645 | |||
1646 | void ide_pad_transfer(ide_drive_t *drive, int write, int len) | ||
1647 | { | ||
1648 | ide_hwif_t *hwif = drive->hwif; | ||
1649 | u8 buf[4] = { 0 }; | ||
1650 | |||
1651 | while (len > 0) { | ||
1652 | if (write) | ||
1653 | hwif->output_data(drive, NULL, buf, min(4, len)); | ||
1654 | else | ||
1655 | hwif->input_data(drive, NULL, buf, min(4, len)); | ||
1656 | len -= 4; | ||
1657 | } | ||
1658 | } | ||
1659 | EXPORT_SYMBOL_GPL(ide_pad_transfer); | ||
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 71d07d740add..54a43b044608 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -395,7 +395,7 @@ static void idetape_input_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
395 | if (bh == NULL) { | 395 | if (bh == NULL) { |
396 | printk(KERN_ERR "ide-tape: bh == NULL in " | 396 | printk(KERN_ERR "ide-tape: bh == NULL in " |
397 | "idetape_input_buffers\n"); | 397 | "idetape_input_buffers\n"); |
398 | ide_atapi_discard_data(drive, bcount); | 398 | ide_pad_transfer(drive, 0, bcount); |
399 | return; | 399 | return; |
400 | } | 400 | } |
401 | count = min( | 401 | count = min( |
@@ -871,7 +871,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) | |||
871 | printk(KERN_ERR "ide-tape: The tape wants to " | 871 | printk(KERN_ERR "ide-tape: The tape wants to " |
872 | "send us more data than expected " | 872 | "send us more data than expected " |
873 | "- discarding data\n"); | 873 | "- discarding data\n"); |
874 | ide_atapi_discard_data(drive, bcount); | 874 | ide_pad_transfer(drive, 0, bcount); |
875 | ide_set_handler(drive, &idetape_pc_intr, | 875 | ide_set_handler(drive, &idetape_pc_intr, |
876 | IDETAPE_WAIT_CMD, NULL); | 876 | IDETAPE_WAIT_CMD, NULL); |
877 | return ide_started; | 877 | return ide_started; |