Skip to content

Commit bd9a250

Browse files
author
Myron Stowe
committed
ice: stop calling pci_disable_device() as we use pcim
JIRA: https://issues.redhat.com/browse/RHEL-59033 Upstream Status: e6501fc commit e6501fc Author: Przemek Kitszel <przemyslaw.kitszel@intel.com> Date: Fri Aug 30 15:44:11 2024 +0200 ice: stop calling pci_disable_device() as we use pcim Our driver uses devres to manage resources, in particular we call pcim_enable_device(), what also means we express the intent to get automatic pci_disable_device() call at driver removal. Manual calls to pci_disable_device() misuse the API. Recent commit (see "Fixes" tag) has changed the removal action from conditional (silent ignore of double call to pci_disable_device()) to unconditional, but able to catch unwanted redundant calls; see cited "Fixes" commit for details. Since that, unloading the driver yields following warn+splat: [70633.628490] ice 0000:af:00.7: disabling already-disabled device [70633.628512] WARNING: CPU: 52 PID: 33890 at drivers/pci/pci.c:2250 pci_disable_device+0xf4/0x100 ... [70633.628744] ? pci_disable_device+0xf4/0x100 [70633.628752] release_nodes+0x4a/0x70 [70633.628759] devres_release_all+0x8b/0xc0 [70633.628768] device_unbind_cleanup+0xe/0x70 [70633.628774] device_release_driver_internal+0x208/0x250 [70633.628781] driver_detach+0x47/0x90 [70633.628786] bus_remove_driver+0x80/0x100 [70633.628791] pci_unregister_driver+0x2a/0xb0 [70633.628799] ice_module_exit+0x11/0x3a [ice] Note that this is the only Intel ethernet driver that needs such fix. Fixes: f748a07 ("PCI: Remove legacy pcim_release()") Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com> Reviewed-by: Philipp Stanner <pstanner@redhat.com> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: Myron Stowe <mstowe@redhat.com>
1 parent 5750bab commit bd9a250

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5286,7 +5286,6 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
52865286
ice_deinit(pf);
52875287
err_init:
52885288
ice_adapter_put(pdev);
5289-
pci_disable_device(pdev);
52905289
return err;
52915290
}
52925291

@@ -5393,7 +5392,6 @@ static void ice_remove(struct pci_dev *pdev)
53935392
ice_set_wake(pf);
53945393

53955394
ice_adapter_put(pdev);
5396-
pci_disable_device(pdev);
53975395
}
53985396

53995397
/**

0 commit comments

Comments
 (0)