Commit e5d3afbe authored by Patryk Małek's avatar Patryk Małek Committed by Greg Kroah-Hartman

i40e: hold the rtnl lock on clearing interrupt scheme

[ Upstream commit 5cba17b1 ]

Hold the rtnl lock when we're clearing interrupt scheme
in i40e_shutdown and in i40e_remove.
Signed-off-by: default avatarPatryk Małek <patryk.malek@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent f9a84bbd
...@@ -14208,6 +14208,7 @@ static void i40e_remove(struct pci_dev *pdev) ...@@ -14208,6 +14208,7 @@ static void i40e_remove(struct pci_dev *pdev)
mutex_destroy(&hw->aq.asq_mutex); mutex_destroy(&hw->aq.asq_mutex);
/* Clear all dynamic memory lists of rings, q_vectors, and VSIs */ /* Clear all dynamic memory lists of rings, q_vectors, and VSIs */
rtnl_lock();
i40e_clear_interrupt_scheme(pf); i40e_clear_interrupt_scheme(pf);
for (i = 0; i < pf->num_alloc_vsi; i++) { for (i = 0; i < pf->num_alloc_vsi; i++) {
if (pf->vsi[i]) { if (pf->vsi[i]) {
...@@ -14216,6 +14217,7 @@ static void i40e_remove(struct pci_dev *pdev) ...@@ -14216,6 +14217,7 @@ static void i40e_remove(struct pci_dev *pdev)
pf->vsi[i] = NULL; pf->vsi[i] = NULL;
} }
} }
rtnl_unlock();
for (i = 0; i < I40E_MAX_VEB; i++) { for (i = 0; i < I40E_MAX_VEB; i++) {
kfree(pf->veb[i]); kfree(pf->veb[i]);
...@@ -14427,7 +14429,13 @@ static void i40e_shutdown(struct pci_dev *pdev) ...@@ -14427,7 +14429,13 @@ static void i40e_shutdown(struct pci_dev *pdev)
wr32(hw, I40E_PFPM_WUFC, wr32(hw, I40E_PFPM_WUFC,
(pf->wol_en ? I40E_PFPM_WUFC_MAG_MASK : 0)); (pf->wol_en ? I40E_PFPM_WUFC_MAG_MASK : 0));
/* Since we're going to destroy queues during the
* i40e_clear_interrupt_scheme() we should hold the RTNL lock for this
* whole section
*/
rtnl_lock();
i40e_clear_interrupt_scheme(pf); i40e_clear_interrupt_scheme(pf);
rtnl_unlock();
if (system_state == SYSTEM_POWER_OFF) { if (system_state == SYSTEM_POWER_OFF) {
pci_wake_from_d3(pdev, pf->wol_en); pci_wake_from_d3(pdev, pf->wol_en);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment