ide-{floppy,tape,scsi}: log device name instead of driver name

Log device name instead of driver name in *_pc_intr() and *_transfer_pc*().

While at it:

* Merge two consecutive printk()-s in *_pc_intr() together.

* Replace "floppy"/"tape"/"scsi" references in printk()-s by "device".

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 0b2eea4c
...@@ -438,8 +438,8 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) ...@@ -438,8 +438,8 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)
debug_log("%s: I/O error\n", drive->name); debug_log("%s: I/O error\n", drive->name);
rq->errors++; rq->errors++;
if (pc->c[0] == GPCMD_REQUEST_SENSE) { if (pc->c[0] == GPCMD_REQUEST_SENSE) {
printk(KERN_ERR "ide-floppy: I/O error in " printk(KERN_ERR "%s: I/O error in request sense"
"request sense command\n"); " command\n", drive->name);
return ide_do_reset(drive); return ide_do_reset(drive);
} }
/* Retry operation */ /* Retry operation */
...@@ -457,8 +457,8 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) ...@@ -457,8 +457,8 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)
if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS; pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
printk(KERN_ERR "ide-floppy: The floppy wants to issue " printk(KERN_ERR "%s: The device wants to issue more interrupts "
"more interrupts in DMA mode\n"); "in DMA mode\n", drive->name);
ide_dma_off(drive); ide_dma_off(drive);
return ide_do_reset(drive); return ide_do_reset(drive);
} }
...@@ -470,14 +470,14 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) ...@@ -470,14 +470,14 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)
ireason = hwif->INB(hwif->io_ports.nsect_addr); ireason = hwif->INB(hwif->io_ports.nsect_addr);
if (ireason & CD) { if (ireason & CD) {
printk(KERN_ERR "ide-floppy: CoD != 0 in %s\n", __func__); printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__);
return ide_do_reset(drive); return ide_do_reset(drive);
} }
if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) { if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) {
/* Hopefully, we will never get here */ /* Hopefully, we will never get here */
printk(KERN_ERR "ide-floppy: We wanted to %s, ", printk(KERN_ERR "%s: We wanted to %s, but the device wants us "
(ireason & IO) ? "Write" : "Read"); "to %s!\n", drive->name,
printk(KERN_ERR "but the floppy wants us to %s !\n", (ireason & IO) ? "Write" : "Read",
(ireason & IO) ? "Read" : "Write"); (ireason & IO) ? "Read" : "Write");
return ide_do_reset(drive); return ide_do_reset(drive);
} }
...@@ -486,9 +486,10 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) ...@@ -486,9 +486,10 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)
temp = pc->xferred + bcount; temp = pc->xferred + bcount;
if (temp > pc->req_xfer) { if (temp > pc->req_xfer) {
if (temp > pc->buf_size) { if (temp > pc->buf_size) {
printk(KERN_ERR "ide-floppy: The floppy wants " printk(KERN_ERR "%s: The device wants to send "
"to send us more data than expected " "us more data than expected - "
"- discarding data\n"); "discarding data\n",
drive->name);
ide_pad_transfer(drive, 0, bcount); ide_pad_transfer(drive, 0, bcount);
ide_set_handler(drive, ide_set_handler(drive,
...@@ -497,8 +498,8 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) ...@@ -497,8 +498,8 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)
NULL); NULL);
return ide_started; return ide_started;
} }
debug_log("The floppy wants to send us more data than" debug_log("The device wants to send us more data than "
" expected - allowing transfer\n"); "expected - allowing transfer\n");
} }
} }
if (pc->flags & PC_FLAG_WRITING) if (pc->flags & PC_FLAG_WRITING)
...@@ -552,14 +553,14 @@ static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t *drive) ...@@ -552,14 +553,14 @@ static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t *drive)
u8 ireason; u8 ireason;
if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) { if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) {
printk(KERN_ERR "ide-floppy: Strange, packet command " printk(KERN_ERR "%s: Strange, packet command initiated yet "
"initiated yet DRQ isn't asserted\n"); "DRQ isn't asserted\n", drive->name);
return startstop; return startstop;
} }
ireason = hwif->INB(hwif->io_ports.nsect_addr); ireason = hwif->INB(hwif->io_ports.nsect_addr);
if ((ireason & CD) == 0 || (ireason & IO)) { if ((ireason & CD) == 0 || (ireason & IO)) {
printk(KERN_ERR "ide-floppy: (IO,CoD) != (0,1) " printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing "
"while issuing a packet command\n"); "a packet command\n", drive->name);
return ide_do_reset(drive); return ide_do_reset(drive);
} }
/* /*
......
...@@ -776,8 +776,8 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) ...@@ -776,8 +776,8 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
debug_log(DBG_ERR, "%s: I/O error\n", tape->name); debug_log(DBG_ERR, "%s: I/O error\n", tape->name);
if (pc->c[0] == REQUEST_SENSE) { if (pc->c[0] == REQUEST_SENSE) {
printk(KERN_ERR "ide-tape: I/O error in request" printk(KERN_ERR "%s: I/O error in request sense"
" sense command\n"); " command\n", drive->name);
return ide_do_reset(drive); return ide_do_reset(drive);
} }
debug_log(DBG_ERR, "[cmd %x]: check condition\n", debug_log(DBG_ERR, "[cmd %x]: check condition\n",
...@@ -805,8 +805,8 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) ...@@ -805,8 +805,8 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS; pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
printk(KERN_ERR "ide-tape: The tape wants to issue more " printk(KERN_ERR "%s: The device wants to issue more interrupts "
"interrupts in DMA mode\n"); "in DMA mode\n", drive->name);
ide_dma_off(drive); ide_dma_off(drive);
return ide_do_reset(drive); return ide_do_reset(drive);
} }
...@@ -817,14 +817,14 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) ...@@ -817,14 +817,14 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
ireason = hwif->INB(hwif->io_ports.nsect_addr); ireason = hwif->INB(hwif->io_ports.nsect_addr);
if (ireason & CD) { if (ireason & CD) {
printk(KERN_ERR "ide-tape: CoD != 0 in %s\n", __func__); printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__);
return ide_do_reset(drive); return ide_do_reset(drive);
} }
if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) { if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) {
/* Hopefully, we will never get here */ /* Hopefully, we will never get here */
printk(KERN_ERR "ide-tape: We wanted to %s, ", printk(KERN_ERR "%s: We wanted to %s, but the device wants us "
(ireason & IO) ? "Write" : "Read"); "to %s!\n", drive->name,
printk(KERN_ERR "ide-tape: but the tape wants us to %s !\n", (ireason & IO) ? "Write" : "Read",
(ireason & IO) ? "Read" : "Write"); (ireason & IO) ? "Read" : "Write");
return ide_do_reset(drive); return ide_do_reset(drive);
} }
...@@ -833,15 +833,16 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) ...@@ -833,15 +833,16 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
temp = pc->xferred + bcount; temp = pc->xferred + bcount;
if (temp > pc->req_xfer) { if (temp > pc->req_xfer) {
if (temp > pc->buf_size) { if (temp > pc->buf_size) {
printk(KERN_ERR "ide-tape: The tape wants to " printk(KERN_ERR "%s: The device wants to send "
"send us more data than expected " "us more data than expected - "
"- discarding data\n"); "discarding data\n",
drive->name);
ide_pad_transfer(drive, 0, bcount); ide_pad_transfer(drive, 0, bcount);
ide_set_handler(drive, &idetape_pc_intr, ide_set_handler(drive, &idetape_pc_intr,
IDETAPE_WAIT_CMD, NULL); IDETAPE_WAIT_CMD, NULL);
return ide_started; return ide_started;
} }
debug_log(DBG_SENSE, "The tape wants to send us more " debug_log(DBG_SENSE, "The device wants to send us more "
"data than expected - allowing transfer\n"); "data than expected - allowing transfer\n");
} }
iobuf = &idetape_input_buffers; iobuf = &idetape_input_buffers;
...@@ -914,26 +915,27 @@ static ide_startstop_t idetape_transfer_pc(ide_drive_t *drive) ...@@ -914,26 +915,27 @@ static ide_startstop_t idetape_transfer_pc(ide_drive_t *drive)
u8 ireason; u8 ireason;
if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) { if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) {
printk(KERN_ERR "ide-tape: Strange, packet command initiated " printk(KERN_ERR "%s: Strange, packet command initiated yet "
"yet DRQ isn't asserted\n"); "DRQ isn't asserted\n", drive->name);
return startstop; return startstop;
} }
ireason = hwif->INB(hwif->io_ports.nsect_addr); ireason = hwif->INB(hwif->io_ports.nsect_addr);
while (retries-- && ((ireason & CD) == 0 || (ireason & IO))) { while (retries-- && ((ireason & CD) == 0 || (ireason & IO))) {
printk(KERN_ERR "ide-tape: (IO,CoD != (0,1) while issuing " printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing "
"a packet command, retrying\n"); "a packet command, retrying\n", drive->name);
udelay(100); udelay(100);
ireason = hwif->INB(hwif->io_ports.nsect_addr); ireason = hwif->INB(hwif->io_ports.nsect_addr);
if (retries == 0) { if (retries == 0) {
printk(KERN_ERR "ide-tape: (IO,CoD != (0,1) while " printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing "
"issuing a packet command, ignoring\n"); "a packet command, ignoring\n",
drive->name);
ireason |= CD; ireason |= CD;
ireason &= ~IO; ireason &= ~IO;
} }
} }
if ((ireason & CD) == 0 || (ireason & IO)) { if ((ireason & CD) == 0 || (ireason & IO)) {
printk(KERN_ERR "ide-tape: (IO,CoD) != (0,1) while issuing " printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing "
"a packet command\n"); "a packet command\n", drive->name);
return ide_do_reset(drive); return ide_do_reset(drive);
} }
/* Set the interrupt routine */ /* Set the interrupt routine */
......
...@@ -391,7 +391,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) ...@@ -391,7 +391,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
ireason = hwif->INB(hwif->io_ports.nsect_addr); ireason = hwif->INB(hwif->io_ports.nsect_addr);
if (ireason & CD) { if (ireason & CD) {
printk(KERN_ERR "ide-scsi: CoD != 0 in idescsi_pc_intr\n"); printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__);
return ide_do_reset (drive); return ide_do_reset (drive);
} }
if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) { if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) {
...@@ -406,9 +406,10 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) ...@@ -406,9 +406,10 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
temp = pc->xferred + bcount; temp = pc->xferred + bcount;
if (temp > pc->req_xfer) { if (temp > pc->req_xfer) {
if (temp > pc->buf_size) { if (temp > pc->buf_size) {
printk(KERN_ERR "ide-scsi: The scsi wants to " printk(KERN_ERR "%s: The device wants to send "
"send us more data than expected " "us more data than expected - "
"- discarding data\n"); "discarding data\n",
drive->name);
temp = pc->buf_size - pc->xferred; temp = pc->buf_size - pc->xferred;
if (temp) { if (temp) {
if (pc->sg) if (pc->sg)
...@@ -417,8 +418,9 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) ...@@ -417,8 +418,9 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
else else
hwif->input_data(drive, NULL, hwif->input_data(drive, NULL,
pc->cur_pos, temp); pc->cur_pos, temp);
printk(KERN_ERR "ide-scsi: transferred" printk(KERN_ERR "%s: transferred %d of "
" %d of %d bytes\n", "%d bytes\n",
drive->name,
temp, bcount); temp, bcount);
} }
pc->xferred += temp; pc->xferred += temp;
...@@ -427,7 +429,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) ...@@ -427,7 +429,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry); ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry);
return ide_started; return ide_started;
} }
debug_log("The scsi wants to send us more data than " debug_log("The device wants to send us more data than "
"expected - allowing transfer\n"); "expected - allowing transfer\n");
} }
xferfunc = hwif->input_data; xferfunc = hwif->input_data;
...@@ -458,14 +460,14 @@ static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive) ...@@ -458,14 +460,14 @@ static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive)
u8 ireason; u8 ireason;
if (ide_wait_stat(&startstop,drive,DRQ_STAT,BUSY_STAT,WAIT_READY)) { if (ide_wait_stat(&startstop,drive,DRQ_STAT,BUSY_STAT,WAIT_READY)) {
printk(KERN_ERR "ide-scsi: Strange, packet command " printk(KERN_ERR "%s: Strange, packet command initiated yet "
"initiated yet DRQ isn't asserted\n"); "DRQ isn't asserted\n", drive->name);
return startstop; return startstop;
} }
ireason = hwif->INB(hwif->io_ports.nsect_addr); ireason = hwif->INB(hwif->io_ports.nsect_addr);
if ((ireason & CD) == 0 || (ireason & IO)) { if ((ireason & CD) == 0 || (ireason & IO)) {
printk(KERN_ERR "ide-scsi: (IO,CoD) != (0,1) while " printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing "
"issuing a packet command\n"); "a packet command\n", drive->name);
return ide_do_reset (drive); return ide_do_reset (drive);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment