From: pirofti Date: Sat, 19 Jul 2014 18:01:23 +0000 (+0000) Subject: Bring back pci_dopm, but disable it before powerdown. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c16e7cd67527e91a2203104c6e45762b1ee5f197;p=openbsd Bring back pci_dopm, but disable it before powerdown. This fixes both the Lemote reboot issue and the USB issue on the Gdium's that miod@ spotted. Suggested by kettenis@, thanks! Okay miod@ --- diff --git a/sys/arch/loongson/dev/apm.c b/sys/arch/loongson/dev/apm.c index 4534e871215..4693d4cf18d 100644 --- a/sys/arch/loongson/dev/apm.c +++ b/sys/arch/loongson/dev/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.22 2014/07/19 12:54:09 pirofti Exp $ */ +/* $OpenBSD: apm.c,v 1.23 2014/07/19 18:01:23 pirofti Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -51,6 +51,8 @@ #include #include +#include /* pci_dopm */ + #include #include @@ -132,6 +134,9 @@ apmmatch(struct device *parent, void *match, void *aux) void apmattach(struct device *parent, struct device *self, void *aux) { + /* Enable PCI Power Management. */ + pci_dopm = 1; + printf("\n"); } diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c index 29c41a1b40d..60f2a66f214 100644 --- a/sys/arch/loongson/loongson/machdep.c +++ b/sys/arch/loongson/loongson/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.56 2014/07/13 22:53:39 uebayasi Exp $ */ +/* $OpenBSD: machdep.c,v 1.57 2014/07/19 18:01:23 pirofti Exp $ */ /* * Copyright (c) 2009, 2010, 2014 Miodrag Vallat. @@ -936,8 +936,10 @@ boot(int howto) haltsys: doshutdownhooks(); mainbus = device_mainbus(); - if (mainbus != NULL) + if (mainbus != NULL) { + pci_dopm = 0; config_suspend(mainbus, DVACT_POWERDOWN); + } if (howto & RB_HALT) { if (howto & RB_POWERDOWN) {