diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-15 15:22:01 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-15 15:22:01 -0400 |
commit | 3e421d324c003f8f002f402141b15d758adbfaef (patch) | |
tree | 2c3463dc5df51276f51faee3ba43502caf48e8d7 /drivers | |
parent | 08424ac24a35b505463919a897b097f27e4dca96 (diff) |
ide-tape: always log debug info in idetape_pc_intr() if debugging is enabled
Add DBG_PC_INTR debug level and use it to always log debug info
in idetape_pc_intr() if debugging is enabled.
While at it:
* Use drive->name instead of tape->name.
* Log device name with "DMA finished" message.
This is a preparation for adding generic ide_pc_intr() helper.
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ide-tape.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 6801c68ee7da..10f2d3336286 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -56,6 +56,8 @@ enum { | |||
56 | DBG_PROCS = (1 << 3), | 56 | DBG_PROCS = (1 << 3), |
57 | /* buffer alloc info (pc_stack & rq_stack) */ | 57 | /* buffer alloc info (pc_stack & rq_stack) */ |
58 | DBG_PCRQ_STACK = (1 << 4), | 58 | DBG_PCRQ_STACK = (1 << 4), |
59 | /* IRQ handler (always log debug info if debugging is on) */ | ||
60 | DBG_PC_INTR = (1 << 5), | ||
59 | }; | 61 | }; |
60 | 62 | ||
61 | /* define to see debug info */ | 63 | /* define to see debug info */ |
@@ -64,7 +66,7 @@ enum { | |||
64 | #if IDETAPE_DEBUG_LOG | 66 | #if IDETAPE_DEBUG_LOG |
65 | #define debug_log(lvl, fmt, args...) \ | 67 | #define debug_log(lvl, fmt, args...) \ |
66 | { \ | 68 | { \ |
67 | if (tape->debug_mask & lvl) \ | 69 | if ((lvl & DBG_PC_INTR) || (tape->debug_mask & lvl)) \ |
68 | printk(KERN_INFO "ide-tape: " fmt, ## args); \ | 70 | printk(KERN_INFO "ide-tape: " fmt, ## args); \ |
69 | } | 71 | } |
70 | #else | 72 | #else |
@@ -806,7 +808,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) | |||
806 | u16 bcount; | 808 | u16 bcount; |
807 | u8 stat, ireason; | 809 | u8 stat, ireason; |
808 | 810 | ||
809 | debug_log(DBG_PROCS, "Enter %s - interrupt handler\n", __func__); | 811 | debug_log(DBG_PC_INTR, "Enter %s - interrupt handler\n", __func__); |
810 | 812 | ||
811 | /* Clear the interrupt */ | 813 | /* Clear the interrupt */ |
812 | stat = ide_read_status(drive); | 814 | stat = ide_read_status(drive); |
@@ -818,13 +820,12 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) | |||
818 | pc->xferred = pc->req_xfer; | 820 | pc->xferred = pc->req_xfer; |
819 | idetape_update_buffers(pc); | 821 | idetape_update_buffers(pc); |
820 | } | 822 | } |
821 | debug_log(DBG_PROCS, "DMA finished\n"); | 823 | debug_log(DBG_PC_INTR, "%s: DMA finished\n", drive->name); |
822 | |||
823 | } | 824 | } |
824 | 825 | ||
825 | /* No more interrupts */ | 826 | /* No more interrupts */ |
826 | if ((stat & DRQ_STAT) == 0) { | 827 | if ((stat & DRQ_STAT) == 0) { |
827 | debug_log(DBG_SENSE, "Packet command completed, %d bytes" | 828 | debug_log(DBG_PC_INTR, "Packet command completed, %d bytes" |
828 | " transferred\n", pc->xferred); | 829 | " transferred\n", pc->xferred); |
829 | 830 | ||
830 | pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS; | 831 | pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS; |
@@ -834,14 +835,14 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) | |||
834 | stat &= ~ERR_STAT; | 835 | stat &= ~ERR_STAT; |
835 | if ((stat & ERR_STAT) || (pc->flags & PC_FLAG_DMA_ERROR)) { | 836 | if ((stat & ERR_STAT) || (pc->flags & PC_FLAG_DMA_ERROR)) { |
836 | /* Error detected */ | 837 | /* Error detected */ |
837 | debug_log(DBG_ERR, "%s: I/O error\n", tape->name); | 838 | debug_log(DBG_PC_INTR, "%s: I/O error\n", drive->name); |
838 | 839 | ||
839 | if (pc->c[0] == REQUEST_SENSE) { | 840 | if (pc->c[0] == REQUEST_SENSE) { |
840 | printk(KERN_ERR "%s: I/O error in request sense" | 841 | printk(KERN_ERR "%s: I/O error in request sense" |
841 | " command\n", drive->name); | 842 | " command\n", drive->name); |
842 | return ide_do_reset(drive); | 843 | return ide_do_reset(drive); |
843 | } | 844 | } |
844 | debug_log(DBG_ERR, "[cmd %x]: check condition\n", | 845 | debug_log(DBG_PC_INTR, "[cmd %x]: check condition\n", |
845 | pc->c[0]); | 846 | pc->c[0]); |
846 | 847 | ||
847 | /* Retry operation */ | 848 | /* Retry operation */ |
@@ -898,7 +899,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) | |||
898 | IDETAPE_WAIT_CMD, NULL); | 899 | IDETAPE_WAIT_CMD, NULL); |
899 | return ide_started; | 900 | return ide_started; |
900 | } | 901 | } |
901 | debug_log(DBG_SENSE, "The device wants to send us more " | 902 | debug_log(DBG_PC_INTR, "The device wants to send us more " |
902 | "data than expected - allowing transfer\n"); | 903 | "data than expected - allowing transfer\n"); |
903 | } | 904 | } |
904 | xferfunc = hwif->input_data; | 905 | xferfunc = hwif->input_data; |
@@ -916,7 +917,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) | |||
916 | pc->xferred += bcount; | 917 | pc->xferred += bcount; |
917 | pc->cur_pos += bcount; | 918 | pc->cur_pos += bcount; |
918 | 919 | ||
919 | debug_log(DBG_SENSE, "[cmd %x] transferred %d bytes on that intr.\n", | 920 | debug_log(DBG_PC_INTR, "[cmd %x] transferred %d bytes on that intr.\n", |
920 | pc->c[0], bcount); | 921 | pc->c[0], bcount); |
921 | 922 | ||
922 | /* And set the interrupt handler again */ | 923 | /* And set the interrupt handler again */ |