aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-10-01 06:42:21 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-03 13:11:55 -0400
commit57069386699994c3e67042fc4928c418f3a39e01 (patch)
tree1308fe671e7440597622e4056508a244bb13929b /drivers/s390/scsi
parent0406289ed57955860a4f8d744a14f4c819260ce4 (diff)
[SCSI] zfcp: put threshold data in hba trace
Now that we removed the long messages for the bit error threshold data, put the data in the hba trace. This way, we get a short warning for the threshold event from the hardware and have the data in the trace for further analysis. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c46
-rw-r--r--drivers/s390/scsi/zfcp_dbf.h1
-rw-r--r--drivers/s390/scsi/zfcp_ext.h2
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c1
4 files changed, 50 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index c1f69f611e69..9c9f9cfcd46d 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -318,6 +318,26 @@ void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter,
318 spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); 318 spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
319} 319}
320 320
321/**
322 * zfcp_hba_dbf_event_berr - trace event for bit error threshold
323 * @adapter: adapter affected by this QDIO related event
324 * @req: fsf request
325 */
326void zfcp_hba_dbf_event_berr(struct zfcp_adapter *adapter,
327 struct zfcp_fsf_req *req)
328{
329 struct zfcp_hba_dbf_record *r = &adapter->hba_dbf_buf;
330 struct fsf_status_read_buffer *sr_buf = req->data;
331 struct fsf_bit_error_payload *err = &sr_buf->payload.bit_error;
332 unsigned long flags;
333
334 spin_lock_irqsave(&adapter->hba_dbf_lock, flags);
335 memset(r, 0, sizeof(*r));
336 strncpy(r->tag, "berr", ZFCP_DBF_TAG_SIZE);
337 memcpy(&r->u.berr, err, sizeof(struct fsf_bit_error_payload));
338 debug_event(adapter->hba_dbf, 0, r, sizeof(*r));
339 spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
340}
321static void zfcp_hba_dbf_view_response(char **p, 341static void zfcp_hba_dbf_view_response(char **p,
322 struct zfcp_hba_dbf_record_response *r) 342 struct zfcp_hba_dbf_record_response *r)
323{ 343{
@@ -399,6 +419,30 @@ static void zfcp_hba_dbf_view_qdio(char **p, struct zfcp_hba_dbf_record_qdio *r)
399 zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count); 419 zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count);
400} 420}
401 421
422static void zfcp_hba_dbf_view_berr(char **p, struct fsf_bit_error_payload *r)
423{
424 zfcp_dbf_out(p, "link_failures", "%d", r->link_failure_error_count);
425 zfcp_dbf_out(p, "loss_of_sync_err", "%d", r->loss_of_sync_error_count);
426 zfcp_dbf_out(p, "loss_of_sig_err", "%d", r->loss_of_signal_error_count);
427 zfcp_dbf_out(p, "prim_seq_err", "%d",
428 r->primitive_sequence_error_count);
429 zfcp_dbf_out(p, "inval_trans_word_err", "%d",
430 r->invalid_transmission_word_error_count);
431 zfcp_dbf_out(p, "CRC_errors", "%d", r->crc_error_count);
432 zfcp_dbf_out(p, "prim_seq_event_to", "%d",
433 r->primitive_sequence_event_timeout_count);
434 zfcp_dbf_out(p, "elast_buf_overrun_err", "%d",
435 r->elastic_buffer_overrun_error_count);
436 zfcp_dbf_out(p, "adv_rec_buf2buf_cred", "%d",
437 r->advertised_receive_b2b_credit);
438 zfcp_dbf_out(p, "curr_rec_buf2buf_cred", "%d",
439 r->current_receive_b2b_credit);
440 zfcp_dbf_out(p, "adv_trans_buf2buf_cred", "%d",
441 r->advertised_transmit_b2b_credit);
442 zfcp_dbf_out(p, "curr_trans_buf2buf_cred", "%d",
443 r->current_transmit_b2b_credit);
444}
445
402static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view, 446static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view,
403 char *out_buf, const char *in_buf) 447 char *out_buf, const char *in_buf)
404{ 448{
@@ -418,6 +462,8 @@ static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view,
418 zfcp_hba_dbf_view_status(&p, &r->u.status); 462 zfcp_hba_dbf_view_status(&p, &r->u.status);
419 else if (strncmp(r->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0) 463 else if (strncmp(r->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0)
420 zfcp_hba_dbf_view_qdio(&p, &r->u.qdio); 464 zfcp_hba_dbf_view_qdio(&p, &r->u.qdio);
465 else if (strncmp(r->tag, "berr", ZFCP_DBF_TAG_SIZE) == 0)
466 zfcp_hba_dbf_view_berr(&p, &r->u.berr);
421 467
422 p += sprintf(p, "\n"); 468 p += sprintf(p, "\n");
423 return p - out_buf; 469 return p - out_buf;
diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h
index 0ddb18449d11..e8f450801fea 100644
--- a/drivers/s390/scsi/zfcp_dbf.h
+++ b/drivers/s390/scsi/zfcp_dbf.h
@@ -151,6 +151,7 @@ struct zfcp_hba_dbf_record {
151 struct zfcp_hba_dbf_record_response response; 151 struct zfcp_hba_dbf_record_response response;
152 struct zfcp_hba_dbf_record_status status; 152 struct zfcp_hba_dbf_record_status status;
153 struct zfcp_hba_dbf_record_qdio qdio; 153 struct zfcp_hba_dbf_record_qdio qdio;
154 struct fsf_bit_error_payload berr;
154 } u; 155 } u;
155} __attribute__ ((packed)); 156} __attribute__ ((packed));
156 157
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index b8c5c37b2afa..b5adeda93e1d 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -49,6 +49,8 @@ extern void zfcp_hba_dbf_event_fsf_unsol(const char *, struct zfcp_adapter *,
49 struct fsf_status_read_buffer *); 49 struct fsf_status_read_buffer *);
50extern void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *, unsigned int, int, 50extern void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *, unsigned int, int,
51 int); 51 int);
52extern void zfcp_hba_dbf_event_berr(struct zfcp_adapter *,
53 struct zfcp_fsf_req *);
52extern void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *); 54extern void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *);
53extern void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *); 55extern void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *);
54extern void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *); 56extern void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index c10b88d235d2..f073fff0868f 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -294,6 +294,7 @@ static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req)
294 dev_warn(&adapter->ccw_device->dev, 294 dev_warn(&adapter->ccw_device->dev,
295 "The error threshold for checksum statistics " 295 "The error threshold for checksum statistics "
296 "has been exceeded\n"); 296 "has been exceeded\n");
297 zfcp_hba_dbf_event_berr(adapter, req);
297 break; 298 break;
298 case FSF_STATUS_READ_LINK_DOWN: 299 case FSF_STATUS_READ_LINK_DOWN:
299 zfcp_fsf_status_read_link_down(req); 300 zfcp_fsf_status_read_link_down(req);