summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authormyers <none@none>2007-01-23 15:37:32 -0800
committermyers <none@none>2007-01-23 15:37:32 -0800
commit0f2cfdbb2dd724b1f649ce31d87b7964153dc0bc (patch)
tree5531861315e21ea1a73d72e75a3de771daf89f8b /usr/src
parenteffc3653de6b0cff5a62436dc3fe82cc88b3545a (diff)
downloadillumos-gate-0f2cfdbb2dd724b1f649ce31d87b7964153dc0bc.tar.gz
6407285 pcplusmp: possible leak with pci config space mapping in apic.c
6427419 psm_common: need to clean up unused poweroff code 6512929 psm: power button does not turn-off system after "init 0"
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/i86pc/io/mp_platform_common.c21
-rw-r--r--usr/src/uts/i86pc/io/pcplusmp/apic.c15
-rw-r--r--usr/src/uts/i86pc/io/psm/psm_common.c22
-rw-r--r--usr/src/uts/i86pc/io/psm/uppc.c26
4 files changed, 35 insertions, 49 deletions
diff --git a/usr/src/uts/i86pc/io/mp_platform_common.c b/usr/src/uts/i86pc/io/mp_platform_common.c
index b032ec1b7c..b8aad6c793 100644
--- a/usr/src/uts/i86pc/io/mp_platform_common.c
+++ b/usr/src/uts/i86pc/io/mp_platform_common.c
@@ -1703,10 +1703,10 @@ apic_handle_pci_pci_bridge(dev_info_t *idip, int child_devno, int child_ipin,
/*CONSTCOND*/
while (1) {
- if ((dipp = ddi_get_parent(dip)) == (dev_info_t *)NULL)
+ if (((dipp = ddi_get_parent(dip)) == (dev_info_t *)NULL) ||
+ (pci_config_setup(dipp, &cfg_handle) == DDI_SUCCESS))
return (-1);
- if ((pci_config_setup(dipp, &cfg_handle) == DDI_SUCCESS) &&
- (pci_config_get8(cfg_handle, PCI_CONF_BASCLASS) ==
+ if ((pci_config_get8(cfg_handle, PCI_CONF_BASCLASS) ==
PCI_CLASS_BRIDGE) && (pci_config_get8(cfg_handle,
PCI_CONF_SUBCLASS) == PCI_BRIDGE_PCI)) {
pci_config_teardown(&cfg_handle);
@@ -1714,12 +1714,11 @@ apic_handle_pci_pci_bridge(dev_info_t *idip, int child_devno, int child_ipin,
NULL) != 0)
return (-1);
/*
- * This is the rotating scheme that Compaq is using
- * and documented in the pci to pci spec. Also, if
- * the pci to pci bridge is behind another pci to
- * pci bridge, then it need to keep transversing
- * up until an interrupt entry is found or reach
- * the top of the tree
+ * This is the rotating scheme documented in the
+ * PCI-to-PCI spec. If the PCI-to-PCI bridge is
+ * behind another PCI-to-PCI bridge, then it needs
+ * to keep ascending until an interrupt entry is
+ * found or the root is reached.
*/
ipin = (child_devno + child_ipin) % PCI_INTD;
if (bridge_bus == 0 && apic_pci_bus_total == 1)
@@ -1733,8 +1732,10 @@ apic_handle_pci_pci_bridge(dev_info_t *idip, int child_devno, int child_ipin,
dip = dipp;
child_devno = bridge_devno;
child_ipin = ipin;
- } else
+ } else {
+ pci_config_teardown(&cfg_handle);
return (-1);
+ }
}
/*LINTED: function will not fall off the bottom */
}
diff --git a/usr/src/uts/i86pc/io/pcplusmp/apic.c b/usr/src/uts/i86pc/io/pcplusmp/apic.c
index 0f30ffa9c8..cc232d7d97 100644
--- a/usr/src/uts/i86pc/io/pcplusmp/apic.c
+++ b/usr/src/uts/i86pc/io/pcplusmp/apic.c
@@ -1400,9 +1400,6 @@ apic_preshutdown(int cmd, int fcn)
APIC_VERBOSE_POWEROFF(("apic_preshutdown(%d,%d); m=%d a=%d\n",
cmd, fcn, apic_poweroff_method, apic_enable_acpi));
- if ((cmd != A_SHUTDOWN) || (fcn != AD_POWEROFF)) {
- return;
- }
}
static void
@@ -1438,9 +1435,17 @@ apic_shutdown(int cmd, int fcn)
intr_restore(iflag);
- if ((cmd != A_SHUTDOWN) || (fcn != AD_POWEROFF)) {
+ /* remainder of function is for shutdown cases only */
+ if (cmd != A_SHUTDOWN)
+ return;
+
+ /* switch system back into Legacy Mode if using ACPI */
+ if (apic_enable_acpi)
+ (void) AcpiDisable();
+
+ /* remainder of function is for shutdown+poweroff case only */
+ if (fcn != AD_POWEROFF)
return;
- }
switch (apic_poweroff_method) {
case APIC_POWEROFF_VIA_RTC:
diff --git a/usr/src/uts/i86pc/io/psm/psm_common.c b/usr/src/uts/i86pc/io/psm/psm_common.c
index 9336174295..1142f680d8 100644
--- a/usr/src/uts/i86pc/io/psm/psm_common.c
+++ b/usr/src/uts/i86pc/io/psm/psm_common.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -40,16 +40,6 @@
#include <sys/sunndi.h>
#include <sys/ksynch.h>
-/*
- * ACPI Poweroff patchable options in acpi_poweroff_opt for broken BIOS
- * workarounds.
- */
-#define ACPI_PO_CLRWAK 0x0001
-#define ACPI_PO_CLRALL 0x0002
-#define ACPI_PO_RSTGPE 0x0004
-#define ACPI_PO_DISARB 0x0008
-#define ACPI_PO_2NDTRY 0x0010
-
/* Global configurables */
char *psm_module_name; /* used to store name of psm module */
@@ -67,16 +57,6 @@ char *psm_module_name; /* used to store name of psm module */
*/
int acpi_irq_check_elcr = 0;
-/*
- * acpi_s5_slp_typ:
- * If >= 0 then override the \_S5 parameter return value. This is useful
- * for systems with broken \_S5 methods which return the wrong value for
- * the chipset in use.
- */
-int acpi_s5_slp_typ = -1;
-int acpi_s5_slp_typ2 = -1; /* second parameter (only patch if different) */
-int acpi_poweroff_opt = 0; /* patchable poweroff options */
-
int psm_verbose = 0;
#define PSM_VERBOSE_IRQ(fmt) \
diff --git a/usr/src/uts/i86pc/io/psm/uppc.c b/usr/src/uts/i86pc/io/psm/uppc.c
index ac7fb4f399..27cb6a6a22 100644
--- a/usr/src/uts/i86pc/io/psm/uppc.c
+++ b/usr/src/uts/i86pc/io/psm/uppc.c
@@ -459,15 +459,6 @@ uppc_preshutdown(int cmd, int fcn)
{
UPPC_VERBOSE_POWEROFF(("uppc_preshutdown(%d,%d);\n", cmd, fcn));
- if ((cmd != A_SHUTDOWN) || (fcn != AD_POWEROFF)) {
- return;
- }
-
- if (uppc_enable_acpi) {
- UPPC_VERBOSE_POWEROFF(("uppc_preshutdown: ACPI enabled\n"));
- } else {
- UPPC_VERBOSE_POWEROFF(("uppc_preshutdown: ACPI not enabled\n"));
- }
}
static void
@@ -475,11 +466,20 @@ uppc_shutdown(int cmd, int fcn)
{
UPPC_VERBOSE_POWEROFF(("uppc_shutdown(%d,%d);\n", cmd, fcn));
- if ((cmd != A_SHUTDOWN) || (fcn != AD_POWEROFF)) {
+ /*
+ * Return if passed a command other than A_SHUTDOWN or
+ * if we're not using ACPI.
+ */
+ if ((cmd != A_SHUTDOWN) || (!uppc_enable_acpi))
+ return;
+
+ /* switch system back into Legacy Mode */
+ (void) AcpiDisable();
+
+ if (fcn != AD_POWEROFF)
return;
- }
- if (uppc_enable_acpi)
- (void) acpi_poweroff();
+
+ (void) acpi_poweroff();
}
static int