From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
qemu-devel@nongnu.org, "Eduardo Habkost" <ehabkost@redhat.com>
Subject: Re: [PATCH 5/6] pcie: fast unplug when slot power is off
Date: Tue, 12 Oct 2021 01:56:31 -0400 [thread overview]
Message-ID: <20211012014700-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20211011120504.254053-6-kraxel@redhat.com>
On Mon, Oct 11, 2021 at 02:05:03PM +0200, Gerd Hoffmann wrote:
> In case the slot is powered off (and the power indicator turned off too)
> we can unplug right away, without round-trip to the guest.
>
> Also clear pending attention button press, there is nothing to care
> about any more.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> hw/pci/pcie.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
> index 70fc11ba4c7d..f3ac04399969 100644
> --- a/hw/pci/pcie.c
> +++ b/hw/pci/pcie.c
> @@ -561,6 +561,16 @@ void pcie_cap_slot_unplug_request_cb(HotplugHandler *hotplug_dev,
> return;
> }
>
> + if (((sltctl & PCI_EXP_SLTCTL_PIC) == PCI_EXP_SLTCTL_PWR_IND_OFF) &&
> + ((sltctl & PCI_EXP_SLTCTL_PCC) == PCI_EXP_SLTCTL_PWR_OFF)) {
> + /* slot is powered off -> unplug without round-trip to the guest */
> + pcie_cap_slot_do_unplug(hotplug_pdev);
> + hotplug_event_notify(hotplug_pdev);
> + pci_word_test_and_clear_mask(exp_cap + PCI_EXP_SLTSTA,
> + PCI_EXP_SLTSTA_ABP);
Does this handle all the things including link status etc btw?
I don't remember off-hand.
> + return;
> + }
> +
> pcie_cap_slot_push_attention_button(hotplug_pdev);
> }
>
> --
> 2.31.1
next prev parent reply other threads:[~2021-10-12 5:57 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-11 12:04 [PATCH 0/6] RfC: try improve native hotplug for pcie root ports Gerd Hoffmann
2021-10-11 12:04 ` [PATCH 1/6] pci: implement power state Gerd Hoffmann
2021-10-11 12:05 ` [PATCH 2/6] pcie: implement slow power control for pcie root ports Gerd Hoffmann
2021-10-11 12:05 ` [PATCH 3/6] pcie: add power indicator blink check Gerd Hoffmann
2021-11-15 11:29 ` Michael S. Tsirkin
2021-11-15 14:52 ` Gerd Hoffmann
2021-10-11 12:05 ` [PATCH 4/6] pcie: factor out pcie_cap_slot_unplug() Gerd Hoffmann
2021-10-11 12:05 ` [PATCH 5/6] pcie: fast unplug when slot power is off Gerd Hoffmann
2021-10-12 5:56 ` Michael S. Tsirkin [this message]
2021-10-12 6:46 ` Gerd Hoffmann
2021-10-11 12:05 ` [PATCH 6/6] pcie: expire pending delete Gerd Hoffmann
2021-10-11 12:49 ` Michael S. Tsirkin
2021-10-12 5:30 ` Gerd Hoffmann
2021-10-12 5:46 ` Michael S. Tsirkin
2021-10-12 6:44 ` Gerd Hoffmann
2021-10-12 7:01 ` Michael S. Tsirkin
2021-10-18 15:36 ` [PATCH 0/6] RfC: try improve native hotplug for pcie root ports Michael S. Tsirkin
2021-10-19 5:21 ` Gerd Hoffmann
2021-10-19 5:46 ` Michael S. Tsirkin
2021-10-19 6:29 ` Gerd Hoffmann
2021-11-01 21:47 ` Michael S. Tsirkin
2021-11-02 12:09 ` Gerd Hoffmann
2021-11-10 12:02 ` Michael S. Tsirkin
2021-11-11 7:53 ` Gerd Hoffmann
2021-11-11 8:20 ` Michael S. Tsirkin
2021-11-11 9:34 ` Gerd Hoffmann
2021-11-11 12:09 ` Gerd Hoffmann
2021-11-11 15:39 ` Michael S. Tsirkin
2021-11-12 11:15 ` Gerd Hoffmann
2021-11-12 12:17 ` Igor Mammedov
2021-11-15 11:13 ` Michael S. Tsirkin
2021-11-11 9:35 ` Daniel P. Berrangé
2021-11-11 17:11 ` Michael S. Tsirkin
2021-11-11 18:08 ` Daniel P. Berrangé
2021-11-11 18:43 ` Michael S. Tsirkin
2021-11-12 10:16 ` 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=20211012014700-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).