summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/sunpci.c
diff options
context:
space:
mode:
authorHans Rosenfeld <rosenfeld@grumpf.hope-2000.org>2011-05-06 10:04:21 -0700
committerHans Rosenfeld <rosenfeld@grumpf.hope-2000.org>2011-05-06 10:04:21 -0700
commitca3c624eb7d0d5f4c0db8b7a3cdfc467ba643f7b (patch)
tree6dec808b0912aec9f41c30e7ff4da16cbb919d00 /usr/src/uts/common/os/sunpci.c
parent447603b54aaea470ed1dcdb5c52d0be1d7801f84 (diff)
downloadillumos-joyent-ca3c624eb7d0d5f4c0db8b7a3cdfc467ba643f7b.tar.gz
506 suspend/resume issue on b147 (6986810)
Reviewed by: Richard Lowe <richlowe@richlowe.net> Reviewed by: Garrett D'Amore <garrett@nexenta.com> Reviewed by: Albert Lee <trisk@nexenta.com> Approved by: Garrett D'Amore <garrett@nexenta.com>
Diffstat (limited to 'usr/src/uts/common/os/sunpci.c')
-rw-r--r--usr/src/uts/common/os/sunpci.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr/src/uts/common/os/sunpci.c b/usr/src/uts/common/os/sunpci.c
index c39e8aa698..b26685d941 100644
--- a/usr/src/uts/common/os/sunpci.c
+++ b/usr/src/uts/common/os/sunpci.c
@@ -1053,8 +1053,7 @@ pci_post_suspend(dev_info_t *dip)
if ((pmcap & (PCI_PMCAP_D3COLD_PME | PCI_PMCAP_D3HOT_PME)) != 0)
p->ppc_suspend_level =
(PCI_PMCSR_PME_EN | PCI_PMCSR_D3HOT);
- else if ((pmcap & PCI_PMCAP_D2_PME) !=
- 0)
+ else if ((pmcap & PCI_PMCAP_D2_PME) != 0)
p->ppc_suspend_level = PCI_PMCSR_PME_EN | PCI_PMCSR_D2;
else if ((pmcap & PCI_PMCAP_D1_PME) != 0)
p->ppc_suspend_level = PCI_PMCSR_PME_EN | PCI_PMCSR_D1;
@@ -1112,9 +1111,9 @@ done:
#if defined(__x86)
- if (pci_enable_wakeup) {
-
- ret = acpi_ddi_setwake(dip, 3);
+ if (pci_enable_wakeup &&
+ (p->ppc_suspend_level & PCI_PMCSR_PME_EN) != 0) {
+ ret = acpi_ddi_setwake(dip, 3);
if (ret) {
PMD(PMD_SX, ("pci_post_suspend, setwake %s@%s rets "
@@ -1173,9 +1172,6 @@ pci_pre_resume(dev_info_t *dip)
int flags;
uint_t length;
clock_t drv_usectohz(clock_t microsecs);
-#if defined(__x86)
- int retval;
-#endif
PMD(PMD_SX, ("pci_pre_resume %s:%d\n", ddi_driver_name(dip),
ddi_get_instance(dip)))
@@ -1187,14 +1183,15 @@ pci_pre_resume(dev_info_t *dip)
flags = p->ppc_flags;
pmcap = p->ppc_cap_offset;
pmcsr = p->ppc_pmcsr;
- ddi_prop_free(p);
#if defined(__x86)
/*
* Turn platform wake enable back off
*/
+ if (pci_enable_wakeup &&
+ (p->ppc_suspend_level & PCI_PMCSR_PME_EN) != 0) {
+ int retval;
- if (pci_enable_wakeup) {
retval = acpi_ddi_setwake(dip, 0); /* 0 for now */
if (retval) {
PMD(PMD_SX, ("pci_pre_resume, setwake %s@%s rets "
@@ -1202,6 +1199,9 @@ pci_pre_resume(dev_info_t *dip)
}
}
#endif
+
+ ddi_prop_free(p);
+
if ((flags & PPCF_NOPMCAP) != 0)
goto done;