aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand/omap2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/onenand/omap2.c')
-rw-r--r--drivers/mtd/onenand/omap2.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index fd406348fdfd..9f322f1a7f22 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -309,7 +309,7 @@ static int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area,
309 goto out_copy; 309 goto out_copy;
310 310
311 /* panic_write() may be in an interrupt context */ 311 /* panic_write() may be in an interrupt context */
312 if (in_interrupt()) 312 if (in_interrupt() || oops_in_progress)
313 goto out_copy; 313 goto out_copy;
314 314
315 if (buf >= high_memory) { 315 if (buf >= high_memory) {
@@ -386,7 +386,7 @@ static int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area,
386 goto out_copy; 386 goto out_copy;
387 387
388 /* panic_write() may be in an interrupt context */ 388 /* panic_write() may be in an interrupt context */
389 if (in_interrupt()) 389 if (in_interrupt() || oops_in_progress)
390 goto out_copy; 390 goto out_copy;
391 391
392 if (buf >= high_memory) { 392 if (buf >= high_memory) {
@@ -403,7 +403,7 @@ static int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area,
403 403
404 dma_src = dma_map_single(&c->pdev->dev, buf, count, DMA_TO_DEVICE); 404 dma_src = dma_map_single(&c->pdev->dev, buf, count, DMA_TO_DEVICE);
405 dma_dst = c->phys_base + bram_offset; 405 dma_dst = c->phys_base + bram_offset;
406 if (dma_mapping_error(&c->pdev->dev, dma_dst)) { 406 if (dma_mapping_error(&c->pdev->dev, dma_src)) {
407 dev_err(&c->pdev->dev, 407 dev_err(&c->pdev->dev,
408 "Couldn't DMA map a %d byte buffer\n", 408 "Couldn't DMA map a %d byte buffer\n",
409 count); 409 count);
@@ -426,7 +426,7 @@ static int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area,
426 if (*done) 426 if (*done)
427 break; 427 break;
428 428
429 dma_unmap_single(&c->pdev->dev, dma_dst, count, DMA_TO_DEVICE); 429 dma_unmap_single(&c->pdev->dev, dma_src, count, DMA_TO_DEVICE);
430 430
431 if (!*done) { 431 if (!*done) {
432 dev_err(&c->pdev->dev, "timeout waiting for DMA\n"); 432 dev_err(&c->pdev->dev, "timeout waiting for DMA\n");
@@ -521,7 +521,7 @@ static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
521 dma_src = dma_map_single(&c->pdev->dev, (void *) buffer, count, 521 dma_src = dma_map_single(&c->pdev->dev, (void *) buffer, count,
522 DMA_TO_DEVICE); 522 DMA_TO_DEVICE);
523 dma_dst = c->phys_base + bram_offset; 523 dma_dst = c->phys_base + bram_offset;
524 if (dma_mapping_error(&c->pdev->dev, dma_dst)) { 524 if (dma_mapping_error(&c->pdev->dev, dma_src)) {
525 dev_err(&c->pdev->dev, 525 dev_err(&c->pdev->dev,
526 "Couldn't DMA map a %d byte buffer\n", 526 "Couldn't DMA map a %d byte buffer\n",
527 count); 527 count);
@@ -539,7 +539,7 @@ static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
539 omap_start_dma(c->dma_channel); 539 omap_start_dma(c->dma_channel);
540 wait_for_completion(&c->dma_done); 540 wait_for_completion(&c->dma_done);
541 541
542 dma_unmap_single(&c->pdev->dev, dma_dst, count, DMA_TO_DEVICE); 542 dma_unmap_single(&c->pdev->dev, dma_src, count, DMA_TO_DEVICE);
543 543
544 return 0; 544 return 0;
545} 545}