From ae34e897a3dc935b2c5995b573acb254224c065c Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 1 Aug 2010 15:44:45 +0200 Subject: Fix unexpected irq + irq timeout on write * linux/src/drivers/block/ide.c (do_rw_disk): Set IRQ handler before issuing write command. --- linux/src/drivers/block/ide.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'linux/src') diff --git a/linux/src/drivers/block/ide.c b/linux/src/drivers/block/ide.c index e52cbed..18f2e76 100644 --- a/linux/src/drivers/block/ide.c +++ b/linux/src/drivers/block/ide.c @@ -1495,6 +1495,10 @@ static inline void do_rw_disk (ide_drive_t *drive, struct request *rq, unsigned if (drive->using_dma && !(HWIF(drive)->dmaproc(ide_dma_write, drive))) return; #endif /* CONFIG_BLK_DEV_TRITON */ + if (drive->mult_count) + ide_set_handler (drive, &multwrite_intr, WAIT_CMD); + else + ide_set_handler (drive, &write_intr, WAIT_CMD); OUT_BYTE(drive->mult_count ? WIN_MULTWRITE : WIN_WRITE, io_base+IDE_COMMAND_OFFSET); if (ide_wait_stat(drive, DATA_READY, drive->bad_wstat, WAIT_DRQ)) { printk("%s: no DRQ after issuing %s\n", drive->name, @@ -1505,10 +1509,8 @@ static inline void do_rw_disk (ide_drive_t *drive, struct request *rq, unsigned cli(); if (drive->mult_count) { HWGROUP(drive)->wrq = *rq; /* scratchpad */ - ide_set_handler (drive, &multwrite_intr, WAIT_CMD); ide_multwrite(drive, drive->mult_count); } else { - ide_set_handler (drive, &write_intr, WAIT_CMD); ide_output_data(drive, rq->buffer, SECTOR_WORDS); } return; -- cgit v1.2.3