All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Rosato <mjrosato@linux.ibm.com>
To: Farhan Ali <alifm@linux.ibm.com>,
	qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Cc: farman@linux.ibm.com, cohuck@redhat.com, alex@shazbot.org,
	clg@redhat.com
Subject: Re: [PATCH v6 2/2] s390x/pci: Reset a device in error state
Date: Wed, 30 Sep 2026 11:32:55 -0400	[thread overview]
Message-ID: <523a3e09-856c-4adb-8134-9a4dc44e16ba@linux.ibm.com> (raw)
In-Reply-To: <20260922171756.920-3-alifm@linux.ibm.com>


> --- a/hw/s390x/s390-pci-bus.c
> +++ b/hw/s390x/s390-pci-bus.c
> @@ -1505,6 +1505,8 @@ static void s390_pci_device_reset(DeviceState *dev)
>          return;
>      case ZPCI_FS_STANDBY:
>          break;
> +    case ZPCI_FS_ERROR:
> +        break;
>      default:
>          pbdev->fh &= ~FH_MASK_ENABLE;
>          pbdev->state = ZPCI_FS_DISABLED;
> @@ -1517,6 +1519,11 @@ static void s390_pci_device_reset(DeviceState *dev)
>      } else if (pbdev->summary_ind) {
>          pci_dereg_irqs(pbdev);
>      }
> +
> +    if (pbdev->state == ZPCI_FS_ERROR) {
> +        s390_pci_reset(pbdev);
> +    }

I know it was mentioned in the prior version, so apologies for not
chiming in til now.  But you really need a comment block explaining why
it's OK to reset the device yet leave it in the ZPCI_FS_ERROR state
after the fact.  That's confusing.

You mentioned in the last version it's because this happens on the
disable path, and there yes we will set the device to ZPCI_FS_DISABLED
right after this -- but what about any other case where we drive this
reset path (e.g. subsystem reset, reboot, and the ISM-specific extra paths)

Note that the non-error cases are ensuring we either leave this function
with the device listed as disabled or standby/reserved.

Would there be harm in, after performing the reset, doing
pbdev->fh &= ~FH_MASK_ENABLE;
pbdev->state = ZPCI_FS_DISABLED;
for the ZPCI_FS_ERROR case now?

Consider that:
1) For a guest-initiated disable, we already checked those were valid
before reaching this point.
2) For all other reset cases, if the device were not in
error/reserved/standby we were leaving here with the device disabled
before this patch.  If the device happened to be in error, now you fix
it up but isn't the proper fix state now 'disabled' to match what an
enabled device would have been?

Thanks,
Matt


  reply	other threads:[~2026-09-30 15:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 17:17 [PATCH v6 0/2] Error recovery for zPCI passthrough devices Farhan Ali
2026-09-22 17:17 ` [PATCH v6 1/2] s390x/pci: Add PCI error handling for vfio pci devices Farhan Ali
2026-09-30 16:30   ` Matthew Rosato
2026-09-30 17:46     ` Farhan Ali
2026-10-01 15:43       ` Matthew Rosato
2026-09-22 17:17 ` [PATCH v6 2/2] s390x/pci: Reset a device in error state Farhan Ali
2026-09-30 15:32   ` Matthew Rosato [this message]
2026-09-30 18:25     ` Farhan Ali
2026-09-30 21:50       ` Matthew Rosato
2026-09-30 21:54         ` Matthew Rosato
2026-09-29 18:03 ` [PATCH v6 0/2] Error recovery for zPCI passthrough devices Farhan Ali

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=523a3e09-856c-4adb-8134-9a4dc44e16ba@linux.ibm.com \
    --to=mjrosato@linux.ibm.com \
    --cc=alex@shazbot.org \
    --cc=alifm@linux.ibm.com \
    --cc=clg@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.