[PATCH 38/40] ide-scsi: add more debugging to idescsi_pc_intr()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-ide@...>
Cc: Borislav Petkov <petkovbb@...>, Bartlomiej Zolnierkiewicz <bzolnier@...>, <linux-kernel@...>
Date: Sunday, May 18, 2008 - 3:00 pm

Add more debugging to idescsi_pc_intr() to match ide-tape's
idetape_pc_intr().

While at it:

* Correct the first debug 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>
---
 drivers/scsi/ide-scsi.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Index: b/drivers/scsi/ide-scsi.c
===================================================================
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -364,7 +364,7 @@ static ide_startstop_t idescsi_pc_intr (
 	u16 bcount;
 	u8 stat, ireason;
 
-	debug_log("Reached %s interrupt handler\n", __func__);
+	debug_log("Enter %s - interrupt handler\n", __func__);
 
 	if (pc->flags & PC_FLAG_TIMEDOUT) {
 		pc->callback(drive);
@@ -383,10 +383,16 @@ static ide_startstop_t idescsi_pc_intr (
 
 	if ((stat & DRQ_STAT) == 0) {
 		/* No more interrupts */
+		debug_log("Packet command completed, %d bytes transferred\n",
+			  pc->xferred);
 		pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
 		local_irq_enable_in_hardirq();
-		if ((stat & ERR_STAT) || (pc->flags & PC_FLAG_DMA_ERROR))
+		if ((stat & ERR_STAT) || (pc->flags & PC_FLAG_DMA_ERROR)) {
+			/* Error detected */
+			debug_log("%s: I/O error\n", drive->name);
+
 			rq->errors++;
+		}
 		pc->callback(drive);
 		return ide_stopped;
 	}
@@ -457,6 +463,9 @@ static ide_startstop_t idescsi_pc_intr (
 	pc->xferred += bcount;
 	pc->cur_pos += bcount;
 
+	debug_log("[cmd %x] transferred %d bytes on that intr.\n",
+		  pc->c[0], bcount);
+
 	/* And set the interrupt handler again */
 	ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry);
 	return ide_started;
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/40] ide: generic ATAPI support, Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:54 pm)
Re: [PATCH 00/40] ide: generic ATAPI support, Borislav Petkov, (Thu May 22, 3:43 am)
Re: [PATCH 00/40] ide: generic ATAPI support, Bartlomiej Zolnierkiewicz..., (Sun May 25, 9:23 am)
[PATCH 40/40] ide: add ide_pc_intr() helper, Bartlomiej Zolnierkiewicz..., (Sun May 18, 3:00 pm)
[PATCH 39/40] ide-{floppy,scsi}: read Status Register before..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 3:00 pm)
[PATCH 38/40] ide-scsi: add more debugging to idescsi_pc_int..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 3:00 pm)
[PATCH 37/40] ide-scsi: use pc-&gt;callback, Bartlomiej Zolnierkiewicz..., (Sun May 18, 3:00 pm)
[PATCH 36/40] ide-floppy: add more debugging to idefloppy_pc..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:59 pm)
[PATCH 35/40] ide-tape: always log debug info in idetape_pc_..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:59 pm)
[PATCH 34/40] ide-tape: add ide_tape_io_buffers() helper, Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:59 pm)
[PATCH 33/40] ide-tape: factor out DSC handling from idetape..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:59 pm)
[PATCH 32/40] ide-{floppy,tape}: move checking of -&gt;faile..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:59 pm)
[PATCH 31/40] ide: add ide_issue_pc() helper, Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:59 pm)
[PATCH 30/40] ide: add PC_FLAG_DRQ_INTERRUPT pc flag, Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:58 pm)
[PATCH 29/40] ide-scsi: move idescsi_map_sg() call out from ..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:58 pm)
[PATCH 28/40] ide: add ide_transfer_pc() helper, Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:58 pm)
[PATCH 27/40] ide-scsi: set drive-&gt;scsi flag for devices ..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:58 pm)
[PATCH 26/40] ide-{cd,floppy,tape}: remove checking for driv..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:58 pm)
[PATCH 25/40] ide: add PC_FLAG_ZIP_DRIVE pc flag, Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:58 pm)
[PATCH 24/40] ide-tape: factor out waiting for good ireason ..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:58 pm)
[PATCH 23/40] ide-tape: set PC_FLAG_DMA_IN_PROGRESS flag in ..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:57 pm)
[PATCH 22/40] ide-floppy: start DMA engine in idefloppy_tran..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:57 pm)
Re: [PATCH 22/40] ide-floppy: start DMA engine in idefloppy_..., Bartlomiej Zolnierkiewicz..., (Tue May 27, 2:58 pm)
[PATCH 21/40] ide-{floppy,tape}: PC_FLAG_DMA_RECOMMENDED -&g..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:57 pm)
[PATCH 20/40] ide-{floppy,tape}: merge pc-&gt;idefloppy_call..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:57 pm)
[PATCH 19/40] ide-floppy: merge callbacks, Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:57 pm)
[PATCH 18/40] ide-tape: make pc-&gt;idetape_callback void, Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:57 pm)
[PATCH 17/40] ide-tape: merge callbacks, Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:57 pm)
[PATCH 16/40] ide-tape: make idetape_retry_pc() void, Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:56 pm)
[PATCH 15/40] ide-{floppy,tape,scsi}: log device name instea..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:56 pm)
[PATCH 14/40] ide-floppy: merge idefloppy_transfer_pc() and ..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:56 pm)
Re: [PATCH 14/40] ide-floppy: merge idefloppy_transfer_pc() ..., Bartlomiej Zolnierkiewicz..., (Tue May 27, 2:57 pm)
Re: [PATCH 14/40] ide-floppy: merge idefloppy_transfer_pc() ..., Bartlomiej Zolnierkiewicz..., (Thu May 29, 7:01 pm)
[PATCH 13/40] ide-tape: remove SIMULATE_ERRORS debug code, Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:56 pm)
[PATCH 12/40] ide-tape: remove stale comments from idetape_p..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:56 pm)
[PATCH 11/40] ide-tape: remove unneeded CONFIG_BLK_DEV_IDEDM..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:56 pm)
[PATCH 10/40] ide-tape: remove superfluous warning message f..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:55 pm)
[PATCH 09/40] ide-tape: remove superfluous error message fro..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:55 pm)
[PATCH 08/40] ide-tape: idetape_pc_intr() should use local_i..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:55 pm)
[PATCH 07/40] ide-scsi: add debug_log() macro, Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:55 pm)
[PATCH 06/40] ide-scsi: remove superfluous BUG_ON() from ide..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:55 pm)
[PATCH 05/40] ide-scsi: merge idescsi_input_buffers() and id..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:55 pm)
[PATCH 04/40] ide-scsi: fix Interrupt Reason checking in ide..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:55 pm)
Re: [PATCH 04/40] ide-scsi: fix Interrupt Reason checking in..., Bartlomiej Zolnierkiewicz..., (Tue May 27, 2:30 pm)
[PATCH 03/40] ide-scsi: fix handling of DMA errors in idescs..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:54 pm)
[PATCH 02/40] ide-scsi: fix DRQ checking for DMA transfers i..., Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:54 pm)
[PATCH 01/40] ide-scsi: fix race in idescsi_transfer_pc(), Bartlomiej Zolnierkiewicz..., (Sun May 18, 2:54 pm)