From: "Francisco Beltrán Millalén" <fbeltranmillalen@gmail.com>
To: bhelgaas@google.com, linux-pci@vger.kernel.org
Cc: stern@rowland.harvard.edu, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/4] PCI/PM: Do not save or restore the config space of an inaccessible device
Date: Thu, 24 Sep 2026 19:29:53 -0300 [thread overview]
Message-ID: <20260924222953.26697-1-fbeltranmillalen@gmail.com> (raw)
In-Reply-To: <20260924124221.12374-1-fbeltranmillalen@gmail.com>
Please don't apply patches 2/4 and 3/4 as they stand: they break SR-IOV
virtual functions.
Both treat an all-ones first dword (Vendor ID and Device ID) as "device
inaccessible", but a VF always reads 0xffff there; that is why
pci_device_is_present() checks the PF instead. With 2/4,
pci_save_state() fails for every VF, from pci_bus_add_device() and from
pci_dev_save_and_disable() before a reset, so no snapshot is ever taken
and nothing valid is restored after the reset. With 3/4 alone, a VF's
config space is never restored. The machine I tested on has no SR-IOV
devices, so nothing there could show it.
I'll send a v2 that uses pci_device_is_present() in 2/4 and reworks 3/4
accordingly. Two more things it will fix:
- The cover letter speaks of "v2 of this work", but the earlier version
was only reviewed privately and never posted. The next posting will
be v2, with changes listed against this one.
- 1/4 says the device is left alone when pci_save_state() fails. That
holds on its own, but with 2/4 applied the save fails without setting
state_saved, so pci_pm_suspend_noirq() calls pci_save_state() and
pci_prepare_to_sleep() itself afterwards. The code in 1/4 is not
affected, but its description is incomplete. Alan, I'm pointing this
out since you acked it with that text.
The v2 will also carry the Assisted-by tag this posting was missing.
Francisco
prev parent reply other threads:[~2026-09-24 22:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 12:42 Francisco Beltrán Millalén
2026-09-24 12:42 ` [PATCH 1/4] usb: hcd-pci: Honour pci_save_state() failure Francisco Beltrán Millalén
2026-09-24 15:30 ` Alan Stern
2026-09-24 12:42 ` [PATCH 2/4] PCI/PM: Do not save the config space of an inaccessible device Francisco Beltrán Millalén
2026-09-24 12:42 ` [PATCH 3/4] PCI/PM: Do not restore a config space snapshot that is all ones Francisco Beltrán Millalén
2026-09-24 12:42 ` [PATCH 4/4] PCI: Do not mistake an absent device for an active link Francisco Beltrán Millalén
2026-09-24 22:29 ` Francisco Beltrán Millalén [this message]
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=20260924222953.26697-1-fbeltranmillalen@gmail.com \
--to=fbeltranmillalen@gmail.com \
--cc=bhelgaas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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
all inboxes | Powered by JetHome®