Skip to content

Commit 1267ff9

Browse files
Sucheta Chakrabortydavem330
authored andcommitted
qlcnic: Initialize trans_work and idc_aen_work at VF probe.
o work_struct should be initialized before cancel_delayed_work call to destroy it. Signed-off-by: Sucheta Chakraborty <[email protected]> Signed-off-by: Shahed Shaikh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7e8fd00 commit 1267ff9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ static void qlcnic_sriov_vf_cancel_fw_work(struct qlcnic_adapter *);
3535
static void qlcnic_sriov_cleanup_transaction(struct qlcnic_bc_trans *);
3636
static int qlcnic_sriov_vf_mbx_op(struct qlcnic_adapter *,
3737
struct qlcnic_cmd_args *);
38+
static void qlcnic_sriov_process_bc_cmd(struct work_struct *);
3839

3940
static struct qlcnic_hardware_ops qlcnic_sriov_vf_hw_ops = {
4041
.read_crb = qlcnic_83xx_read_crb,
@@ -179,6 +180,8 @@ int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs)
179180
spin_lock_init(&vf->rcv_pend.lock);
180181
init_completion(&vf->ch_free_cmpl);
181182

183+
INIT_WORK(&vf->trans_work, qlcnic_sriov_process_bc_cmd);
184+
182185
if (qlcnic_sriov_pf_check(adapter)) {
183186
vp = kzalloc(sizeof(struct qlcnic_vport), GFP_KERNEL);
184187
if (!vp) {
@@ -653,6 +656,8 @@ int qlcnic_sriov_vf_init(struct qlcnic_adapter *adapter, int pci_using_dac)
653656
if (qlcnic_read_mac_addr(adapter))
654657
dev_warn(&adapter->pdev->dev, "failed to read mac addr\n");
655658

659+
INIT_DELAYED_WORK(&adapter->idc_aen_work, qlcnic_83xx_idc_aen_work);
660+
656661
clear_bit(__QLCNIC_RESETTING, &adapter->state);
657662
return 0;
658663
}
@@ -865,7 +870,6 @@ static void qlcnic_sriov_schedule_bc_cmd(struct qlcnic_sriov *sriov,
865870
vf->adapter->need_fw_reset)
866871
return;
867872

868-
INIT_WORK(&vf->trans_work, func);
869873
queue_work(sriov->bc.bc_trans_wq, &vf->trans_work);
870874
}
871875

0 commit comments

Comments
 (0)