scsi: lpfc: Fix driver release of fw-logging buffers
[linux-2.6-microblaze.git] / drivers / scsi / lpfc / lpfc_sli.c
index 760b819..3826a32 100644 (file)
@@ -6197,6 +6197,25 @@ lpfc_set_features(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox,
        return;
 }
 
+/**
+ * lpfc_ras_stop_fwlog: Disable FW logging by the adapter
+ * @phba: Pointer to HBA context object.
+ *
+ * Disable FW logging into host memory on the adapter. To
+ * be done before reading logs from the host memory.
+ **/
+void
+lpfc_ras_stop_fwlog(struct lpfc_hba *phba)
+{
+       struct lpfc_ras_fwlog *ras_fwlog = &phba->ras_fwlog;
+
+       ras_fwlog->ras_active = false;
+
+       /* Disable FW logging to host memory */
+       writel(LPFC_CTL_PDEV_CTL_DDL_RAS,
+              phba->sli4_hba.conf_regs_memmap_p + LPFC_CTL_PDEV_CTL_OFFSET);
+}
+
 /**
  * lpfc_sli4_ras_dma_free - Free memory allocated for FW logging.
  * @phba: Pointer to HBA context object.