Re: [PATCH v2 3/3] PCI/IOV: Restore initial VF ReBAR sizes on PF driver remove

[email protected] Mon, 03 Aug 2026 10:41:19 +0000
Newsgroups org.kernel.vger.linux-pci
Message-ID <[email protected]>
> sriov_disable() and sriov_enable() error paths restore the per-VF BAR
> sizes saved at probe time. They do not cover the case where the PF
> driver is detached while VF BARs were resized but SR-IOV was never
> enabled (or was already disabled).
>=20
> Restore the initial sizes from pci_iov_remove() as well. That hook runs
> on driver detach while the device is still live, unlike sriov_release()
> which runs later from the pci_dev release path.
>=20
> Skip the restore when the PF driver leaves SR-IOV enabled; in that case
> VF memory decoding is still active and pci_iov_vf_bar_set_size() cannot
> safely change the VF BAR size.
>=20
> Signed-off-by: Marcin Bernatowicz <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

--=20
Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260803103007.2096=
[email protected]?part=3D3