diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:22 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:22 -0400 |
commit | 88b4132e101e60e8fa67996ae3072ab6b71e8500 (patch) | |
tree | 6b65c2d0d8691c577d60e6d1f84ad6db172a82d7 /drivers | |
parent | 11998b316173f814698f9037ce9179d634d1f423 (diff) |
ide: set/clear drive->waiting_for_dma flag in the core code
Set/clear drive->waiting_for_dma flag in the core code
instead of in ->dma_setup and ->dma_end methods.
There should be no functional changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/au1xxx-ide.c | 6 | ||||
-rw-r--r-- | drivers/ide/cmd64x.c | 1 | ||||
-rw-r--r-- | drivers/ide/icside.c | 4 | ||||
-rw-r--r-- | drivers/ide/ide-atapi.c | 4 | ||||
-rw-r--r-- | drivers/ide/ide-cd.c | 1 | ||||
-rw-r--r-- | drivers/ide/ide-dma-sff.c | 3 | ||||
-rw-r--r-- | drivers/ide/ide-dma.c | 4 | ||||
-rw-r--r-- | drivers/ide/ns87415.c | 1 | ||||
-rw-r--r-- | drivers/ide/pmac.c | 3 | ||||
-rw-r--r-- | drivers/ide/sc1200.c | 2 | ||||
-rw-r--r-- | drivers/ide/scc_pata.c | 3 | ||||
-rw-r--r-- | drivers/ide/sgiioc4.c | 3 | ||||
-rw-r--r-- | drivers/ide/trm290.c | 8 | ||||
-rw-r--r-- | drivers/ide/tx4939ide.c | 4 |
14 files changed, 11 insertions, 36 deletions
diff --git a/drivers/ide/au1xxx-ide.c b/drivers/ide/au1xxx-ide.c index 239643806b97..549bbb2755a8 100644 --- a/drivers/ide/au1xxx-ide.c +++ b/drivers/ide/au1xxx-ide.c | |||
@@ -290,7 +290,6 @@ static int auide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) | |||
290 | if (auide_build_dmatable(drive, cmd) == 0) | 290 | if (auide_build_dmatable(drive, cmd) == 0) |
291 | return 1; | 291 | return 1; |
292 | 292 | ||
293 | drive->waiting_for_dma = 1; | ||
294 | return 0; | 293 | return 0; |
295 | } | 294 | } |
296 | 295 | ||
@@ -315,16 +314,11 @@ static void auide_dma_host_set(ide_drive_t *drive, int on) | |||
315 | 314 | ||
316 | static void auide_ddma_tx_callback(int irq, void *param) | 315 | static void auide_ddma_tx_callback(int irq, void *param) |
317 | { | 316 | { |
318 | _auide_hwif *ahwif = (_auide_hwif*)param; | ||
319 | ahwif->drive->waiting_for_dma = 0; | ||
320 | } | 317 | } |
321 | 318 | ||
322 | static void auide_ddma_rx_callback(int irq, void *param) | 319 | static void auide_ddma_rx_callback(int irq, void *param) |
323 | { | 320 | { |
324 | _auide_hwif *ahwif = (_auide_hwif*)param; | ||
325 | ahwif->drive->waiting_for_dma = 0; | ||
326 | } | 321 | } |
327 | |||
328 | #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ | 322 | #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ |
329 | 323 | ||
330 | static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 devwidth, u32 flags) | 324 | static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 devwidth, u32 flags) |
diff --git a/drivers/ide/cmd64x.c b/drivers/ide/cmd64x.c index f2edf280ef8b..80b777e4247b 100644 --- a/drivers/ide/cmd64x.c +++ b/drivers/ide/cmd64x.c | |||
@@ -318,7 +318,6 @@ static int cmd646_1_dma_end(ide_drive_t *drive) | |||
318 | ide_hwif_t *hwif = drive->hwif; | 318 | ide_hwif_t *hwif = drive->hwif; |
319 | u8 dma_stat = 0, dma_cmd = 0; | 319 | u8 dma_stat = 0, dma_cmd = 0; |
320 | 320 | ||
321 | drive->waiting_for_dma = 0; | ||
322 | /* get DMA status */ | 321 | /* get DMA status */ |
323 | dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); | 322 | dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); |
324 | /* read DMA command state */ | 323 | /* read DMA command state */ |
diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c index 9bf57d7c8e57..4e16ce68b063 100644 --- a/drivers/ide/icside.c +++ b/drivers/ide/icside.c | |||
@@ -287,8 +287,6 @@ static int icside_dma_end(ide_drive_t *drive) | |||
287 | ide_hwif_t *hwif = drive->hwif; | 287 | ide_hwif_t *hwif = drive->hwif; |
288 | struct expansion_card *ec = ECARD_DEV(hwif->dev); | 288 | struct expansion_card *ec = ECARD_DEV(hwif->dev); |
289 | 289 | ||
290 | drive->waiting_for_dma = 0; | ||
291 | |||
292 | disable_dma(ec->dma); | 290 | disable_dma(ec->dma); |
293 | 291 | ||
294 | return get_dma_residue(ec->dma) != 0; | 292 | return get_dma_residue(ec->dma) != 0; |
@@ -343,8 +341,6 @@ static int icside_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) | |||
343 | set_dma_sg(ec->dma, hwif->sg_table, cmd->sg_nents); | 341 | set_dma_sg(ec->dma, hwif->sg_table, cmd->sg_nents); |
344 | set_dma_mode(ec->dma, dma_mode); | 342 | set_dma_mode(ec->dma, dma_mode); |
345 | 343 | ||
346 | drive->waiting_for_dma = 1; | ||
347 | |||
348 | return 0; | 344 | return 0; |
349 | } | 345 | } |
350 | 346 | ||
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index 89d2339bdef3..db6e617790bd 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -342,8 +342,10 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive) | |||
342 | stat = tp_ops->read_status(hwif); | 342 | stat = tp_ops->read_status(hwif); |
343 | 343 | ||
344 | if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { | 344 | if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { |
345 | int rc = hwif->dma_ops->dma_end(drive); | 345 | int rc; |
346 | 346 | ||
347 | drive->waiting_for_dma = 0; | ||
348 | rc = hwif->dma_ops->dma_end(drive); | ||
347 | ide_destroy_dmatable(drive); | 349 | ide_destroy_dmatable(drive); |
348 | 350 | ||
349 | if (rc || (drive->media == ide_tape && (stat & ATA_ERR))) { | 351 | if (rc || (drive->media == ide_tape && (stat & ATA_ERR))) { |
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 4a0d66ee9547..f5c7bb739f45 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -638,6 +638,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
638 | dma = drive->dma; | 638 | dma = drive->dma; |
639 | if (dma) { | 639 | if (dma) { |
640 | drive->dma = 0; | 640 | drive->dma = 0; |
641 | drive->waiting_for_dma = 0; | ||
641 | dma_error = hwif->dma_ops->dma_end(drive); | 642 | dma_error = hwif->dma_ops->dma_end(drive); |
642 | ide_destroy_dmatable(drive); | 643 | ide_destroy_dmatable(drive); |
643 | if (dma_error) { | 644 | if (dma_error) { |
diff --git a/drivers/ide/ide-dma-sff.c b/drivers/ide/ide-dma-sff.c index e10054b827a0..f8c7d0cd2ff8 100644 --- a/drivers/ide/ide-dma-sff.c +++ b/drivers/ide/ide-dma-sff.c | |||
@@ -216,7 +216,6 @@ int ide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) | |||
216 | /* clear INTR & ERROR flags */ | 216 | /* clear INTR & ERROR flags */ |
217 | ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR); | 217 | ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR); |
218 | 218 | ||
219 | drive->waiting_for_dma = 1; | ||
220 | return 0; | 219 | return 0; |
221 | } | 220 | } |
222 | EXPORT_SYMBOL_GPL(ide_dma_setup); | 221 | EXPORT_SYMBOL_GPL(ide_dma_setup); |
@@ -290,8 +289,6 @@ int ide_dma_end(ide_drive_t *drive) | |||
290 | ide_hwif_t *hwif = drive->hwif; | 289 | ide_hwif_t *hwif = drive->hwif; |
291 | u8 dma_stat = 0, dma_cmd = 0, mask; | 290 | u8 dma_stat = 0, dma_cmd = 0, mask; |
292 | 291 | ||
293 | drive->waiting_for_dma = 0; | ||
294 | |||
295 | /* stop DMA */ | 292 | /* stop DMA */ |
296 | if (hwif->host_flags & IDE_HFLAG_MMIO) { | 293 | if (hwif->host_flags & IDE_HFLAG_MMIO) { |
297 | dma_cmd = readb((void __iomem *)(hwif->dma_base + ATA_DMA_CMD)); | 294 | dma_cmd = readb((void __iomem *)(hwif->dma_base + ATA_DMA_CMD)); |
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index d61f9a8cc18a..4d3102887d9c 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -91,6 +91,7 @@ ide_startstop_t ide_dma_intr(ide_drive_t *drive) | |||
91 | ide_hwif_t *hwif = drive->hwif; | 91 | ide_hwif_t *hwif = drive->hwif; |
92 | u8 stat = 0, dma_stat = 0; | 92 | u8 stat = 0, dma_stat = 0; |
93 | 93 | ||
94 | drive->waiting_for_dma = 0; | ||
94 | dma_stat = hwif->dma_ops->dma_end(drive); | 95 | dma_stat = hwif->dma_ops->dma_end(drive); |
95 | ide_destroy_dmatable(drive); | 96 | ide_destroy_dmatable(drive); |
96 | stat = hwif->tp_ops->read_status(hwif); | 97 | stat = hwif->tp_ops->read_status(hwif); |
@@ -479,6 +480,7 @@ ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) | |||
479 | 480 | ||
480 | if (error < 0) { | 481 | if (error < 0) { |
481 | printk(KERN_WARNING "%s: DMA timeout error\n", drive->name); | 482 | printk(KERN_WARNING "%s: DMA timeout error\n", drive->name); |
483 | drive->waiting_for_dma = 0; | ||
482 | (void)dma_ops->dma_end(drive); | 484 | (void)dma_ops->dma_end(drive); |
483 | ide_destroy_dmatable(drive); | 485 | ide_destroy_dmatable(drive); |
484 | ret = ide_error(drive, "dma timeout error", | 486 | ret = ide_error(drive, "dma timeout error", |
@@ -491,6 +493,7 @@ ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) | |||
491 | if (dma_ops->dma_test_irq(drive) == 0) { | 493 | if (dma_ops->dma_test_irq(drive) == 0) { |
492 | ide_dump_status(drive, "DMA timeout", | 494 | ide_dump_status(drive, "DMA timeout", |
493 | hwif->tp_ops->read_status(hwif)); | 495 | hwif->tp_ops->read_status(hwif)); |
496 | drive->waiting_for_dma = 0; | ||
494 | (void)dma_ops->dma_end(drive); | 497 | (void)dma_ops->dma_end(drive); |
495 | ide_destroy_dmatable(drive); | 498 | ide_destroy_dmatable(drive); |
496 | } | 499 | } |
@@ -577,5 +580,6 @@ int ide_dma_prepare(ide_drive_t *drive, struct ide_cmd *cmd) | |||
577 | ide_map_sg(drive, cmd); | 580 | ide_map_sg(drive, cmd); |
578 | return 1; | 581 | return 1; |
579 | } | 582 | } |
583 | drive->waiting_for_dma = 1; | ||
580 | return 0; | 584 | return 0; |
581 | } | 585 | } |
diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c index 6e0f372d2f09..cbc1d1110385 100644 --- a/drivers/ide/ns87415.c +++ b/drivers/ide/ns87415.c | |||
@@ -207,7 +207,6 @@ static int ns87415_dma_end(ide_drive_t *drive) | |||
207 | ide_hwif_t *hwif = drive->hwif; | 207 | ide_hwif_t *hwif = drive->hwif; |
208 | u8 dma_stat = 0, dma_cmd = 0; | 208 | u8 dma_stat = 0, dma_cmd = 0; |
209 | 209 | ||
210 | drive->waiting_for_dma = 0; | ||
211 | dma_stat = hwif->dma_ops->dma_sff_read_status(hwif); | 210 | dma_stat = hwif->dma_ops->dma_sff_read_status(hwif); |
212 | /* get DMA command mode */ | 211 | /* get DMA command mode */ |
213 | dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD); | 212 | dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD); |
diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c index 1df7b7636453..879c3d8d9f36 100644 --- a/drivers/ide/pmac.c +++ b/drivers/ide/pmac.c | |||
@@ -1517,8 +1517,6 @@ static int pmac_ide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) | |||
1517 | (void)readl(PMAC_IDE_REG(IDE_TIMING_CONFIG)); | 1517 | (void)readl(PMAC_IDE_REG(IDE_TIMING_CONFIG)); |
1518 | } | 1518 | } |
1519 | 1519 | ||
1520 | drive->waiting_for_dma = 1; | ||
1521 | |||
1522 | return 0; | 1520 | return 0; |
1523 | } | 1521 | } |
1524 | 1522 | ||
@@ -1553,7 +1551,6 @@ pmac_ide_dma_end (ide_drive_t *drive) | |||
1553 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; | 1551 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; |
1554 | u32 dstat; | 1552 | u32 dstat; |
1555 | 1553 | ||
1556 | drive->waiting_for_dma = 0; | ||
1557 | dstat = readl(&dma->status); | 1554 | dstat = readl(&dma->status); |
1558 | writel(((RUN|WAKE|DEAD) << 16), &dma->control); | 1555 | writel(((RUN|WAKE|DEAD) << 16), &dma->control); |
1559 | 1556 | ||
diff --git a/drivers/ide/sc1200.c b/drivers/ide/sc1200.c index d9c47034bedd..13e3988f00f0 100644 --- a/drivers/ide/sc1200.c +++ b/drivers/ide/sc1200.c | |||
@@ -183,8 +183,6 @@ static int sc1200_dma_end(ide_drive_t *drive) | |||
183 | outb(dma_stat|0x1b, dma_base+2); /* clear the INTR & ERROR bits */ | 183 | outb(dma_stat|0x1b, dma_base+2); /* clear the INTR & ERROR bits */ |
184 | outb(inb(dma_base)&~1, dma_base); /* !! DO THIS HERE !! stop DMA */ | 184 | outb(inb(dma_base)&~1, dma_base); /* !! DO THIS HERE !! stop DMA */ |
185 | 185 | ||
186 | drive->waiting_for_dma = 0; | ||
187 | |||
188 | return (dma_stat & 7) != 4; /* verify good DMA status */ | 186 | return (dma_stat & 7) != 4; /* verify good DMA status */ |
189 | } | 187 | } |
190 | 188 | ||
diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c index 2cdf51d8917a..542419ffa9b7 100644 --- a/drivers/ide/scc_pata.c +++ b/drivers/ide/scc_pata.c | |||
@@ -335,7 +335,7 @@ static int scc_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) | |||
335 | 335 | ||
336 | /* clear INTR & ERROR flags */ | 336 | /* clear INTR & ERROR flags */ |
337 | out_be32((void __iomem *)(hwif->dma_base + 4), dma_stat | 6); | 337 | out_be32((void __iomem *)(hwif->dma_base + 4), dma_stat | 6); |
338 | drive->waiting_for_dma = 1; | 338 | |
339 | return 0; | 339 | return 0; |
340 | } | 340 | } |
341 | 341 | ||
@@ -354,7 +354,6 @@ static int __scc_dma_end(ide_drive_t *drive) | |||
354 | ide_hwif_t *hwif = drive->hwif; | 354 | ide_hwif_t *hwif = drive->hwif; |
355 | u8 dma_stat, dma_cmd; | 355 | u8 dma_stat, dma_cmd; |
356 | 356 | ||
357 | drive->waiting_for_dma = 0; | ||
358 | /* get DMA command mode */ | 357 | /* get DMA command mode */ |
359 | dma_cmd = scc_ide_inb(hwif->dma_base); | 358 | dma_cmd = scc_ide_inb(hwif->dma_base); |
360 | /* stop DMA */ | 359 | /* stop DMA */ |
diff --git a/drivers/ide/sgiioc4.c b/drivers/ide/sgiioc4.c index d90e8c5af0a2..cb2657c4c976 100644 --- a/drivers/ide/sgiioc4.c +++ b/drivers/ide/sgiioc4.c | |||
@@ -258,8 +258,6 @@ static int sgiioc4_dma_end(ide_drive_t *drive) | |||
258 | } | 258 | } |
259 | } | 259 | } |
260 | 260 | ||
261 | drive->waiting_for_dma = 0; | ||
262 | |||
263 | return dma_stat; | 261 | return dma_stat; |
264 | } | 262 | } |
265 | 263 | ||
@@ -412,7 +410,6 @@ sgiioc4_configure_for_dma(int dma_direction, ide_drive_t * drive) | |||
412 | writel(ending_dma_addr, (void __iomem *)(dma_base + IOC4_DMA_END_ADDR * 4)); | 410 | writel(ending_dma_addr, (void __iomem *)(dma_base + IOC4_DMA_END_ADDR * 4)); |
413 | 411 | ||
414 | writel(dma_direction, (void __iomem *)ioc4_dma_addr); | 412 | writel(dma_direction, (void __iomem *)ioc4_dma_addr); |
415 | drive->waiting_for_dma = 1; | ||
416 | } | 413 | } |
417 | 414 | ||
418 | /* IOC4 Scatter Gather list Format */ | 415 | /* IOC4 Scatter Gather list Format */ |
diff --git a/drivers/ide/trm290.c b/drivers/ide/trm290.c index 0be27cae27d5..c0528f27fcae 100644 --- a/drivers/ide/trm290.c +++ b/drivers/ide/trm290.c | |||
@@ -198,9 +198,9 @@ static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) | |||
198 | return 1; | 198 | return 1; |
199 | 199 | ||
200 | outl(hwif->dmatable_dma | rw, hwif->dma_base); | 200 | outl(hwif->dmatable_dma | rw, hwif->dma_base); |
201 | drive->waiting_for_dma = 1; | ||
202 | /* start DMA */ | 201 | /* start DMA */ |
203 | outw(count * 2 - 1, hwif->dma_base + 2); | 202 | outw(count * 2 - 1, hwif->dma_base + 2); |
203 | |||
204 | return 0; | 204 | return 0; |
205 | } | 205 | } |
206 | 206 | ||
@@ -211,11 +211,7 @@ static void trm290_dma_start(ide_drive_t *drive) | |||
211 | 211 | ||
212 | static int trm290_dma_end(ide_drive_t *drive) | 212 | static int trm290_dma_end(ide_drive_t *drive) |
213 | { | 213 | { |
214 | u16 status; | 214 | u16 status = inw(drive->hwif->dma_base + 2); |
215 | |||
216 | drive->waiting_for_dma = 0; | ||
217 | |||
218 | status = inw(drive->hwif->dma_base + 2); | ||
219 | 215 | ||
220 | trm290_prepare_drive(drive, 0); | 216 | trm290_prepare_drive(drive, 0); |
221 | 217 | ||
diff --git a/drivers/ide/tx4939ide.c b/drivers/ide/tx4939ide.c index 7267c46c07cd..faf0d97b9ce8 100644 --- a/drivers/ide/tx4939ide.c +++ b/drivers/ide/tx4939ide.c | |||
@@ -304,8 +304,6 @@ static int tx4939ide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) | |||
304 | /* clear INTR & ERROR flags */ | 304 | /* clear INTR & ERROR flags */ |
305 | tx4939ide_clear_dma_status(base); | 305 | tx4939ide_clear_dma_status(base); |
306 | 306 | ||
307 | drive->waiting_for_dma = 1; | ||
308 | |||
309 | tx4939ide_writew(SECTOR_SIZE / 2, base, drive->dn ? | 307 | tx4939ide_writew(SECTOR_SIZE / 2, base, drive->dn ? |
310 | TX4939IDE_Xfer_Cnt_2 : TX4939IDE_Xfer_Cnt_1); | 308 | TX4939IDE_Xfer_Cnt_2 : TX4939IDE_Xfer_Cnt_1); |
311 | 309 | ||
@@ -321,8 +319,6 @@ static int tx4939ide_dma_end(ide_drive_t *drive) | |||
321 | void __iomem *base = TX4939IDE_BASE(hwif); | 319 | void __iomem *base = TX4939IDE_BASE(hwif); |
322 | u16 ctl = tx4939ide_readw(base, TX4939IDE_Int_Ctl); | 320 | u16 ctl = tx4939ide_readw(base, TX4939IDE_Int_Ctl); |
323 | 321 | ||
324 | drive->waiting_for_dma = 0; | ||
325 | |||
326 | /* get DMA command mode */ | 322 | /* get DMA command mode */ |
327 | dma_cmd = tx4939ide_readb(base, TX4939IDE_DMA_Cmd); | 323 | dma_cmd = tx4939ide_readb(base, TX4939IDE_DMA_Cmd); |
328 | /* stop DMA */ | 324 | /* stop DMA */ |