aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2014-11-24 09:37:21 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-24 10:10:23 -0500
commita1a75b35fc47dede004fb579f86bf1ac12e2bff5 (patch)
treec93dd6b7b3dc29e6d8d9d90c95742239205dfc7c
parent3707a186c8970e3c4f3c8d9ccf4230b8657e919f (diff)
esp_scsi: convert to dev_printk
Use dev_printk functions for correct device annotations. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/scsi/esp_scsi.c212
1 files changed, 106 insertions, 106 deletions
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c
index 57ccb147b22b..d85f2392c6ae 100644
--- a/drivers/scsi/esp_scsi.c
+++ b/drivers/scsi/esp_scsi.c
@@ -52,52 +52,52 @@ static u32 esp_debug;
52 52
53#define esp_log_intr(f, a...) \ 53#define esp_log_intr(f, a...) \
54do { if (esp_debug & ESP_DEBUG_INTR) \ 54do { if (esp_debug & ESP_DEBUG_INTR) \
55 printk(f, ## a); \ 55 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
56} while (0) 56} while (0)
57 57
58#define esp_log_reset(f, a...) \ 58#define esp_log_reset(f, a...) \
59do { if (esp_debug & ESP_DEBUG_RESET) \ 59do { if (esp_debug & ESP_DEBUG_RESET) \
60 printk(f, ## a); \ 60 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
61} while (0) 61} while (0)
62 62
63#define esp_log_msgin(f, a...) \ 63#define esp_log_msgin(f, a...) \
64do { if (esp_debug & ESP_DEBUG_MSGIN) \ 64do { if (esp_debug & ESP_DEBUG_MSGIN) \
65 printk(f, ## a); \ 65 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
66} while (0) 66} while (0)
67 67
68#define esp_log_msgout(f, a...) \ 68#define esp_log_msgout(f, a...) \
69do { if (esp_debug & ESP_DEBUG_MSGOUT) \ 69do { if (esp_debug & ESP_DEBUG_MSGOUT) \
70 printk(f, ## a); \ 70 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
71} while (0) 71} while (0)
72 72
73#define esp_log_cmddone(f, a...) \ 73#define esp_log_cmddone(f, a...) \
74do { if (esp_debug & ESP_DEBUG_CMDDONE) \ 74do { if (esp_debug & ESP_DEBUG_CMDDONE) \
75 printk(f, ## a); \ 75 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
76} while (0) 76} while (0)
77 77
78#define esp_log_disconnect(f, a...) \ 78#define esp_log_disconnect(f, a...) \
79do { if (esp_debug & ESP_DEBUG_DISCONNECT) \ 79do { if (esp_debug & ESP_DEBUG_DISCONNECT) \
80 printk(f, ## a); \ 80 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
81} while (0) 81} while (0)
82 82
83#define esp_log_datastart(f, a...) \ 83#define esp_log_datastart(f, a...) \
84do { if (esp_debug & ESP_DEBUG_DATASTART) \ 84do { if (esp_debug & ESP_DEBUG_DATASTART) \
85 printk(f, ## a); \ 85 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
86} while (0) 86} while (0)
87 87
88#define esp_log_datadone(f, a...) \ 88#define esp_log_datadone(f, a...) \
89do { if (esp_debug & ESP_DEBUG_DATADONE) \ 89do { if (esp_debug & ESP_DEBUG_DATADONE) \
90 printk(f, ## a); \ 90 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
91} while (0) 91} while (0)
92 92
93#define esp_log_reconnect(f, a...) \ 93#define esp_log_reconnect(f, a...) \
94do { if (esp_debug & ESP_DEBUG_RECONNECT) \ 94do { if (esp_debug & ESP_DEBUG_RECONNECT) \
95 printk(f, ## a); \ 95 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
96} while (0) 96} while (0)
97 97
98#define esp_log_autosense(f, a...) \ 98#define esp_log_autosense(f, a...) \
99do { if (esp_debug & ESP_DEBUG_AUTOSENSE) \ 99do { if (esp_debug & ESP_DEBUG_AUTOSENSE) \
100 printk(f, ## a); \ 100 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
101} while (0) 101} while (0)
102 102
103#define esp_read8(REG) esp->ops->esp_read8(esp, REG) 103#define esp_read8(REG) esp->ops->esp_read8(esp, REG)
@@ -150,19 +150,17 @@ static void esp_dump_cmd_log(struct esp *esp)
150 int idx = esp->esp_event_cur; 150 int idx = esp->esp_event_cur;
151 int stop = idx; 151 int stop = idx;
152 152
153 printk(KERN_INFO PFX "esp%d: Dumping command log\n", 153 shost_printk(KERN_INFO, esp->host, "Dumping command log\n");
154 esp->host->unique_id);
155 do { 154 do {
156 struct esp_event_ent *p = &esp->esp_event_log[idx]; 155 struct esp_event_ent *p = &esp->esp_event_log[idx];
157 156
158 printk(KERN_INFO PFX "esp%d: ent[%d] %s ", 157 shost_printk(KERN_INFO, esp->host,
159 esp->host->unique_id, idx, 158 "ent[%d] %s val[%02x] sreg[%02x] seqreg[%02x] "
160 p->type == ESP_EVENT_TYPE_CMD ? "CMD" : "EVENT"); 159 "sreg2[%02x] ireg[%02x] ss[%02x] event[%02x]\n",
161 160 idx,
162 printk("val[%02x] sreg[%02x] seqreg[%02x] " 161 p->type == ESP_EVENT_TYPE_CMD ? "CMD" : "EVENT",
163 "sreg2[%02x] ireg[%02x] ss[%02x] event[%02x]\n", 162 p->val, p->sreg, p->seqreg,
164 p->val, p->sreg, p->seqreg, 163 p->sreg2, p->ireg, p->select_state, p->event);
165 p->sreg2, p->ireg, p->select_state, p->event);
166 164
167 idx = (idx + 1) & (ESP_EVENT_LOG_SZ - 1); 165 idx = (idx + 1) & (ESP_EVENT_LOG_SZ - 1);
168 } while (idx != stop); 166 } while (idx != stop);
@@ -176,9 +174,8 @@ static void esp_flush_fifo(struct esp *esp)
176 174
177 while (esp_read8(ESP_FFLAGS) & ESP_FF_FBYTES) { 175 while (esp_read8(ESP_FFLAGS) & ESP_FF_FBYTES) {
178 if (--lim == 0) { 176 if (--lim == 0) {
179 printk(KERN_ALERT PFX "esp%d: ESP_FF_BYTES " 177 shost_printk(KERN_ALERT, esp->host,
180 "will not clear!\n", 178 "ESP_FF_BYTES will not clear!\n");
181 esp->host->unique_id);
182 break; 179 break;
183 } 180 }
184 udelay(1); 181 udelay(1);
@@ -383,12 +380,11 @@ static void esp_advance_dma(struct esp *esp, struct esp_cmd_entry *ent,
383 p->cur_residue -= len; 380 p->cur_residue -= len;
384 p->tot_residue -= len; 381 p->tot_residue -= len;
385 if (p->cur_residue < 0 || p->tot_residue < 0) { 382 if (p->cur_residue < 0 || p->tot_residue < 0) {
386 printk(KERN_ERR PFX "esp%d: Data transfer overflow.\n", 383 shost_printk(KERN_ERR, esp->host,
387 esp->host->unique_id); 384 "Data transfer overflow.\n");
388 printk(KERN_ERR PFX "esp%d: cur_residue[%d] tot_residue[%d] " 385 shost_printk(KERN_ERR, esp->host,
389 "len[%u]\n", 386 "cur_residue[%d] tot_residue[%d] len[%u]\n",
390 esp->host->unique_id, 387 p->cur_residue, p->tot_residue, len);
391 p->cur_residue, p->tot_residue, len);
392 p->cur_residue = 0; 388 p->cur_residue = 0;
393 p->tot_residue = 0; 389 p->tot_residue = 0;
394 } 390 }
@@ -604,9 +600,8 @@ static void esp_autosense(struct esp *esp, struct esp_cmd_entry *ent)
604 600
605 601
606 if (!ent->sense_ptr) { 602 if (!ent->sense_ptr) {
607 esp_log_autosense("esp%d: Doing auto-sense for " 603 esp_log_autosense("Doing auto-sense for tgt[%d] lun[%d]\n",
608 "tgt[%d] lun[%d]\n", 604 tgt, lun);
609 esp->host->unique_id, tgt, lun);
610 605
611 ent->sense_ptr = cmd->sense_buffer; 606 ent->sense_ptr = cmd->sense_buffer;
612 ent->sense_dma = esp->ops->map_single(esp, 607 ent->sense_dma = esp->ops->map_single(esp,
@@ -953,8 +948,8 @@ static int esp_check_gross_error(struct esp *esp)
953 * - DMA programmed with wrong direction 948 * - DMA programmed with wrong direction
954 * - improper phase change 949 * - improper phase change
955 */ 950 */
956 printk(KERN_ERR PFX "esp%d: Gross error sreg[%02x]\n", 951 shost_printk(KERN_ERR, esp->host,
957 esp->host->unique_id, esp->sreg); 952 "Gross error sreg[%02x]\n", esp->sreg);
958 /* XXX Reset the chip. XXX */ 953 /* XXX Reset the chip. XXX */
959 return 1; 954 return 1;
960 } 955 }
@@ -982,14 +977,13 @@ static int esp_check_spur_intr(struct esp *esp)
982 * ESP is not, the only possibility is a DMA error. 977 * ESP is not, the only possibility is a DMA error.
983 */ 978 */
984 if (!esp->ops->dma_error(esp)) { 979 if (!esp->ops->dma_error(esp)) {
985 printk(KERN_ERR PFX "esp%d: Spurious irq, " 980 shost_printk(KERN_ERR, esp->host,
986 "sreg=%02x.\n", 981 "Spurious irq, sreg=%02x.\n",
987 esp->host->unique_id, esp->sreg); 982 esp->sreg);
988 return -1; 983 return -1;
989 } 984 }
990 985
991 printk(KERN_ERR PFX "esp%d: DMA error\n", 986 shost_printk(KERN_ERR, esp->host, "DMA error\n");
992 esp->host->unique_id);
993 987
994 /* XXX Reset the chip. XXX */ 988 /* XXX Reset the chip. XXX */
995 return -1; 989 return -1;
@@ -1002,7 +996,7 @@ static int esp_check_spur_intr(struct esp *esp)
1002 996
1003static void esp_schedule_reset(struct esp *esp) 997static void esp_schedule_reset(struct esp *esp)
1004{ 998{
1005 esp_log_reset("ESP: esp_schedule_reset() from %pf\n", 999 esp_log_reset("esp_schedule_reset() from %pf\n",
1006 __builtin_return_address(0)); 1000 __builtin_return_address(0));
1007 esp->flags |= ESP_FLAG_RESETTING; 1001 esp->flags |= ESP_FLAG_RESETTING;
1008 esp_event(esp, ESP_EVENT_RESET); 1002 esp_event(esp, ESP_EVENT_RESET);
@@ -1019,20 +1013,20 @@ static struct esp_cmd_entry *esp_reconnect_with_tag(struct esp *esp,
1019 int i; 1013 int i;
1020 1014
1021 if (!lp->num_tagged) { 1015 if (!lp->num_tagged) {
1022 printk(KERN_ERR PFX "esp%d: Reconnect w/num_tagged==0\n", 1016 shost_printk(KERN_ERR, esp->host,
1023 esp->host->unique_id); 1017 "Reconnect w/num_tagged==0\n");
1024 return NULL; 1018 return NULL;
1025 } 1019 }
1026 1020
1027 esp_log_reconnect("ESP: reconnect tag, "); 1021 esp_log_reconnect("reconnect tag, ");
1028 1022
1029 for (i = 0; i < ESP_QUICKIRQ_LIMIT; i++) { 1023 for (i = 0; i < ESP_QUICKIRQ_LIMIT; i++) {
1030 if (esp->ops->irq_pending(esp)) 1024 if (esp->ops->irq_pending(esp))
1031 break; 1025 break;
1032 } 1026 }
1033 if (i == ESP_QUICKIRQ_LIMIT) { 1027 if (i == ESP_QUICKIRQ_LIMIT) {
1034 printk(KERN_ERR PFX "esp%d: Reconnect IRQ1 timeout\n", 1028 shost_printk(KERN_ERR, esp->host,
1035 esp->host->unique_id); 1029 "Reconnect IRQ1 timeout\n");
1036 return NULL; 1030 return NULL;
1037 } 1031 }
1038 1032
@@ -1043,14 +1037,14 @@ static struct esp_cmd_entry *esp_reconnect_with_tag(struct esp *esp,
1043 i, esp->ireg, esp->sreg); 1037 i, esp->ireg, esp->sreg);
1044 1038
1045 if (esp->ireg & ESP_INTR_DC) { 1039 if (esp->ireg & ESP_INTR_DC) {
1046 printk(KERN_ERR PFX "esp%d: Reconnect, got disconnect.\n", 1040 shost_printk(KERN_ERR, esp->host,
1047 esp->host->unique_id); 1041 "Reconnect, got disconnect.\n");
1048 return NULL; 1042 return NULL;
1049 } 1043 }
1050 1044
1051 if ((esp->sreg & ESP_STAT_PMASK) != ESP_MIP) { 1045 if ((esp->sreg & ESP_STAT_PMASK) != ESP_MIP) {
1052 printk(KERN_ERR PFX "esp%d: Reconnect, not MIP sreg[%02x].\n", 1046 shost_printk(KERN_ERR, esp->host,
1053 esp->host->unique_id, esp->sreg); 1047 "Reconnect, not MIP sreg[%02x].\n", esp->sreg);
1054 return NULL; 1048 return NULL;
1055 } 1049 }
1056 1050
@@ -1073,8 +1067,7 @@ static struct esp_cmd_entry *esp_reconnect_with_tag(struct esp *esp,
1073 udelay(1); 1067 udelay(1);
1074 } 1068 }
1075 if (i == ESP_RESELECT_TAG_LIMIT) { 1069 if (i == ESP_RESELECT_TAG_LIMIT) {
1076 printk(KERN_ERR PFX "esp%d: Reconnect IRQ2 timeout\n", 1070 shost_printk(KERN_ERR, esp->host, "Reconnect IRQ2 timeout\n");
1077 esp->host->unique_id);
1078 return NULL; 1071 return NULL;
1079 } 1072 }
1080 esp->ops->dma_drain(esp); 1073 esp->ops->dma_drain(esp);
@@ -1087,17 +1080,17 @@ static struct esp_cmd_entry *esp_reconnect_with_tag(struct esp *esp,
1087 1080
1088 if (esp->command_block[0] < SIMPLE_QUEUE_TAG || 1081 if (esp->command_block[0] < SIMPLE_QUEUE_TAG ||
1089 esp->command_block[0] > ORDERED_QUEUE_TAG) { 1082 esp->command_block[0] > ORDERED_QUEUE_TAG) {
1090 printk(KERN_ERR PFX "esp%d: Reconnect, bad tag " 1083 shost_printk(KERN_ERR, esp->host,
1091 "type %02x.\n", 1084 "Reconnect, bad tag type %02x.\n",
1092 esp->host->unique_id, esp->command_block[0]); 1085 esp->command_block[0]);
1093 return NULL; 1086 return NULL;
1094 } 1087 }
1095 1088
1096 ent = lp->tagged_cmds[esp->command_block[1]]; 1089 ent = lp->tagged_cmds[esp->command_block[1]];
1097 if (!ent) { 1090 if (!ent) {
1098 printk(KERN_ERR PFX "esp%d: Reconnect, no entry for " 1091 shost_printk(KERN_ERR, esp->host,
1099 "tag %02x.\n", 1092 "Reconnect, no entry for tag %02x.\n",
1100 esp->host->unique_id, esp->command_block[1]); 1093 esp->command_block[1]);
1101 return NULL; 1094 return NULL;
1102 } 1095 }
1103 1096
@@ -1163,9 +1156,9 @@ static int esp_reconnect(struct esp *esp)
1163 tp = &esp->target[target]; 1156 tp = &esp->target[target];
1164 dev = __scsi_device_lookup_by_target(tp->starget, lun); 1157 dev = __scsi_device_lookup_by_target(tp->starget, lun);
1165 if (!dev) { 1158 if (!dev) {
1166 printk(KERN_ERR PFX "esp%d: Reconnect, no lp " 1159 shost_printk(KERN_ERR, esp->host,
1167 "tgt[%u] lun[%u]\n", 1160 "Reconnect, no lp tgt[%u] lun[%u]\n",
1168 esp->host->unique_id, target, lun); 1161 target, lun);
1169 goto do_reset; 1162 goto do_reset;
1170 } 1163 }
1171 lp = dev->hostdata; 1164 lp = dev->hostdata;
@@ -1291,8 +1284,8 @@ static int esp_finish_select(struct esp *esp)
1291 return 0; 1284 return 0;
1292 } 1285 }
1293 1286
1294 printk("ESP: Unexpected selection completion ireg[%x].\n", 1287 shost_printk(KERN_INFO, esp->host,
1295 esp->ireg); 1288 "Unexpected selection completion ireg[%x]\n", esp->ireg);
1296 esp_schedule_reset(esp); 1289 esp_schedule_reset(esp);
1297 return 0; 1290 return 0;
1298} 1291}
@@ -1556,8 +1549,8 @@ static void esp_msgin_extended(struct esp *esp)
1556 return; 1549 return;
1557 } 1550 }
1558 1551
1559 printk("ESP: Unexpected extended msg type %x\n", 1552 shost_printk(KERN_INFO, esp->host,
1560 esp->msg_in[2]); 1553 "Unexpected extended msg type %x\n", esp->msg_in[2]);
1561 1554
1562 esp->msg_out[0] = ABORT_TASK_SET; 1555 esp->msg_out[0] = ABORT_TASK_SET;
1563 esp->msg_out_len = 1; 1556 esp->msg_out_len = 1;
@@ -1574,7 +1567,8 @@ static int esp_msgin_process(struct esp *esp)
1574 1567
1575 if (msg0 & 0x80) { 1568 if (msg0 & 0x80) {
1576 /* Identify */ 1569 /* Identify */
1577 printk("ESP: Unexpected msgin identify\n"); 1570 shost_printk(KERN_INFO, esp->host,
1571 "Unexpected msgin identify\n");
1578 return 0; 1572 return 0;
1579 } 1573 }
1580 1574
@@ -1673,8 +1667,9 @@ again:
1673 break; 1667 break;
1674 1668
1675 default: 1669 default:
1676 printk("ESP: Unexpected phase, sreg=%02x\n", 1670 shost_printk(KERN_INFO, esp->host,
1677 esp->sreg); 1671 "Unexpected phase, sreg=%02x\n",
1672 esp->sreg);
1678 esp_schedule_reset(esp); 1673 esp_schedule_reset(esp);
1679 return 0; 1674 return 0;
1680 } 1675 }
@@ -1708,18 +1703,17 @@ again:
1708 esp->data_dma_len = dma_len; 1703 esp->data_dma_len = dma_len;
1709 1704
1710 if (!dma_len) { 1705 if (!dma_len) {
1711 printk(KERN_ERR PFX "esp%d: DMA length is zero!\n", 1706 shost_printk(KERN_ERR, esp->host,
1712 esp->host->unique_id); 1707 "DMA length is zero!\n");
1713 printk(KERN_ERR PFX "esp%d: cur adr[%08llx] len[%08x]\n", 1708 shost_printk(KERN_ERR, esp->host,
1714 esp->host->unique_id, 1709 "cur adr[%08llx] len[%08x]\n",
1715 (unsigned long long)esp_cur_dma_addr(ent, cmd), 1710 (unsigned long long)esp_cur_dma_addr(ent, cmd),
1716 esp_cur_dma_len(ent, cmd)); 1711 esp_cur_dma_len(ent, cmd));
1717 esp_schedule_reset(esp); 1712 esp_schedule_reset(esp);
1718 return 0; 1713 return 0;
1719 } 1714 }
1720 1715
1721 esp_log_datastart("ESP: start data addr[%08llx] len[%u] " 1716 esp_log_datastart("start data addr[%08llx] len[%u] write(%d)\n",
1722 "write(%d)\n",
1723 (unsigned long long)dma_addr, dma_len, write); 1717 (unsigned long long)dma_addr, dma_len, write);
1724 1718
1725 esp->ops->send_dma_cmd(esp, dma_addr, dma_len, dma_len, 1719 esp->ops->send_dma_cmd(esp, dma_addr, dma_len, dma_len,
@@ -1733,7 +1727,8 @@ again:
1733 int bytes_sent; 1727 int bytes_sent;
1734 1728
1735 if (esp->ops->dma_error(esp)) { 1729 if (esp->ops->dma_error(esp)) {
1736 printk("ESP: data done, DMA error, resetting\n"); 1730 shost_printk(KERN_INFO, esp->host,
1731 "data done, DMA error, resetting\n");
1737 esp_schedule_reset(esp); 1732 esp_schedule_reset(esp);
1738 return 0; 1733 return 0;
1739 } 1734 }
@@ -1749,14 +1744,15 @@ again:
1749 /* We should always see exactly a bus-service 1744 /* We should always see exactly a bus-service
1750 * interrupt at the end of a successful transfer. 1745 * interrupt at the end of a successful transfer.
1751 */ 1746 */
1752 printk("ESP: data done, not BSERV, resetting\n"); 1747 shost_printk(KERN_INFO, esp->host,
1748 "data done, not BSERV, resetting\n");
1753 esp_schedule_reset(esp); 1749 esp_schedule_reset(esp);
1754 return 0; 1750 return 0;
1755 } 1751 }
1756 1752
1757 bytes_sent = esp_data_bytes_sent(esp, ent, cmd); 1753 bytes_sent = esp_data_bytes_sent(esp, ent, cmd);
1758 1754
1759 esp_log_datadone("ESP: data done flgs[%x] sent[%d]\n", 1755 esp_log_datadone("data done flgs[%x] sent[%d]\n",
1760 ent->flags, bytes_sent); 1756 ent->flags, bytes_sent);
1761 1757
1762 if (bytes_sent < 0) { 1758 if (bytes_sent < 0) {
@@ -1785,8 +1781,9 @@ again:
1785 } 1781 }
1786 1782
1787 if (ent->message != COMMAND_COMPLETE) { 1783 if (ent->message != COMMAND_COMPLETE) {
1788 printk("ESP: Unexpected message %x in status\n", 1784 shost_printk(KERN_INFO, esp->host,
1789 ent->message); 1785 "Unexpected message %x in status\n",
1786 ent->message);
1790 esp_schedule_reset(esp); 1787 esp_schedule_reset(esp);
1791 return 0; 1788 return 0;
1792 } 1789 }
@@ -1804,8 +1801,7 @@ again:
1804 scsi_esp_cmd(esp, ESP_CMD_ESEL); 1801 scsi_esp_cmd(esp, ESP_CMD_ESEL);
1805 1802
1806 if (ent->message == COMMAND_COMPLETE) { 1803 if (ent->message == COMMAND_COMPLETE) {
1807 esp_log_cmddone("ESP: Command done status[%x] " 1804 esp_log_cmddone("Command done status[%x] message[%x]\n",
1808 "message[%x]\n",
1809 ent->status, ent->message); 1805 ent->status, ent->message);
1810 if (ent->status == SAM_STAT_TASK_SET_FULL) 1806 if (ent->status == SAM_STAT_TASK_SET_FULL)
1811 esp_event_queue_full(esp, ent); 1807 esp_event_queue_full(esp, ent);
@@ -1821,16 +1817,16 @@ again:
1821 DID_OK)); 1817 DID_OK));
1822 } 1818 }
1823 } else if (ent->message == DISCONNECT) { 1819 } else if (ent->message == DISCONNECT) {
1824 esp_log_disconnect("ESP: Disconnecting tgt[%d] " 1820 esp_log_disconnect("Disconnecting tgt[%d] tag[%x:%x]\n",
1825 "tag[%x:%x]\n",
1826 cmd->device->id, 1821 cmd->device->id,
1827 ent->tag[0], ent->tag[1]); 1822 ent->tag[0], ent->tag[1]);
1828 1823
1829 esp->active_cmd = NULL; 1824 esp->active_cmd = NULL;
1830 esp_maybe_execute_command(esp); 1825 esp_maybe_execute_command(esp);
1831 } else { 1826 } else {
1832 printk("ESP: Unexpected message %x in freebus\n", 1827 shost_printk(KERN_INFO, esp->host,
1833 ent->message); 1828 "Unexpected message %x in freebus\n",
1829 ent->message);
1834 esp_schedule_reset(esp); 1830 esp_schedule_reset(esp);
1835 return 0; 1831 return 0;
1836 } 1832 }
@@ -1917,7 +1913,7 @@ again:
1917 val = esp_read8(ESP_FDATA); 1913 val = esp_read8(ESP_FDATA);
1918 esp->msg_in[esp->msg_in_len++] = val; 1914 esp->msg_in[esp->msg_in_len++] = val;
1919 1915
1920 esp_log_msgin("ESP: Got msgin byte %x\n", val); 1916 esp_log_msgin("Got msgin byte %x\n", val);
1921 1917
1922 if (!esp_msgin_process(esp)) 1918 if (!esp_msgin_process(esp))
1923 esp->msg_in_len = 0; 1919 esp->msg_in_len = 0;
@@ -1930,7 +1926,8 @@ again:
1930 if (esp->event != ESP_EVENT_FREE_BUS) 1926 if (esp->event != ESP_EVENT_FREE_BUS)
1931 esp_event(esp, ESP_EVENT_CHECK_PHASE); 1927 esp_event(esp, ESP_EVENT_CHECK_PHASE);
1932 } else { 1928 } else {
1933 printk("ESP: MSGIN neither BSERV not FDON, resetting"); 1929 shost_printk(KERN_INFO, esp->host,
1930 "MSGIN neither BSERV not FDON, resetting");
1934 esp_schedule_reset(esp); 1931 esp_schedule_reset(esp);
1935 return 0; 1932 return 0;
1936 } 1933 }
@@ -1961,8 +1958,8 @@ again:
1961 break; 1958 break;
1962 1959
1963 default: 1960 default:
1964 printk("ESP: Unexpected event %x, resetting\n", 1961 shost_printk(KERN_INFO, esp->host,
1965 esp->event); 1962 "Unexpected event %x, resetting\n", esp->event);
1966 esp_schedule_reset(esp); 1963 esp_schedule_reset(esp);
1967 return 0; 1964 return 0;
1968 break; 1965 break;
@@ -2085,14 +2082,15 @@ static void __esp_interrupt(struct esp *esp)
2085 } 2082 }
2086 } 2083 }
2087 2084
2088 esp_log_intr("ESP: intr sreg[%02x] seqreg[%02x] " 2085 esp_log_intr("intr sreg[%02x] seqreg[%02x] "
2089 "sreg2[%02x] ireg[%02x]\n", 2086 "sreg2[%02x] ireg[%02x]\n",
2090 esp->sreg, esp->seqreg, esp->sreg2, esp->ireg); 2087 esp->sreg, esp->seqreg, esp->sreg2, esp->ireg);
2091 2088
2092 intr_done = 0; 2089 intr_done = 0;
2093 2090
2094 if (esp->ireg & (ESP_INTR_S | ESP_INTR_SATN | ESP_INTR_IC)) { 2091 if (esp->ireg & (ESP_INTR_S | ESP_INTR_SATN | ESP_INTR_IC)) {
2095 printk("ESP: unexpected IREG %02x\n", esp->ireg); 2092 shost_printk(KERN_INFO, esp->host,
2093 "unexpected IREG %02x\n", esp->ireg);
2096 if (esp->ireg & ESP_INTR_IC) 2094 if (esp->ireg & ESP_INTR_IC)
2097 esp_dump_cmd_log(esp); 2095 esp_dump_cmd_log(esp);
2098 2096
@@ -2334,12 +2332,13 @@ int scsi_esp_register(struct esp *esp, struct device *dev)
2334 2332
2335 esp_bootup_reset(esp); 2333 esp_bootup_reset(esp);
2336 2334
2337 printk(KERN_INFO PFX "esp%u, regs[%1p:%1p] irq[%u]\n", 2335 dev_printk(KERN_INFO, dev, "esp%u: regs[%1p:%1p] irq[%u]\n",
2338 esp->host->unique_id, esp->regs, esp->dma_regs, 2336 esp->host->unique_id, esp->regs, esp->dma_regs,
2339 esp->host->irq); 2337 esp->host->irq);
2340 printk(KERN_INFO PFX "esp%u is a %s, %u MHz (ccf=%u), SCSI ID %u\n", 2338 dev_printk(KERN_INFO, dev,
2341 esp->host->unique_id, esp_chip_names[esp->rev], 2339 "esp%u: is a %s, %u MHz (ccf=%u), SCSI ID %u\n",
2342 esp->cfreq / 1000000, esp->cfact, esp->scsi_id); 2340 esp->host->unique_id, esp_chip_names[esp->rev],
2341 esp->cfreq / 1000000, esp->cfact, esp->scsi_id);
2343 2342
2344 /* Let the SCSI bus reset settle. */ 2343 /* Let the SCSI bus reset settle. */
2345 ssleep(esp_bus_reset_settle); 2344 ssleep(esp_bus_reset_settle);
@@ -2437,19 +2436,20 @@ static int esp_eh_abort_handler(struct scsi_cmnd *cmd)
2437 * XXX much for the final driver. 2436 * XXX much for the final driver.
2438 */ 2437 */
2439 spin_lock_irqsave(esp->host->host_lock, flags); 2438 spin_lock_irqsave(esp->host->host_lock, flags);
2440 printk(KERN_ERR PFX "esp%d: Aborting command [%p:%02x]\n", 2439 shost_printk(KERN_ERR, esp->host, "Aborting command [%p:%02x]\n",
2441 esp->host->unique_id, cmd, cmd->cmnd[0]); 2440 cmd, cmd->cmnd[0]);
2442 ent = esp->active_cmd; 2441 ent = esp->active_cmd;
2443 if (ent) 2442 if (ent)
2444 printk(KERN_ERR PFX "esp%d: Current command [%p:%02x]\n", 2443 shost_printk(KERN_ERR, esp->host,
2445 esp->host->unique_id, ent->cmd, ent->cmd->cmnd[0]); 2444 "Current command [%p:%02x]\n",
2445 ent->cmd, ent->cmd->cmnd[0]);
2446 list_for_each_entry(ent, &esp->queued_cmds, list) { 2446 list_for_each_entry(ent, &esp->queued_cmds, list) {
2447 printk(KERN_ERR PFX "esp%d: Queued command [%p:%02x]\n", 2447 shost_printk(KERN_ERR, esp->host, "Queued command [%p:%02x]\n",
2448 esp->host->unique_id, ent->cmd, ent->cmd->cmnd[0]); 2448 ent->cmd, ent->cmd->cmnd[0]);
2449 } 2449 }
2450 list_for_each_entry(ent, &esp->active_cmds, list) { 2450 list_for_each_entry(ent, &esp->active_cmds, list) {
2451 printk(KERN_ERR PFX "esp%d: Active command [%p:%02x]\n", 2451 shost_printk(KERN_ERR, esp->host, " Active command [%p:%02x]\n",
2452 esp->host->unique_id, ent->cmd, ent->cmd->cmnd[0]); 2452 ent->cmd, ent->cmd->cmnd[0]);
2453 } 2453 }
2454 esp_dump_cmd_log(esp); 2454 esp_dump_cmd_log(esp);
2455 spin_unlock_irqrestore(esp->host->host_lock, flags); 2455 spin_unlock_irqrestore(esp->host->host_lock, flags);