@@ -11,6 +11,10 @@ MODULE_DESCRIPTION(DRV_SUMMARY);
MODULE_IMPORT_NS(LIBETH);
MODULE_LICENSE("GPL");
+/* Prevent lockdep from complaining when PF reset the VFs */
+static struct lock_class_key idpf_pf_vport_init_lock_key;
+static struct lock_class_key idpf_pf_work_lock_key;
+
/**
* idpf_remove - Device removal routine
* @pdev: PCI device information struct
@@ -140,9 +144,25 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
adapter->req_tx_splitq = true;
adapter->req_rx_splitq = true;
+ mutex_init(&adapter->vport_init_lock);
+ mutex_init(&adapter->vport_cfg_lock);
+ mutex_init(&adapter->vector_lock);
+ mutex_init(&adapter->queue_lock);
+ mutex_init(&adapter->vc_buf_lock);
+
+ INIT_DELAYED_WORK(&adapter->init_task, idpf_init_task);
+ INIT_DELAYED_WORK(&adapter->serv_task, idpf_service_task);
+ INIT_DELAYED_WORK(&adapter->mbx_task, idpf_mbx_task);
+ INIT_DELAYED_WORK(&adapter->stats_task, idpf_statistics_task);
+ INIT_DELAYED_WORK(&adapter->vc_event_task, idpf_vc_event_task);
+
switch (ent->device) {
case IDPF_DEV_ID_PF:
idpf_dev_ops_init(adapter);
+ lockdep_set_class(&adapter->vport_init_lock,
+ &idpf_pf_vport_init_lock_key);
+ lockdep_init_map(&adapter->vc_event_task.work.lockdep_map,
+ "idpf-PF-vc-work", &idpf_pf_work_lock_key, 0);
break;
case IDPF_DEV_ID_VF:
idpf_vf_dev_ops_init(adapter);
@@ -233,18 +253,6 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_cfg_hw;
}
- mutex_init(&adapter->vport_init_lock);
- mutex_init(&adapter->vport_cfg_lock);
- mutex_init(&adapter->vector_lock);
- mutex_init(&adapter->queue_lock);
- mutex_init(&adapter->vc_buf_lock);
-
- INIT_DELAYED_WORK(&adapter->init_task, idpf_init_task);
- INIT_DELAYED_WORK(&adapter->serv_task, idpf_service_task);
- INIT_DELAYED_WORK(&adapter->mbx_task, idpf_mbx_task);
- INIT_DELAYED_WORK(&adapter->stats_task, idpf_statistics_task);
- INIT_DELAYED_WORK(&adapter->vc_event_task, idpf_vc_event_task);
-
adapter->dev_ops.reg_ops.reset_reg_init(adapter);
set_bit(IDPF_HR_DRV_LOAD, adapter->flags);
queue_delayed_work(adapter->vc_event_wq, &adapter->vc_event_task,