All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Annie Li <annie.li@oracle.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH 1/1] pcie: Do not set power state for some hot-plugged devices
Date: Wed, 15 Dec 2021 07:05:13 +0100	[thread overview]
Message-ID: <20211215060513.kugy3y32nj2te7ui@sirius.home.kraxel.org> (raw)
In-Reply-To: <20211214215312.944-1-annie.li@oracle.com>

On Tue, Dec 14, 2021 at 09:53:12PM +0000, Annie Li wrote:
> After the PCIe device is hot-plugged, the device's power state is
> initialized as ON. However, the device isn't powered on yet, i.e.
> the PCI_EXP_SYSCTL_PCC bit isn't set to PCI_EXP_SLTCTL_PWR_ON.
> Later on, its power state will set back to OFF due to the non
> PCI_EXP_SLTCTL_PWR_ON state. The device is invisible until
> PCI_EXP_SLTCTL_PWR_ON is set.
> 
> This may be appropriate for general PCIe hot-plug cases. However,
> if the device is hot-plugged when the VM is in VM_STATE_PRELAUNCH
> state, especially the system disk device, the firmware will fail
> to find the system disk. As a result, the guest fails to boot.

Maybe we should just not set DeviceState->hotplugged = true for devices
added in VM_STATE_PRELAUNCH?  It's not actual hotplug (i.e. device added
while the system is running) after all ...

There are lots of places checking DeviceState->hotplugged, and I suspect
we have similar issues elsewhere.

take care,
  Gerd



  reply	other threads:[~2021-12-15  6:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14 21:53 [PATCH 1/1] pcie: Do not set power state for some hot-plugged devices Annie Li
2021-12-15  6:05 ` Gerd Hoffmann [this message]
2021-12-15 19:20   ` Annie.li
2021-12-16  6:11     ` Gerd Hoffmann
2021-12-16 23:10       ` Annie.li
2021-12-17  6:47         ` Gerd Hoffmann

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=20211215060513.kugy3y32nj2te7ui@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=annie.li@oracle.com \
    --cc=qemu-devel@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.