Commit 7af67051 authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] lpfc 8.2.3 : Temperature handling fix

Temperature handling fix - return proper error code indicator for applications
Signed-off-by: default avatarJames Smart <James.Smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 76bb24ef
...@@ -386,6 +386,11 @@ struct hbq_s { ...@@ -386,6 +386,11 @@ struct hbq_s {
#define LPFC_ELS_HBQ 0 #define LPFC_ELS_HBQ 0
#define LPFC_EXTRA_HBQ 1 #define LPFC_EXTRA_HBQ 1
enum hba_temp_state {
HBA_NORMAL_TEMP,
HBA_OVER_TEMP
};
struct lpfc_hba { struct lpfc_hba {
struct lpfc_sli sli; struct lpfc_sli sli;
uint32_t sli_rev; /* SLI2 or SLI3 */ uint32_t sli_rev; /* SLI2 or SLI3 */
...@@ -589,6 +594,7 @@ struct lpfc_hba { ...@@ -589,6 +594,7 @@ struct lpfc_hba {
*/ */
#define QUE_BUFTAG_BIT (1<<31) #define QUE_BUFTAG_BIT (1<<31)
uint32_t buffer_tag_count; uint32_t buffer_tag_count;
enum hba_temp_state over_temp_state;
}; };
static inline struct Scsi_Host * static inline struct Scsi_Host *
......
...@@ -979,6 +979,12 @@ lpfc_soft_wwpn_store(struct class_device *cdev, const char *buf, size_t count) ...@@ -979,6 +979,12 @@ lpfc_soft_wwpn_store(struct class_device *cdev, const char *buf, size_t count)
unsigned int i, j, cnt=count; unsigned int i, j, cnt=count;
u8 wwpn[8]; u8 wwpn[8];
spin_lock_irq(&phba->hbalock);
if (phba->over_temp_state == HBA_OVER_TEMP) {
spin_unlock_irq(&phba->hbalock);
return -EPERM;
}
spin_unlock_irq(&phba->hbalock);
/* count may include a LF at end of string */ /* count may include a LF at end of string */
if (buf[cnt-1] == '\n') if (buf[cnt-1] == '\n')
cnt--; cnt--;
...@@ -1750,6 +1756,12 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr, ...@@ -1750,6 +1756,12 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,
spin_lock_irq(&phba->hbalock); spin_lock_irq(&phba->hbalock);
if (phba->over_temp_state == HBA_OVER_TEMP) {
sysfs_mbox_idle(phba);
spin_unlock_irq(&phba->hbalock);
return -EPERM;
}
if (off == 0 && if (off == 0 &&
phba->sysfs_mbox.state == SMBOX_WRITING && phba->sysfs_mbox.state == SMBOX_WRITING &&
phba->sysfs_mbox.offset >= 2 * sizeof(uint32_t)) { phba->sysfs_mbox.offset >= 2 * sizeof(uint32_t)) {
......
...@@ -246,6 +246,15 @@ lpfc_config_port_post(struct lpfc_hba *phba) ...@@ -246,6 +246,15 @@ lpfc_config_port_post(struct lpfc_hba *phba)
int i, j; int i, j;
int rc; int rc;
spin_lock_irq(&phba->hbalock);
/*
* If the Config port completed correctly the HBA is not
* over heated any more.
*/
if (phba->over_temp_state == HBA_OVER_TEMP)
phba->over_temp_state = HBA_NORMAL_TEMP;
spin_unlock_irq(&phba->hbalock);
pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!pmb) { if (!pmb) {
phba->link_state = LPFC_HBA_ERROR; phba->link_state = LPFC_HBA_ERROR;
...@@ -703,7 +712,10 @@ lpfc_handle_eratt(struct lpfc_hba *phba) ...@@ -703,7 +712,10 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
SCSI_NL_VID_TYPE_PCI SCSI_NL_VID_TYPE_PCI
| PCI_VENDOR_ID_EMULEX); | PCI_VENDOR_ID_EMULEX);
spin_lock_irq(&phba->hbalock);
psli->sli_flag &= ~LPFC_SLI2_ACTIVE; psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
phba->over_temp_state = HBA_OVER_TEMP;
spin_unlock_irq(&phba->hbalock);
lpfc_offline_prep(phba); lpfc_offline_prep(phba);
lpfc_offline(phba); lpfc_offline(phba);
lpfc_unblock_mgmt_io(phba); lpfc_unblock_mgmt_io(phba);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment