scsi: qla2xxx: Move free of fcport out of interrupt context
authorJoe Carnuccio <joe.carnuccio@cavium.com>
Wed, 12 Feb 2020 21:44:13 +0000 (13:44 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 21 Feb 2020 23:30:59 +0000 (18:30 -0500)
This patch moves freeing of fcport out of interrupt context.

Link: https://lore.kernel.org/r/20200212214436.25532-3-hmadhani@marvell.com
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_bsg.c

index d7169e43f5e180edd53bb1b56ad5d238723a7c5e..5870d26ab707eae5bdc6bad83adc18c4c217dafa 100644 (file)
 #include <linux/delay.h>
 #include <linux/bsg-lib.h>
 
+static void qla2xxx_free_fcport_work(struct work_struct *work)
+{
+       struct fc_port *fcport = container_of(work, typeof(*fcport),
+           free_work);
+
+       qla2x00_free_fcport(fcport);
+}
+
 /* BSG support for ELS/CT pass through */
 void qla2x00_bsg_job_done(srb_t *sp, int res)
 {
@@ -53,8 +61,10 @@ void qla2x00_bsg_sp_free(srb_t *sp)
 
        if (sp->type == SRB_CT_CMD ||
            sp->type == SRB_FXIOCB_BCMD ||
-           sp->type == SRB_ELS_CMD_HST)
-               qla2x00_free_fcport(sp->fcport);
+           sp->type == SRB_ELS_CMD_HST) {
+               INIT_WORK(&sp->fcport->free_work, qla2xxx_free_fcport_work);
+               queue_work(ha->wq, &sp->fcport->free_work);
+       }
 
        qla2x00_rel_sp(sp);
 }