Re: [PATCH 4/5] PCI: Add cxl DVSEC state save/restore across resets

From: Jonathan Cameron

Date: Thu Mar 12 2026 - 08:29:23 EST


On Fri, 6 Mar 2026 08:00:18 +0000
smadhavan@xxxxxxxxxx wrote:

> From: Srirangan Madhavan <smadhavan@xxxxxxxxxx>
>
> Save and restore CXL DVSEC control registers (CTRL, CTRL2), range
> base registers, and lock state across PCI resets.
>
> When the DVSEC CONFIG_LOCK bit is set, certain DVSEC fields
> become read-only and hardware may have updated them.

This I'm not following. Can you give an example of which
fields the hardware is allowed to change after lock is set?

> Blindly
> restoring saved values would be silently ignored or conflict
> with hardware state. Instead, a read-merge-write approach is
> used: current hardware values are read for the RWL
> (read-write-when-locked) fields and merged with saved state,
> so only writable bits are restored while locked bits retain
> their hardware values.
>
> Hooked into pci_save_state()/pci_restore_state() so all PCI reset
> paths automatically preserve CXL DVSEC configuration.
>
> Signed-off-by: Srirangan Madhavan <smadhavan@xxxxxxxxxx>