From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
Bernd Schumacher <bernd@bschu.de>,
"Alexandre N." <an.tech@mailo.com>,
Salvatore Bonaccorso <carnil@debian.org>,
1131025@bugs.debian.org, Uwe Kleine-Koenig <ukleinek@debian.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Mario Limonciello <mario.limonciello@amd.com>,
Alex Williamson <alex@shazbot.org>,
regressions@lists.linux.dev, linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: Update saved_config_space upon resource assignment
Date: Thu, 16 Apr 2026 15:16:08 +0300 (EEST) [thread overview]
Message-ID: <9fcb46ff-56d2-1504-11a1-ad8449c80b2d@linux.intel.com> (raw)
In-Reply-To: <aeDH4XNvwcX7RI0m@wunner.de>
[-- Attachment #1: Type: text/plain, Size: 1976 bytes --]
On Thu, 16 Apr 2026, Lukas Wunner wrote:
> On Thu, Apr 16, 2026 at 02:08:03PM +0300, Ilpo Järvinen wrote:
> > On Wed, 15 Apr 2026, Lukas Wunner wrote:
> > > Bernd reports passthrough failure of a Digital Devices Cine S2 V6 DVB
> > > adapter plugged into an ASRock X570S PG Riptide board with BIOS version
> > > P5.41 (09/07/2023):
> [...]
> > > Since a2f1e22390ac, config space is saved on enumeration, prior to BAR
> > > correction. Upon passthrough, the corrected BAR is overwritten with the
> > > incorrect saved value by:
> >
> > I'm wondering if there's something that makes this problem specific to
> > only standard BARs?
> >
> > Can other resources, namely IOV resources or bridge windows, similarly be
> > updated "too late" and not get correctly updated into the saved config
> > space?
>
> IOV registers are not saved, they're reconstructed from pci_dev->resource[]:
>
> pci_restore_iov_state()
> sriov_restore_state()
> pci_update_resource()
> pci_iov_update_resource()
>
> Bridge windows are saved when portdrv probes (see call to pci_save_state()
> in pcie_portdrv_probe()) and that happens after the fs_initcall() because
> portdrv is registered from a device_initcall(). So those should be fine
> as well.
>
> (FWIW sashiko also flagged the bridge windows not getting saved as an
> (alleged) problem.)
>
> Thanks for taking a look!
Okay, fair.
It feels a bit odd they're all handled differently (not a problem when it
comes to this patch). Maybe it would make sense to eventually restore them
all from the pci_dev's resource array. Add something like
pci_restore_resources() that would restore all the resources that are
relevant for the type.
I don't know if that's doable when it comes to the order of things,
especially with sriov, but if doable, it would prevent them ever getting
out of sync again and would avoid the trouble of having to save them
elsewhere.
--
i.
next prev parent reply other threads:[~2026-04-16 12:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 15:56 [PATCH] PCI: Update saved_config_space upon resource assignment Lukas Wunner
2026-04-16 11:08 ` Ilpo Järvinen
2026-04-16 11:28 ` Lukas Wunner
2026-04-16 12:16 ` Ilpo Järvinen [this message]
2026-04-16 12:35 ` 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=9fcb46ff-56d2-1504-11a1-ad8449c80b2d@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=1131025@bugs.debian.org \
--cc=alex@shazbot.org \
--cc=an.tech@mailo.com \
--cc=bernd@bschu.de \
--cc=carnil@debian.org \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mario.limonciello@amd.com \
--cc=rafael@kernel.org \
--cc=regressions@lists.linux.dev \
--cc=ukleinek@debian.org \
/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