aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c3
-rw-r--r--drivers/s390/scsi/zfcp_ccw.c4
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c42
-rw-r--r--drivers/s390/scsi/zfcp_dbf.h8
-rw-r--r--drivers/s390/scsi/zfcp_erp.c1
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c23
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c12
7 files changed, 38 insertions, 55 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 3b56220fb900..3d4e3e3f3fc0 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -610,7 +610,8 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn,
610 atomic_set_mask(status | ZFCP_STATUS_COMMON_REMOVE, &port->status); 610 atomic_set_mask(status | ZFCP_STATUS_COMMON_REMOVE, &port->status);
611 atomic_set(&port->refcount, 0); 611 atomic_set(&port->refcount, 0);
612 612
613 dev_set_name(&port->sysfs_device, "0x%016llx", wwpn); 613 dev_set_name(&port->sysfs_device, "0x%016llx",
614 (unsigned long long)wwpn);
614 port->sysfs_device.parent = &adapter->ccw_device->dev; 615 port->sysfs_device.parent = &adapter->ccw_device->dev;
615 616
616 port->sysfs_device.release = zfcp_sysfs_port_release; 617 port->sysfs_device.release = zfcp_sysfs_port_release;
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index b04038c74786..951a8d409d1d 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -116,7 +116,9 @@ static int zfcp_ccw_set_online(struct ccw_device *ccw_device)
116 zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 85, 116 zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 85,
117 NULL); 117 NULL);
118 zfcp_erp_wait(adapter); 118 zfcp_erp_wait(adapter);
119 goto out; 119 up(&zfcp_data.config_sema);
120 flush_work(&adapter->scan_work);
121 return 0;
120 122
121 out_scsi_register: 123 out_scsi_register:
122 zfcp_erp_thread_kill(adapter); 124 zfcp_erp_thread_kill(adapter);
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index 060f5f2352ec..31012d58cfb7 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -30,7 +30,7 @@ static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len,
30 dump->offset = offset; 30 dump->offset = offset;
31 dump->size = min(from_len - offset, room); 31 dump->size = min(from_len - offset, room);
32 memcpy(dump->data, from + offset, dump->size); 32 memcpy(dump->data, from + offset, dump->size);
33 debug_event(dbf, level, dump, dump->size); 33 debug_event(dbf, level, dump, dump->size + sizeof(*dump));
34 } 34 }
35} 35}
36 36
@@ -108,7 +108,7 @@ static int zfcp_dbf_view_header(debug_info_t *id, struct debug_view *view,
108 t.tv_sec, t.tv_nsec); 108 t.tv_sec, t.tv_nsec);
109 zfcp_dbf_out(&p, "cpu", "%02i", entry->id.fields.cpuid); 109 zfcp_dbf_out(&p, "cpu", "%02i", entry->id.fields.cpuid);
110 } else { 110 } else {
111 zfcp_dbf_outd(&p, NULL, dump->data, dump->size, dump->offset, 111 zfcp_dbf_outd(&p, "", dump->data, dump->size, dump->offset,
112 dump->total_size); 112 dump->total_size);
113 if ((dump->offset + dump->size) == dump->total_size) 113 if ((dump->offset + dump->size) == dump->total_size)
114 p += sprintf(p, "\n"); 114 p += sprintf(p, "\n");
@@ -366,6 +366,7 @@ static void zfcp_hba_dbf_view_response(char **p,
366 break; 366 break;
367 zfcp_dbf_out(p, "scsi_cmnd", "0x%0Lx", r->u.fcp.cmnd); 367 zfcp_dbf_out(p, "scsi_cmnd", "0x%0Lx", r->u.fcp.cmnd);
368 zfcp_dbf_out(p, "scsi_serial", "0x%016Lx", r->u.fcp.serial); 368 zfcp_dbf_out(p, "scsi_serial", "0x%016Lx", r->u.fcp.serial);
369 p += sprintf(*p, "\n");
369 break; 370 break;
370 371
371 case FSF_QTCB_OPEN_PORT_WITH_DID: 372 case FSF_QTCB_OPEN_PORT_WITH_DID:
@@ -465,7 +466,8 @@ static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view,
465 else if (strncmp(r->tag, "berr", ZFCP_DBF_TAG_SIZE) == 0) 466 else if (strncmp(r->tag, "berr", ZFCP_DBF_TAG_SIZE) == 0)
466 zfcp_hba_dbf_view_berr(&p, &r->u.berr); 467 zfcp_hba_dbf_view_berr(&p, &r->u.berr);
467 468
468 p += sprintf(p, "\n"); 469 if (strncmp(r->tag, "resp", ZFCP_DBF_TAG_SIZE) != 0)
470 p += sprintf(p, "\n");
469 return p - out_buf; 471 return p - out_buf;
470} 472}
471 473
@@ -880,6 +882,7 @@ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req)
880 struct ct_hdr *hdr = sg_virt(ct->req); 882 struct ct_hdr *hdr = sg_virt(ct->req);
881 struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf; 883 struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf;
882 struct zfcp_san_dbf_record_ct_request *oct = &r->u.ct_req; 884 struct zfcp_san_dbf_record_ct_request *oct = &r->u.ct_req;
885 int level = 3;
883 unsigned long flags; 886 unsigned long flags;
884 887
885 spin_lock_irqsave(&adapter->san_dbf_lock, flags); 888 spin_lock_irqsave(&adapter->san_dbf_lock, flags);
@@ -896,9 +899,10 @@ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req)
896 oct->options = hdr->options; 899 oct->options = hdr->options;
897 oct->max_res_size = hdr->max_res_size; 900 oct->max_res_size = hdr->max_res_size;
898 oct->len = min((int)ct->req->length - (int)sizeof(struct ct_hdr), 901 oct->len = min((int)ct->req->length - (int)sizeof(struct ct_hdr),
899 ZFCP_DBF_CT_PAYLOAD); 902 ZFCP_DBF_SAN_MAX_PAYLOAD);
900 memcpy(oct->payload, (void *)hdr + sizeof(struct ct_hdr), oct->len); 903 debug_event(adapter->san_dbf, level, r, sizeof(*r));
901 debug_event(adapter->san_dbf, 3, r, sizeof(*r)); 904 zfcp_dbf_hexdump(adapter->san_dbf, r, sizeof(*r), level,
905 (void *)hdr + sizeof(struct ct_hdr), oct->len);
902 spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); 906 spin_unlock_irqrestore(&adapter->san_dbf_lock, flags);
903} 907}
904 908
@@ -914,6 +918,7 @@ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req)
914 struct ct_hdr *hdr = sg_virt(ct->resp); 918 struct ct_hdr *hdr = sg_virt(ct->resp);
915 struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf; 919 struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf;
916 struct zfcp_san_dbf_record_ct_response *rct = &r->u.ct_resp; 920 struct zfcp_san_dbf_record_ct_response *rct = &r->u.ct_resp;
921 int level = 3;
917 unsigned long flags; 922 unsigned long flags;
918 923
919 spin_lock_irqsave(&adapter->san_dbf_lock, flags); 924 spin_lock_irqsave(&adapter->san_dbf_lock, flags);
@@ -929,9 +934,10 @@ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req)
929 rct->expl = hdr->reason_code_expl; 934 rct->expl = hdr->reason_code_expl;
930 rct->vendor_unique = hdr->vendor_unique; 935 rct->vendor_unique = hdr->vendor_unique;
931 rct->len = min((int)ct->resp->length - (int)sizeof(struct ct_hdr), 936 rct->len = min((int)ct->resp->length - (int)sizeof(struct ct_hdr),
932 ZFCP_DBF_CT_PAYLOAD); 937 ZFCP_DBF_SAN_MAX_PAYLOAD);
933 memcpy(rct->payload, (void *)hdr + sizeof(struct ct_hdr), rct->len); 938 debug_event(adapter->san_dbf, level, r, sizeof(*r));
934 debug_event(adapter->san_dbf, 3, r, sizeof(*r)); 939 zfcp_dbf_hexdump(adapter->san_dbf, r, sizeof(*r), level,
940 (void *)hdr + sizeof(struct ct_hdr), rct->len);
935 spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); 941 spin_unlock_irqrestore(&adapter->san_dbf_lock, flags);
936} 942}
937 943
@@ -954,7 +960,7 @@ static void zfcp_san_dbf_event_els(const char *tag, int level,
954 rec->u.els.ls_code = ls_code; 960 rec->u.els.ls_code = ls_code;
955 debug_event(adapter->san_dbf, level, rec, sizeof(*rec)); 961 debug_event(adapter->san_dbf, level, rec, sizeof(*rec));
956 zfcp_dbf_hexdump(adapter->san_dbf, rec, sizeof(*rec), level, 962 zfcp_dbf_hexdump(adapter->san_dbf, rec, sizeof(*rec), level,
957 buffer, min(buflen, ZFCP_DBF_ELS_MAX_PAYLOAD)); 963 buffer, min(buflen, ZFCP_DBF_SAN_MAX_PAYLOAD));
958 spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); 964 spin_unlock_irqrestore(&adapter->san_dbf_lock, flags);
959} 965}
960 966
@@ -1008,8 +1014,6 @@ static int zfcp_san_dbf_view_format(debug_info_t *id, struct debug_view *view,
1008 char *out_buf, const char *in_buf) 1014 char *out_buf, const char *in_buf)
1009{ 1015{
1010 struct zfcp_san_dbf_record *r = (struct zfcp_san_dbf_record *)in_buf; 1016 struct zfcp_san_dbf_record *r = (struct zfcp_san_dbf_record *)in_buf;
1011 char *buffer = NULL;
1012 int buflen = 0, total = 0;
1013 char *p = out_buf; 1017 char *p = out_buf;
1014 1018
1015 if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) 1019 if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0)
@@ -1029,9 +1033,6 @@ static int zfcp_san_dbf_view_format(debug_info_t *id, struct debug_view *view,
1029 zfcp_dbf_out(&p, "gs_subtype", "0x%02x", ct->gs_subtype); 1033 zfcp_dbf_out(&p, "gs_subtype", "0x%02x", ct->gs_subtype);
1030 zfcp_dbf_out(&p, "options", "0x%02x", ct->options); 1034 zfcp_dbf_out(&p, "options", "0x%02x", ct->options);
1031 zfcp_dbf_out(&p, "max_res_size", "0x%04x", ct->max_res_size); 1035 zfcp_dbf_out(&p, "max_res_size", "0x%04x", ct->max_res_size);
1032 total = ct->len;
1033 buffer = ct->payload;
1034 buflen = min(total, ZFCP_DBF_CT_PAYLOAD);
1035 } else if (strncmp(r->tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) { 1036 } else if (strncmp(r->tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) {
1036 struct zfcp_san_dbf_record_ct_response *ct = &r->u.ct_resp; 1037 struct zfcp_san_dbf_record_ct_response *ct = &r->u.ct_resp;
1037 zfcp_dbf_out(&p, "cmd_rsp_code", "0x%04x", ct->cmd_rsp_code); 1038 zfcp_dbf_out(&p, "cmd_rsp_code", "0x%04x", ct->cmd_rsp_code);
@@ -1039,23 +1040,12 @@ static int zfcp_san_dbf_view_format(debug_info_t *id, struct debug_view *view,
1039 zfcp_dbf_out(&p, "reason_code", "0x%02x", ct->reason_code); 1040 zfcp_dbf_out(&p, "reason_code", "0x%02x", ct->reason_code);
1040 zfcp_dbf_out(&p, "reason_code_expl", "0x%02x", ct->expl); 1041 zfcp_dbf_out(&p, "reason_code_expl", "0x%02x", ct->expl);
1041 zfcp_dbf_out(&p, "vendor_unique", "0x%02x", ct->vendor_unique); 1042 zfcp_dbf_out(&p, "vendor_unique", "0x%02x", ct->vendor_unique);
1042 total = ct->len;
1043 buffer = ct->payload;
1044 buflen = min(total, ZFCP_DBF_CT_PAYLOAD);
1045 } else if (strncmp(r->tag, "oels", ZFCP_DBF_TAG_SIZE) == 0 || 1043 } else if (strncmp(r->tag, "oels", ZFCP_DBF_TAG_SIZE) == 0 ||
1046 strncmp(r->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 || 1044 strncmp(r->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 ||
1047 strncmp(r->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) { 1045 strncmp(r->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) {
1048 struct zfcp_san_dbf_record_els *els = &r->u.els; 1046 struct zfcp_san_dbf_record_els *els = &r->u.els;
1049 zfcp_dbf_out(&p, "ls_code", "0x%02x", els->ls_code); 1047 zfcp_dbf_out(&p, "ls_code", "0x%02x", els->ls_code);
1050 total = els->len;
1051 buffer = els->payload;
1052 buflen = min(total, ZFCP_DBF_ELS_PAYLOAD);
1053 } 1048 }
1054
1055 zfcp_dbf_outd(&p, "payload", buffer, buflen, 0, total);
1056 if (buflen == total)
1057 p += sprintf(p, "\n");
1058
1059 return p - out_buf; 1049 return p - out_buf;
1060} 1050}
1061 1051
diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h
index e8f450801fea..5d6b2dff855b 100644
--- a/drivers/s390/scsi/zfcp_dbf.h
+++ b/drivers/s390/scsi/zfcp_dbf.h
@@ -163,8 +163,6 @@ struct zfcp_san_dbf_record_ct_request {
163 u8 options; 163 u8 options;
164 u16 max_res_size; 164 u16 max_res_size;
165 u32 len; 165 u32 len;
166#define ZFCP_DBF_CT_PAYLOAD 24
167 u8 payload[ZFCP_DBF_CT_PAYLOAD];
168} __attribute__ ((packed)); 166} __attribute__ ((packed));
169 167
170struct zfcp_san_dbf_record_ct_response { 168struct zfcp_san_dbf_record_ct_response {
@@ -174,15 +172,11 @@ struct zfcp_san_dbf_record_ct_response {
174 u8 expl; 172 u8 expl;
175 u8 vendor_unique; 173 u8 vendor_unique;
176 u32 len; 174 u32 len;
177 u8 payload[ZFCP_DBF_CT_PAYLOAD];
178} __attribute__ ((packed)); 175} __attribute__ ((packed));
179 176
180struct zfcp_san_dbf_record_els { 177struct zfcp_san_dbf_record_els {
181 u8 ls_code; 178 u8 ls_code;
182 u32 len; 179 u32 len;
183#define ZFCP_DBF_ELS_PAYLOAD 32
184#define ZFCP_DBF_ELS_MAX_PAYLOAD 1024
185 u8 payload[ZFCP_DBF_ELS_PAYLOAD];
186} __attribute__ ((packed)); 180} __attribute__ ((packed));
187 181
188struct zfcp_san_dbf_record { 182struct zfcp_san_dbf_record {
@@ -196,6 +190,8 @@ struct zfcp_san_dbf_record {
196 struct zfcp_san_dbf_record_ct_response ct_resp; 190 struct zfcp_san_dbf_record_ct_response ct_resp;
197 struct zfcp_san_dbf_record_els els; 191 struct zfcp_san_dbf_record_els els;
198 } u; 192 } u;
193#define ZFCP_DBF_SAN_MAX_PAYLOAD 1024
194 u8 payload[32];
199} __attribute__ ((packed)); 195} __attribute__ ((packed));
200 196
201struct zfcp_scsi_dbf_record { 197struct zfcp_scsi_dbf_record {
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 9040f738ff33..35364f64da7f 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -472,6 +472,7 @@ static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act)
472 ZFCP_STATUS_ERP_TIMEDOUT)) { 472 ZFCP_STATUS_ERP_TIMEDOUT)) {
473 act->fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; 473 act->fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
474 zfcp_rec_dbf_event_action(142, act); 474 zfcp_rec_dbf_event_action(142, act);
475 act->fsf_req->erp_action = NULL;
475 } 476 }
476 if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) 477 if (act->status & ZFCP_STATUS_ERP_TIMEDOUT)
477 zfcp_rec_dbf_event_action(143, act); 478 zfcp_rec_dbf_event_action(143, act);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 5ae1d497e5ed..d024442ee128 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -683,6 +683,7 @@ static struct zfcp_fsf_req *zfcp_fsf_alloc_noqtcb(mempool_t *pool)
683 if (!req) 683 if (!req)
684 return NULL; 684 return NULL;
685 memset(req, 0, sizeof(*req)); 685 memset(req, 0, sizeof(*req));
686 req->pool = pool;
686 return req; 687 return req;
687} 688}
688 689
@@ -769,28 +770,24 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_adapter *adapter,
769static int zfcp_fsf_req_send(struct zfcp_fsf_req *req) 770static int zfcp_fsf_req_send(struct zfcp_fsf_req *req)
770{ 771{
771 struct zfcp_adapter *adapter = req->adapter; 772 struct zfcp_adapter *adapter = req->adapter;
772 struct zfcp_qdio_queue *req_q = &adapter->req_q; 773 unsigned long flags;
773 int idx; 774 int idx;
774 775
775 /* put allocated FSF request into hash table */ 776 /* put allocated FSF request into hash table */
776 spin_lock(&adapter->req_list_lock); 777 spin_lock_irqsave(&adapter->req_list_lock, flags);
777 idx = zfcp_reqlist_hash(req->req_id); 778 idx = zfcp_reqlist_hash(req->req_id);
778 list_add_tail(&req->list, &adapter->req_list[idx]); 779 list_add_tail(&req->list, &adapter->req_list[idx]);
779 spin_unlock(&adapter->req_list_lock); 780 spin_unlock_irqrestore(&adapter->req_list_lock, flags);
780 781
781 req->qdio_outb_usage = atomic_read(&req_q->count); 782 req->qdio_outb_usage = atomic_read(&adapter->req_q.count);
782 req->issued = get_clock(); 783 req->issued = get_clock();
783 if (zfcp_qdio_send(req)) { 784 if (zfcp_qdio_send(req)) {
784 /* Queues are down..... */
785 del_timer(&req->timer); 785 del_timer(&req->timer);
786 spin_lock(&adapter->req_list_lock); 786 spin_lock_irqsave(&adapter->req_list_lock, flags);
787 zfcp_reqlist_remove(adapter, req); 787 /* lookup request again, list might have changed */
788 spin_unlock(&adapter->req_list_lock); 788 if (zfcp_reqlist_find_safe(adapter, req))
789 /* undo changes in request queue made for this request */ 789 zfcp_reqlist_remove(adapter, req);
790 atomic_add(req->sbal_number, &req_q->count); 790 spin_unlock_irqrestore(&adapter->req_list_lock, flags);
791 req_q->first -= req->sbal_number;
792 req_q->first += QDIO_MAX_BUFFERS_PER_Q;
793 req_q->first %= QDIO_MAX_BUFFERS_PER_Q; /* wrap */
794 zfcp_erp_adapter_reopen(adapter, 0, 116, req); 791 zfcp_erp_adapter_reopen(adapter, 0, 116, req);
795 return -EIO; 792 return -EIO;
796 } 793 }
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index ca8f85f3dad4..e46fd3e9f68f 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -24,14 +24,10 @@ char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu)
24static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) 24static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
25{ 25{
26 struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; 26 struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata;
27 WARN_ON(!unit); 27 atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status);
28 if (unit) { 28 unit->device = NULL;
29 atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); 29 zfcp_erp_unit_failed(unit, 12, NULL);
30 sdpnt->hostdata = NULL; 30 zfcp_unit_put(unit);
31 unit->device = NULL;
32 zfcp_erp_unit_failed(unit, 12, NULL);
33 zfcp_unit_put(unit);
34 }
35} 31}
36 32
37static int zfcp_scsi_slave_configure(struct scsi_device *sdp) 33static int zfcp_scsi_slave_configure(struct scsi_device *sdp)