aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2007-10-27 13:37:05 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 19:22:31 -0500
commit57127f157298ea2dacbbc878a3c5d2a5daca772c (patch)
tree2536d995c36e068576a690b33cd2029f0749ddbe /drivers/scsi/lpfc/lpfc_init.c
parentd1a357fcc8348d325d151f6fe0ea54e317652457 (diff)
[SCSI] lpfc 8.2.3 : Added support for ASICs that report temperature
Added support for ASICs that report temperature. Temperature notices are reported as events and logged. Temperature can be read via sysfs. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index ecebdfa00470..17f445478beb 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -212,6 +212,18 @@ out_free_mbox:
212 return 0; 212 return 0;
213} 213}
214 214
215/* Completion handler for config async event mailbox command. */
216static void
217lpfc_config_async_cmpl(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq)
218{
219 if (pmboxq->mb.mbxStatus == MBX_SUCCESS)
220 phba->temp_sensor_support = 1;
221 else
222 phba->temp_sensor_support = 0;
223 mempool_free(pmboxq, phba->mbox_mem_pool);
224 return;
225}
226
215/************************************************************************/ 227/************************************************************************/
216/* */ 228/* */
217/* lpfc_config_port_post */ 229/* lpfc_config_port_post */
@@ -409,7 +421,21 @@ lpfc_config_port_post(struct lpfc_hba *phba)
409 return -EIO; 421 return -EIO;
410 } 422 }
411 /* MBOX buffer will be freed in mbox compl */ 423 /* MBOX buffer will be freed in mbox compl */
424 pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
425 lpfc_config_async(phba, pmb, LPFC_ELS_RING);
426 pmb->mbox_cmpl = lpfc_config_async_cmpl;
427 pmb->vport = phba->pport;
428 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
412 429
430 if ((rc != MBX_BUSY) && (rc != MBX_SUCCESS)) {
431 lpfc_printf_log(phba,
432 KERN_ERR,
433 LOG_INIT,
434 "0456 Adapter failed to issue "
435 "ASYNCEVT_ENABLE mbox status x%x \n.",
436 rc);
437 mempool_free(pmb, phba->mbox_mem_pool);
438 }
413 return (0); 439 return (0);
414} 440}
415 441
@@ -601,6 +627,8 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
601 struct lpfc_sli_ring *pring; 627 struct lpfc_sli_ring *pring;
602 struct lpfc_vport **vports; 628 struct lpfc_vport **vports;
603 uint32_t event_data; 629 uint32_t event_data;
630 unsigned long temperature;
631 struct temp_event temp_event_data;
604 struct Scsi_Host *shost; 632 struct Scsi_Host *shost;
605 int i; 633 int i;
606 634
@@ -655,6 +683,33 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
655 return; 683 return;
656 } 684 }
657 lpfc_unblock_mgmt_io(phba); 685 lpfc_unblock_mgmt_io(phba);
686 } else if (phba->work_hs & HS_CRIT_TEMP) {
687 temperature = readl(phba->MBslimaddr + TEMPERATURE_OFFSET);
688 temp_event_data.event_type = FC_REG_TEMPERATURE_EVENT;
689 temp_event_data.event_code = LPFC_CRIT_TEMP;
690 temp_event_data.data = (uint32_t)temperature;
691
692 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
693 "0459 Adapter maximum temperature exceeded "
694 "(%ld), taking this port offline "
695 "Data: x%x x%x x%x\n",
696 temperature, phba->work_hs,
697 phba->work_status[0], phba->work_status[1]);
698
699 shost = lpfc_shost_from_vport(phba->pport);
700 fc_host_post_vendor_event(shost, fc_get_event_number(),
701 sizeof(temp_event_data),
702 (char *) &temp_event_data,
703 SCSI_NL_VID_TYPE_PCI
704 | PCI_VENDOR_ID_EMULEX);
705
706 psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
707 lpfc_offline_prep(phba);
708 lpfc_offline(phba);
709 lpfc_unblock_mgmt_io(phba);
710 phba->link_state = LPFC_HBA_ERROR;
711 lpfc_hba_down_post(phba);
712
658 } else { 713 } else {
659 /* The if clause above forces this code path when the status 714 /* The if clause above forces this code path when the status
660 * failure is a value other than FFER6. Do not call the offline 715 * failure is a value other than FFER6. Do not call the offline