diff options
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 4 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ccw.c | 6 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.c | 11 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 81 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 17 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ext.h | 6 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 19 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 59 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.h | 75 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_qdio.c | 28 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 3 |
11 files changed, 60 insertions, 249 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index a8c965b6f744..ee13a455c823 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -351,7 +351,7 @@ err_out_free: | |||
351 | */ | 351 | */ |
352 | void zfcp_unit_dequeue(struct zfcp_unit *unit) | 352 | void zfcp_unit_dequeue(struct zfcp_unit *unit) |
353 | { | 353 | { |
354 | zfcp_unit_wait(unit); | 354 | wait_event(unit->remove_wq, atomic_read(&unit->refcount) == 0); |
355 | write_lock_irq(&zfcp_data.config_lock); | 355 | write_lock_irq(&zfcp_data.config_lock); |
356 | list_del(&unit->list); | 356 | list_del(&unit->list); |
357 | write_unlock_irq(&zfcp_data.config_lock); | 357 | write_unlock_irq(&zfcp_data.config_lock); |
@@ -740,7 +740,7 @@ err_out: | |||
740 | */ | 740 | */ |
741 | void zfcp_port_dequeue(struct zfcp_port *port) | 741 | void zfcp_port_dequeue(struct zfcp_port *port) |
742 | { | 742 | { |
743 | zfcp_port_wait(port); | 743 | wait_event(port->remove_wq, atomic_read(&port->refcount) == 0); |
744 | write_lock_irq(&zfcp_data.config_lock); | 744 | write_lock_irq(&zfcp_data.config_lock); |
745 | list_del(&port->list); | 745 | list_del(&port->list); |
746 | port->adapter->ports--; | 746 | port->adapter->ports--; |
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index ef8bdfbb55f8..0e1a42f7a4b5 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c | |||
@@ -67,14 +67,14 @@ static void zfcp_ccw_remove(struct ccw_device *ccw_device) | |||
67 | 67 | ||
68 | list_for_each_entry_safe(port, p, &adapter->port_remove_lh, list) { | 68 | list_for_each_entry_safe(port, p, &adapter->port_remove_lh, list) { |
69 | list_for_each_entry_safe(unit, u, &port->unit_remove_lh, list) { | 69 | list_for_each_entry_safe(unit, u, &port->unit_remove_lh, list) { |
70 | if (atomic_test_mask(ZFCP_STATUS_UNIT_REGISTERED, | 70 | if (atomic_read(&unit->status) & |
71 | &unit->status)) | 71 | ZFCP_STATUS_UNIT_REGISTERED) |
72 | scsi_remove_device(unit->device); | 72 | scsi_remove_device(unit->device); |
73 | zfcp_unit_dequeue(unit); | 73 | zfcp_unit_dequeue(unit); |
74 | } | 74 | } |
75 | zfcp_port_dequeue(port); | 75 | zfcp_port_dequeue(port); |
76 | } | 76 | } |
77 | zfcp_adapter_wait(adapter); | 77 | wait_event(adapter->remove_wq, atomic_read(&adapter->refcount) == 0); |
78 | zfcp_adapter_dequeue(adapter); | 78 | zfcp_adapter_dequeue(adapter); |
79 | 79 | ||
80 | up(&zfcp_data.config_sema); | 80 | up(&zfcp_data.config_sema); |
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 91b1a364a24c..d088d30516f9 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c | |||
@@ -831,7 +831,7 @@ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req) | |||
831 | struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; | 831 | struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; |
832 | struct zfcp_port *port = ct->port; | 832 | struct zfcp_port *port = ct->port; |
833 | struct zfcp_adapter *adapter = port->adapter; | 833 | struct zfcp_adapter *adapter = port->adapter; |
834 | struct ct_hdr *hdr = zfcp_sg_to_address(ct->req); | 834 | struct ct_hdr *hdr = sg_virt(ct->req); |
835 | struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf; | 835 | struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf; |
836 | struct zfcp_san_dbf_record_ct_request *oct = &r->u.ct_req; | 836 | struct zfcp_san_dbf_record_ct_request *oct = &r->u.ct_req; |
837 | unsigned long flags; | 837 | unsigned long flags; |
@@ -865,7 +865,7 @@ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req) | |||
865 | struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; | 865 | struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; |
866 | struct zfcp_port *port = ct->port; | 866 | struct zfcp_port *port = ct->port; |
867 | struct zfcp_adapter *adapter = port->adapter; | 867 | struct zfcp_adapter *adapter = port->adapter; |
868 | struct ct_hdr *hdr = zfcp_sg_to_address(ct->resp); | 868 | struct ct_hdr *hdr = sg_virt(ct->resp); |
869 | struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf; | 869 | struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf; |
870 | struct zfcp_san_dbf_record_ct_response *rct = &r->u.ct_resp; | 870 | struct zfcp_san_dbf_record_ct_response *rct = &r->u.ct_resp; |
871 | unsigned long flags; | 871 | unsigned long flags; |
@@ -922,8 +922,8 @@ void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *fsf_req) | |||
922 | 922 | ||
923 | zfcp_san_dbf_event_els("oels", 2, fsf_req, | 923 | zfcp_san_dbf_event_els("oels", 2, fsf_req, |
924 | fc_host_port_id(els->adapter->scsi_host), | 924 | fc_host_port_id(els->adapter->scsi_host), |
925 | els->d_id, *(u8 *) zfcp_sg_to_address(els->req), | 925 | els->d_id, *(u8 *) sg_virt(els->req), |
926 | zfcp_sg_to_address(els->req), els->req->length); | 926 | sg_virt(els->req), els->req->length); |
927 | } | 927 | } |
928 | 928 | ||
929 | /** | 929 | /** |
@@ -936,8 +936,7 @@ void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *fsf_req) | |||
936 | 936 | ||
937 | zfcp_san_dbf_event_els("rels", 2, fsf_req, els->d_id, | 937 | zfcp_san_dbf_event_els("rels", 2, fsf_req, els->d_id, |
938 | fc_host_port_id(els->adapter->scsi_host), | 938 | fc_host_port_id(els->adapter->scsi_host), |
939 | *(u8 *)zfcp_sg_to_address(els->req), | 939 | *(u8 *)sg_virt(els->req), sg_virt(els->resp), |
940 | zfcp_sg_to_address(els->resp), | ||
941 | els->resp->length); | 940 | els->resp->length); |
942 | } | 941 | } |
943 | 942 | ||
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 74d7529621bb..699ecaf2e503 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -39,29 +39,6 @@ | |||
39 | 39 | ||
40 | /********************* GENERAL DEFINES *********************************/ | 40 | /********************* GENERAL DEFINES *********************************/ |
41 | 41 | ||
42 | /** | ||
43 | * zfcp_sg_to_address - determine kernel address from struct scatterlist | ||
44 | * @list: struct scatterlist | ||
45 | * Return: kernel address | ||
46 | */ | ||
47 | static inline void * | ||
48 | zfcp_sg_to_address(struct scatterlist *list) | ||
49 | { | ||
50 | return sg_virt(list); | ||
51 | } | ||
52 | |||
53 | /** | ||
54 | * zfcp_address_to_sg - set up struct scatterlist from kernel address | ||
55 | * @address: kernel address | ||
56 | * @list: struct scatterlist | ||
57 | * @size: buffer size | ||
58 | */ | ||
59 | static inline void | ||
60 | zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int size) | ||
61 | { | ||
62 | sg_set_buf(list, address, size); | ||
63 | } | ||
64 | |||
65 | #define REQUEST_LIST_SIZE 128 | 42 | #define REQUEST_LIST_SIZE 128 |
66 | 43 | ||
67 | /********************* SCSI SPECIFIC DEFINES *********************************/ | 44 | /********************* SCSI SPECIFIC DEFINES *********************************/ |
@@ -218,13 +195,6 @@ struct fcp_logo { | |||
218 | #define ZFCP_LS_RSCN 0x61 | 195 | #define ZFCP_LS_RSCN 0x61 |
219 | #define ZFCP_LS_RNID 0x78 | 196 | #define ZFCP_LS_RNID 0x78 |
220 | 197 | ||
221 | struct zfcp_ls_rjt_par { | ||
222 | u8 action; | ||
223 | u8 reason_code; | ||
224 | u8 reason_expl; | ||
225 | u8 vendor_unique; | ||
226 | } __attribute__ ((packed)); | ||
227 | |||
228 | struct zfcp_ls_adisc { | 198 | struct zfcp_ls_adisc { |
229 | u8 code; | 199 | u8 code; |
230 | u8 field[3]; | 200 | u8 field[3]; |
@@ -234,20 +204,6 @@ struct zfcp_ls_adisc { | |||
234 | u32 nport_id; | 204 | u32 nport_id; |
235 | } __attribute__ ((packed)); | 205 | } __attribute__ ((packed)); |
236 | 206 | ||
237 | struct zfcp_ls_adisc_acc { | ||
238 | u8 code; | ||
239 | u8 field[3]; | ||
240 | u32 hard_nport_id; | ||
241 | u64 wwpn; | ||
242 | u64 wwnn; | ||
243 | u32 nport_id; | ||
244 | } __attribute__ ((packed)); | ||
245 | |||
246 | struct zfcp_rc_entry { | ||
247 | u8 code; | ||
248 | const char *description; | ||
249 | }; | ||
250 | |||
251 | /* | 207 | /* |
252 | * FC-GS-2 stuff | 208 | * FC-GS-2 stuff |
253 | */ | 209 | */ |
@@ -281,9 +237,7 @@ struct zfcp_rc_entry { | |||
281 | #define ZFCP_STATUS_COMMON_RUNNING 0x40000000 | 237 | #define ZFCP_STATUS_COMMON_RUNNING 0x40000000 |
282 | #define ZFCP_STATUS_COMMON_ERP_FAILED 0x20000000 | 238 | #define ZFCP_STATUS_COMMON_ERP_FAILED 0x20000000 |
283 | #define ZFCP_STATUS_COMMON_UNBLOCKED 0x10000000 | 239 | #define ZFCP_STATUS_COMMON_UNBLOCKED 0x10000000 |
284 | #define ZFCP_STATUS_COMMON_OPENING 0x08000000 | ||
285 | #define ZFCP_STATUS_COMMON_OPEN 0x04000000 | 240 | #define ZFCP_STATUS_COMMON_OPEN 0x04000000 |
286 | #define ZFCP_STATUS_COMMON_CLOSING 0x02000000 | ||
287 | #define ZFCP_STATUS_COMMON_ERP_INUSE 0x01000000 | 241 | #define ZFCP_STATUS_COMMON_ERP_INUSE 0x01000000 |
288 | #define ZFCP_STATUS_COMMON_ACCESS_DENIED 0x00800000 | 242 | #define ZFCP_STATUS_COMMON_ACCESS_DENIED 0x00800000 |
289 | #define ZFCP_STATUS_COMMON_ACCESS_BOXED 0x00400000 | 243 | #define ZFCP_STATUS_COMMON_ACCESS_BOXED 0x00400000 |
@@ -291,14 +245,12 @@ struct zfcp_rc_entry { | |||
291 | 245 | ||
292 | /* adapter status */ | 246 | /* adapter status */ |
293 | #define ZFCP_STATUS_ADAPTER_QDIOUP 0x00000002 | 247 | #define ZFCP_STATUS_ADAPTER_QDIOUP 0x00000002 |
294 | #define ZFCP_STATUS_ADAPTER_REGISTERED 0x00000004 | ||
295 | #define ZFCP_STATUS_ADAPTER_XCONFIG_OK 0x00000008 | 248 | #define ZFCP_STATUS_ADAPTER_XCONFIG_OK 0x00000008 |
296 | #define ZFCP_STATUS_ADAPTER_HOST_CON_INIT 0x00000010 | 249 | #define ZFCP_STATUS_ADAPTER_HOST_CON_INIT 0x00000010 |
297 | #define ZFCP_STATUS_ADAPTER_ERP_THREAD_UP 0x00000020 | 250 | #define ZFCP_STATUS_ADAPTER_ERP_THREAD_UP 0x00000020 |
298 | #define ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL 0x00000080 | 251 | #define ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL 0x00000080 |
299 | #define ZFCP_STATUS_ADAPTER_ERP_PENDING 0x00000100 | 252 | #define ZFCP_STATUS_ADAPTER_ERP_PENDING 0x00000100 |
300 | #define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200 | 253 | #define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200 |
301 | #define ZFCP_STATUS_ADAPTER_XPORT_OK 0x00000800 | ||
302 | 254 | ||
303 | /* FC-PH/FC-GS well-known address identifiers for generic services */ | 255 | /* FC-PH/FC-GS well-known address identifiers for generic services */ |
304 | #define ZFCP_DID_MANAGEMENT_SERVICE 0xFFFFFA | 256 | #define ZFCP_DID_MANAGEMENT_SERVICE 0xFFFFFA |
@@ -321,20 +273,16 @@ struct zfcp_rc_entry { | |||
321 | ZFCP_STATUS_PORT_NO_SCSI_ID) | 273 | ZFCP_STATUS_PORT_NO_SCSI_ID) |
322 | 274 | ||
323 | /* logical unit status */ | 275 | /* logical unit status */ |
324 | #define ZFCP_STATUS_UNIT_TEMPORARY 0x00000002 | ||
325 | #define ZFCP_STATUS_UNIT_SHARED 0x00000004 | 276 | #define ZFCP_STATUS_UNIT_SHARED 0x00000004 |
326 | #define ZFCP_STATUS_UNIT_READONLY 0x00000008 | 277 | #define ZFCP_STATUS_UNIT_READONLY 0x00000008 |
327 | #define ZFCP_STATUS_UNIT_REGISTERED 0x00000010 | 278 | #define ZFCP_STATUS_UNIT_REGISTERED 0x00000010 |
328 | #define ZFCP_STATUS_UNIT_SCSI_WORK_PENDING 0x00000020 | 279 | #define ZFCP_STATUS_UNIT_SCSI_WORK_PENDING 0x00000020 |
329 | 280 | ||
330 | /* FSF request status (this does not have a common part) */ | 281 | /* FSF request status (this does not have a common part) */ |
331 | #define ZFCP_STATUS_FSFREQ_NOT_INIT 0x00000000 | ||
332 | #define ZFCP_STATUS_FSFREQ_POOL 0x00000001 | ||
333 | #define ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT 0x00000002 | 282 | #define ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT 0x00000002 |
334 | #define ZFCP_STATUS_FSFREQ_COMPLETED 0x00000004 | 283 | #define ZFCP_STATUS_FSFREQ_COMPLETED 0x00000004 |
335 | #define ZFCP_STATUS_FSFREQ_ERROR 0x00000008 | 284 | #define ZFCP_STATUS_FSFREQ_ERROR 0x00000008 |
336 | #define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010 | 285 | #define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010 |
337 | #define ZFCP_STATUS_FSFREQ_ABORTING 0x00000020 | ||
338 | #define ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED 0x00000040 | 286 | #define ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED 0x00000040 |
339 | #define ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED 0x00000080 | 287 | #define ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED 0x00000080 |
340 | #define ZFCP_STATUS_FSFREQ_ABORTED 0x00000100 | 288 | #define ZFCP_STATUS_FSFREQ_ABORTED 0x00000100 |
@@ -475,7 +423,7 @@ struct zfcp_erp_action { | |||
475 | struct zfcp_adapter *adapter; /* device which should be recovered */ | 423 | struct zfcp_adapter *adapter; /* device which should be recovered */ |
476 | struct zfcp_port *port; | 424 | struct zfcp_port *port; |
477 | struct zfcp_unit *unit; | 425 | struct zfcp_unit *unit; |
478 | volatile u32 status; /* recovery status */ | 426 | u32 status; /* recovery status */ |
479 | u32 step; /* active step of this erp action */ | 427 | u32 step; /* active step of this erp action */ |
480 | struct zfcp_fsf_req *fsf_req; /* fsf request currently pending | 428 | struct zfcp_fsf_req *fsf_req; /* fsf request currently pending |
481 | for this action */ | 429 | for this action */ |
@@ -626,7 +574,7 @@ struct zfcp_fsf_req { | |||
626 | u8 sbal_response; /* SBAL used in interrupt */ | 574 | u8 sbal_response; /* SBAL used in interrupt */ |
627 | wait_queue_head_t completion_wq; /* can be used by a routine | 575 | wait_queue_head_t completion_wq; /* can be used by a routine |
628 | to wait for completion */ | 576 | to wait for completion */ |
629 | volatile u32 status; /* status of this request */ | 577 | u32 status; /* status of this request */ |
630 | u32 fsf_command; /* FSF Command copy */ | 578 | u32 fsf_command; /* FSF Command copy */ |
631 | struct fsf_qtcb *qtcb; /* address of associated QTCB */ | 579 | struct fsf_qtcb *qtcb; /* address of associated QTCB */ |
632 | u32 seq_no; /* Sequence number of request */ | 580 | u32 seq_no; /* Sequence number of request */ |
@@ -678,14 +626,7 @@ struct zfcp_fsf_req_qtcb { | |||
678 | #define ZFCP_SET 0x00000100 | 626 | #define ZFCP_SET 0x00000100 |
679 | #define ZFCP_CLEAR 0x00000200 | 627 | #define ZFCP_CLEAR 0x00000200 |
680 | 628 | ||
681 | #ifndef atomic_test_mask | ||
682 | #define atomic_test_mask(mask, target) \ | ||
683 | ((atomic_read(target) & mask) == mask) | ||
684 | #endif | ||
685 | |||
686 | #define zfcp_get_busid_by_adapter(adapter) (adapter->ccw_device->dev.bus_id) | 629 | #define zfcp_get_busid_by_adapter(adapter) (adapter->ccw_device->dev.bus_id) |
687 | #define zfcp_get_busid_by_port(port) (zfcp_get_busid_by_adapter(port->adapter)) | ||
688 | #define zfcp_get_busid_by_unit(unit) (zfcp_get_busid_by_port(unit->port)) | ||
689 | 630 | ||
690 | /* | 631 | /* |
691 | * Helper functions for request ID management. | 632 | * Helper functions for request ID management. |
@@ -746,12 +687,6 @@ zfcp_unit_put(struct zfcp_unit *unit) | |||
746 | } | 687 | } |
747 | 688 | ||
748 | static inline void | 689 | static inline void |
749 | zfcp_unit_wait(struct zfcp_unit *unit) | ||
750 | { | ||
751 | wait_event(unit->remove_wq, atomic_read(&unit->refcount) == 0); | ||
752 | } | ||
753 | |||
754 | static inline void | ||
755 | zfcp_port_get(struct zfcp_port *port) | 690 | zfcp_port_get(struct zfcp_port *port) |
756 | { | 691 | { |
757 | atomic_inc(&port->refcount); | 692 | atomic_inc(&port->refcount); |
@@ -765,12 +700,6 @@ zfcp_port_put(struct zfcp_port *port) | |||
765 | } | 700 | } |
766 | 701 | ||
767 | static inline void | 702 | static inline void |
768 | zfcp_port_wait(struct zfcp_port *port) | ||
769 | { | ||
770 | wait_event(port->remove_wq, atomic_read(&port->refcount) == 0); | ||
771 | } | ||
772 | |||
773 | static inline void | ||
774 | zfcp_adapter_get(struct zfcp_adapter *adapter) | 703 | zfcp_adapter_get(struct zfcp_adapter *adapter) |
775 | { | 704 | { |
776 | atomic_inc(&adapter->refcount); | 705 | atomic_inc(&adapter->refcount); |
@@ -783,10 +712,4 @@ zfcp_adapter_put(struct zfcp_adapter *adapter) | |||
783 | wake_up(&adapter->remove_wq); | 712 | wake_up(&adapter->remove_wq); |
784 | } | 713 | } |
785 | 714 | ||
786 | static inline void | ||
787 | zfcp_adapter_wait(struct zfcp_adapter *adapter) | ||
788 | { | ||
789 | wait_event(adapter->remove_wq, atomic_read(&adapter->refcount) == 0); | ||
790 | } | ||
791 | |||
792 | #endif /* ZFCP_DEF_H */ | 715 | #endif /* ZFCP_DEF_H */ |
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 4dd8fe70c415..b18c6dd37294 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -669,8 +669,6 @@ static int zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *act) | |||
669 | int ret; | 669 | int ret; |
670 | struct zfcp_adapter *adapter = act->adapter; | 670 | struct zfcp_adapter *adapter = act->adapter; |
671 | 671 | ||
672 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); | ||
673 | |||
674 | write_lock_irq(&adapter->erp_lock); | 672 | write_lock_irq(&adapter->erp_lock); |
675 | zfcp_erp_action_to_running(act); | 673 | zfcp_erp_action_to_running(act); |
676 | write_unlock_irq(&adapter->erp_lock); | 674 | write_unlock_irq(&adapter->erp_lock); |
@@ -741,8 +739,7 @@ static int zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *act, | |||
741 | ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); | 739 | ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); |
742 | failed_qdio: | 740 | failed_qdio: |
743 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK | | 741 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK | |
744 | ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | | 742 | ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, |
745 | ZFCP_STATUS_ADAPTER_XPORT_OK, | ||
746 | &act->adapter->status); | 743 | &act->adapter->status); |
747 | return retval; | 744 | return retval; |
748 | } | 745 | } |
@@ -751,15 +748,11 @@ static int zfcp_erp_adapter_strategy(struct zfcp_erp_action *act) | |||
751 | { | 748 | { |
752 | int retval; | 749 | int retval; |
753 | 750 | ||
754 | atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &act->adapter->status); | ||
755 | zfcp_erp_adapter_strategy_generic(act, 1); /* close */ | 751 | zfcp_erp_adapter_strategy_generic(act, 1); /* close */ |
756 | atomic_clear_mask(ZFCP_STATUS_COMMON_CLOSING, &act->adapter->status); | ||
757 | if (act->status & ZFCP_STATUS_ERP_CLOSE_ONLY) | 752 | if (act->status & ZFCP_STATUS_ERP_CLOSE_ONLY) |
758 | return ZFCP_ERP_EXIT; | 753 | return ZFCP_ERP_EXIT; |
759 | 754 | ||
760 | atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &act->adapter->status); | ||
761 | retval = zfcp_erp_adapter_strategy_generic(act, 0); /* open */ | 755 | retval = zfcp_erp_adapter_strategy_generic(act, 0); /* open */ |
762 | atomic_clear_mask(ZFCP_STATUS_COMMON_OPENING, &act->adapter->status); | ||
763 | 756 | ||
764 | if (retval == ZFCP_ERP_FAILED) | 757 | if (retval == ZFCP_ERP_FAILED) |
765 | ssleep(8); | 758 | ssleep(8); |
@@ -783,9 +776,7 @@ static int zfcp_erp_port_forced_strategy_close(struct zfcp_erp_action *act) | |||
783 | 776 | ||
784 | static void zfcp_erp_port_strategy_clearstati(struct zfcp_port *port) | 777 | static void zfcp_erp_port_strategy_clearstati(struct zfcp_port *port) |
785 | { | 778 | { |
786 | atomic_clear_mask(ZFCP_STATUS_COMMON_OPENING | | 779 | atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | |
787 | ZFCP_STATUS_COMMON_CLOSING | | ||
788 | ZFCP_STATUS_COMMON_ACCESS_DENIED | | ||
789 | ZFCP_STATUS_PORT_DID_DID | | 780 | ZFCP_STATUS_PORT_DID_DID | |
790 | ZFCP_STATUS_PORT_PHYS_CLOSING | | 781 | ZFCP_STATUS_PORT_PHYS_CLOSING | |
791 | ZFCP_STATUS_PORT_INVALID_WWPN, | 782 | ZFCP_STATUS_PORT_INVALID_WWPN, |
@@ -998,9 +989,7 @@ static int zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) | |||
998 | 989 | ||
999 | static void zfcp_erp_unit_strategy_clearstati(struct zfcp_unit *unit) | 990 | static void zfcp_erp_unit_strategy_clearstati(struct zfcp_unit *unit) |
1000 | { | 991 | { |
1001 | atomic_clear_mask(ZFCP_STATUS_COMMON_OPENING | | 992 | atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | |
1002 | ZFCP_STATUS_COMMON_CLOSING | | ||
1003 | ZFCP_STATUS_COMMON_ACCESS_DENIED | | ||
1004 | ZFCP_STATUS_UNIT_SHARED | | 993 | ZFCP_STATUS_UNIT_SHARED | |
1005 | ZFCP_STATUS_UNIT_READONLY, | 994 | ZFCP_STATUS_UNIT_READONLY, |
1006 | &unit->status); | 995 | &unit->status); |
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index edfdb21591f3..a8dd105dc086 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h | |||
@@ -135,10 +135,8 @@ extern struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command(unsigned long, | |||
135 | extern int zfcp_qdio_allocate(struct zfcp_adapter *); | 135 | extern int zfcp_qdio_allocate(struct zfcp_adapter *); |
136 | extern void zfcp_qdio_free(struct zfcp_adapter *); | 136 | extern void zfcp_qdio_free(struct zfcp_adapter *); |
137 | extern int zfcp_qdio_send(struct zfcp_fsf_req *); | 137 | extern int zfcp_qdio_send(struct zfcp_fsf_req *); |
138 | extern volatile struct qdio_buffer_element *zfcp_qdio_sbale_req( | 138 | extern struct qdio_buffer_element *zfcp_qdio_sbale_req(struct zfcp_fsf_req *); |
139 | struct zfcp_fsf_req *); | 139 | extern struct qdio_buffer_element *zfcp_qdio_sbale_curr(struct zfcp_fsf_req *); |
140 | extern volatile struct qdio_buffer_element *zfcp_qdio_sbale_curr( | ||
141 | struct zfcp_fsf_req *); | ||
142 | extern int zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *, unsigned long, | 140 | extern int zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *, unsigned long, |
143 | struct scatterlist *, int); | 141 | struct scatterlist *, int); |
144 | extern int zfcp_qdio_open(struct zfcp_adapter *); | 142 | extern int zfcp_qdio_open(struct zfcp_adapter *); |
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index 56196c98c07b..44456f74a12d 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
@@ -47,10 +47,11 @@ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range, | |||
47 | 47 | ||
48 | read_lock_irqsave(&zfcp_data.config_lock, flags); | 48 | read_lock_irqsave(&zfcp_data.config_lock, flags); |
49 | list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) { | 49 | list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) { |
50 | if (atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) | 50 | if ((atomic_read(&port->status) & ZFCP_STATUS_PORT_WKA) == |
51 | ZFCP_STATUS_PORT_WKA) | ||
51 | continue; | 52 | continue; |
52 | /* FIXME: ZFCP_STATUS_PORT_DID_DID check is racy */ | 53 | /* FIXME: ZFCP_STATUS_PORT_DID_DID check is racy */ |
53 | if (!atomic_test_mask(ZFCP_STATUS_PORT_DID_DID, &port->status)) | 54 | if (!(atomic_read(&port->status) & ZFCP_STATUS_PORT_DID_DID)) |
54 | /* Try to connect to unused ports anyway. */ | 55 | /* Try to connect to unused ports anyway. */ |
55 | zfcp_erp_port_reopen(port, | 56 | zfcp_erp_port_reopen(port, |
56 | ZFCP_STATUS_COMMON_ERP_FAILED, | 57 | ZFCP_STATUS_COMMON_ERP_FAILED, |
@@ -255,14 +256,14 @@ struct zfcp_els_adisc { | |||
255 | struct scatterlist req; | 256 | struct scatterlist req; |
256 | struct scatterlist resp; | 257 | struct scatterlist resp; |
257 | struct zfcp_ls_adisc ls_adisc; | 258 | struct zfcp_ls_adisc ls_adisc; |
258 | struct zfcp_ls_adisc_acc ls_adisc_acc; | 259 | struct zfcp_ls_adisc ls_adisc_acc; |
259 | }; | 260 | }; |
260 | 261 | ||
261 | static void zfcp_fc_adisc_handler(unsigned long data) | 262 | static void zfcp_fc_adisc_handler(unsigned long data) |
262 | { | 263 | { |
263 | struct zfcp_els_adisc *adisc = (struct zfcp_els_adisc *) data; | 264 | struct zfcp_els_adisc *adisc = (struct zfcp_els_adisc *) data; |
264 | struct zfcp_port *port = adisc->els.port; | 265 | struct zfcp_port *port = adisc->els.port; |
265 | struct zfcp_ls_adisc_acc *ls_adisc = &adisc->ls_adisc_acc; | 266 | struct zfcp_ls_adisc *ls_adisc = &adisc->ls_adisc_acc; |
266 | 267 | ||
267 | if (adisc->els.status) { | 268 | if (adisc->els.status) { |
268 | /* request rejected or timed out */ | 269 | /* request rejected or timed out */ |
@@ -295,7 +296,7 @@ static int zfcp_fc_adisc(struct zfcp_port *port) | |||
295 | sg_init_one(adisc->els.req, &adisc->ls_adisc, | 296 | sg_init_one(adisc->els.req, &adisc->ls_adisc, |
296 | sizeof(struct zfcp_ls_adisc)); | 297 | sizeof(struct zfcp_ls_adisc)); |
297 | sg_init_one(adisc->els.resp, &adisc->ls_adisc_acc, | 298 | sg_init_one(adisc->els.resp, &adisc->ls_adisc_acc, |
298 | sizeof(struct zfcp_ls_adisc_acc)); | 299 | sizeof(struct zfcp_ls_adisc)); |
299 | 300 | ||
300 | adisc->els.req_count = 1; | 301 | adisc->els.req_count = 1; |
301 | adisc->els.resp_count = 1; | 302 | adisc->els.resp_count = 1; |
@@ -345,16 +346,16 @@ static int zfcp_scan_get_nameserver(struct zfcp_adapter *adapter) | |||
345 | if (!adapter->nameserver_port) | 346 | if (!adapter->nameserver_port) |
346 | return -EINTR; | 347 | return -EINTR; |
347 | 348 | ||
348 | if (!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, | 349 | if (!(atomic_read(&adapter->nameserver_port->status) & |
349 | &adapter->nameserver_port->status)) { | 350 | ZFCP_STATUS_COMMON_UNBLOCKED)) { |
350 | ret = zfcp_erp_port_reopen(adapter->nameserver_port, 0, 148, | 351 | ret = zfcp_erp_port_reopen(adapter->nameserver_port, 0, 148, |
351 | NULL); | 352 | NULL); |
352 | if (ret) | 353 | if (ret) |
353 | return ret; | 354 | return ret; |
354 | zfcp_erp_wait(adapter); | 355 | zfcp_erp_wait(adapter); |
355 | } | 356 | } |
356 | return !atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, | 357 | return !(atomic_read(&adapter->nameserver_port->status) & |
357 | &adapter->nameserver_port->status); | 358 | ZFCP_STATUS_COMMON_UNBLOCKED); |
358 | } | 359 | } |
359 | 360 | ||
360 | static void zfcp_gpn_ft_handler(unsigned long _done) | 361 | static void zfcp_gpn_ft_handler(unsigned long _done) |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 489a1896499e..af75fd2ef1e2 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -621,7 +621,6 @@ static void zfcp_fsf_exchange_port_evaluate(struct zfcp_fsf_req *req) | |||
621 | 621 | ||
622 | static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req) | 622 | static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req) |
623 | { | 623 | { |
624 | struct zfcp_adapter *adapter = req->adapter; | ||
625 | struct fsf_qtcb *qtcb = req->qtcb; | 624 | struct fsf_qtcb *qtcb = req->qtcb; |
626 | 625 | ||
627 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) | 626 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
@@ -630,11 +629,9 @@ static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req) | |||
630 | switch (qtcb->header.fsf_status) { | 629 | switch (qtcb->header.fsf_status) { |
631 | case FSF_GOOD: | 630 | case FSF_GOOD: |
632 | zfcp_fsf_exchange_port_evaluate(req); | 631 | zfcp_fsf_exchange_port_evaluate(req); |
633 | atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); | ||
634 | break; | 632 | break; |
635 | case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: | 633 | case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: |
636 | zfcp_fsf_exchange_port_evaluate(req); | 634 | zfcp_fsf_exchange_port_evaluate(req); |
637 | atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); | ||
638 | zfcp_fsf_link_down_info_eval(req, 43, | 635 | zfcp_fsf_link_down_info_eval(req, 43, |
639 | &qtcb->header.fsf_status_qual.link_down_info); | 636 | &qtcb->header.fsf_status_qual.link_down_info); |
640 | break; | 637 | break; |
@@ -708,7 +705,7 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_adapter *adapter, | |||
708 | u32 fsf_cmd, int req_flags, | 705 | u32 fsf_cmd, int req_flags, |
709 | mempool_t *pool) | 706 | mempool_t *pool) |
710 | { | 707 | { |
711 | volatile struct qdio_buffer_element *sbale; | 708 | struct qdio_buffer_element *sbale; |
712 | 709 | ||
713 | struct zfcp_fsf_req *req; | 710 | struct zfcp_fsf_req *req; |
714 | struct zfcp_qdio_queue *req_q = &adapter->req_q; | 711 | struct zfcp_qdio_queue *req_q = &adapter->req_q; |
@@ -810,7 +807,7 @@ int zfcp_fsf_status_read(struct zfcp_adapter *adapter) | |||
810 | { | 807 | { |
811 | struct zfcp_fsf_req *req; | 808 | struct zfcp_fsf_req *req; |
812 | struct fsf_status_read_buffer *sr_buf; | 809 | struct fsf_status_read_buffer *sr_buf; |
813 | volatile struct qdio_buffer_element *sbale; | 810 | struct qdio_buffer_element *sbale; |
814 | int retval = -EIO; | 811 | int retval = -EIO; |
815 | 812 | ||
816 | spin_lock_bh(&adapter->req_q.lock); | 813 | spin_lock_bh(&adapter->req_q.lock); |
@@ -923,7 +920,7 @@ struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command(unsigned long old_req_id, | |||
923 | struct zfcp_unit *unit, | 920 | struct zfcp_unit *unit, |
924 | int req_flags) | 921 | int req_flags) |
925 | { | 922 | { |
926 | volatile struct qdio_buffer_element *sbale; | 923 | struct qdio_buffer_element *sbale; |
927 | struct zfcp_fsf_req *req = NULL; | 924 | struct zfcp_fsf_req *req = NULL; |
928 | 925 | ||
929 | spin_lock(&adapter->req_q.lock); | 926 | spin_lock(&adapter->req_q.lock); |
@@ -1171,8 +1168,8 @@ int zfcp_fsf_send_els(struct zfcp_send_els *els) | |||
1171 | goto out; | 1168 | goto out; |
1172 | } | 1169 | } |
1173 | 1170 | ||
1174 | ret = zfcp_fsf_setup_sbals(req, els->req, els->resp, | 1171 | ret = zfcp_fsf_setup_sbals(req, els->req, els->resp, 2); |
1175 | FSF_MAX_SBALS_PER_ELS_REQ); | 1172 | |
1176 | if (ret) | 1173 | if (ret) |
1177 | goto failed_send; | 1174 | goto failed_send; |
1178 | 1175 | ||
@@ -1201,7 +1198,7 @@ out: | |||
1201 | 1198 | ||
1202 | int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) | 1199 | int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) |
1203 | { | 1200 | { |
1204 | volatile struct qdio_buffer_element *sbale; | 1201 | struct qdio_buffer_element *sbale; |
1205 | struct zfcp_fsf_req *req; | 1202 | struct zfcp_fsf_req *req; |
1206 | struct zfcp_adapter *adapter = erp_action->adapter; | 1203 | struct zfcp_adapter *adapter = erp_action->adapter; |
1207 | int retval = -EIO; | 1204 | int retval = -EIO; |
@@ -1245,7 +1242,7 @@ out: | |||
1245 | int zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter, | 1242 | int zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter, |
1246 | struct fsf_qtcb_bottom_config *data) | 1243 | struct fsf_qtcb_bottom_config *data) |
1247 | { | 1244 | { |
1248 | volatile struct qdio_buffer_element *sbale; | 1245 | struct qdio_buffer_element *sbale; |
1249 | struct zfcp_fsf_req *req = NULL; | 1246 | struct zfcp_fsf_req *req = NULL; |
1250 | int retval = -EIO; | 1247 | int retval = -EIO; |
1251 | 1248 | ||
@@ -1294,7 +1291,7 @@ out: | |||
1294 | */ | 1291 | */ |
1295 | int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action) | 1292 | int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action) |
1296 | { | 1293 | { |
1297 | volatile struct qdio_buffer_element *sbale; | 1294 | struct qdio_buffer_element *sbale; |
1298 | struct zfcp_fsf_req *req; | 1295 | struct zfcp_fsf_req *req; |
1299 | struct zfcp_adapter *adapter = erp_action->adapter; | 1296 | struct zfcp_adapter *adapter = erp_action->adapter; |
1300 | int retval = -EIO; | 1297 | int retval = -EIO; |
@@ -1341,7 +1338,7 @@ out: | |||
1341 | int zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter, | 1338 | int zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter, |
1342 | struct fsf_qtcb_bottom_port *data) | 1339 | struct fsf_qtcb_bottom_port *data) |
1343 | { | 1340 | { |
1344 | volatile struct qdio_buffer_element *sbale; | 1341 | struct qdio_buffer_element *sbale; |
1345 | struct zfcp_fsf_req *req = NULL; | 1342 | struct zfcp_fsf_req *req = NULL; |
1346 | int retval = -EIO; | 1343 | int retval = -EIO; |
1347 | 1344 | ||
@@ -1386,7 +1383,7 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req) | |||
1386 | struct fsf_plogi *plogi; | 1383 | struct fsf_plogi *plogi; |
1387 | 1384 | ||
1388 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) | 1385 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
1389 | goto skip_fsfstatus; | 1386 | return; |
1390 | 1387 | ||
1391 | switch (header->fsf_status) { | 1388 | switch (header->fsf_status) { |
1392 | case FSF_PORT_ALREADY_OPEN: | 1389 | case FSF_PORT_ALREADY_OPEN: |
@@ -1456,9 +1453,6 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req) | |||
1456 | req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 1453 | req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
1457 | break; | 1454 | break; |
1458 | } | 1455 | } |
1459 | |||
1460 | skip_fsfstatus: | ||
1461 | atomic_clear_mask(ZFCP_STATUS_COMMON_OPENING, &port->status); | ||
1462 | } | 1456 | } |
1463 | 1457 | ||
1464 | /** | 1458 | /** |
@@ -1468,7 +1462,7 @@ skip_fsfstatus: | |||
1468 | */ | 1462 | */ |
1469 | int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | 1463 | int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) |
1470 | { | 1464 | { |
1471 | volatile struct qdio_buffer_element *sbale; | 1465 | struct qdio_buffer_element *sbale; |
1472 | struct zfcp_adapter *adapter = erp_action->adapter; | 1466 | struct zfcp_adapter *adapter = erp_action->adapter; |
1473 | struct zfcp_fsf_req *req; | 1467 | struct zfcp_fsf_req *req; |
1474 | int retval = -EIO; | 1468 | int retval = -EIO; |
@@ -1495,7 +1489,6 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | |||
1495 | req->data = erp_action->port; | 1489 | req->data = erp_action->port; |
1496 | req->erp_action = erp_action; | 1490 | req->erp_action = erp_action; |
1497 | erp_action->fsf_req = req; | 1491 | erp_action->fsf_req = req; |
1498 | atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->port->status); | ||
1499 | 1492 | ||
1500 | zfcp_fsf_start_erp_timer(req); | 1493 | zfcp_fsf_start_erp_timer(req); |
1501 | retval = zfcp_fsf_req_send(req); | 1494 | retval = zfcp_fsf_req_send(req); |
@@ -1513,7 +1506,7 @@ static void zfcp_fsf_close_port_handler(struct zfcp_fsf_req *req) | |||
1513 | struct zfcp_port *port = req->data; | 1506 | struct zfcp_port *port = req->data; |
1514 | 1507 | ||
1515 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) | 1508 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
1516 | goto skip_fsfstatus; | 1509 | return; |
1517 | 1510 | ||
1518 | switch (req->qtcb->header.fsf_status) { | 1511 | switch (req->qtcb->header.fsf_status) { |
1519 | case FSF_PORT_HANDLE_NOT_VALID: | 1512 | case FSF_PORT_HANDLE_NOT_VALID: |
@@ -1528,9 +1521,6 @@ static void zfcp_fsf_close_port_handler(struct zfcp_fsf_req *req) | |||
1528 | ZFCP_CLEAR); | 1521 | ZFCP_CLEAR); |
1529 | break; | 1522 | break; |
1530 | } | 1523 | } |
1531 | |||
1532 | skip_fsfstatus: | ||
1533 | atomic_clear_mask(ZFCP_STATUS_COMMON_CLOSING, &port->status); | ||
1534 | } | 1524 | } |
1535 | 1525 | ||
1536 | /** | 1526 | /** |
@@ -1540,7 +1530,7 @@ skip_fsfstatus: | |||
1540 | */ | 1530 | */ |
1541 | int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) | 1531 | int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) |
1542 | { | 1532 | { |
1543 | volatile struct qdio_buffer_element *sbale; | 1533 | struct qdio_buffer_element *sbale; |
1544 | struct zfcp_adapter *adapter = erp_action->adapter; | 1534 | struct zfcp_adapter *adapter = erp_action->adapter; |
1545 | struct zfcp_fsf_req *req; | 1535 | struct zfcp_fsf_req *req; |
1546 | int retval = -EIO; | 1536 | int retval = -EIO; |
@@ -1566,7 +1556,6 @@ int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) | |||
1566 | req->erp_action = erp_action; | 1556 | req->erp_action = erp_action; |
1567 | req->qtcb->header.port_handle = erp_action->port->handle; | 1557 | req->qtcb->header.port_handle = erp_action->port->handle; |
1568 | erp_action->fsf_req = req; | 1558 | erp_action->fsf_req = req; |
1569 | atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &erp_action->port->status); | ||
1570 | 1559 | ||
1571 | zfcp_fsf_start_erp_timer(req); | 1560 | zfcp_fsf_start_erp_timer(req); |
1572 | retval = zfcp_fsf_req_send(req); | 1561 | retval = zfcp_fsf_req_send(req); |
@@ -1637,7 +1626,7 @@ skip_fsfstatus: | |||
1637 | */ | 1626 | */ |
1638 | int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) | 1627 | int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) |
1639 | { | 1628 | { |
1640 | volatile struct qdio_buffer_element *sbale; | 1629 | struct qdio_buffer_element *sbale; |
1641 | struct zfcp_adapter *adapter = erp_action->adapter; | 1630 | struct zfcp_adapter *adapter = erp_action->adapter; |
1642 | struct zfcp_fsf_req *req; | 1631 | struct zfcp_fsf_req *req; |
1643 | int retval = -EIO; | 1632 | int retval = -EIO; |
@@ -1688,7 +1677,7 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req) | |||
1688 | int exclusive, readwrite; | 1677 | int exclusive, readwrite; |
1689 | 1678 | ||
1690 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) | 1679 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
1691 | goto skip_fsfstatus; | 1680 | return; |
1692 | 1681 | ||
1693 | atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | | 1682 | atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | |
1694 | ZFCP_STATUS_COMMON_ACCESS_BOXED | | 1683 | ZFCP_STATUS_COMMON_ACCESS_BOXED | |
@@ -1798,9 +1787,6 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req) | |||
1798 | } | 1787 | } |
1799 | break; | 1788 | break; |
1800 | } | 1789 | } |
1801 | |||
1802 | skip_fsfstatus: | ||
1803 | atomic_clear_mask(ZFCP_STATUS_COMMON_OPENING, &unit->status); | ||
1804 | } | 1790 | } |
1805 | 1791 | ||
1806 | /** | 1792 | /** |
@@ -1810,7 +1796,7 @@ skip_fsfstatus: | |||
1810 | */ | 1796 | */ |
1811 | int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) | 1797 | int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) |
1812 | { | 1798 | { |
1813 | volatile struct qdio_buffer_element *sbale; | 1799 | struct qdio_buffer_element *sbale; |
1814 | struct zfcp_adapter *adapter = erp_action->adapter; | 1800 | struct zfcp_adapter *adapter = erp_action->adapter; |
1815 | struct zfcp_fsf_req *req; | 1801 | struct zfcp_fsf_req *req; |
1816 | int retval = -EIO; | 1802 | int retval = -EIO; |
@@ -1841,8 +1827,6 @@ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) | |||
1841 | if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE)) | 1827 | if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE)) |
1842 | req->qtcb->bottom.support.option = FSF_OPEN_LUN_SUPPRESS_BOXING; | 1828 | req->qtcb->bottom.support.option = FSF_OPEN_LUN_SUPPRESS_BOXING; |
1843 | 1829 | ||
1844 | atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->unit->status); | ||
1845 | |||
1846 | zfcp_fsf_start_erp_timer(req); | 1830 | zfcp_fsf_start_erp_timer(req); |
1847 | retval = zfcp_fsf_req_send(req); | 1831 | retval = zfcp_fsf_req_send(req); |
1848 | if (retval) { | 1832 | if (retval) { |
@@ -1859,7 +1843,7 @@ static void zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *req) | |||
1859 | struct zfcp_unit *unit = req->data; | 1843 | struct zfcp_unit *unit = req->data; |
1860 | 1844 | ||
1861 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) | 1845 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
1862 | goto skip_fsfstatus; | 1846 | return; |
1863 | 1847 | ||
1864 | switch (req->qtcb->header.fsf_status) { | 1848 | switch (req->qtcb->header.fsf_status) { |
1865 | case FSF_PORT_HANDLE_NOT_VALID: | 1849 | case FSF_PORT_HANDLE_NOT_VALID: |
@@ -1889,8 +1873,6 @@ static void zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *req) | |||
1889 | atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status); | 1873 | atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status); |
1890 | break; | 1874 | break; |
1891 | } | 1875 | } |
1892 | skip_fsfstatus: | ||
1893 | atomic_clear_mask(ZFCP_STATUS_COMMON_CLOSING, &unit->status); | ||
1894 | } | 1876 | } |
1895 | 1877 | ||
1896 | /** | 1878 | /** |
@@ -1900,7 +1882,7 @@ skip_fsfstatus: | |||
1900 | */ | 1882 | */ |
1901 | int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) | 1883 | int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) |
1902 | { | 1884 | { |
1903 | volatile struct qdio_buffer_element *sbale; | 1885 | struct qdio_buffer_element *sbale; |
1904 | struct zfcp_adapter *adapter = erp_action->adapter; | 1886 | struct zfcp_adapter *adapter = erp_action->adapter; |
1905 | struct zfcp_fsf_req *req; | 1887 | struct zfcp_fsf_req *req; |
1906 | int retval = -EIO; | 1888 | int retval = -EIO; |
@@ -1926,7 +1908,6 @@ int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) | |||
1926 | req->data = erp_action->unit; | 1908 | req->data = erp_action->unit; |
1927 | req->erp_action = erp_action; | 1909 | req->erp_action = erp_action; |
1928 | erp_action->fsf_req = req; | 1910 | erp_action->fsf_req = req; |
1929 | atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &erp_action->unit->status); | ||
1930 | 1911 | ||
1931 | zfcp_fsf_start_erp_timer(req); | 1912 | zfcp_fsf_start_erp_timer(req); |
1932 | retval = zfcp_fsf_req_send(req); | 1913 | retval = zfcp_fsf_req_send(req); |
@@ -2275,7 +2256,7 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_adapter *adapter, | |||
2275 | struct zfcp_unit *unit, | 2256 | struct zfcp_unit *unit, |
2276 | u8 tm_flags, int req_flags) | 2257 | u8 tm_flags, int req_flags) |
2277 | { | 2258 | { |
2278 | volatile struct qdio_buffer_element *sbale; | 2259 | struct qdio_buffer_element *sbale; |
2279 | struct zfcp_fsf_req *req = NULL; | 2260 | struct zfcp_fsf_req *req = NULL; |
2280 | struct fcp_cmnd_iu *fcp_cmnd_iu; | 2261 | struct fcp_cmnd_iu *fcp_cmnd_iu; |
2281 | 2262 | ||
@@ -2335,7 +2316,7 @@ static void zfcp_fsf_control_file_handler(struct zfcp_fsf_req *req) | |||
2335 | struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *adapter, | 2316 | struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *adapter, |
2336 | struct zfcp_fsf_cfdc *fsf_cfdc) | 2317 | struct zfcp_fsf_cfdc *fsf_cfdc) |
2337 | { | 2318 | { |
2338 | volatile struct qdio_buffer_element *sbale; | 2319 | struct qdio_buffer_element *sbale; |
2339 | struct zfcp_fsf_req *req = NULL; | 2320 | struct zfcp_fsf_req *req = NULL; |
2340 | struct fsf_qtcb_bottom_support *bottom; | 2321 | struct fsf_qtcb_bottom_support *bottom; |
2341 | int direction, retval = -EIO, bytes; | 2322 | int direction, retval = -EIO, bytes; |
diff --git a/drivers/s390/scsi/zfcp_fsf.h b/drivers/s390/scsi/zfcp_fsf.h index bf94b4da0763..fd3a88777ac8 100644 --- a/drivers/s390/scsi/zfcp_fsf.h +++ b/drivers/s390/scsi/zfcp_fsf.h | |||
@@ -71,13 +71,6 @@ | |||
71 | #define FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED 0x00000041 | 71 | #define FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED 0x00000041 |
72 | #define FSF_ELS_COMMAND_REJECTED 0x00000050 | 72 | #define FSF_ELS_COMMAND_REJECTED 0x00000050 |
73 | #define FSF_GENERIC_COMMAND_REJECTED 0x00000051 | 73 | #define FSF_GENERIC_COMMAND_REJECTED 0x00000051 |
74 | #define FSF_OPERATION_PARTIALLY_SUCCESSFUL 0x00000052 | ||
75 | #define FSF_AUTHORIZATION_FAILURE 0x00000053 | ||
76 | #define FSF_CFDC_ERROR_DETECTED 0x00000054 | ||
77 | #define FSF_CONTROL_FILE_UPDATE_ERROR 0x00000055 | ||
78 | #define FSF_CONTROL_FILE_TOO_LARGE 0x00000056 | ||
79 | #define FSF_ACCESS_CONFLICT_DETECTED 0x00000057 | ||
80 | #define FSF_CONFLICTS_OVERRULED 0x00000058 | ||
81 | #define FSF_PORT_BOXED 0x00000059 | 74 | #define FSF_PORT_BOXED 0x00000059 |
82 | #define FSF_LUN_BOXED 0x0000005A | 75 | #define FSF_LUN_BOXED 0x0000005A |
83 | #define FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE 0x0000005B | 76 | #define FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE 0x0000005B |
@@ -85,9 +78,7 @@ | |||
85 | #define FSF_REQUEST_SIZE_TOO_LARGE 0x00000061 | 78 | #define FSF_REQUEST_SIZE_TOO_LARGE 0x00000061 |
86 | #define FSF_RESPONSE_SIZE_TOO_LARGE 0x00000062 | 79 | #define FSF_RESPONSE_SIZE_TOO_LARGE 0x00000062 |
87 | #define FSF_SBAL_MISMATCH 0x00000063 | 80 | #define FSF_SBAL_MISMATCH 0x00000063 |
88 | #define FSF_OPEN_PORT_WITHOUT_PRLI 0x00000064 | ||
89 | #define FSF_ADAPTER_STATUS_AVAILABLE 0x000000AD | 81 | #define FSF_ADAPTER_STATUS_AVAILABLE 0x000000AD |
90 | #define FSF_FCP_RSP_AVAILABLE 0x000000AF | ||
91 | #define FSF_UNKNOWN_COMMAND 0x000000E2 | 82 | #define FSF_UNKNOWN_COMMAND 0x000000E2 |
92 | #define FSF_UNKNOWN_OP_SUBTYPE 0x000000E3 | 83 | #define FSF_UNKNOWN_OP_SUBTYPE 0x000000E3 |
93 | #define FSF_INVALID_COMMAND_OPTION 0x000000E5 | 84 | #define FSF_INVALID_COMMAND_OPTION 0x000000E5 |
@@ -102,20 +93,9 @@ | |||
102 | #define FSF_SQ_RETRY_IF_POSSIBLE 0x02 | 93 | #define FSF_SQ_RETRY_IF_POSSIBLE 0x02 |
103 | #define FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED 0x03 | 94 | #define FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED 0x03 |
104 | #define FSF_SQ_INVOKE_LINK_TEST_PROCEDURE 0x04 | 95 | #define FSF_SQ_INVOKE_LINK_TEST_PROCEDURE 0x04 |
105 | #define FSF_SQ_ULP_PROGRAMMING_ERROR 0x05 | ||
106 | #define FSF_SQ_COMMAND_ABORTED 0x06 | 96 | #define FSF_SQ_COMMAND_ABORTED 0x06 |
107 | #define FSF_SQ_NO_RETRY_POSSIBLE 0x07 | 97 | #define FSF_SQ_NO_RETRY_POSSIBLE 0x07 |
108 | 98 | ||
109 | /* FSF status qualifier for CFDC commands */ | ||
110 | #define FSF_SQ_CFDC_HARDENED_ON_SE 0x00000000 | ||
111 | #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE 0x00000001 | ||
112 | #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE2 0x00000002 | ||
113 | /* CFDC subtable codes */ | ||
114 | #define FSF_SQ_CFDC_SUBTABLE_OS 0x0001 | ||
115 | #define FSF_SQ_CFDC_SUBTABLE_PORT_WWPN 0x0002 | ||
116 | #define FSF_SQ_CFDC_SUBTABLE_PORT_DID 0x0003 | ||
117 | #define FSF_SQ_CFDC_SUBTABLE_LUN 0x0004 | ||
118 | |||
119 | /* FSF status qualifier (most significant 4 bytes), local link down */ | 99 | /* FSF status qualifier (most significant 4 bytes), local link down */ |
120 | #define FSF_PSQ_LINK_NO_LIGHT 0x00000004 | 100 | #define FSF_PSQ_LINK_NO_LIGHT 0x00000004 |
121 | #define FSF_PSQ_LINK_WRAP_PLUG 0x00000008 | 101 | #define FSF_PSQ_LINK_WRAP_PLUG 0x00000008 |
@@ -145,7 +125,6 @@ | |||
145 | #define FSF_STATUS_READ_LINK_UP 0x00000006 | 125 | #define FSF_STATUS_READ_LINK_UP 0x00000006 |
146 | #define FSF_STATUS_READ_NOTIFICATION_LOST 0x00000009 | 126 | #define FSF_STATUS_READ_NOTIFICATION_LOST 0x00000009 |
147 | #define FSF_STATUS_READ_CFDC_UPDATED 0x0000000A | 127 | #define FSF_STATUS_READ_CFDC_UPDATED 0x0000000A |
148 | #define FSF_STATUS_READ_CFDC_HARDENED 0x0000000B | ||
149 | #define FSF_STATUS_READ_FEATURE_UPDATE_ALERT 0x0000000C | 128 | #define FSF_STATUS_READ_FEATURE_UPDATE_ALERT 0x0000000C |
150 | 129 | ||
151 | /* status subtypes in status read buffer */ | 130 | /* status subtypes in status read buffer */ |
@@ -159,20 +138,9 @@ | |||
159 | 138 | ||
160 | /* status subtypes for unsolicited status notification lost */ | 139 | /* status subtypes for unsolicited status notification lost */ |
161 | #define FSF_STATUS_READ_SUB_INCOMING_ELS 0x00000001 | 140 | #define FSF_STATUS_READ_SUB_INCOMING_ELS 0x00000001 |
162 | #define FSF_STATUS_READ_SUB_SENSE_DATA 0x00000002 | ||
163 | #define FSF_STATUS_READ_SUB_LINK_STATUS 0x00000004 | ||
164 | #define FSF_STATUS_READ_SUB_PORT_CLOSED 0x00000008 | ||
165 | #define FSF_STATUS_READ_SUB_BIT_ERROR_THRESHOLD 0x00000010 | ||
166 | #define FSF_STATUS_READ_SUB_ACT_UPDATED 0x00000020 | 141 | #define FSF_STATUS_READ_SUB_ACT_UPDATED 0x00000020 |
167 | #define FSF_STATUS_READ_SUB_ACT_HARDENED 0x00000040 | ||
168 | #define FSF_STATUS_READ_SUB_FEATURE_UPDATE_ALERT 0x00000080 | ||
169 | |||
170 | /* status subtypes for CFDC */ | ||
171 | #define FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE 0x00000002 | ||
172 | #define FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE2 0x0000000F | ||
173 | 142 | ||
174 | /* topologie that is detected by the adapter */ | 143 | /* topologie that is detected by the adapter */ |
175 | #define FSF_TOPO_ERROR 0x00000000 | ||
176 | #define FSF_TOPO_P2P 0x00000001 | 144 | #define FSF_TOPO_P2P 0x00000001 |
177 | #define FSF_TOPO_FABRIC 0x00000002 | 145 | #define FSF_TOPO_FABRIC 0x00000002 |
178 | #define FSF_TOPO_AL 0x00000003 | 146 | #define FSF_TOPO_AL 0x00000003 |
@@ -180,17 +148,13 @@ | |||
180 | /* data direction for FCP commands */ | 148 | /* data direction for FCP commands */ |
181 | #define FSF_DATADIR_WRITE 0x00000001 | 149 | #define FSF_DATADIR_WRITE 0x00000001 |
182 | #define FSF_DATADIR_READ 0x00000002 | 150 | #define FSF_DATADIR_READ 0x00000002 |
183 | #define FSF_DATADIR_READ_WRITE 0x00000003 | ||
184 | #define FSF_DATADIR_CMND 0x00000004 | 151 | #define FSF_DATADIR_CMND 0x00000004 |
185 | 152 | ||
186 | /* fc service class */ | 153 | /* fc service class */ |
187 | #define FSF_CLASS_1 0x00000001 | ||
188 | #define FSF_CLASS_2 0x00000002 | ||
189 | #define FSF_CLASS_3 0x00000003 | 154 | #define FSF_CLASS_3 0x00000003 |
190 | 155 | ||
191 | /* SBAL chaining */ | 156 | /* SBAL chaining */ |
192 | #define FSF_MAX_SBALS_PER_REQ 36 | 157 | #define FSF_MAX_SBALS_PER_REQ 36 |
193 | #define FSF_MAX_SBALS_PER_ELS_REQ 2 | ||
194 | 158 | ||
195 | /* logging space behind QTCB */ | 159 | /* logging space behind QTCB */ |
196 | #define FSF_QTCB_LOG_SIZE 1024 | 160 | #define FSF_QTCB_LOG_SIZE 1024 |
@@ -200,50 +164,16 @@ | |||
200 | #define FSF_FEATURE_LUN_SHARING 0x00000004 | 164 | #define FSF_FEATURE_LUN_SHARING 0x00000004 |
201 | #define FSF_FEATURE_NOTIFICATION_LOST 0x00000008 | 165 | #define FSF_FEATURE_NOTIFICATION_LOST 0x00000008 |
202 | #define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010 | 166 | #define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010 |
203 | #define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020 | ||
204 | #define FSF_FEATURE_UPDATE_ALERT 0x00000100 | 167 | #define FSF_FEATURE_UPDATE_ALERT 0x00000100 |
205 | #define FSF_FEATURE_MEASUREMENT_DATA 0x00000200 | 168 | #define FSF_FEATURE_MEASUREMENT_DATA 0x00000200 |
206 | 169 | ||
207 | /* host connection features */ | 170 | /* host connection features */ |
208 | #define FSF_FEATURE_NPIV_MODE 0x00000001 | 171 | #define FSF_FEATURE_NPIV_MODE 0x00000001 |
209 | #define FSF_FEATURE_VM_ASSIGNED_WWPN 0x00000002 | ||
210 | 172 | ||
211 | /* option */ | 173 | /* option */ |
212 | #define FSF_OPEN_LUN_SUPPRESS_BOXING 0x00000001 | 174 | #define FSF_OPEN_LUN_SUPPRESS_BOXING 0x00000001 |
213 | #define FSF_OPEN_LUN_REPLICATE_SENSE 0x00000002 | ||
214 | |||
215 | /* adapter types */ | ||
216 | #define FSF_ADAPTER_TYPE_FICON 0x00000001 | ||
217 | #define FSF_ADAPTER_TYPE_FICON_EXPRESS 0x00000002 | ||
218 | |||
219 | /* port types */ | ||
220 | #define FSF_HBA_PORTTYPE_UNKNOWN 0x00000001 | ||
221 | #define FSF_HBA_PORTTYPE_NOTPRESENT 0x00000003 | ||
222 | #define FSF_HBA_PORTTYPE_NPORT 0x00000005 | ||
223 | #define FSF_HBA_PORTTYPE_PTP 0x00000021 | ||
224 | /* following are not defined and used by FSF Spec | ||
225 | but are additionally defined by FC-HBA */ | ||
226 | #define FSF_HBA_PORTTYPE_OTHER 0x00000002 | ||
227 | #define FSF_HBA_PORTTYPE_NOTPRESENT 0x00000003 | ||
228 | #define FSF_HBA_PORTTYPE_NLPORT 0x00000006 | ||
229 | #define FSF_HBA_PORTTYPE_FLPORT 0x00000007 | ||
230 | #define FSF_HBA_PORTTYPE_FPORT 0x00000008 | ||
231 | #define FSF_HBA_PORTTYPE_LPORT 0x00000020 | ||
232 | |||
233 | /* port states */ | ||
234 | #define FSF_HBA_PORTSTATE_UNKNOWN 0x00000001 | ||
235 | #define FSF_HBA_PORTSTATE_ONLINE 0x00000002 | ||
236 | #define FSF_HBA_PORTSTATE_OFFLINE 0x00000003 | ||
237 | #define FSF_HBA_PORTSTATE_LINKDOWN 0x00000006 | ||
238 | #define FSF_HBA_PORTSTATE_ERROR 0x00000007 | ||
239 | |||
240 | /* IO states of adapter */ | ||
241 | #define FSF_IOSTAT_NPORT_RJT 0x00000004 | ||
242 | #define FSF_IOSTAT_FABRIC_RJT 0x00000005 | ||
243 | #define FSF_IOSTAT_LS_RJT 0x00000009 | ||
244 | 175 | ||
245 | /* open LUN access flags*/ | 176 | /* open LUN access flags*/ |
246 | #define FSF_UNIT_ACCESS_OPEN_LUN_ALLOWED 0x01000000 | ||
247 | #define FSF_UNIT_ACCESS_EXCLUSIVE 0x02000000 | 177 | #define FSF_UNIT_ACCESS_EXCLUSIVE 0x02000000 |
248 | #define FSF_UNIT_ACCESS_OUTBOUND_TRANSFER 0x10000000 | 178 | #define FSF_UNIT_ACCESS_OUTBOUND_TRANSFER 0x10000000 |
249 | 179 | ||
@@ -265,11 +195,6 @@ struct fsf_queue_designator { | |||
265 | u32 res1; | 195 | u32 res1; |
266 | } __attribute__ ((packed)); | 196 | } __attribute__ ((packed)); |
267 | 197 | ||
268 | struct fsf_port_closed_payload { | ||
269 | struct fsf_queue_designator queue_designator; | ||
270 | u32 port_handle; | ||
271 | } __attribute__ ((packed)); | ||
272 | |||
273 | struct fsf_bit_error_payload { | 198 | struct fsf_bit_error_payload { |
274 | u32 res1; | 199 | u32 res1; |
275 | u32 link_failure_error_count; | 200 | u32 link_failure_error_count; |
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index 9c5b84980901..0dfaa176af7f 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c | |||
@@ -28,7 +28,7 @@ static int zfcp_qdio_buffers_enqueue(struct qdio_buffer **sbal) | |||
28 | return 0; | 28 | return 0; |
29 | } | 29 | } |
30 | 30 | ||
31 | static volatile struct qdio_buffer_element * | 31 | static struct qdio_buffer_element * |
32 | zfcp_qdio_sbale(struct zfcp_qdio_queue *q, int sbal_idx, int sbale_idx) | 32 | zfcp_qdio_sbale(struct zfcp_qdio_queue *q, int sbal_idx, int sbale_idx) |
33 | { | 33 | { |
34 | return &q->sbal[sbal_idx]->element[sbale_idx]; | 34 | return &q->sbal[sbal_idx]->element[sbale_idx]; |
@@ -145,7 +145,7 @@ static void zfcp_qdio_int_resp(struct ccw_device *cdev, unsigned int qdio_err, | |||
145 | { | 145 | { |
146 | struct zfcp_adapter *adapter = (struct zfcp_adapter *) parm; | 146 | struct zfcp_adapter *adapter = (struct zfcp_adapter *) parm; |
147 | struct zfcp_qdio_queue *queue = &adapter->resp_q; | 147 | struct zfcp_qdio_queue *queue = &adapter->resp_q; |
148 | volatile struct qdio_buffer_element *sbale; | 148 | struct qdio_buffer_element *sbale; |
149 | int sbal_idx, sbale_idx, sbal_no; | 149 | int sbal_idx, sbale_idx, sbal_no; |
150 | 150 | ||
151 | if (unlikely(qdio_err)) { | 151 | if (unlikely(qdio_err)) { |
@@ -190,8 +190,7 @@ static void zfcp_qdio_int_resp(struct ccw_device *cdev, unsigned int qdio_err, | |||
190 | * @fsf_req: pointer to struct fsf_req | 190 | * @fsf_req: pointer to struct fsf_req |
191 | * Returns: pointer to qdio_buffer_element (SBALE) structure | 191 | * Returns: pointer to qdio_buffer_element (SBALE) structure |
192 | */ | 192 | */ |
193 | volatile struct qdio_buffer_element * | 193 | struct qdio_buffer_element *zfcp_qdio_sbale_req(struct zfcp_fsf_req *req) |
194 | zfcp_qdio_sbale_req(struct zfcp_fsf_req *req) | ||
195 | { | 194 | { |
196 | return zfcp_qdio_sbale(&req->adapter->req_q, req->sbal_last, 0); | 195 | return zfcp_qdio_sbale(&req->adapter->req_q, req->sbal_last, 0); |
197 | } | 196 | } |
@@ -201,8 +200,7 @@ zfcp_qdio_sbale_req(struct zfcp_fsf_req *req) | |||
201 | * @fsf_req: pointer to struct fsf_req | 200 | * @fsf_req: pointer to struct fsf_req |
202 | * Returns: pointer to qdio_buffer_element (SBALE) structure | 201 | * Returns: pointer to qdio_buffer_element (SBALE) structure |
203 | */ | 202 | */ |
204 | volatile struct qdio_buffer_element * | 203 | struct qdio_buffer_element *zfcp_qdio_sbale_curr(struct zfcp_fsf_req *req) |
205 | zfcp_qdio_sbale_curr(struct zfcp_fsf_req *req) | ||
206 | { | 204 | { |
207 | return zfcp_qdio_sbale(&req->adapter->req_q, req->sbal_last, | 205 | return zfcp_qdio_sbale(&req->adapter->req_q, req->sbal_last, |
208 | req->sbale_curr); | 206 | req->sbale_curr); |
@@ -216,10 +214,10 @@ static void zfcp_qdio_sbal_limit(struct zfcp_fsf_req *fsf_req, int max_sbals) | |||
216 | % QDIO_MAX_BUFFERS_PER_Q; | 214 | % QDIO_MAX_BUFFERS_PER_Q; |
217 | } | 215 | } |
218 | 216 | ||
219 | static volatile struct qdio_buffer_element * | 217 | static struct qdio_buffer_element * |
220 | zfcp_qdio_sbal_chain(struct zfcp_fsf_req *fsf_req, unsigned long sbtype) | 218 | zfcp_qdio_sbal_chain(struct zfcp_fsf_req *fsf_req, unsigned long sbtype) |
221 | { | 219 | { |
222 | volatile struct qdio_buffer_element *sbale; | 220 | struct qdio_buffer_element *sbale; |
223 | 221 | ||
224 | /* set last entry flag in current SBALE of current SBAL */ | 222 | /* set last entry flag in current SBALE of current SBAL */ |
225 | sbale = zfcp_qdio_sbale_curr(fsf_req); | 223 | sbale = zfcp_qdio_sbale_curr(fsf_req); |
@@ -250,7 +248,7 @@ zfcp_qdio_sbal_chain(struct zfcp_fsf_req *fsf_req, unsigned long sbtype) | |||
250 | return sbale; | 248 | return sbale; |
251 | } | 249 | } |
252 | 250 | ||
253 | static volatile struct qdio_buffer_element * | 251 | static struct qdio_buffer_element * |
254 | zfcp_qdio_sbale_next(struct zfcp_fsf_req *fsf_req, unsigned long sbtype) | 252 | zfcp_qdio_sbale_next(struct zfcp_fsf_req *fsf_req, unsigned long sbtype) |
255 | { | 253 | { |
256 | if (fsf_req->sbale_curr == ZFCP_LAST_SBALE_PER_SBAL) | 254 | if (fsf_req->sbale_curr == ZFCP_LAST_SBALE_PER_SBAL) |
@@ -273,7 +271,7 @@ static int zfcp_qdio_fill_sbals(struct zfcp_fsf_req *fsf_req, | |||
273 | unsigned int sbtype, void *start_addr, | 271 | unsigned int sbtype, void *start_addr, |
274 | unsigned int total_length) | 272 | unsigned int total_length) |
275 | { | 273 | { |
276 | volatile struct qdio_buffer_element *sbale; | 274 | struct qdio_buffer_element *sbale; |
277 | unsigned long remaining, length; | 275 | unsigned long remaining, length; |
278 | void *addr; | 276 | void *addr; |
279 | 277 | ||
@@ -308,7 +306,7 @@ static int zfcp_qdio_fill_sbals(struct zfcp_fsf_req *fsf_req, | |||
308 | int zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype, | 306 | int zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype, |
309 | struct scatterlist *sg, int max_sbals) | 307 | struct scatterlist *sg, int max_sbals) |
310 | { | 308 | { |
311 | volatile struct qdio_buffer_element *sbale; | 309 | struct qdio_buffer_element *sbale; |
312 | int retval, bytes = 0; | 310 | int retval, bytes = 0; |
313 | 311 | ||
314 | /* figure out last allowed SBAL */ | 312 | /* figure out last allowed SBAL */ |
@@ -345,7 +343,7 @@ int zfcp_qdio_send(struct zfcp_fsf_req *fsf_req) | |||
345 | int first = fsf_req->sbal_first; | 343 | int first = fsf_req->sbal_first; |
346 | int count = fsf_req->sbal_number; | 344 | int count = fsf_req->sbal_number; |
347 | int retval, pci, pci_batch; | 345 | int retval, pci, pci_batch; |
348 | volatile struct qdio_buffer_element *sbale; | 346 | struct qdio_buffer_element *sbale; |
349 | 347 | ||
350 | /* acknowledgements for transferred buffers */ | 348 | /* acknowledgements for transferred buffers */ |
351 | pci_batch = req_q->pci_batch + count; | 349 | pci_batch = req_q->pci_batch + count; |
@@ -419,7 +417,7 @@ void zfcp_qdio_close(struct zfcp_adapter *adapter) | |||
419 | struct zfcp_qdio_queue *req_q; | 417 | struct zfcp_qdio_queue *req_q; |
420 | int first, count; | 418 | int first, count; |
421 | 419 | ||
422 | if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) | 420 | if (!(atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) |
423 | return; | 421 | return; |
424 | 422 | ||
425 | /* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */ | 423 | /* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */ |
@@ -451,10 +449,10 @@ void zfcp_qdio_close(struct zfcp_adapter *adapter) | |||
451 | */ | 449 | */ |
452 | int zfcp_qdio_open(struct zfcp_adapter *adapter) | 450 | int zfcp_qdio_open(struct zfcp_adapter *adapter) |
453 | { | 451 | { |
454 | volatile struct qdio_buffer_element *sbale; | 452 | struct qdio_buffer_element *sbale; |
455 | int cc; | 453 | int cc; |
456 | 454 | ||
457 | if (atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) | 455 | if (atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP) |
458 | return -EIO; | 456 | return -EIO; |
459 | 457 | ||
460 | if (qdio_establish(&adapter->qdio_init_data)) | 458 | if (qdio_establish(&adapter->qdio_init_data)) |
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 6348cc5520e1..2095a1e41e80 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -183,7 +183,6 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
183 | return retval; | 183 | return retval; |
184 | } | 184 | } |
185 | fsf_req->data = NULL; | 185 | fsf_req->data = NULL; |
186 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ABORTING; | ||
187 | 186 | ||
188 | /* don't access old fsf_req after releasing the abort_lock */ | 187 | /* don't access old fsf_req after releasing the abort_lock */ |
189 | write_unlock_irqrestore(&adapter->abort_lock, flags); | 188 | write_unlock_irqrestore(&adapter->abort_lock, flags); |
@@ -313,7 +312,6 @@ int zfcp_adapter_scsi_register(struct zfcp_adapter *adapter) | |||
313 | scsi_host_put(adapter->scsi_host); | 312 | scsi_host_put(adapter->scsi_host); |
314 | return -EIO; | 313 | return -EIO; |
315 | } | 314 | } |
316 | atomic_set_mask(ZFCP_STATUS_ADAPTER_REGISTERED, &adapter->status); | ||
317 | 315 | ||
318 | return 0; | 316 | return 0; |
319 | } | 317 | } |
@@ -337,7 +335,6 @@ void zfcp_adapter_scsi_unregister(struct zfcp_adapter *adapter) | |||
337 | scsi_remove_host(shost); | 335 | scsi_remove_host(shost); |
338 | scsi_host_put(shost); | 336 | scsi_host_put(shost); |
339 | adapter->scsi_host = NULL; | 337 | adapter->scsi_host = NULL; |
340 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_REGISTERED, &adapter->status); | ||
341 | 338 | ||
342 | return; | 339 | return; |
343 | } | 340 | } |