NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Can I use NetBSD as a desktop system?



This diff makes uaudio claim to support suspend, does it work if you
don't drvctl -d uaudio0 with this change?

Index: uaudio.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uaudio.c,v
retrieving revision 1.154
diff -u -r1.154 uaudio.c
--- uaudio.c	9 Jun 2017 10:11:20 -0000	1.154
+++ uaudio.c	20 Jul 2017 18:50:05 -0000
@@ -504,6 +504,9 @@
 	DPRINTF("%s", "doing audio_attach_mi\n");
 	sc->sc_audiodev = audio_attach_mi(&uaudio_hw_if, sc, sc->sc_dev);
 
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "couldn't establish power handler\n");
+
 	return;
 }
 
@@ -537,6 +540,8 @@
 	int rv;
 
 	rv = 0;
+
+	pmf_device_deregister(self);
 	/* Wait for outstanding requests to complete. */
 	usbd_delay_ms(sc->sc_udev, UAUDIO_NCHANBUFS * UAUDIO_NFRAMES);
 







I also wonder where ral(4) suspend code fails, if at all.
What happens if you turn it on, and enabling debug to get as much
information as possible in case it fails?

Index: rt2860.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/rt2860.c,v
retrieving revision 1.27
diff -u -r1.27 rt2860.c
--- rt2860.c	20 Jul 2017 18:17:25 -0000	1.27
+++ rt2860.c	20 Jul 2017 18:55:22 -0000
@@ -63,10 +63,11 @@
 
 #include <dev/pci/pcidevs.h>
 
+#define RAL_DEBUG 1
 #ifdef RAL_DEBUG
 #define DPRINTF(x)	do { if (rt2860_debug > 0) printf x; } while (0)
 #define DPRINTFN(n, x)	do { if (rt2860_debug >= (n)) printf x; } while (0)
-int rt2860_debug = 0;
+int rt2860_debug = 999;
 #else
 #define DPRINTF(x)
 #define DPRINTFN(n, x)

Index: if_ral_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ral_pci.c,v
retrieving revision 1.23
diff -u -r1.23 if_ral_pci.c
--- if_ral_pci.c	6 Jul 2016 14:28:51 -0000	1.23
+++ if_ral_pci.c	20 Jul 2017 18:56:18 -0000
@@ -56,7 +56,7 @@
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pcidevs.h>
 
-#define RAL_POWER_MANAGEMENT 0	/* Disabled for now */
+#define RAL_POWER_MANAGEMENT 1
 
 static struct ral_opns {
 	int	(*attach)(void *, int);




Summary:
1. Build a kernel with all these changes
2. Try if `drvctl -d ral0` and then suspend works (uaudio isn't causing problems)
3. Try without any drvctl -d

If you want to see it succeed  to resume you can apply the first or last diff in:
http://gnats.netbsd.org/52409


Home | Main Index | Thread Index | Old Index