Skip to content

ice/i40e: pci_enable_device() fixes

Lukas Wunner intel-wired-lan netdev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ice: Fix enable_cnt imbalance on resumedrivers/net/ethernet/intel/ice/ice_main.c+0 -60 replies
2/3ice: Fix enable_cnt imbalance on PCIe error recoverydrivers/net/ethernet/intel/ice/ice_main.c+11 -210 replies
3/3i40e: Fix enable_cnt imbalance on PCIe error recoverydrivers/net/ethernet/intel/i40e/i40e_main.c+10 -190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] ice/i40e: pci_enable_device() fixes

The ice and i40e drivers perform surplus calls to pci_enable_device() on resume and on error recovery. This results in the Memory Space Enable bit in the PCI Command register not being cleared on driver unbind.

Not a catastrophic issue, so although these commits contain Fixes tags, I recommend applying through next-queue.git to let them bake in linux-next for a couple of weeks.

I have neither an ice nor i40e card available, so this is compile-tested only. I'm hoping Intel validation can test it.

Suggested test procedure:

- Unbind the driver through sysfs without having suspended the card:
echo D:B:D.F | sudo tee /sys/bus/pci/drivers/ice/unbind (replace D:B:D.F with the device address, e.g. 0000:07:00.0)

- Verify with lspci that it says "Mem-" in the "Control:" register:
lspci -vv -s D:B:D.F

- Rebind the driver:
echo D:B:D.F | sudo tee /sys/bus/pci/drivers/ice/bind

- Suspend the card, resume the card, unbind the driver, re-run lspci. Expected result without this series "Mem+", with this series "Mem-".

For error recovery, the procedure is the same but instead of suspending and resuming the card, an error needs to be injected. See the section on "Software error injection" in Documentation/PCI/pcieaer-howto.rst.

Thanks!

Lukas Wunner (3):
ice: Fix enable_cnt imbalance on resume
ice: Fix enable_cnt imbalance on PCIe error recovery
i40e: Fix enable_cnt imbalance on PCIe error recovery

 drivers/net/ethernet/intel/i40e/i40e_main.c | 29 ++++++----------
 drivers/net/ethernet/intel/ice/ice_main.c   | 38 ++++++---------------
 2 files changed, 21 insertions(+), 46 deletions(-)
Signature · 1 line
2.47.2