svn commit: r215100 - head/sys/powerpc/powermac
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Wed Nov 10 20:09:06 UTC 2010
Author: nwhitehorn
Date: Wed Nov 10 20:09:05 2010
New Revision: 215100
URL: http://svn.freebsd.org/changeset/base/215100
Log:
Disabling CPU NAP modes during SMU commands is a hack needed only on U3
systems. Don't use it on non-U3 systems to allow cpu_idle() to work
correctly.
Modified:
head/sys/powerpc/powermac/smu.c
Modified: head/sys/powerpc/powermac/smu.c
==============================================================================
--- head/sys/powerpc/powermac/smu.c Wed Nov 10 19:33:13 2010 (r215099)
+++ head/sys/powerpc/powermac/smu.c Wed Nov 10 20:09:05 2010 (r215100)
@@ -96,6 +96,7 @@ struct smu_softc {
struct resource *sc_memr;
int sc_memrid;
+ int sc_u3;
bus_dma_tag_t sc_dmatag;
bus_space_tag_t sc_bt;
@@ -275,6 +276,10 @@ smu_attach(device_t dev)
sc->sc_cur_cmd = NULL;
sc->sc_doorbellirqid = -1;
+ sc->sc_u3 = 0;
+ if (OF_finddevice("/u3") != -1)
+ sc->sc_u3 = 1;
+
/*
* Map the mailbox area. This should be determined from firmware,
* but I have not found a simple way to do that.
@@ -417,7 +422,9 @@ smu_send_cmd(device_t dev, struct smu_cm
mtx_assert(&sc->sc_mtx, MA_OWNED);
- powerpc_pow_enabled = 0; /* SMU cannot work if we go to NAP */
+ if (sc->sc_u3)
+ powerpc_pow_enabled = 0; /* SMU cannot work if we go to NAP */
+
sc->sc_cur_cmd = cmd;
/* Copy the command to the mailbox */
@@ -464,7 +471,8 @@ smu_doorbell_intr(void *xdev)
sizeof(sc->sc_cmd->data));
wakeup(sc->sc_cur_cmd);
sc->sc_cur_cmd = NULL;
- powerpc_pow_enabled = 1;
+ if (sc->sc_u3)
+ powerpc_pow_enabled = 1;
done:
/* Queue next command if one is pending */
More information about the svn-src-head
mailing list