diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-24 18:22:43 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-24 18:22:43 -0400 |
commit | 65ca5377322c7543163066f373ae9e6b0ad8de8a (patch) | |
tree | 0d333cb6c781f151d82ed66fd4ece26359525366 /drivers/ide/ide-io.c | |
parent | b6a45a0b1e9a358b81201659cf87b023e3ec73e0 (diff) |
ide: move ide_dma_timeout_retry() to ide-dma.c
Move ide_dma_timeout_retry() to ide-dma.c and add static inline
version for CONFIG_BLK_DEV_IDEDMA=n.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r-- | drivers/ide/ide-io.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 835cf646bb07..557b15700ea2 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -819,63 +819,6 @@ plug_device_2: | |||
819 | blk_plug_device(q); | 819 | blk_plug_device(q); |
820 | } | 820 | } |
821 | 821 | ||
822 | /* | ||
823 | * un-busy the port etc, and clear any pending DMA status. we want to | ||
824 | * retry the current request in pio mode instead of risking tossing it | ||
825 | * all away | ||
826 | */ | ||
827 | static ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) | ||
828 | { | ||
829 | ide_hwif_t *hwif = drive->hwif; | ||
830 | struct request *rq; | ||
831 | ide_startstop_t ret = ide_stopped; | ||
832 | |||
833 | /* | ||
834 | * end current dma transaction | ||
835 | */ | ||
836 | |||
837 | if (error < 0) { | ||
838 | printk(KERN_WARNING "%s: DMA timeout error\n", drive->name); | ||
839 | (void)hwif->dma_ops->dma_end(drive); | ||
840 | ret = ide_error(drive, "dma timeout error", | ||
841 | hwif->tp_ops->read_status(hwif)); | ||
842 | } else { | ||
843 | printk(KERN_WARNING "%s: DMA timeout retry\n", drive->name); | ||
844 | hwif->dma_ops->dma_timeout(drive); | ||
845 | } | ||
846 | |||
847 | /* | ||
848 | * disable dma for now, but remember that we did so because of | ||
849 | * a timeout -- we'll reenable after we finish this next request | ||
850 | * (or rather the first chunk of it) in pio. | ||
851 | */ | ||
852 | drive->dev_flags |= IDE_DFLAG_DMA_PIO_RETRY; | ||
853 | drive->retry_pio++; | ||
854 | ide_dma_off_quietly(drive); | ||
855 | |||
856 | /* | ||
857 | * un-busy drive etc and make sure request is sane | ||
858 | */ | ||
859 | |||
860 | rq = hwif->rq; | ||
861 | if (!rq) | ||
862 | goto out; | ||
863 | |||
864 | hwif->rq = NULL; | ||
865 | |||
866 | rq->errors = 0; | ||
867 | |||
868 | if (!rq->bio) | ||
869 | goto out; | ||
870 | |||
871 | rq->sector = rq->bio->bi_sector; | ||
872 | rq->current_nr_sectors = bio_iovec(rq->bio)->bv_len >> 9; | ||
873 | rq->hard_cur_sectors = rq->current_nr_sectors; | ||
874 | rq->buffer = bio_data(rq->bio); | ||
875 | out: | ||
876 | return ret; | ||
877 | } | ||
878 | |||
879 | static void ide_plug_device(ide_drive_t *drive) | 822 | static void ide_plug_device(ide_drive_t *drive) |
880 | { | 823 | { |
881 | struct request_queue *q = drive->queue; | 824 | struct request_queue *q = drive->queue; |