From: kettenis Date: Tue, 11 Jun 2024 17:35:26 +0000 (+0000) Subject: Avoid powering down PCI devices if we're rebooting. This makes some X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c309a8226f56e36f262f0c1e3d1f5f2076dee996;p=openbsd Avoid powering down PCI devices if we're rebooting. This makes some machines (e.g. the t410) unhappy. ok mglocker@ --- diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 09c4b56d3d4..ae1e3755836 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.430 2024/06/02 11:08:41 kettenis Exp $ */ +/* $OpenBSD: acpi.c,v 1.431 2024/06/11 17:35:26 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -726,8 +727,10 @@ acpi_pci_min_powerstate(pci_chipset_tag_t pc, pcitag_t tag) if (pdev->bus == bus && pdev->dev == dev && pdev->fun == fun) { switch (acpi_softc->sc_state) { case ACPI_STATE_S0: - defaultstate = PCI_PMCSR_STATE_D3; - state = pdev->_s0w; + if (boothowto & RB_POWERDOWN) { + defaultstate = PCI_PMCSR_STATE_D3; + state = pdev->_s0w; + } break; case ACPI_STATE_S3: defaultstate = PCI_PMCSR_STATE_D3;