1
linux/drivers/scsi/fnic
Martin Wilck f30e5f77d2 scsi: fnic: Move flush_work initialization out of if block
After commit 379a58caa1 ("scsi: fnic: Move fnic_fnic_flush_tx() to a
work queue"), it can happen that a work item is sent to an uninitialized
work queue.  This may has the effect that the item being queued is never
actually queued, and any further actions depending on it will not
proceed.

The following warning is observed while the fnic driver is loaded:

kernel: WARNING: CPU: 11 PID: 0 at ../kernel/workqueue.c:1524 __queue_work+0x373/0x410
kernel:  <IRQ>
kernel:  queue_work_on+0x3a/0x50
kernel:  fnic_wq_copy_cmpl_handler+0x54a/0x730 [fnic 62fbff0c42e7fb825c60a55cde2fb91facb2ed24]
kernel:  fnic_isr_msix_wq_copy+0x2d/0x60 [fnic 62fbff0c42e7fb825c60a55cde2fb91facb2ed24]
kernel:  __handle_irq_event_percpu+0x36/0x1a0
kernel:  handle_irq_event_percpu+0x30/0x70
kernel:  handle_irq_event+0x34/0x60
kernel:  handle_edge_irq+0x7e/0x1a0
kernel:  __common_interrupt+0x3b/0xb0
kernel:  common_interrupt+0x58/0xa0
kernel:  </IRQ>

It has been observed that this may break the rediscovery of Fibre
Channel devices after a temporary fabric failure.

This patch fixes it by moving the work queue initialization out of
an if block in fnic_probe().

Signed-off-by: Martin Wilck <mwilck@suse.com>
Fixes: 379a58caa1 ("scsi: fnic: Move fnic_fnic_flush_tx() to a work queue")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240930133014.71615-1-mwilck@suse.com
Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2024-10-03 21:45:11 -04:00
..
cq_desc.h
cq_enet_desc.h
cq_exch_desc.h
fcpio.h
fnic_attrs.c scsi: fnic: Convert snprintf() to sysfs_emit() 2024-01-29 20:40:48 -05:00
fnic_debugfs.c
fnic_fcs.c scsi: fnic: Move fnic_fnic_flush_tx() to a work queue 2024-02-12 20:50:07 -05:00
fnic_fip.h
fnic_io.h
fnic_isr.c scsi: fnic: Modify ISRs to support multiqueue (MQ) 2023-12-13 22:11:33 -05:00
fnic_main.c scsi: fnic: Move flush_work initialization out of if block 2024-10-03 21:45:11 -04:00
fnic_res.c scsi: fnic: Get copy workqueue count and interrupt mode from config 2023-12-13 22:11:33 -05:00
fnic_res.h
fnic_scsi.c SCSI misc on 20240316 2024-03-16 16:31:12 -07:00
fnic_stats.h scsi: fnic: Define stats to track multiqueue (MQ) IOs 2023-12-13 22:11:33 -05:00
fnic_trace.c scsi: fnic: Define stats to track multiqueue (MQ) IOs 2023-12-13 22:11:33 -05:00
fnic_trace.h
fnic.h scsi: fnic: Move fnic_fnic_flush_tx() to a work queue 2024-02-12 20:50:07 -05:00
Makefile
rq_enet_desc.h
vnic_cq_copy.h
vnic_cq.c
vnic_cq.h
vnic_dev.c scsi: fnic: Add and improve log messages 2023-12-13 22:11:33 -05:00
vnic_dev.h
vnic_devcmd.h
vnic_intr.c
vnic_intr.h
vnic_nic.h
vnic_resource.h
vnic_rq.c
vnic_rq.h
vnic_scsi.h
vnic_stats.h
vnic_wq_copy.c
vnic_wq_copy.h
vnic_wq.c
vnic_wq.h
wq_enet_desc.h