Re: [PATCH v13 2/5] s390/pci: Improve function measurement state management
From: Niklas Schnelle
Date: Wed Nov 11 2026 - 15:46:41 EST
On Wed, 2026-11-11 at 11:27 -0500, Omar Elghoul wrote:
> When a zPCI function is disabled and re-enabled, the firmware implicitly
> disables function measurement while the kernel still believes it is
> enabled, leading to a disconnect between the user-visible state and the
> actual device state.
>
> Add the statistics_on field to struct zpci_dev to track the desired FMB
> state. Introduce the functions zpci_fmb_request_on()/_off(), which defer
> to zpci_fmb_enable()/_disable() to perform the actual firmware change.
> This decouples the enablement or disablement step from managing the
> user's requested state.
>
> Restore the state in pcibios_enable_device(), pcibios_disable_device(),
> and zpci_reenable_device(). New devices start with measurement on by
> default, unchanged from before.
>
> Signed-off-by: Omar Elghoul <oelghoul@xxxxxxxxxxxxx>
> Reviewed-by: Gerd Bayer <gbayer@xxxxxxxxxxxxx>
> ---
> arch/s390/include/asm/pci.h | 7 +++--
> arch/s390/pci/pci.c | 54 +++++++++++++++++++++++++++++++++----
> arch/s390/pci/pci_debug.c | 4 +--
> 3 files changed, 56 insertions(+), 9 deletions(-)
>
Looks good to me. Thank you for the great work and endurance of
iterating on this as many times as it took.
Reviewed-by: Niklas Schnelle <schnelle@xxxxxxxxxxxxx>