aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi
diff options
context:
space:
mode:
authorAndreas Herrmann <aherrman@de.ibm.com>2005-06-13 07:23:57 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-06-13 22:37:01 -0400
commitd736a27b7efbc835c7b83db5c1bbd41edbadf32e (patch)
treecefcc6dfb1853b6d008d67124b032bdfd6ff990b /drivers/s390/scsi
parentcd8a383ebc93f8ded9cefee53a337542c3aacad7 (diff)
[SCSI] zfcp: fix handling of port boxed and lun boxed fsf states
From: Maxim Shchetynin <maxim@de.ibm.com> Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r--drivers/s390/scsi/zfcp_def.h1
-rw-r--r--drivers/s390/scsi/zfcp_erp.c68
-rw-r--r--drivers/s390/scsi/zfcp_ext.h2
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c32
4 files changed, 75 insertions, 28 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index bfbbb825f9ab..4103b5be7683 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -490,6 +490,7 @@ do { \
490#define ZFCP_STATUS_COMMON_CLOSING 0x02000000 490#define ZFCP_STATUS_COMMON_CLOSING 0x02000000
491#define ZFCP_STATUS_COMMON_ERP_INUSE 0x01000000 491#define ZFCP_STATUS_COMMON_ERP_INUSE 0x01000000
492#define ZFCP_STATUS_COMMON_ACCESS_DENIED 0x00800000 492#define ZFCP_STATUS_COMMON_ACCESS_DENIED 0x00800000
493#define ZFCP_STATUS_COMMON_ACCESS_BOXED 0x00400000
493 494
494/* adapter status */ 495/* adapter status */
495#define ZFCP_STATUS_ADAPTER_QDIOUP 0x00000002 496#define ZFCP_STATUS_ADAPTER_QDIOUP 0x00000002
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 6d73891eec9e..0cf31f7d1c0f 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -3482,6 +3482,45 @@ zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action)
3482} 3482}
3483 3483
3484/* 3484/*
3485 * function: zfcp_erp_port_boxed
3486 *
3487 * purpose:
3488 */
3489void
3490zfcp_erp_port_boxed(struct zfcp_port *port)
3491{
3492 struct zfcp_adapter *adapter = port->adapter;
3493 unsigned long flags;
3494
3495 debug_text_event(adapter->erp_dbf, 3, "p_access_boxed");
3496 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
3497 read_lock_irqsave(&zfcp_data.config_lock, flags);
3498 zfcp_erp_modify_port_status(port,
3499 ZFCP_STATUS_COMMON_ACCESS_BOXED,
3500 ZFCP_SET);
3501 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
3502 zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED);
3503}
3504
3505/*
3506 * function: zfcp_erp_unit_boxed
3507 *
3508 * purpose:
3509 */
3510void
3511zfcp_erp_unit_boxed(struct zfcp_unit *unit)
3512{
3513 struct zfcp_adapter *adapter = unit->port->adapter;
3514
3515 debug_text_event(adapter->erp_dbf, 3, "u_access_boxed");
3516 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t));
3517 zfcp_erp_modify_unit_status(unit,
3518 ZFCP_STATUS_COMMON_ACCESS_BOXED,
3519 ZFCP_SET);
3520 zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED);
3521}
3522
3523/*
3485 * function: zfcp_erp_port_access_denied 3524 * function: zfcp_erp_port_access_denied
3486 * 3525 *
3487 * purpose: 3526 * purpose:
@@ -3492,11 +3531,13 @@ zfcp_erp_port_access_denied(struct zfcp_port *port)
3492 struct zfcp_adapter *adapter = port->adapter; 3531 struct zfcp_adapter *adapter = port->adapter;
3493 unsigned long flags; 3532 unsigned long flags;
3494 3533
3495 debug_text_event(adapter->erp_dbf, 3, "p_access_block"); 3534 debug_text_event(adapter->erp_dbf, 3, "p_access_denied");
3496 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); 3535 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
3497 read_lock_irqsave(&zfcp_data.config_lock, flags); 3536 read_lock_irqsave(&zfcp_data.config_lock, flags);
3498 zfcp_erp_modify_port_status(port, ZFCP_STATUS_COMMON_ERP_FAILED | 3537 zfcp_erp_modify_port_status(port,
3499 ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); 3538 ZFCP_STATUS_COMMON_ERP_FAILED |
3539 ZFCP_STATUS_COMMON_ACCESS_DENIED,
3540 ZFCP_SET);
3500 read_unlock_irqrestore(&zfcp_data.config_lock, flags); 3541 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
3501} 3542}
3502 3543
@@ -3510,10 +3551,12 @@ zfcp_erp_unit_access_denied(struct zfcp_unit *unit)
3510{ 3551{
3511 struct zfcp_adapter *adapter = unit->port->adapter; 3552 struct zfcp_adapter *adapter = unit->port->adapter;
3512 3553
3513 debug_text_event(adapter->erp_dbf, 3, "u_access_block"); 3554 debug_text_event(adapter->erp_dbf, 3, "u_access_denied");
3514 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); 3555 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t));
3515 zfcp_erp_modify_unit_status(unit, ZFCP_STATUS_COMMON_ERP_FAILED | 3556 zfcp_erp_modify_unit_status(unit,
3516 ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); 3557 ZFCP_STATUS_COMMON_ERP_FAILED |
3558 ZFCP_STATUS_COMMON_ACCESS_DENIED,
3559 ZFCP_SET);
3517} 3560}
3518 3561
3519/* 3562/*
@@ -3527,7 +3570,7 @@ zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter)
3527 struct zfcp_port *port; 3570 struct zfcp_port *port;
3528 unsigned long flags; 3571 unsigned long flags;
3529 3572
3530 debug_text_event(adapter->erp_dbf, 3, "a_access_unblock"); 3573 debug_text_event(adapter->erp_dbf, 3, "a_access_recover");
3531 debug_event(adapter->erp_dbf, 3, &adapter->name, 8); 3574 debug_event(adapter->erp_dbf, 3, &adapter->name, 8);
3532 3575
3533 read_lock_irqsave(&zfcp_data.config_lock, flags); 3576 read_lock_irqsave(&zfcp_data.config_lock, flags);
@@ -3550,10 +3593,12 @@ zfcp_erp_port_access_changed(struct zfcp_port *port)
3550 struct zfcp_adapter *adapter = port->adapter; 3593 struct zfcp_adapter *adapter = port->adapter;
3551 struct zfcp_unit *unit; 3594 struct zfcp_unit *unit;
3552 3595
3553 debug_text_event(adapter->erp_dbf, 3, "p_access_unblock"); 3596 debug_text_event(adapter->erp_dbf, 3, "p_access_recover");
3554 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); 3597 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
3555 3598
3556 if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, 3599 if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED,
3600 &port->status) &&
3601 !atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_BOXED,
3557 &port->status)) { 3602 &port->status)) {
3558 if (!atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) 3603 if (!atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status))
3559 list_for_each_entry(unit, &port->unit_list_head, list) 3604 list_for_each_entry(unit, &port->unit_list_head, list)
@@ -3580,10 +3625,13 @@ zfcp_erp_unit_access_changed(struct zfcp_unit *unit)
3580{ 3625{
3581 struct zfcp_adapter *adapter = unit->port->adapter; 3626 struct zfcp_adapter *adapter = unit->port->adapter;
3582 3627
3583 debug_text_event(adapter->erp_dbf, 3, "u_access_unblock"); 3628 debug_text_event(adapter->erp_dbf, 3, "u_access_recover");
3584 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); 3629 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t));
3585 3630
3586 if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &unit->status)) 3631 if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED,
3632 &unit->status) &&
3633 !atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_BOXED,
3634 &unit->status))
3587 return; 3635 return;
3588 3636
3589 ZFCP_LOG_NORMAL("reopen of unit 0x%016Lx on port 0x%016Lx " 3637 ZFCP_LOG_NORMAL("reopen of unit 0x%016Lx on port 0x%016Lx "
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index 8f0da2e02a47..42df7e57eeae 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -171,6 +171,8 @@ extern int zfcp_erp_async_handler(struct zfcp_erp_action *, unsigned long);
171 171
172extern int zfcp_test_link(struct zfcp_port *); 172extern int zfcp_test_link(struct zfcp_port *);
173 173
174extern void zfcp_erp_port_boxed(struct zfcp_port *);
175extern void zfcp_erp_unit_boxed(struct zfcp_unit *);
174extern void zfcp_erp_port_access_denied(struct zfcp_port *); 176extern void zfcp_erp_port_access_denied(struct zfcp_port *);
175extern void zfcp_erp_unit_access_denied(struct zfcp_unit *); 177extern void zfcp_erp_unit_access_denied(struct zfcp_unit *);
176extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *); 178extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 56b2ea97da1f..0d9f20edc490 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -1228,7 +1228,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1228 zfcp_get_busid_by_unit(unit)); 1228 zfcp_get_busid_by_unit(unit));
1229 debug_text_event(new_fsf_req->adapter->erp_dbf, 2, 1229 debug_text_event(new_fsf_req->adapter->erp_dbf, 2,
1230 "fsf_s_pboxed"); 1230 "fsf_s_pboxed");
1231 zfcp_erp_port_reopen(unit->port, 0); 1231 zfcp_erp_port_boxed(unit->port);
1232 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR 1232 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
1233 | ZFCP_STATUS_FSFREQ_RETRY; 1233 | ZFCP_STATUS_FSFREQ_RETRY;
1234 break; 1234 break;
@@ -1240,10 +1240,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1240 unit->fcp_lun, unit->port->wwpn, 1240 unit->fcp_lun, unit->port->wwpn,
1241 zfcp_get_busid_by_unit(unit)); 1241 zfcp_get_busid_by_unit(unit));
1242 debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); 1242 debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed");
1243 zfcp_erp_unit_reopen(unit, 0); 1243 zfcp_erp_unit_boxed(unit);
1244 zfcp_cmd_dbf_event_fsf("unitbox", new_fsf_req,
1245 &new_fsf_req->qtcb->header.fsf_status_qual,
1246 sizeof(union fsf_status_qual));
1247 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR 1244 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
1248 | ZFCP_STATUS_FSFREQ_RETRY; 1245 | ZFCP_STATUS_FSFREQ_RETRY;
1249 break; 1246 break;
@@ -1573,7 +1570,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1573 "(adapter %s, port d_id=0x%08x)\n", 1570 "(adapter %s, port d_id=0x%08x)\n",
1574 zfcp_get_busid_by_port(port), port->d_id); 1571 zfcp_get_busid_by_port(port), port->d_id);
1575 debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); 1572 debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed");
1576 zfcp_erp_port_reopen(port, 0); 1573 zfcp_erp_port_boxed(port);
1577 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR 1574 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
1578 | ZFCP_STATUS_FSFREQ_RETRY; 1575 | ZFCP_STATUS_FSFREQ_RETRY;
1579 break; 1576 break;
@@ -2460,6 +2457,9 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2460 /* mark port as open */ 2457 /* mark port as open */
2461 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN | 2458 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN |
2462 ZFCP_STATUS_PORT_PHYS_OPEN, &port->status); 2459 ZFCP_STATUS_PORT_PHYS_OPEN, &port->status);
2460 atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED |
2461 ZFCP_STATUS_COMMON_ACCESS_BOXED,
2462 &port->status);
2463 retval = 0; 2463 retval = 0;
2464 /* check whether D_ID has changed during open */ 2464 /* check whether D_ID has changed during open */
2465 /* 2465 /*
@@ -2803,7 +2803,7 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
2803 port->wwpn, 2803 port->wwpn,
2804 zfcp_get_busid_by_port(port)); 2804 zfcp_get_busid_by_port(port));
2805 debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_pboxed"); 2805 debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_pboxed");
2806 zfcp_erp_port_reopen(port, 0); 2806 zfcp_erp_port_boxed(port);
2807 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 2807 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
2808 ZFCP_STATUS_FSFREQ_RETRY; 2808 ZFCP_STATUS_FSFREQ_RETRY;
2809 break; 2809 break;
@@ -3035,7 +3035,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3035 "needs to be reopened\n", 3035 "needs to be reopened\n",
3036 unit->port->wwpn, zfcp_get_busid_by_unit(unit)); 3036 unit->port->wwpn, zfcp_get_busid_by_unit(unit));
3037 debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); 3037 debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed");
3038 zfcp_erp_port_reopen(unit->port, 0); 3038 zfcp_erp_port_boxed(unit->port);
3039 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 3039 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
3040 ZFCP_STATUS_FSFREQ_RETRY; 3040 ZFCP_STATUS_FSFREQ_RETRY;
3041 break; 3041 break;
@@ -3145,7 +3145,9 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3145 unit->handle); 3145 unit->handle);
3146 /* mark unit as open */ 3146 /* mark unit as open */
3147 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status); 3147 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status);
3148 3148 atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED |
3149 ZFCP_STATUS_COMMON_ACCESS_BOXED,
3150 &unit->status);
3149 if (adapter->supported_features & FSF_FEATURE_LUN_SHARING){ 3151 if (adapter->supported_features & FSF_FEATURE_LUN_SHARING){
3150 if (!exclusive) 3152 if (!exclusive)
3151 atomic_set_mask(ZFCP_STATUS_UNIT_SHARED, 3153 atomic_set_mask(ZFCP_STATUS_UNIT_SHARED,
@@ -3335,7 +3337,7 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req)
3335 unit->port->wwpn, 3337 unit->port->wwpn,
3336 zfcp_get_busid_by_unit(unit)); 3338 zfcp_get_busid_by_unit(unit));
3337 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); 3339 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed");
3338 zfcp_erp_port_reopen(unit->port, 0); 3340 zfcp_erp_port_boxed(unit->port);
3339 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 3341 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
3340 ZFCP_STATUS_FSFREQ_RETRY; 3342 ZFCP_STATUS_FSFREQ_RETRY;
3341 break; 3343 break;
@@ -3881,10 +3883,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3881 "needs to be reopened\n", 3883 "needs to be reopened\n",
3882 unit->port->wwpn, zfcp_get_busid_by_unit(unit)); 3884 unit->port->wwpn, zfcp_get_busid_by_unit(unit));
3883 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); 3885 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed");
3884 zfcp_erp_port_reopen(unit->port, 0); 3886 zfcp_erp_port_boxed(unit->port);
3885 zfcp_cmd_dbf_event_fsf("portbox", fsf_req,
3886 &header->fsf_status_qual,
3887 sizeof (union fsf_status_qual));
3888 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 3887 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
3889 ZFCP_STATUS_FSFREQ_RETRY; 3888 ZFCP_STATUS_FSFREQ_RETRY;
3890 break; 3889 break;
@@ -3895,10 +3894,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3895 zfcp_get_busid_by_unit(unit), 3894 zfcp_get_busid_by_unit(unit),
3896 unit->port->wwpn, unit->fcp_lun); 3895 unit->port->wwpn, unit->fcp_lun);
3897 debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); 3896 debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed");
3898 zfcp_erp_unit_reopen(unit, 0); 3897 zfcp_erp_unit_boxed(unit);
3899 zfcp_cmd_dbf_event_fsf("unitbox", fsf_req,
3900 &header->fsf_status_qual,
3901 sizeof(union fsf_status_qual));
3902 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR 3898 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
3903 | ZFCP_STATUS_FSFREQ_RETRY; 3899 | ZFCP_STATUS_FSFREQ_RETRY;
3904 break; 3900 break;