From: Ani Sinha <ani@anisinha.ca>
To: qemu-devel@nongnu.org
Cc: Ani Sinha <ani@anisinha.ca>, Igor Mammedov <imammedo@redhat.com>,
jusual@redhat.com, "Michael S. Tsirkin" <mst@redhat.com>
Subject: [PATCH] hw/acpi: some cosmetic improvements to existing code
Date: Wed, 21 Jul 2021 19:46:10 +0530 [thread overview]
Message-ID: <20210721141610.139310-1-ani@anisinha.ca> (raw)
All existing code using acpi_get_i386_pci_host() checks for a non-null
return from this function call. This change brings the same check to
acpi_pcihp_disable_root_bus() function. Also adds a comment describing
why we unconditionally pass a truth value to the last argument when calling
acpi_pcihp_reset() from ich9 platform.
Fixes: c0e427d6eb5fef ("hw/acpi/ich9: Enable ACPI PCI hot-plug")
Signed-off-by: Ani Sinha <ani@anisinha.ca>
---
hw/acpi/ich9.c | 1 +
hw/acpi/pcihp.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 778e27b659..58d8430eb9 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -281,6 +281,7 @@ static void pm_reset(void *opaque)
pm->smi_en_wmask = ~0;
if (pm->use_acpi_hotplug_bridge) {
+ /* on root PCIE bus, we always use native or SHPC based hotplug */
acpi_pcihp_reset(&pm->acpi_pci_hotplug, true);
}
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index f4d706e47d..856c6e1b47 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -136,6 +136,11 @@ static void acpi_pcihp_disable_root_bus(void)
return;
}
+ if (!host) {
+ root_hp_disabled = true;
+ return;
+ }
+
bus = PCI_HOST_BRIDGE(host)->bus;
if (bus) {
/* setting the hotplug handler to NULL makes the bus non-hotpluggable */
--
2.25.1
next reply other threads:[~2021-07-21 14:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-21 14:16 Ani Sinha [this message]
2021-07-25 7:14 ` [PATCH] hw/acpi: some cosmetic improvements to existing code Ani Sinha
2021-07-26 11:59 ` Igor Mammedov
2021-07-26 12:56 ` Ani Sinha
2021-07-26 13:29 ` Igor Mammedov
2021-07-26 13:50 ` Ani Sinha
2021-07-26 13:44 ` Ani Sinha
-- strict thread matches above, loose matches on Subject: below --
2021-07-21 14:07 Ani Sinha
2021-07-21 14:11 ` Ani Sinha
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=20210721141610.139310-1-ani@anisinha.ca \
--to=ani@anisinha.ca \
--cc=imammedo@redhat.com \
--cc=jusual@redhat.com \
--cc=mst@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).