aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 68e92be1ef5b..eb5a5ad4ffbf 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -1,7 +1,7 @@
1/******************************************************************* 1/*******************************************************************
2 * This file is part of the Emulex Linux Device Driver for * 2 * This file is part of the Emulex Linux Device Driver for *
3 * Fibre Channel Host Bus Adapters. * 3 * Fibre Channel Host Bus Adapters. *
4 * Copyright (C) 2004-2007 Emulex. All rights reserved. * 4 * Copyright (C) 2004-2008 Emulex. All rights reserved. *
5 * EMULEX and SLI are trademarks of Emulex. * 5 * EMULEX and SLI are trademarks of Emulex. *
6 * www.emulex.com * 6 * www.emulex.com *
7 * Portions Copyright (C) 2004-2005 Christoph Hellwig * 7 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
@@ -311,12 +311,14 @@ lpfc_do_offline(struct lpfc_hba *phba, uint32_t type)
311 311
312 psli = &phba->sli; 312 psli = &phba->sli;
313 313
314 /* Wait a little for things to settle down, but not
315 * long enough for dev loss timeout to expire.
316 */
314 for (i = 0; i < psli->num_rings; i++) { 317 for (i = 0; i < psli->num_rings; i++) {
315 pring = &psli->ring[i]; 318 pring = &psli->ring[i];
316 /* The linkdown event takes 30 seconds to timeout. */
317 while (pring->txcmplq_cnt) { 319 while (pring->txcmplq_cnt) {
318 msleep(10); 320 msleep(10);
319 if (cnt++ > 3000) { 321 if (cnt++ > 500) { /* 5 secs */
320 lpfc_printf_log(phba, 322 lpfc_printf_log(phba,
321 KERN_WARNING, LOG_INIT, 323 KERN_WARNING, LOG_INIT,
322 "0466 Outstanding IO when " 324 "0466 Outstanding IO when "
@@ -989,7 +991,7 @@ lpfc_soft_wwpn_store(struct class_device *cdev, const char *buf, size_t count)
989 spin_lock_irq(&phba->hbalock); 991 spin_lock_irq(&phba->hbalock);
990 if (phba->over_temp_state == HBA_OVER_TEMP) { 992 if (phba->over_temp_state == HBA_OVER_TEMP) {
991 spin_unlock_irq(&phba->hbalock); 993 spin_unlock_irq(&phba->hbalock);
992 return -EPERM; 994 return -EACCES;
993 } 995 }
994 spin_unlock_irq(&phba->hbalock); 996 spin_unlock_irq(&phba->hbalock);
995 /* count may include a LF at end of string */ 997 /* count may include a LF at end of string */
@@ -1782,7 +1784,7 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,
1782 if (phba->over_temp_state == HBA_OVER_TEMP) { 1784 if (phba->over_temp_state == HBA_OVER_TEMP) {
1783 sysfs_mbox_idle(phba); 1785 sysfs_mbox_idle(phba);
1784 spin_unlock_irq(&phba->hbalock); 1786 spin_unlock_irq(&phba->hbalock);
1785 return -EPERM; 1787 return -EACCES;
1786 } 1788 }
1787 1789
1788 if (off == 0 && 1790 if (off == 0 &&
@@ -1801,9 +1803,7 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,
1801 case MBX_DUMP_CONTEXT: 1803 case MBX_DUMP_CONTEXT:
1802 case MBX_RUN_DIAGS: 1804 case MBX_RUN_DIAGS:
1803 case MBX_RESTART: 1805 case MBX_RESTART:
1804 case MBX_FLASH_WR_ULA:
1805 case MBX_SET_MASK: 1806 case MBX_SET_MASK:
1806 case MBX_SET_SLIM:
1807 case MBX_SET_DEBUG: 1807 case MBX_SET_DEBUG:
1808 if (!(vport->fc_flag & FC_OFFLINE_MODE)) { 1808 if (!(vport->fc_flag & FC_OFFLINE_MODE)) {
1809 printk(KERN_WARNING "mbox_read:Command 0x%x " 1809 printk(KERN_WARNING "mbox_read:Command 0x%x "
@@ -1831,6 +1831,8 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,
1831 case MBX_LOAD_EXP_ROM: 1831 case MBX_LOAD_EXP_ROM:
1832 case MBX_BEACON: 1832 case MBX_BEACON:
1833 case MBX_DEL_LD_ENTRY: 1833 case MBX_DEL_LD_ENTRY:
1834 case MBX_SET_VARIABLE:
1835 case MBX_WRITE_WWN:
1834 break; 1836 break;
1835 case MBX_READ_SPARM64: 1837 case MBX_READ_SPARM64:
1836 case MBX_READ_LA: 1838 case MBX_READ_LA:
@@ -1852,6 +1854,17 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,
1852 return -EPERM; 1854 return -EPERM;
1853 } 1855 }
1854 1856
1857 /* If HBA encountered an error attention, allow only DUMP
1858 * mailbox command until the HBA is restarted.
1859 */
1860 if ((phba->pport->stopped) &&
1861 (phba->sysfs_mbox.mbox->mb.mbxCommand
1862 != MBX_DUMP_MEMORY)) {
1863 sysfs_mbox_idle(phba);
1864 spin_unlock_irq(&phba->hbalock);
1865 return -EPERM;
1866 }
1867
1855 phba->sysfs_mbox.mbox->vport = vport; 1868 phba->sysfs_mbox.mbox->vport = vport;
1856 1869
1857 if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO) { 1870 if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO) {
@@ -2052,7 +2065,8 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
2052 fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; 2065 fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
2053 break; 2066 break;
2054 } 2067 }
2055 } 2068 } else
2069 fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
2056 2070
2057 spin_unlock_irq(shost->host_lock); 2071 spin_unlock_irq(shost->host_lock);
2058} 2072}
@@ -2072,7 +2086,7 @@ lpfc_get_host_fabric_name (struct Scsi_Host *shost)
2072 node_name = wwn_to_u64(phba->fc_fabparam.nodeName.u.wwn); 2086 node_name = wwn_to_u64(phba->fc_fabparam.nodeName.u.wwn);
2073 else 2087 else
2074 /* fabric is local port if there is no F/FL_Port */ 2088 /* fabric is local port if there is no F/FL_Port */
2075 node_name = wwn_to_u64(vport->fc_nodename.u.wwn); 2089 node_name = 0;
2076 2090
2077 spin_unlock_irq(shost->host_lock); 2091 spin_unlock_irq(shost->host_lock);
2078 2092