scsi: qedf: Improve firmware debug dump handling
authorChad Dupuis <chad.dupuis@cavium.com>
Wed, 25 Apr 2018 13:08:58 +0000 (06:08 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 8 May 2018 04:57:10 +0000 (00:57 -0400)
Get all firmware debug data instead of just a grc dump.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qedf/qedf.h
drivers/scsi/qedf/qedf_dbg.c
drivers/scsi/qedf/qedf_main.c

index 1dffe21..44770f8 100644 (file)
@@ -367,6 +367,7 @@ struct qedf_ctx {
 #define QEDF_IO_WORK_MIN               64
        mempool_t *io_mempool;
        struct workqueue_struct *dpc_wq;
+       struct delayed_work grcdump_work;
 
        u32 slow_sge_ios;
        u32 fast_sge_ios;
@@ -499,6 +500,7 @@ extern void qedf_process_seq_cleanup_compl(struct qedf_ctx *qedf,
        struct fcoe_cqe *cqe, struct qedf_ioreq *io_req);
 extern int qedf_send_flogi(struct qedf_ctx *qedf);
 extern void qedf_fp_io_handler(struct work_struct *work);
+extern void qedf_wq_grcdump(struct work_struct *work);
 
 #define FCOE_WORD_TO_BYTE  4
 #define QEDF_MAX_TASK_NUM      0xFFFF
index bd1cef2..e02c7a4 100644 (file)
@@ -147,7 +147,7 @@ qedf_get_grc_dump(struct qed_dev *cdev, const struct qed_common_ops *common,
        if (!*buf)
                return -EINVAL;
 
-       return common->dbg_grc(cdev, *buf, grcsize);
+       return common->dbg_all_data(cdev, *buf);
 }
 
 void
index 2da6ba8..3f4243f 100644 (file)
@@ -3008,6 +3008,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
        qedf->link_update_wq = create_workqueue(host_buf);
        INIT_DELAYED_WORK(&qedf->link_update, qedf_handle_link_update);
        INIT_DELAYED_WORK(&qedf->link_recovery, qedf_link_recovery);
+       INIT_DELAYED_WORK(&qedf->grcdump_work, qedf_wq_grcdump);
        qedf->fipvlan_retries = qedf_fipvlan_retries;
        /* Set a default prio in case DCBX doesn't converge */
        qedf->prio = QEDF_DEFAULT_PRIO;
@@ -3240,7 +3241,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
         * unload process.
         */
        if (mode != QEDF_MODE_RECOVERY) {
-               qedf->grcdump_size = qed_ops->common->dbg_grc_size(qedf->cdev);
+               qedf->grcdump_size =
+                   qed_ops->common->dbg_all_data_size(qedf->cdev);
                if (qedf->grcdump_size) {
                        rc = qedf_alloc_grc_dump_buf(&qedf->grcdump,
                            qedf->grcdump_size);
@@ -3424,6 +3426,15 @@ static void qedf_remove(struct pci_dev *pdev)
        __qedf_remove(pdev, QEDF_MODE_NORMAL);
 }
 
+void qedf_wq_grcdump(struct work_struct *work)
+{
+       struct qedf_ctx *qedf =
+           container_of(work, struct qedf_ctx, grcdump_work.work);
+
+       QEDF_ERR(&(qedf->dbg_ctx), "Collecting GRC dump.\n");
+       qedf_capture_grc_dump(qedf);
+}
+
 /*
  * Module Init/Remove
  */