aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_dbf.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-18 16:00:54 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-18 16:00:54 -0400
commitbb2c018b09b681d43f5e08124b83e362647ea82b (patch)
treed794902c78f9fdd04ed88a4b8d451ed6f9292ec0 /drivers/s390/scsi/zfcp_dbf.c
parent82638844d9a8581bbf33201cc209a14876eca167 (diff)
parent5b664cb235e97afbf34db9c4d77f08ebd725335e (diff)
Merge branch 'linus' into cpus4096
Conflicts: drivers/acpi/processor_throttling.c Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/s390/scsi/zfcp_dbf.c')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c102
1 files changed, 47 insertions, 55 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index c8bad675dbd1..fca48b88fc53 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -1,22 +1,9 @@
1/* 1/*
2 * This file is part of the zfcp device driver for 2 * zfcp device driver
3 * FCP adapters for IBM System z9 and zSeries.
4 * 3 *
5 * (C) Copyright IBM Corp. 2002, 2006 4 * Debug traces for zfcp.
6 * 5 *
7 * This program is free software; you can redistribute it and/or modify 6 * Copyright IBM Corporation 2002, 2008
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 7 */
21 8
22#include <linux/ctype.h> 9#include <linux/ctype.h>
@@ -29,8 +16,6 @@ module_param(dbfsize, uint, 0400);
29MODULE_PARM_DESC(dbfsize, 16MODULE_PARM_DESC(dbfsize,
30 "number of pages for each debug feature area (default 4)"); 17 "number of pages for each debug feature area (default 4)");
31 18
32#define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER
33
34static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len, 19static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len,
35 int level, char *from, int from_len) 20 int level, char *from, int from_len)
36{ 21{
@@ -186,8 +171,8 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req)
186 fsf_status_qual, FSF_STATUS_QUALIFIER_SIZE); 171 fsf_status_qual, FSF_STATUS_QUALIFIER_SIZE);
187 response->fsf_req_status = fsf_req->status; 172 response->fsf_req_status = fsf_req->status;
188 response->sbal_first = fsf_req->sbal_first; 173 response->sbal_first = fsf_req->sbal_first;
189 response->sbal_curr = fsf_req->sbal_curr;
190 response->sbal_last = fsf_req->sbal_last; 174 response->sbal_last = fsf_req->sbal_last;
175 response->sbal_response = fsf_req->sbal_response;
191 response->pool = fsf_req->pool != NULL; 176 response->pool = fsf_req->pool != NULL;
192 response->erp_action = (unsigned long)fsf_req->erp_action; 177 response->erp_action = (unsigned long)fsf_req->erp_action;
193 178
@@ -268,7 +253,7 @@ void zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter,
268 strncpy(rec->tag, "stat", ZFCP_DBF_TAG_SIZE); 253 strncpy(rec->tag, "stat", ZFCP_DBF_TAG_SIZE);
269 strncpy(rec->tag2, tag, ZFCP_DBF_TAG_SIZE); 254 strncpy(rec->tag2, tag, ZFCP_DBF_TAG_SIZE);
270 255
271 rec->u.status.failed = adapter->status_read_failed; 256 rec->u.status.failed = atomic_read(&adapter->stat_miss);
272 if (status_buffer != NULL) { 257 if (status_buffer != NULL) {
273 rec->u.status.status_type = status_buffer->status_type; 258 rec->u.status.status_type = status_buffer->status_type;
274 rec->u.status.status_subtype = status_buffer->status_subtype; 259 rec->u.status.status_subtype = status_buffer->status_subtype;
@@ -312,15 +297,13 @@ void zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter,
312/** 297/**
313 * zfcp_hba_dbf_event_qdio - trace event for QDIO related failure 298 * zfcp_hba_dbf_event_qdio - trace event for QDIO related failure
314 * @adapter: adapter affected by this QDIO related event 299 * @adapter: adapter affected by this QDIO related event
315 * @status: as passed by qdio module
316 * @qdio_error: as passed by qdio module 300 * @qdio_error: as passed by qdio module
317 * @siga_error: as passed by qdio module
318 * @sbal_index: first buffer with error condition, as passed by qdio module 301 * @sbal_index: first buffer with error condition, as passed by qdio module
319 * @sbal_count: number of buffers affected, as passed by qdio module 302 * @sbal_count: number of buffers affected, as passed by qdio module
320 */ 303 */
321void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, unsigned int status, 304void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter,
322 unsigned int qdio_error, unsigned int siga_error, 305 unsigned int qdio_error, int sbal_index,
323 int sbal_index, int sbal_count) 306 int sbal_count)
324{ 307{
325 struct zfcp_hba_dbf_record *r = &adapter->hba_dbf_buf; 308 struct zfcp_hba_dbf_record *r = &adapter->hba_dbf_buf;
326 unsigned long flags; 309 unsigned long flags;
@@ -328,9 +311,7 @@ void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, unsigned int status,
328 spin_lock_irqsave(&adapter->hba_dbf_lock, flags); 311 spin_lock_irqsave(&adapter->hba_dbf_lock, flags);
329 memset(r, 0, sizeof(*r)); 312 memset(r, 0, sizeof(*r));
330 strncpy(r->tag, "qdio", ZFCP_DBF_TAG_SIZE); 313 strncpy(r->tag, "qdio", ZFCP_DBF_TAG_SIZE);
331 r->u.qdio.status = status;
332 r->u.qdio.qdio_error = qdio_error; 314 r->u.qdio.qdio_error = qdio_error;
333 r->u.qdio.siga_error = siga_error;
334 r->u.qdio.sbal_index = sbal_index; 315 r->u.qdio.sbal_index = sbal_index;
335 r->u.qdio.sbal_count = sbal_count; 316 r->u.qdio.sbal_count = sbal_count;
336 debug_event(adapter->hba_dbf, 0, r, sizeof(*r)); 317 debug_event(adapter->hba_dbf, 0, r, sizeof(*r));
@@ -355,8 +336,8 @@ static void zfcp_hba_dbf_view_response(char **p,
355 FSF_STATUS_QUALIFIER_SIZE, 0, FSF_STATUS_QUALIFIER_SIZE); 336 FSF_STATUS_QUALIFIER_SIZE, 0, FSF_STATUS_QUALIFIER_SIZE);
356 zfcp_dbf_out(p, "fsf_req_status", "0x%08x", r->fsf_req_status); 337 zfcp_dbf_out(p, "fsf_req_status", "0x%08x", r->fsf_req_status);
357 zfcp_dbf_out(p, "sbal_first", "0x%02x", r->sbal_first); 338 zfcp_dbf_out(p, "sbal_first", "0x%02x", r->sbal_first);
358 zfcp_dbf_out(p, "sbal_curr", "0x%02x", r->sbal_curr);
359 zfcp_dbf_out(p, "sbal_last", "0x%02x", r->sbal_last); 339 zfcp_dbf_out(p, "sbal_last", "0x%02x", r->sbal_last);
340 zfcp_dbf_out(p, "sbal_response", "0x%02x", r->sbal_response);
360 zfcp_dbf_out(p, "pool", "0x%02x", r->pool); 341 zfcp_dbf_out(p, "pool", "0x%02x", r->pool);
361 342
362 switch (r->fsf_command) { 343 switch (r->fsf_command) {
@@ -413,9 +394,7 @@ static void zfcp_hba_dbf_view_status(char **p,
413 394
414static void zfcp_hba_dbf_view_qdio(char **p, struct zfcp_hba_dbf_record_qdio *r) 395static void zfcp_hba_dbf_view_qdio(char **p, struct zfcp_hba_dbf_record_qdio *r)
415{ 396{
416 zfcp_dbf_out(p, "status", "0x%08x", r->status);
417 zfcp_dbf_out(p, "qdio_error", "0x%08x", r->qdio_error); 397 zfcp_dbf_out(p, "qdio_error", "0x%08x", r->qdio_error);
418 zfcp_dbf_out(p, "siga_error", "0x%08x", r->siga_error);
419 zfcp_dbf_out(p, "sbal_index", "0x%02x", r->sbal_index); 398 zfcp_dbf_out(p, "sbal_index", "0x%02x", r->sbal_index);
420 zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count); 399 zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count);
421} 400}
@@ -515,13 +494,13 @@ static const char *zfcp_rec_dbf_ids[] = {
515 [52] = "port boxed close unit", 494 [52] = "port boxed close unit",
516 [53] = "port boxed fcp", 495 [53] = "port boxed fcp",
517 [54] = "unit boxed fcp", 496 [54] = "unit boxed fcp",
518 [55] = "port access denied ct", 497 [55] = "port access denied",
519 [56] = "port access denied els", 498 [56] = "",
520 [57] = "port access denied open port", 499 [57] = "",
521 [58] = "port access denied close physical", 500 [58] = "",
522 [59] = "unit access denied open unit", 501 [59] = "unit access denied",
523 [60] = "shared unit access denied open unit", 502 [60] = "shared unit access denied open unit",
524 [61] = "unit access denied fcp", 503 [61] = "",
525 [62] = "request timeout", 504 [62] = "request timeout",
526 [63] = "adisc link test reject or timeout", 505 [63] = "adisc link test reject or timeout",
527 [64] = "adisc link test d_id changed", 506 [64] = "adisc link test d_id changed",
@@ -546,8 +525,8 @@ static const char *zfcp_rec_dbf_ids[] = {
546 [80] = "exclusive read-only unit access unsupported", 525 [80] = "exclusive read-only unit access unsupported",
547 [81] = "shared read-write unit access unsupported", 526 [81] = "shared read-write unit access unsupported",
548 [82] = "incoming rscn", 527 [82] = "incoming rscn",
549 [83] = "incoming plogi", 528 [83] = "incoming wwpn",
550 [84] = "incoming logo", 529 [84] = "",
551 [85] = "online", 530 [85] = "online",
552 [86] = "offline", 531 [86] = "offline",
553 [87] = "ccw device gone", 532 [87] = "ccw device gone",
@@ -586,8 +565,8 @@ static const char *zfcp_rec_dbf_ids[] = {
586 [120] = "unknown fsf command", 565 [120] = "unknown fsf command",
587 [121] = "no recommendation for status qualifier", 566 [121] = "no recommendation for status qualifier",
588 [122] = "status read physical port closed in error", 567 [122] = "status read physical port closed in error",
589 [123] = "fc service class not supported ct", 568 [123] = "fc service class not supported",
590 [124] = "fc service class not supported els", 569 [124] = "",
591 [125] = "need newer zfcp", 570 [125] = "need newer zfcp",
592 [126] = "need newer microcode", 571 [126] = "need newer microcode",
593 [127] = "arbitrated loop not supported", 572 [127] = "arbitrated loop not supported",
@@ -595,7 +574,7 @@ static const char *zfcp_rec_dbf_ids[] = {
595 [129] = "qtcb size mismatch", 574 [129] = "qtcb size mismatch",
596 [130] = "unknown fsf status ecd", 575 [130] = "unknown fsf status ecd",
597 [131] = "fcp request too big", 576 [131] = "fcp request too big",
598 [132] = "fc service class not supported fcp", 577 [132] = "",
599 [133] = "data direction not valid fcp", 578 [133] = "data direction not valid fcp",
600 [134] = "command length not valid fcp", 579 [134] = "command length not valid fcp",
601 [135] = "status read act update", 580 [135] = "status read act update",
@@ -603,13 +582,18 @@ static const char *zfcp_rec_dbf_ids[] = {
603 [137] = "hbaapi port open", 582 [137] = "hbaapi port open",
604 [138] = "hbaapi unit open", 583 [138] = "hbaapi unit open",
605 [139] = "hbaapi unit shutdown", 584 [139] = "hbaapi unit shutdown",
606 [140] = "qdio error", 585 [140] = "qdio error outbound",
607 [141] = "scsi host reset", 586 [141] = "scsi host reset",
608 [142] = "dismissing fsf request for recovery action", 587 [142] = "dismissing fsf request for recovery action",
609 [143] = "recovery action timed out", 588 [143] = "recovery action timed out",
610 [144] = "recovery action gone", 589 [144] = "recovery action gone",
611 [145] = "recovery action being processed", 590 [145] = "recovery action being processed",
612 [146] = "recovery action ready for next step", 591 [146] = "recovery action ready for next step",
592 [147] = "qdio error inbound",
593 [148] = "nameserver needed for port scan",
594 [149] = "port scan",
595 [150] = "ptp attach",
596 [151] = "port validation failed",
613}; 597};
614 598
615static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, 599static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view,
@@ -670,24 +654,20 @@ static struct debug_view zfcp_rec_dbf_view = {
670 * zfcp_rec_dbf_event_thread - trace event related to recovery thread operation 654 * zfcp_rec_dbf_event_thread - trace event related to recovery thread operation
671 * @id2: identifier for event 655 * @id2: identifier for event
672 * @adapter: adapter 656 * @adapter: adapter
673 * @lock: non-zero value indicates that erp_lock has not yet been acquired 657 * This function assumes that the caller is holding erp_lock.
674 */ 658 */
675void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter, int lock) 659void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter)
676{ 660{
677 struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf; 661 struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf;
678 unsigned long flags = 0; 662 unsigned long flags = 0;
679 struct list_head *entry; 663 struct list_head *entry;
680 unsigned ready = 0, running = 0, total; 664 unsigned ready = 0, running = 0, total;
681 665
682 if (lock)
683 read_lock_irqsave(&adapter->erp_lock, flags);
684 list_for_each(entry, &adapter->erp_ready_head) 666 list_for_each(entry, &adapter->erp_ready_head)
685 ready++; 667 ready++;
686 list_for_each(entry, &adapter->erp_running_head) 668 list_for_each(entry, &adapter->erp_running_head)
687 running++; 669 running++;
688 total = adapter->erp_total_count; 670 total = adapter->erp_total_count;
689 if (lock)
690 read_unlock_irqrestore(&adapter->erp_lock, flags);
691 671
692 spin_lock_irqsave(&adapter->rec_dbf_lock, flags); 672 spin_lock_irqsave(&adapter->rec_dbf_lock, flags);
693 memset(r, 0, sizeof(*r)); 673 memset(r, 0, sizeof(*r));
@@ -696,10 +676,25 @@ void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter, int lock)
696 r->u.thread.total = total; 676 r->u.thread.total = total;
697 r->u.thread.ready = ready; 677 r->u.thread.ready = ready;
698 r->u.thread.running = running; 678 r->u.thread.running = running;
699 debug_event(adapter->rec_dbf, 5, r, sizeof(*r)); 679 debug_event(adapter->rec_dbf, 6, r, sizeof(*r));
700 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); 680 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags);
701} 681}
702 682
683/**
684 * zfcp_rec_dbf_event_thread - trace event related to recovery thread operation
685 * @id2: identifier for event
686 * @adapter: adapter
687 * This function assumes that the caller does not hold erp_lock.
688 */
689void zfcp_rec_dbf_event_thread_lock(u8 id2, struct zfcp_adapter *adapter)
690{
691 unsigned long flags;
692
693 read_lock_irqsave(&adapter->erp_lock, flags);
694 zfcp_rec_dbf_event_thread(id2, adapter);
695 read_unlock_irqrestore(&adapter->erp_lock, flags);
696}
697
703static void zfcp_rec_dbf_event_target(u8 id2, void *ref, 698static void zfcp_rec_dbf_event_target(u8 id2, void *ref,
704 struct zfcp_adapter *adapter, 699 struct zfcp_adapter *adapter,
705 atomic_t *status, atomic_t *erp_count, 700 atomic_t *status, atomic_t *erp_count,
@@ -823,7 +818,7 @@ void zfcp_rec_dbf_event_action(u8 id2, struct zfcp_erp_action *erp_action)
823 r->u.action.status = erp_action->status; 818 r->u.action.status = erp_action->status;
824 r->u.action.step = erp_action->step; 819 r->u.action.step = erp_action->step;
825 r->u.action.fsf_req = (unsigned long)erp_action->fsf_req; 820 r->u.action.fsf_req = (unsigned long)erp_action->fsf_req;
826 debug_event(adapter->rec_dbf, 4, r, sizeof(*r)); 821 debug_event(adapter->rec_dbf, 5, r, sizeof(*r));
827 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); 822 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags);
828} 823}
829 824
@@ -960,7 +955,7 @@ void zfcp_san_dbf_event_incoming_els(struct zfcp_fsf_req *fsf_req)
960 955
961 zfcp_san_dbf_event_els("iels", 1, fsf_req, buf->d_id, 956 zfcp_san_dbf_event_els("iels", 1, fsf_req, buf->d_id,
962 fc_host_port_id(adapter->scsi_host), 957 fc_host_port_id(adapter->scsi_host),
963 *(u8 *)buf->payload, (void *)buf->payload, 958 buf->payload.data[0], (void *)buf->payload.data,
964 length); 959 length);
965} 960}
966 961
@@ -1064,8 +1059,7 @@ static void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level,
1064 if (fsf_req != NULL) { 1059 if (fsf_req != NULL) {
1065 fcp_rsp = (struct fcp_rsp_iu *) 1060 fcp_rsp = (struct fcp_rsp_iu *)
1066 &(fsf_req->qtcb->bottom.io.fcp_rsp); 1061 &(fsf_req->qtcb->bottom.io.fcp_rsp);
1067 fcp_rsp_info = 1062 fcp_rsp_info = (unsigned char *) &fcp_rsp[1];
1068 zfcp_get_fcp_rsp_info_ptr(fcp_rsp);
1069 fcp_sns_info = 1063 fcp_sns_info =
1070 zfcp_get_fcp_sns_info_ptr(fcp_rsp); 1064 zfcp_get_fcp_sns_info_ptr(fcp_rsp);
1071 1065
@@ -1279,5 +1273,3 @@ void zfcp_adapter_debug_unregister(struct zfcp_adapter *adapter)
1279 adapter->hba_dbf = NULL; 1273 adapter->hba_dbf = NULL;
1280 adapter->rec_dbf = NULL; 1274 adapter->rec_dbf = NULL;
1281} 1275}
1282
1283#undef ZFCP_LOG_AREA