aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/lpfc/lpfc.h6
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c12
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c12
3 files changed, 30 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index 46ccdffb46aa..1ddfd688fea3 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -386,6 +386,11 @@ struct hbq_s {
386#define LPFC_ELS_HBQ 0 386#define LPFC_ELS_HBQ 0
387#define LPFC_EXTRA_HBQ 1 387#define LPFC_EXTRA_HBQ 1
388 388
389enum hba_temp_state {
390 HBA_NORMAL_TEMP,
391 HBA_OVER_TEMP
392};
393
389struct lpfc_hba { 394struct lpfc_hba {
390 struct lpfc_sli sli; 395 struct lpfc_sli sli;
391 uint32_t sli_rev; /* SLI2 or SLI3 */ 396 uint32_t sli_rev; /* SLI2 or SLI3 */
@@ -589,6 +594,7 @@ struct lpfc_hba {
589 */ 594 */
590#define QUE_BUFTAG_BIT (1<<31) 595#define QUE_BUFTAG_BIT (1<<31)
591 uint32_t buffer_tag_count; 596 uint32_t buffer_tag_count;
597 enum hba_temp_state over_temp_state;
592}; 598};
593 599
594static inline struct Scsi_Host * 600static inline struct Scsi_Host *
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 4e9e890449a3..e1b041d8f6d5 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -979,6 +979,12 @@ lpfc_soft_wwpn_store(struct class_device *cdev, const char *buf, size_t count)
979 unsigned int i, j, cnt=count; 979 unsigned int i, j, cnt=count;
980 u8 wwpn[8]; 980 u8 wwpn[8];
981 981
982 spin_lock_irq(&phba->hbalock);
983 if (phba->over_temp_state == HBA_OVER_TEMP) {
984 spin_unlock_irq(&phba->hbalock);
985 return -EPERM;
986 }
987 spin_unlock_irq(&phba->hbalock);
982 /* count may include a LF at end of string */ 988 /* count may include a LF at end of string */
983 if (buf[cnt-1] == '\n') 989 if (buf[cnt-1] == '\n')
984 cnt--; 990 cnt--;
@@ -1750,6 +1756,12 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,
1750 1756
1751 spin_lock_irq(&phba->hbalock); 1757 spin_lock_irq(&phba->hbalock);
1752 1758
1759 if (phba->over_temp_state == HBA_OVER_TEMP) {
1760 sysfs_mbox_idle(phba);
1761 spin_unlock_irq(&phba->hbalock);
1762 return -EPERM;
1763 }
1764
1753 if (off == 0 && 1765 if (off == 0 &&
1754 phba->sysfs_mbox.state == SMBOX_WRITING && 1766 phba->sysfs_mbox.state == SMBOX_WRITING &&
1755 phba->sysfs_mbox.offset >= 2 * sizeof(uint32_t)) { 1767 phba->sysfs_mbox.offset >= 2 * sizeof(uint32_t)) {
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index db96f7504a14..0615af41c7b5 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -246,6 +246,15 @@ lpfc_config_port_post(struct lpfc_hba *phba)
246 int i, j; 246 int i, j;
247 int rc; 247 int rc;
248 248
249 spin_lock_irq(&phba->hbalock);
250 /*
251 * If the Config port completed correctly the HBA is not
252 * over heated any more.
253 */
254 if (phba->over_temp_state == HBA_OVER_TEMP)
255 phba->over_temp_state = HBA_NORMAL_TEMP;
256 spin_unlock_irq(&phba->hbalock);
257
249 pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 258 pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
250 if (!pmb) { 259 if (!pmb) {
251 phba->link_state = LPFC_HBA_ERROR; 260 phba->link_state = LPFC_HBA_ERROR;
@@ -703,7 +712,10 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
703 SCSI_NL_VID_TYPE_PCI 712 SCSI_NL_VID_TYPE_PCI
704 | PCI_VENDOR_ID_EMULEX); 713 | PCI_VENDOR_ID_EMULEX);
705 714
715 spin_lock_irq(&phba->hbalock);
706 psli->sli_flag &= ~LPFC_SLI2_ACTIVE; 716 psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
717 phba->over_temp_state = HBA_OVER_TEMP;
718 spin_unlock_irq(&phba->hbalock);
707 lpfc_offline_prep(phba); 719 lpfc_offline_prep(phba);
708 lpfc_offline(phba); 720 lpfc_offline(phba);
709 lpfc_unblock_mgmt_io(phba); 721 lpfc_unblock_mgmt_io(phba);