Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/dev/pci/hdaudio Pull up following revision(s) (reques...
details: https://anonhg.NetBSD.org/src/rev/9072a4a66d44
branches: netbsd-7
changeset: 800200:9072a4a66d44
user: snj <snj%NetBSD.org@localhost>
date: Fri May 12 04:59:12 2017 +0000
description:
Pull up following revision(s) (requested by khorben in ticket #1369):
sys/dev/pci/hdaudio/hdaudio_pci.c: patch based on revision 1.6 of sys/dev/pci/hdaudio_pci.c
Always allow hdaudio(4) to suspend
Sometimes hdaudio(4) can fail to attach, but the device remains in the
tree. Even though the PMF registration is performed, it is explicitly
de-registered in the code path for errors - therefore preventing suspending
later. This patch makes sure PMF registration is performed accordingly upon
errors as well.
No objection on tech-kern@.
Tested on a Lenovo ThinkPad T440s (amd64).
diffstat:
sys/dev/pci/hdaudio/hdaudio_pci.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (41 lines):
diff -r 803e9c86332c -r 9072a4a66d44 sys/dev/pci/hdaudio/hdaudio_pci.c
--- a/sys/dev/pci/hdaudio/hdaudio_pci.c Wed Apr 26 14:55:52 2017 +0000
+++ b/sys/dev/pci/hdaudio/hdaudio_pci.c Fri May 12 04:59:12 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_pci.c,v 1.12.4.2 2015/07/17 04:44:41 snj Exp $ */
+/* $NetBSD: hdaudio_pci.c,v 1.12.4.3 2017/05/12 04:59:12 snj Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.12.4.2 2015/07/17 04:44:41 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.12.4.3 2017/05/12 04:59:12 snj Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -156,9 +156,6 @@
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
- if (!pmf_device_register(self, NULL, hdaudio_pci_resume))
- aprint_error_dev(self, "couldn't establish power handler\n");
-
hdaudio_pci_reinit(sc);
/* Attach bus-independent HD audio layer */
@@ -172,8 +169,11 @@
csr = pci_conf_read(sc->sc_pc, sc->sc_tag, PCI_COMMAND_STATUS_REG);
csr &= ~(PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_BACKTOBACK_ENABLE);
pci_conf_write(sc->sc_pc, sc->sc_tag, PCI_COMMAND_STATUS_REG, csr);
- pmf_device_deregister(self);
+ if (!pmf_device_register(self, NULL, NULL))
+ aprint_error_dev(self, "couldn't establish power handler\n");
}
+ else if (!pmf_device_register(self, NULL, hdaudio_pci_resume))
+ aprint_error_dev(self, "couldn't establish power handler\n");
}
static int
Home |
Main Index |
Thread Index |
Old Index