scsi: fnic: move flush_work initialization out of if block
Subsystems (3)
PATCH 1/1 scsi: fnic: move flush_work initialization out of if block
After commit 379a58caa199 ("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().
--- drivers/scsi/fnic/fnic_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/fnic/fnic_main.c +1 -1
@@ -830,7 +830,6 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)spin_lock_init (&fnic->vlans_lock);INIT_WORK (&fnic->fip_frame_work, fnic_handle_fip_frame);INIT_WORK (&fnic->event_work, fnic_handle_event); -INIT_WORK (&fnic->flush_work, fnic_flush_tx);skb_queue_head_init (&fnic->fip_frame_queue);INIT_LIST_HEAD (&fnic->evlist);INIT_LIST_HEAD (&fnic->vlans);
@@ -948,6 +947,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)INIT_WORK (&fnic->link_work, fnic_handle_link);INIT_WORK (&fnic->frame_work, fnic_handle_frame); +INIT_WORK (&fnic->flush_work, fnic_flush_tx);skb_queue_head_init (&fnic->frame_queue);skb_queue_head_init (&fnic->tx_queue);
Signature · 1 line
2.46.1
Karan Tilak Kumar (kartilak)
maintainerQuoted 50 lines · Martin Wilck
After commit
379a58caa199("scsi: fnic: Movefnic_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 <[email protected]>Fixes 379a58caa199 ("scsi: fnic: Move fnic_fnic_flush_tx() to a work queue")---
drivers/scsi/fnic/fnic_main.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/fnic/fnic_main.c +1
-2@@ -830,7 +830,6 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)spin_lock_init (&fnic->vlans_lock);INIT_WORK (&fnic->fip_frame_work, fnic_handle_fip_frame);INIT_WORK (&fnic->event_work, fnic_handle_event); -INIT_WORK (&fnic->flush_work, fnic_flush_tx);skb_queue_head_init (&fnic->fip_frame_queue);INIT_LIST_HEAD (&fnic->evlist);INIT_LIST_HEAD (&fnic->vlans);@@ -948,6 +947,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)INIT_WORK (&fnic->link_work, fnic_handle_link);INIT_WORK (&fnic->frame_work, fnic_handle_frame); +INIT_WORK (&fnic->flush_work, fnic_flush_tx);skb_queue_head_init (&fnic->frame_queue);skb_queue_head_init (&fnic->tx_queue); --
Quoted 3 lines
2.46.1
Looks good to me.
Regards,
Karan
Quoted 56 lines · Martin Wilck
After commit
379a58caa199("scsi: fnic: Movefnic_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 <[email protected]>Fixes 379a58caa199 ("scsi: fnic: Move fnic_fnic_flush_tx() to a work queue")--- drivers/scsi/fnic/fnic_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/fnic/fnic_main.c +1
-2@@ -830,7 +830,6 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)spin_lock_init (&fnic->vlans_lock);INIT_WORK (&fnic->fip_frame_work, fnic_handle_fip_frame);INIT_WORK (&fnic->event_work, fnic_handle_event); -INIT_WORK (&fnic->flush_work, fnic_flush_tx);skb_queue_head_init (&fnic->fip_frame_queue);INIT_LIST_HEAD (&fnic->evlist);INIT_LIST_HEAD (&fnic->vlans);@@ -948,6 +947,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)INIT_WORK (&fnic->link_work, fnic_handle_link);INIT_WORK (&fnic->frame_work, fnic_handle_frame); +INIT_WORK (&fnic->flush_work, fnic_flush_tx);skb_queue_head_init (&fnic->frame_queue);skb_queue_head_init (&fnic->tx_queue); --
Quoted 2 lines
2.46.1
Quoted 50 lines · Martin Wilck
After commit
379a58caa199("scsi: fnic: Movefnic_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 <[email protected]>Fixes 379a58caa199 ("scsi: fnic: Move fnic_fnic_flush_tx() to a work queue")---
drivers/scsi/fnic/fnic_main.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/fnic/fnic_main.c +1
-2@@ -830,7 +830,6 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)spin_lock_init (&fnic->vlans_lock);INIT_WORK (&fnic->fip_frame_work, fnic_handle_fip_frame);INIT_WORK (&fnic->event_work, fnic_handle_event); -INIT_WORK (&fnic->flush_work, fnic_flush_tx);skb_queue_head_init (&fnic->fip_frame_queue);INIT_LIST_HEAD (&fnic->evlist);INIT_LIST_HEAD (&fnic->vlans);@@ -948,6 +947,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)INIT_WORK (&fnic->link_work, fnic_handle_link);INIT_WORK (&fnic->frame_work, fnic_handle_frame); +INIT_WORK (&fnic->flush_work, fnic_flush_tx);skb_queue_head_init (&fnic->frame_queue);skb_queue_head_init (&fnic->tx_queue); --
Quoted 3 lines
2.46.1
Sorry, the correct tag is:
Regards,
Karan