aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_erp.c
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/zfcp_erp.c
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/zfcp_erp.c')
-rw-r--r--drivers/s390/scsi/zfcp_erp.c68
1 files changed, 58 insertions, 10 deletions
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 "