Re: [PATCH] PCI: liveupdate: Factor out pci_dev_ser allocation and release

From: Mike Rapoport

Date: Tue Nov 17 2026 - 08:01:43 EST


From: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>

On Mon, 09 Nov 2026 17:40:09 +0000, David Matlack wrote:
> Move the code that starts and stops preserving a device into
> pci_liveupdate_alloc_dev_ser() and pci_liveupdate_free_dev_ser(), and
> split pci_liveupdate_preserve_device() into separate paths for devices
> that are already preserved and devices being preserved for the first
> time. Leave a single refcount increment shared by both paths.
>
> Since upstream bridges are preserved once for every preserved device
> below them, nr_devices is only incremented when a device's struct
> pci_dev_ser is allocated and only decremented when it is released, not
> on every preserve and unpreserve. Keeping that accounting in a pair of
> helpers makes the relationship explicit.
>
> [...]

Applied to lu-pci-preservation branch of liveupdate/linux.git tree, thanks!

[1/1] PCI: liveupdate: Factor out pci_dev_ser allocation and release
commit: 75181814fbd531e0e29833e8646825c6e5051e8b

tree: https://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux
branch: lu-pci-preservation

--
Sincerely yours,
Mike.