aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_erp.c
diff options
context:
space:
mode:
authorMartin Peschke <mp3@de.ibm.com>2008-03-27 09:22:02 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-07 13:19:04 -0400
commit698ec01635819c5ae60090bb4efcbeffc41642fb (patch)
tree8800461be45c3efa65558441a3d049fd0a38bf52 /drivers/s390/scsi/zfcp_erp.c
parent348447e85749120ad600a5c8e23b6bb7058b931d (diff)
[SCSI] zfcp: Add traces for state changes.
This patch writes a trace record which provides information about state changes for adapters, ports and units, e.g. target failure, targets becoming online, targets being temporarily blocked due to pending recovery, targets which have been recovered successfully etc. Signed-off-by: Martin Peschke <mp3@de.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_erp.c')
-rw-r--r--drivers/s390/scsi/zfcp_erp.c153
1 files changed, 91 insertions, 62 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index f9383f068169..bee03443efd4 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -163,7 +163,7 @@ static void zfcp_close_fsf(struct zfcp_adapter *adapter)
163 /* reset FSF request sequence number */ 163 /* reset FSF request sequence number */
164 adapter->fsf_req_seq_no = 0; 164 adapter->fsf_req_seq_no = 0;
165 /* all ports and units are closed */ 165 /* all ports and units are closed */
166 zfcp_erp_modify_adapter_status(adapter, 166 zfcp_erp_modify_adapter_status(adapter, 24, 0,
167 ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); 167 ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR);
168} 168}
169 169
@@ -216,7 +216,7 @@ zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, int clear_mask)
216 zfcp_get_busid_by_adapter(adapter)); 216 zfcp_get_busid_by_adapter(adapter));
217 debug_text_event(adapter->erp_dbf, 5, "a_ro_f"); 217 debug_text_event(adapter->erp_dbf, 5, "a_ro_f");
218 /* ensure propagation of failed status to new devices */ 218 /* ensure propagation of failed status to new devices */
219 zfcp_erp_adapter_failed(adapter); 219 zfcp_erp_adapter_failed(adapter, 13, 0);
220 retval = -EIO; 220 retval = -EIO;
221 goto out; 221 goto out;
222 } 222 }
@@ -572,7 +572,7 @@ zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask)
572 debug_text_event(adapter->erp_dbf, 5, "p_ro_f"); 572 debug_text_event(adapter->erp_dbf, 5, "p_ro_f");
573 debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); 573 debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t));
574 /* ensure propagation of failed status to new devices */ 574 /* ensure propagation of failed status to new devices */
575 zfcp_erp_port_failed(port); 575 zfcp_erp_port_failed(port, 14, 0);
576 retval = -EIO; 576 retval = -EIO;
577 goto out; 577 goto out;
578 } 578 }
@@ -688,18 +688,44 @@ zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear_mask)
688static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int clear_mask) 688static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int clear_mask)
689{ 689{
690 debug_text_event(adapter->erp_dbf, 6, "a_bl"); 690 debug_text_event(adapter->erp_dbf, 6, "a_bl");
691 zfcp_erp_modify_adapter_status(adapter, 691 zfcp_erp_modify_adapter_status(adapter, 15, 0,
692 ZFCP_STATUS_COMMON_UNBLOCKED | 692 ZFCP_STATUS_COMMON_UNBLOCKED |
693 clear_mask, ZFCP_CLEAR); 693 clear_mask, ZFCP_CLEAR);
694} 694}
695 695
696/* FIXME: isn't really atomic */
697/*
698 * returns the mask which has not been set so far, i.e.
699 * 0 if no bit has been changed, !0 if some bit has been changed
700 */
701static int atomic_test_and_set_mask(unsigned long mask, atomic_t *v)
702{
703 int changed_bits = (atomic_read(v) /*XOR*/^ mask) & mask;
704 atomic_set_mask(mask, v);
705 return changed_bits;
706}
707
708/* FIXME: isn't really atomic */
709/*
710 * returns the mask which has not been cleared so far, i.e.
711 * 0 if no bit has been changed, !0 if some bit has been changed
712 */
713static int atomic_test_and_clear_mask(unsigned long mask, atomic_t *v)
714{
715 int changed_bits = atomic_read(v) & mask;
716 atomic_clear_mask(mask, v);
717 return changed_bits;
718}
719
696/** 720/**
697 * zfcp_erp_adapter_unblock - mark adapter as unblocked, allow scsi requests 721 * zfcp_erp_adapter_unblock - mark adapter as unblocked, allow scsi requests
698 */ 722 */
699static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) 723static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter)
700{ 724{
701 debug_text_event(adapter->erp_dbf, 6, "a_ubl"); 725 debug_text_event(adapter->erp_dbf, 6, "a_ubl");
702 atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status); 726 if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
727 &adapter->status))
728 zfcp_rec_dbf_event_adapter(16, 0, adapter);
703} 729}
704 730
705/* 731/*
@@ -718,7 +744,7 @@ zfcp_erp_port_block(struct zfcp_port *port, int clear_mask)
718 744
719 debug_text_event(adapter->erp_dbf, 6, "p_bl"); 745 debug_text_event(adapter->erp_dbf, 6, "p_bl");
720 debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); 746 debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t));
721 zfcp_erp_modify_port_status(port, 747 zfcp_erp_modify_port_status(port, 17, 0,
722 ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, 748 ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask,
723 ZFCP_CLEAR); 749 ZFCP_CLEAR);
724} 750}
@@ -737,7 +763,9 @@ zfcp_erp_port_unblock(struct zfcp_port *port)
737 763
738 debug_text_event(adapter->erp_dbf, 6, "p_ubl"); 764 debug_text_event(adapter->erp_dbf, 6, "p_ubl");
739 debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); 765 debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t));
740 atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status); 766 if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
767 &port->status))
768 zfcp_rec_dbf_event_port(18, 0, port);
741} 769}
742 770
743/* 771/*
@@ -756,7 +784,7 @@ zfcp_erp_unit_block(struct zfcp_unit *unit, int clear_mask)
756 784
757 debug_text_event(adapter->erp_dbf, 6, "u_bl"); 785 debug_text_event(adapter->erp_dbf, 6, "u_bl");
758 debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t)); 786 debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t));
759 zfcp_erp_modify_unit_status(unit, 787 zfcp_erp_modify_unit_status(unit, 19, 0,
760 ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, 788 ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask,
761 ZFCP_CLEAR); 789 ZFCP_CLEAR);
762} 790}
@@ -775,7 +803,9 @@ zfcp_erp_unit_unblock(struct zfcp_unit *unit)
775 803
776 debug_text_event(adapter->erp_dbf, 6, "u_ubl"); 804 debug_text_event(adapter->erp_dbf, 6, "u_ubl");
777 debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t)); 805 debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t));
778 atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status); 806 if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
807 &unit->status))
808 zfcp_rec_dbf_event_unit(20, 0, unit);
779} 809}
780 810
781static void 811static void
@@ -1357,9 +1387,9 @@ zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action)
1357 * 1387 *
1358 */ 1388 */
1359void 1389void
1360zfcp_erp_adapter_failed(struct zfcp_adapter *adapter) 1390zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, u8 id, u64 ref)
1361{ 1391{
1362 zfcp_erp_modify_adapter_status(adapter, 1392 zfcp_erp_modify_adapter_status(adapter, id, ref,
1363 ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); 1393 ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET);
1364 ZFCP_LOG_NORMAL("adapter erp failed on adapter %s\n", 1394 ZFCP_LOG_NORMAL("adapter erp failed on adapter %s\n",
1365 zfcp_get_busid_by_adapter(adapter)); 1395 zfcp_get_busid_by_adapter(adapter));
@@ -1373,9 +1403,9 @@ zfcp_erp_adapter_failed(struct zfcp_adapter *adapter)
1373 * 1403 *
1374 */ 1404 */
1375void 1405void
1376zfcp_erp_port_failed(struct zfcp_port *port) 1406zfcp_erp_port_failed(struct zfcp_port *port, u8 id, u64 ref)
1377{ 1407{
1378 zfcp_erp_modify_port_status(port, 1408 zfcp_erp_modify_port_status(port, id, ref,
1379 ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); 1409 ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET);
1380 1410
1381 if (atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) 1411 if (atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status))
@@ -1397,9 +1427,9 @@ zfcp_erp_port_failed(struct zfcp_port *port)
1397 * 1427 *
1398 */ 1428 */
1399void 1429void
1400zfcp_erp_unit_failed(struct zfcp_unit *unit) 1430zfcp_erp_unit_failed(struct zfcp_unit *unit, u8 id, u64 ref)
1401{ 1431{
1402 zfcp_erp_modify_unit_status(unit, 1432 zfcp_erp_modify_unit_status(unit, id, ref,
1403 ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); 1433 ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET);
1404 1434
1405 ZFCP_LOG_NORMAL("unit erp failed on unit 0x%016Lx on port 0x%016Lx " 1435 ZFCP_LOG_NORMAL("unit erp failed on unit 0x%016Lx on port 0x%016Lx "
@@ -1522,7 +1552,7 @@ zfcp_erp_strategy_check_unit(struct zfcp_unit *unit, int result)
1522 case ZFCP_ERP_FAILED : 1552 case ZFCP_ERP_FAILED :
1523 atomic_inc(&unit->erp_counter); 1553 atomic_inc(&unit->erp_counter);
1524 if (atomic_read(&unit->erp_counter) > ZFCP_MAX_ERPS) 1554 if (atomic_read(&unit->erp_counter) > ZFCP_MAX_ERPS)
1525 zfcp_erp_unit_failed(unit); 1555 zfcp_erp_unit_failed(unit, 21, 0);
1526 break; 1556 break;
1527 case ZFCP_ERP_EXIT : 1557 case ZFCP_ERP_EXIT :
1528 /* nothing */ 1558 /* nothing */
@@ -1551,7 +1581,7 @@ zfcp_erp_strategy_check_port(struct zfcp_port *port, int result)
1551 case ZFCP_ERP_FAILED : 1581 case ZFCP_ERP_FAILED :
1552 atomic_inc(&port->erp_counter); 1582 atomic_inc(&port->erp_counter);
1553 if (atomic_read(&port->erp_counter) > ZFCP_MAX_ERPS) 1583 if (atomic_read(&port->erp_counter) > ZFCP_MAX_ERPS)
1554 zfcp_erp_port_failed(port); 1584 zfcp_erp_port_failed(port, 22, 0);
1555 break; 1585 break;
1556 case ZFCP_ERP_EXIT : 1586 case ZFCP_ERP_EXIT :
1557 /* nothing */ 1587 /* nothing */
@@ -1579,7 +1609,7 @@ zfcp_erp_strategy_check_adapter(struct zfcp_adapter *adapter, int result)
1579 case ZFCP_ERP_FAILED : 1609 case ZFCP_ERP_FAILED :
1580 atomic_inc(&adapter->erp_counter); 1610 atomic_inc(&adapter->erp_counter);
1581 if (atomic_read(&adapter->erp_counter) > ZFCP_MAX_ERPS) 1611 if (atomic_read(&adapter->erp_counter) > ZFCP_MAX_ERPS)
1582 zfcp_erp_adapter_failed(adapter); 1612 zfcp_erp_adapter_failed(adapter, 23, 0);
1583 break; 1613 break;
1584 case ZFCP_ERP_EXIT : 1614 case ZFCP_ERP_EXIT :
1585 /* nothing */ 1615 /* nothing */
@@ -1737,29 +1767,30 @@ zfcp_erp_wait(struct zfcp_adapter *adapter)
1737 return retval; 1767 return retval;
1738} 1768}
1739 1769
1740void 1770void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, u8 id,
1741zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, 1771 u64 ref, u32 mask, int set_or_clear)
1742 u32 mask, int set_or_clear)
1743{ 1772{
1744 struct zfcp_port *port; 1773 struct zfcp_port *port;
1745 u32 common_mask = mask & ZFCP_COMMON_FLAGS; 1774 u32 changed, common_mask = mask & ZFCP_COMMON_FLAGS;
1746 1775
1747 if (set_or_clear == ZFCP_SET) { 1776 if (set_or_clear == ZFCP_SET) {
1748 atomic_set_mask(mask, &adapter->status); 1777 changed = atomic_test_and_set_mask(mask, &adapter->status);
1749 debug_text_event(adapter->erp_dbf, 3, "a_mod_as_s"); 1778 debug_text_event(adapter->erp_dbf, 3, "a_mod_as_s");
1750 } else { 1779 } else {
1751 atomic_clear_mask(mask, &adapter->status); 1780 changed = atomic_test_and_clear_mask(mask, &adapter->status);
1752 if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) 1781 if (mask & ZFCP_STATUS_COMMON_ERP_FAILED)
1753 atomic_set(&adapter->erp_counter, 0); 1782 atomic_set(&adapter->erp_counter, 0);
1754 debug_text_event(adapter->erp_dbf, 3, "a_mod_as_c"); 1783 debug_text_event(adapter->erp_dbf, 3, "a_mod_as_c");
1755 } 1784 }
1785 if (changed)
1786 zfcp_rec_dbf_event_adapter(id, ref, adapter);
1756 debug_event(adapter->erp_dbf, 3, &mask, sizeof (u32)); 1787 debug_event(adapter->erp_dbf, 3, &mask, sizeof (u32));
1757 1788
1758 /* Deal with all underlying devices, only pass common_mask */ 1789 /* Deal with all underlying devices, only pass common_mask */
1759 if (common_mask) 1790 if (common_mask)
1760 list_for_each_entry(port, &adapter->port_list_head, list) 1791 list_for_each_entry(port, &adapter->port_list_head, list)
1761 zfcp_erp_modify_port_status(port, common_mask, 1792 zfcp_erp_modify_port_status(port, id, ref, common_mask,
1762 set_or_clear); 1793 set_or_clear);
1763} 1794}
1764 1795
1765/* 1796/*
@@ -1768,29 +1799,31 @@ zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter,
1768 * purpose: sets the port and all underlying devices to ERP_FAILED 1799 * purpose: sets the port and all underlying devices to ERP_FAILED
1769 * 1800 *
1770 */ 1801 */
1771void 1802void zfcp_erp_modify_port_status(struct zfcp_port *port, u8 id, u64 ref,
1772zfcp_erp_modify_port_status(struct zfcp_port *port, u32 mask, int set_or_clear) 1803 u32 mask, int set_or_clear)
1773{ 1804{
1774 struct zfcp_unit *unit; 1805 struct zfcp_unit *unit;
1775 u32 common_mask = mask & ZFCP_COMMON_FLAGS; 1806 u32 changed, common_mask = mask & ZFCP_COMMON_FLAGS;
1776 1807
1777 if (set_or_clear == ZFCP_SET) { 1808 if (set_or_clear == ZFCP_SET) {
1778 atomic_set_mask(mask, &port->status); 1809 changed = atomic_test_and_set_mask(mask, &port->status);
1779 debug_text_event(port->adapter->erp_dbf, 3, "p_mod_ps_s"); 1810 debug_text_event(port->adapter->erp_dbf, 3, "p_mod_ps_s");
1780 } else { 1811 } else {
1781 atomic_clear_mask(mask, &port->status); 1812 changed = atomic_test_and_clear_mask(mask, &port->status);
1782 if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) 1813 if (mask & ZFCP_STATUS_COMMON_ERP_FAILED)
1783 atomic_set(&port->erp_counter, 0); 1814 atomic_set(&port->erp_counter, 0);
1784 debug_text_event(port->adapter->erp_dbf, 3, "p_mod_ps_c"); 1815 debug_text_event(port->adapter->erp_dbf, 3, "p_mod_ps_c");
1785 } 1816 }
1817 if (changed)
1818 zfcp_rec_dbf_event_port(id, ref, port);
1786 debug_event(port->adapter->erp_dbf, 3, &port->wwpn, sizeof (wwn_t)); 1819 debug_event(port->adapter->erp_dbf, 3, &port->wwpn, sizeof (wwn_t));
1787 debug_event(port->adapter->erp_dbf, 3, &mask, sizeof (u32)); 1820 debug_event(port->adapter->erp_dbf, 3, &mask, sizeof (u32));
1788 1821
1789 /* Modify status of all underlying devices, only pass common mask */ 1822 /* Modify status of all underlying devices, only pass common mask */
1790 if (common_mask) 1823 if (common_mask)
1791 list_for_each_entry(unit, &port->unit_list_head, list) 1824 list_for_each_entry(unit, &port->unit_list_head, list)
1792 zfcp_erp_modify_unit_status(unit, common_mask, 1825 zfcp_erp_modify_unit_status(unit, id, ref, common_mask,
1793 set_or_clear); 1826 set_or_clear);
1794} 1827}
1795 1828
1796/* 1829/*
@@ -1799,19 +1832,23 @@ zfcp_erp_modify_port_status(struct zfcp_port *port, u32 mask, int set_or_clear)
1799 * purpose: sets the unit to ERP_FAILED 1832 * purpose: sets the unit to ERP_FAILED
1800 * 1833 *
1801 */ 1834 */
1802void 1835void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u8 id, u64 ref,
1803zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u32 mask, int set_or_clear) 1836 u32 mask, int set_or_clear)
1804{ 1837{
1838 u32 changed;
1839
1805 if (set_or_clear == ZFCP_SET) { 1840 if (set_or_clear == ZFCP_SET) {
1806 atomic_set_mask(mask, &unit->status); 1841 changed = atomic_test_and_set_mask(mask, &unit->status);
1807 debug_text_event(unit->port->adapter->erp_dbf, 3, "u_mod_us_s"); 1842 debug_text_event(unit->port->adapter->erp_dbf, 3, "u_mod_us_s");
1808 } else { 1843 } else {
1809 atomic_clear_mask(mask, &unit->status); 1844 changed = atomic_test_and_clear_mask(mask, &unit->status);
1810 if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) { 1845 if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) {
1811 atomic_set(&unit->erp_counter, 0); 1846 atomic_set(&unit->erp_counter, 0);
1812 } 1847 }
1813 debug_text_event(unit->port->adapter->erp_dbf, 3, "u_mod_us_c"); 1848 debug_text_event(unit->port->adapter->erp_dbf, 3, "u_mod_us_c");
1814 } 1849 }
1850 if (changed)
1851 zfcp_rec_dbf_event_unit(id, ref, unit);
1815 debug_event(unit->port->adapter->erp_dbf, 3, &unit->fcp_lun, 1852 debug_event(unit->port->adapter->erp_dbf, 3, &unit->fcp_lun,
1816 sizeof (fcp_lun_t)); 1853 sizeof (fcp_lun_t));
1817 debug_event(unit->port->adapter->erp_dbf, 3, &mask, sizeof (u32)); 1854 debug_event(unit->port->adapter->erp_dbf, 3, &mask, sizeof (u32));
@@ -2403,7 +2440,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
2403 port->wwpn, 2440 port->wwpn,
2404 zfcp_get_busid_by_adapter(adapter), 2441 zfcp_get_busid_by_adapter(adapter),
2405 adapter->peer_wwpn); 2442 adapter->peer_wwpn);
2406 zfcp_erp_port_failed(port); 2443 zfcp_erp_port_failed(port, 25, 0);
2407 retval = ZFCP_ERP_FAILED; 2444 retval = ZFCP_ERP_FAILED;
2408 break; 2445 break;
2409 } 2446 }
@@ -2461,7 +2498,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
2461 "for port 0x%016Lx " 2498 "for port 0x%016Lx "
2462 "(misconfigured WWPN?)\n", 2499 "(misconfigured WWPN?)\n",
2463 port->wwpn); 2500 port->wwpn);
2464 zfcp_erp_port_failed(port); 2501 zfcp_erp_port_failed(port, 26, 0);
2465 retval = ZFCP_ERP_EXIT; 2502 retval = ZFCP_ERP_EXIT;
2466 } else { 2503 } else {
2467 ZFCP_LOG_DEBUG("nameserver look-up failed for " 2504 ZFCP_LOG_DEBUG("nameserver look-up failed for "
@@ -2567,7 +2604,7 @@ zfcp_erp_port_strategy_open_nameserver_wakeup(struct zfcp_erp_action
2567 if (atomic_test_mask( 2604 if (atomic_test_mask(
2568 ZFCP_STATUS_COMMON_ERP_FAILED, 2605 ZFCP_STATUS_COMMON_ERP_FAILED,
2569 &adapter->nameserver_port->status)) 2606 &adapter->nameserver_port->status))
2570 zfcp_erp_port_failed(erp_action->port); 2607 zfcp_erp_port_failed(erp_action->port, 27, 0);
2571 zfcp_erp_action_ready(erp_action); 2608 zfcp_erp_action_ready(erp_action);
2572 } 2609 }
2573 } 2610 }
@@ -3274,8 +3311,7 @@ static void zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action)
3274 list_move(&erp_action->list, &erp_action->adapter->erp_ready_head); 3311 list_move(&erp_action->list, &erp_action->adapter->erp_ready_head);
3275} 3312}
3276 3313
3277void 3314void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, u64 ref)
3278zfcp_erp_port_boxed(struct zfcp_port *port)
3279{ 3315{
3280 struct zfcp_adapter *adapter = port->adapter; 3316 struct zfcp_adapter *adapter = port->adapter;
3281 unsigned long flags; 3317 unsigned long flags;
@@ -3283,28 +3319,24 @@ zfcp_erp_port_boxed(struct zfcp_port *port)
3283 debug_text_event(adapter->erp_dbf, 3, "p_access_boxed"); 3319 debug_text_event(adapter->erp_dbf, 3, "p_access_boxed");
3284 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); 3320 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
3285 read_lock_irqsave(&zfcp_data.config_lock, flags); 3321 read_lock_irqsave(&zfcp_data.config_lock, flags);
3286 zfcp_erp_modify_port_status(port, 3322 zfcp_erp_modify_port_status(port, id, ref,
3287 ZFCP_STATUS_COMMON_ACCESS_BOXED, 3323 ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET);
3288 ZFCP_SET);
3289 read_unlock_irqrestore(&zfcp_data.config_lock, flags); 3324 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
3290 zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED); 3325 zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED);
3291} 3326}
3292 3327
3293void 3328void zfcp_erp_unit_boxed(struct zfcp_unit *unit, u8 id, u64 ref)
3294zfcp_erp_unit_boxed(struct zfcp_unit *unit)
3295{ 3329{
3296 struct zfcp_adapter *adapter = unit->port->adapter; 3330 struct zfcp_adapter *adapter = unit->port->adapter;
3297 3331
3298 debug_text_event(adapter->erp_dbf, 3, "u_access_boxed"); 3332 debug_text_event(adapter->erp_dbf, 3, "u_access_boxed");
3299 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); 3333 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t));
3300 zfcp_erp_modify_unit_status(unit, 3334 zfcp_erp_modify_unit_status(unit, id, ref,
3301 ZFCP_STATUS_COMMON_ACCESS_BOXED, 3335 ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET);
3302 ZFCP_SET);
3303 zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED); 3336 zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED);
3304} 3337}
3305 3338
3306void 3339void zfcp_erp_port_access_denied(struct zfcp_port *port, u8 id, u64 ref)
3307zfcp_erp_port_access_denied(struct zfcp_port *port)
3308{ 3340{
3309 struct zfcp_adapter *adapter = port->adapter; 3341 struct zfcp_adapter *adapter = port->adapter;
3310 unsigned long flags; 3342 unsigned long flags;
@@ -3312,24 +3344,21 @@ zfcp_erp_port_access_denied(struct zfcp_port *port)
3312 debug_text_event(adapter->erp_dbf, 3, "p_access_denied"); 3344 debug_text_event(adapter->erp_dbf, 3, "p_access_denied");
3313 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); 3345 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
3314 read_lock_irqsave(&zfcp_data.config_lock, flags); 3346 read_lock_irqsave(&zfcp_data.config_lock, flags);
3315 zfcp_erp_modify_port_status(port, 3347 zfcp_erp_modify_port_status(port, id, ref,
3316 ZFCP_STATUS_COMMON_ERP_FAILED | 3348 ZFCP_STATUS_COMMON_ERP_FAILED |
3317 ZFCP_STATUS_COMMON_ACCESS_DENIED, 3349 ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET);
3318 ZFCP_SET);
3319 read_unlock_irqrestore(&zfcp_data.config_lock, flags); 3350 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
3320} 3351}
3321 3352
3322void 3353void zfcp_erp_unit_access_denied(struct zfcp_unit *unit, u8 id, u64 ref)
3323zfcp_erp_unit_access_denied(struct zfcp_unit *unit)
3324{ 3354{
3325 struct zfcp_adapter *adapter = unit->port->adapter; 3355 struct zfcp_adapter *adapter = unit->port->adapter;
3326 3356
3327 debug_text_event(adapter->erp_dbf, 3, "u_access_denied"); 3357 debug_text_event(adapter->erp_dbf, 3, "u_access_denied");
3328 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); 3358 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t));
3329 zfcp_erp_modify_unit_status(unit, 3359 zfcp_erp_modify_unit_status(unit, id, ref,
3330 ZFCP_STATUS_COMMON_ERP_FAILED | 3360 ZFCP_STATUS_COMMON_ERP_FAILED |
3331 ZFCP_STATUS_COMMON_ACCESS_DENIED, 3361 ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET);
3332 ZFCP_SET);
3333} 3362}
3334 3363
3335void 3364void