aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ftl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ftl.c')
-rw-r--r--drivers/mtd/ftl.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index 037b399df3f1..c7382bb686c6 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -339,7 +339,7 @@ static int erase_xfer(partition_t *part,
339 struct erase_info *erase; 339 struct erase_info *erase;
340 340
341 xfer = &part->XferInfo[xfernum]; 341 xfer = &part->XferInfo[xfernum];
342 DEBUG(1, "ftl_cs: erasing xfer unit at 0x%x\n", xfer->Offset); 342 pr_debug("ftl_cs: erasing xfer unit at 0x%x\n", xfer->Offset);
343 xfer->state = XFER_ERASING; 343 xfer->state = XFER_ERASING;
344 344
345 /* Is there a free erase slot? Always in MTD. */ 345 /* Is there a free erase slot? Always in MTD. */
@@ -415,7 +415,7 @@ static int prepare_xfer(partition_t *part, int i)
415 xfer = &part->XferInfo[i]; 415 xfer = &part->XferInfo[i];
416 xfer->state = XFER_FAILED; 416 xfer->state = XFER_FAILED;
417 417
418 DEBUG(1, "ftl_cs: preparing xfer unit at 0x%x\n", xfer->Offset); 418 pr_debug("ftl_cs: preparing xfer unit at 0x%x\n", xfer->Offset);
419 419
420 /* Write the transfer unit header */ 420 /* Write the transfer unit header */
421 header = part->header; 421 header = part->header;
@@ -476,7 +476,7 @@ static int copy_erase_unit(partition_t *part, uint16_t srcunit,
476 476
477 eun = &part->EUNInfo[srcunit]; 477 eun = &part->EUNInfo[srcunit];
478 xfer = &part->XferInfo[xferunit]; 478 xfer = &part->XferInfo[xferunit];
479 DEBUG(2, "ftl_cs: copying block 0x%x to 0x%x\n", 479 pr_debug("ftl_cs: copying block 0x%x to 0x%x\n",
480 eun->Offset, xfer->Offset); 480 eun->Offset, xfer->Offset);
481 481
482 482
@@ -598,7 +598,7 @@ static int copy_erase_unit(partition_t *part, uint16_t srcunit,
598 unit with the fewest erases, and usually pick the data unit with 598 unit with the fewest erases, and usually pick the data unit with
599 the most deleted blocks. But with a small probability, pick the 599 the most deleted blocks. But with a small probability, pick the
600 oldest data unit instead. This means that we generally postpone 600 oldest data unit instead. This means that we generally postpone
601 the next reclaimation as long as possible, but shuffle static 601 the next reclamation as long as possible, but shuffle static
602 stuff around a bit for wear leveling. 602 stuff around a bit for wear leveling.
603 603
604======================================================================*/ 604======================================================================*/
@@ -609,8 +609,8 @@ static int reclaim_block(partition_t *part)
609 uint32_t best; 609 uint32_t best;
610 int queued, ret; 610 int queued, ret;
611 611
612 DEBUG(0, "ftl_cs: reclaiming space...\n"); 612 pr_debug("ftl_cs: reclaiming space...\n");
613 DEBUG(3, "NumTransferUnits == %x\n", part->header.NumTransferUnits); 613 pr_debug("NumTransferUnits == %x\n", part->header.NumTransferUnits);
614 /* Pick the least erased transfer unit */ 614 /* Pick the least erased transfer unit */
615 best = 0xffffffff; xfer = 0xffff; 615 best = 0xffffffff; xfer = 0xffff;
616 do { 616 do {
@@ -618,22 +618,22 @@ static int reclaim_block(partition_t *part)
618 for (i = 0; i < part->header.NumTransferUnits; i++) { 618 for (i = 0; i < part->header.NumTransferUnits; i++) {
619 int n=0; 619 int n=0;
620 if (part->XferInfo[i].state == XFER_UNKNOWN) { 620 if (part->XferInfo[i].state == XFER_UNKNOWN) {
621 DEBUG(3,"XferInfo[%d].state == XFER_UNKNOWN\n",i); 621 pr_debug("XferInfo[%d].state == XFER_UNKNOWN\n",i);
622 n=1; 622 n=1;
623 erase_xfer(part, i); 623 erase_xfer(part, i);
624 } 624 }
625 if (part->XferInfo[i].state == XFER_ERASING) { 625 if (part->XferInfo[i].state == XFER_ERASING) {
626 DEBUG(3,"XferInfo[%d].state == XFER_ERASING\n",i); 626 pr_debug("XferInfo[%d].state == XFER_ERASING\n",i);
627 n=1; 627 n=1;
628 queued = 1; 628 queued = 1;
629 } 629 }
630 else if (part->XferInfo[i].state == XFER_ERASED) { 630 else if (part->XferInfo[i].state == XFER_ERASED) {
631 DEBUG(3,"XferInfo[%d].state == XFER_ERASED\n",i); 631 pr_debug("XferInfo[%d].state == XFER_ERASED\n",i);
632 n=1; 632 n=1;
633 prepare_xfer(part, i); 633 prepare_xfer(part, i);
634 } 634 }
635 if (part->XferInfo[i].state == XFER_PREPARED) { 635 if (part->XferInfo[i].state == XFER_PREPARED) {
636 DEBUG(3,"XferInfo[%d].state == XFER_PREPARED\n",i); 636 pr_debug("XferInfo[%d].state == XFER_PREPARED\n",i);
637 n=1; 637 n=1;
638 if (part->XferInfo[i].EraseCount <= best) { 638 if (part->XferInfo[i].EraseCount <= best) {
639 best = part->XferInfo[i].EraseCount; 639 best = part->XferInfo[i].EraseCount;
@@ -641,12 +641,12 @@ static int reclaim_block(partition_t *part)
641 } 641 }
642 } 642 }
643 if (!n) 643 if (!n)
644 DEBUG(3,"XferInfo[%d].state == %x\n",i, part->XferInfo[i].state); 644 pr_debug("XferInfo[%d].state == %x\n",i, part->XferInfo[i].state);
645 645
646 } 646 }
647 if (xfer == 0xffff) { 647 if (xfer == 0xffff) {
648 if (queued) { 648 if (queued) {
649 DEBUG(1, "ftl_cs: waiting for transfer " 649 pr_debug("ftl_cs: waiting for transfer "
650 "unit to be prepared...\n"); 650 "unit to be prepared...\n");
651 if (part->mbd.mtd->sync) 651 if (part->mbd.mtd->sync)
652 part->mbd.mtd->sync(part->mbd.mtd); 652 part->mbd.mtd->sync(part->mbd.mtd);
@@ -656,7 +656,7 @@ static int reclaim_block(partition_t *part)
656 printk(KERN_NOTICE "ftl_cs: reclaim failed: no " 656 printk(KERN_NOTICE "ftl_cs: reclaim failed: no "
657 "suitable transfer units!\n"); 657 "suitable transfer units!\n");
658 else 658 else
659 DEBUG(1, "ftl_cs: reclaim failed: no " 659 pr_debug("ftl_cs: reclaim failed: no "
660 "suitable transfer units!\n"); 660 "suitable transfer units!\n");
661 661
662 return -EIO; 662 return -EIO;
@@ -666,7 +666,7 @@ static int reclaim_block(partition_t *part)
666 666
667 eun = 0; 667 eun = 0;
668 if ((jiffies % shuffle_freq) == 0) { 668 if ((jiffies % shuffle_freq) == 0) {
669 DEBUG(1, "ftl_cs: recycling freshest block...\n"); 669 pr_debug("ftl_cs: recycling freshest block...\n");
670 best = 0xffffffff; 670 best = 0xffffffff;
671 for (i = 0; i < part->DataUnits; i++) 671 for (i = 0; i < part->DataUnits; i++)
672 if (part->EUNInfo[i].EraseCount <= best) { 672 if (part->EUNInfo[i].EraseCount <= best) {
@@ -686,7 +686,7 @@ static int reclaim_block(partition_t *part)
686 printk(KERN_NOTICE "ftl_cs: reclaim failed: " 686 printk(KERN_NOTICE "ftl_cs: reclaim failed: "
687 "no free blocks!\n"); 687 "no free blocks!\n");
688 else 688 else
689 DEBUG(1,"ftl_cs: reclaim failed: " 689 pr_debug("ftl_cs: reclaim failed: "
690 "no free blocks!\n"); 690 "no free blocks!\n");
691 691
692 return -EIO; 692 return -EIO;
@@ -771,7 +771,7 @@ static uint32_t find_free(partition_t *part)
771 printk(KERN_NOTICE "ftl_cs: bad free list!\n"); 771 printk(KERN_NOTICE "ftl_cs: bad free list!\n");
772 return 0; 772 return 0;
773 } 773 }
774 DEBUG(2, "ftl_cs: found free block at %d in %d\n", blk, eun); 774 pr_debug("ftl_cs: found free block at %d in %d\n", blk, eun);
775 return blk; 775 return blk;
776 776
777} /* find_free */ 777} /* find_free */
@@ -791,7 +791,7 @@ static int ftl_read(partition_t *part, caddr_t buffer,
791 int ret; 791 int ret;
792 size_t offset, retlen; 792 size_t offset, retlen;
793 793
794 DEBUG(2, "ftl_cs: ftl_read(0x%p, 0x%lx, %ld)\n", 794 pr_debug("ftl_cs: ftl_read(0x%p, 0x%lx, %ld)\n",
795 part, sector, nblocks); 795 part, sector, nblocks);
796 if (!(part->state & FTL_FORMATTED)) { 796 if (!(part->state & FTL_FORMATTED)) {
797 printk(KERN_NOTICE "ftl_cs: bad partition\n"); 797 printk(KERN_NOTICE "ftl_cs: bad partition\n");
@@ -840,7 +840,7 @@ static int set_bam_entry(partition_t *part, uint32_t log_addr,
840 int ret; 840 int ret;
841 size_t retlen, offset; 841 size_t retlen, offset;
842 842
843 DEBUG(2, "ftl_cs: set_bam_entry(0x%p, 0x%x, 0x%x)\n", 843 pr_debug("ftl_cs: set_bam_entry(0x%p, 0x%x, 0x%x)\n",
844 part, log_addr, virt_addr); 844 part, log_addr, virt_addr);
845 bsize = 1 << part->header.EraseUnitSize; 845 bsize = 1 << part->header.EraseUnitSize;
846 eun = log_addr / bsize; 846 eun = log_addr / bsize;
@@ -905,7 +905,7 @@ static int ftl_write(partition_t *part, caddr_t buffer,
905 int ret; 905 int ret;
906 size_t retlen, offset; 906 size_t retlen, offset;
907 907
908 DEBUG(2, "ftl_cs: ftl_write(0x%p, %ld, %ld)\n", 908 pr_debug("ftl_cs: ftl_write(0x%p, %ld, %ld)\n",
909 part, sector, nblocks); 909 part, sector, nblocks);
910 if (!(part->state & FTL_FORMATTED)) { 910 if (!(part->state & FTL_FORMATTED)) {
911 printk(KERN_NOTICE "ftl_cs: bad partition\n"); 911 printk(KERN_NOTICE "ftl_cs: bad partition\n");
@@ -1011,7 +1011,7 @@ static int ftl_discardsect(struct mtd_blktrans_dev *dev,
1011 partition_t *part = (void *)dev; 1011 partition_t *part = (void *)dev;
1012 uint32_t bsize = 1 << part->header.EraseUnitSize; 1012 uint32_t bsize = 1 << part->header.EraseUnitSize;
1013 1013
1014 DEBUG(1, "FTL erase sector %ld for %d sectors\n", 1014 pr_debug("FTL erase sector %ld for %d sectors\n",
1015 sector, nr_sects); 1015 sector, nr_sects);
1016 1016
1017 while (nr_sects) { 1017 while (nr_sects) {