intel-wired-lan.osuosl.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org
Subject: [Intel-wired-lan] [PATCH 0/3] ice/i40e: pci_enable_device() fixes
Date: Sat, 16 Aug 2025 09:10:00 +0200	[thread overview]
Message-ID: <cover.1755327132.git.lukas@wunner.de> (raw)

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(-)

-- 
2.47.2


             reply	other threads:[~2025-08-16  7:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-16  7:10 Lukas Wunner [this message]
2025-08-16  7:10 ` [Intel-wired-lan] [PATCH 1/3] ice: Fix enable_cnt imbalance on resume Lukas Wunner
2025-08-16  7:10 ` [Intel-wired-lan] [PATCH 2/3] ice: Fix enable_cnt imbalance on PCIe error recovery Lukas Wunner
2025-08-16  7:10 ` [Intel-wired-lan] [PATCH 3/3] i40e: " Lukas Wunner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1755327132.git.lukas@wunner.de \
    --to=lukas@wunner.de \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.kitszel@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).