summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authormyers <none@none>2006-05-19 16:55:25 -0700
committermyers <none@none>2006-05-19 16:55:25 -0700
commit859dcd3dbc163471e8193bed809ffec32b8d2b3d (patch)
tree0bab654e61fb0403bf8fd2b0a511ab2b83080432 /usr/src
parentc203fc81f70f1716c969e5594fb698596e632014 (diff)
downloadillumos-joyent-859dcd3dbc163471e8193bed809ffec32b8d2b3d.tar.gz
6426595 acpica: AcpiOsSleep() loses track of time and sleeps forever during poweroff
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/i86pc/io/acpica/osl.c11
-rw-r--r--usr/src/uts/i86pc/io/psm/psm_common.c4
2 files changed, 13 insertions, 2 deletions
diff --git a/usr/src/uts/i86pc/io/acpica/osl.c b/usr/src/uts/i86pc/io/acpica/osl.c
index 60d737b78a..019a55849b 100644
--- a/usr/src/uts/i86pc/io/acpica/osl.c
+++ b/usr/src/uts/i86pc/io/acpica/osl.c
@@ -90,6 +90,9 @@ static char *acpi_table_path = "/boot/acpi/tables/";
/* non-zero while create_d2a_map() is working */
static int creating_d2a_map = 0;
+/* set by acpi_poweroff() in PSMs */
+int acpica_powering_off = 0;
+
/*
*
*/
@@ -641,9 +644,13 @@ AcpiOsSleep(ACPI_INTEGER Milliseconds)
/*
* During kernel startup, before the first
* tick interrupt has taken place, we can't call
- * delay. So we busy wait if lbolt == 0.
+ * delay; very late in kernel shutdown, clock interrupts
+ * are blocked, so delay doesn't work then either.
+ * So we busy wait if lbolt == 0 (kernel startup)
+ * or if psm_shutdown() has set acpi_powering_off to
+ * a non-zero value.
*/
- if (ddi_get_lbolt() == 0)
+ if ((ddi_get_lbolt() == 0) || acpica_powering_off)
drv_usecwait(Milliseconds * 1000);
else
delay(drv_usectohz(Milliseconds * 1000));
diff --git a/usr/src/uts/i86pc/io/psm/psm_common.c b/usr/src/uts/i86pc/io/psm/psm_common.c
index fd67d47590..9336174295 100644
--- a/usr/src/uts/i86pc/io/psm/psm_common.c
+++ b/usr/src/uts/i86pc/io/psm/psm_common.c
@@ -948,8 +948,12 @@ acpi_get_irq_lnk_cache_ent(ACPI_HANDLE lnkobj, int *pci_irqp,
int
acpi_poweroff(void)
{
+ extern int acpica_powering_off;
+
PSM_VERBOSE_POWEROFF(("acpi_poweroff: starting poweroff\n"));
+ acpica_powering_off = 1;
+
if (AcpiEnterSleepStatePrep(5) != AE_OK)
return (1);
ACPI_DISABLE_IRQS();