Re: IBM T42 freezes when going to sleep under X11
On Fri, Dec 02, 2005 at 12:52:58PM -0800, George Hartzell wrote: G I finally found the cause of my problems: there has been changes in G the em driver (Gb ethernet), such that the machine freezes when trying G to switch automatically from the X11 VT to the system console, before G going to sleep. The interaction is surprising, but clearly the problem G disappears when I remove device em from the kernel configuration, G and it reappears when I do kldload if_em. Since I'm using only ath G (wireless) anyway, this is fine with me... G G A previous partial solution suggested to me was to add G hw.syscons.sc_no_suspend_vtswitch=1 G to sysctl.conf, but this means the screen gets garbled and I have to G do the switch by hand anyway, which is a real pain. G Worse still: the machine would still freeze when going to sleep while G the disk is active. G G The last step is to track down the bug in em, as it still seems to G be there in yesterday's STABLE. G G I don't seem to have any problem with my T42p using a kernel compiled G on 11/29 11:21 G G My copy of if_em.c is: G G /*$FreeBSD: src/sys/dev/em/if_em.c,v 1.65.2.8 2005/11/25 14:11:59 glebius Exp $*/ George, Jacques, what em(4) cards exactly do you have? pciconf -lv | grep -A4 ^em Can you please try the attached patch? -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE Index: if_em.c === RCS file: /home/ncvs/src/sys/dev/em/if_em.c,v retrieving revision 1.85 diff -u -r1.85 if_em.c --- if_em.c 10 Nov 2005 11:44:37 - 1.85 +++ if_em.c 11 Nov 2005 12:13:48 - @@ -129,8 +129,11 @@ static int em_attach(device_t); static int em_detach(device_t); static int em_shutdown(device_t); +static int em_suspend(device_t); +static int em_resume(device_t); static void em_intr(void *); static void em_start(struct ifnet *); +static void em_start_locked(struct ifnet *ifp); static int em_ioctl(struct ifnet *, u_long, caddr_t); static void em_watchdog(struct ifnet *); static void em_init(void *); @@ -208,6 +211,8 @@ DEVMETHOD(device_attach, em_attach), DEVMETHOD(device_detach, em_detach), DEVMETHOD(device_shutdown, em_shutdown), + DEVMETHOD(device_suspend, em_suspend), + DEVMETHOD(device_resume, em_resume), {0, 0} }; @@ -580,6 +585,41 @@ return(0); } +/* + * Suspend/resume device methods. + */ +static int +em_suspend(device_t dev) +{ + struct adapter *adapter = device_get_softc(dev); + + EM_LOCK(adapter); + em_stop(adapter); + EM_UNLOCK(adapter); + + return bus_generic_suspend(dev); +} + +static int +em_resume(device_t dev) +{ + struct adapter *adapter = device_get_softc(dev); + struct ifnet *ifp; + + EM_LOCK(adapter); + ifp = adapter-ifp; + if (ifp-if_flags IFF_UP) { + em_init_locked(adapter); + if (ifp-if_drv_flags IFF_DRV_RUNNING) + em_start_locked(ifp); + } + + em_init_locked(adapter); + EM_UNLOCK(adapter); + + return bus_generic_resume(dev); +} + /* * Transmit entry point ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: IBM T42 freezes when going to sleep under X11
From: Gleb Smirnoff [EMAIL PROTECTED] George, Jacques, what em(4) cards exactly do you have? pciconf -lv | grep -A4 ^em Dear Gleb, Here is the info: [EMAIL PROTECTED]:1:0: class=0x02 card=0x05491014 chip=0x101e8086 rev=0x03 hdr=0x00 vendor = 'Intel Corporation' device = '82540EP Gigabit Ethernet Controller (Mobile)' class= network subclass = ethernet Can you please try the attached patch? I tried it, but the behaviour didn't change: immediate hang when trying to suspend (the screen does not even switch to ttyv0.) --- Jacques Garrigue Nagoya University garrigue at math.nagoya-u.ac.jp ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: IBM T42 freezes when going to sleep under X11
Gleb Smirnoff writes: On Fri, Dec 02, 2005 at 12:52:58PM -0800, George Hartzell wrote: G I finally found the cause of my problems: there has been changes in G the em driver (Gb ethernet), such that the machine freezes when trying G to switch automatically from the X11 VT to the system console, before G going to sleep. The interaction is surprising, but clearly the problem G disappears when I remove device em from the kernel configuration, G and it reappears when I do kldload if_em. Since I'm using only ath G (wireless) anyway, this is fine with me... G G A previous partial solution suggested to me was to add G hw.syscons.sc_no_suspend_vtswitch=1 G to sysctl.conf, but this means the screen gets garbled and I have to G do the switch by hand anyway, which is a real pain. G Worse still: the machine would still freeze when going to sleep while G the disk is active. G G The last step is to track down the bug in em, as it still seems to G be there in yesterday's STABLE. G G I don't seem to have any problem with my T42p using a kernel compiled G on 11/29 11:21 G G My copy of if_em.c is: G G /*$FreeBSD: src/sys/dev/em/if_em.c,v 1.65.2.8 2005/11/25 14:11:59 glebius Exp $*/ George, Jacques, what em(4) cards exactly do you have? pciconf -lv | grep -A4 ^em (satchel)[10:35am]~pciconf -lv | grep -A4 ^em [EMAIL PROTECTED]:1:0: class=0x02 card=0x05491014 chip=0x101e8086 rev=0x03 hdr=0x00 vendor = 'Intel Corporation' device = '82540EP Gigabit Ethernet Controller (Mobile)' class= network subclass = ethernet (satchel)[10:36am]~ Can you please try the attached patch? I'll give it a try this weekend. g. ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: IBM T42 freezes when going to sleep under X11
Gleb Smirnoff writes: On Fri, Dec 02, 2005 at 12:52:58PM -0800, George Hartzell wrote: G I finally found the cause of my problems: there has been changes in G the em driver (Gb ethernet), such that the machine freezes when trying G to switch automatically from the X11 VT to the system console, before G going to sleep. The interaction is surprising, but clearly the problem G disappears when I remove device em from the kernel configuration, G and it reappears when I do kldload if_em. Since I'm using only ath G (wireless) anyway, this is fine with me... G G A previous partial solution suggested to me was to add G hw.syscons.sc_no_suspend_vtswitch=1 G to sysctl.conf, but this means the screen gets garbled and I have to G do the switch by hand anyway, which is a real pain. G Worse still: the machine would still freeze when going to sleep while G the disk is active. G G The last step is to track down the bug in em, as it still seems to G be there in yesterday's STABLE. G G I don't seem to have any problem with my T42p using a kernel compiled G on 11/29 11:21 G G My copy of if_em.c is: G G /*$FreeBSD: src/sys/dev/em/if_em.c,v 1.65.2.8 2005/11/25 14:11:59 glebius Exp $*/ George, Jacques, what em(4) cards exactly do you have? pciconf -lv | grep -A4 ^em Can you please try the attached patch? -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE Index: if_em.c === RCS file: /home/ncvs/src/sys/dev/em/if_em.c,v retrieving revision 1.85 diff -u -r1.85 if_em.c --- if_em.c 10 Nov 2005 11:44:37 - 1.85 +++ if_em.c 11 Nov 2005 12:13:48 - @@ -129,8 +129,11 @@ static int em_attach(device_t); static int em_detach(device_t); static int em_shutdown(device_t); +static int em_suspend(device_t); +static int em_resume(device_t); static void em_intr(void *); static void em_start(struct ifnet *); +static void em_start_locked(struct ifnet *ifp); static int em_ioctl(struct ifnet *, u_long, caddr_t); static void em_watchdog(struct ifnet *); static void em_init(void *); @@ -208,6 +211,8 @@ DEVMETHOD(device_attach, em_attach), DEVMETHOD(device_detach, em_detach), DEVMETHOD(device_shutdown, em_shutdown), +DEVMETHOD(device_suspend, em_suspend), +DEVMETHOD(device_resume, em_resume), {0, 0} }; @@ -580,6 +585,41 @@ return(0); } +/* + * Suspend/resume device methods. + */ +static int +em_suspend(device_t dev) +{ +struct adapter *adapter = device_get_softc(dev); + +EM_LOCK(adapter); +em_stop(adapter); +EM_UNLOCK(adapter); + +return bus_generic_suspend(dev); +} + +static int +em_resume(device_t dev) +{ +struct adapter *adapter = device_get_softc(dev); +struct ifnet *ifp; + +EM_LOCK(adapter); +ifp = adapter-ifp; +if (ifp-if_flags IFF_UP) { +em_init_locked(adapter); +if (ifp-if_drv_flags IFF_DRV_RUNNING) +em_start_locked(ifp); +} + +em_init_locked(adapter); +EM_UNLOCK(adapter); + +return bus_generic_resume(dev); +} + /* * Transmit entry point I'll post details as a reply to earlier in the thread, but I have started seeing crashes. I don't suspect the em driver, I *do* suspect synaptics support. But I have more digging to do With respect to this patch, it causes me a problem. I have ifconfig_em0=DHCP NOAUTO in my /etc/rc.conf, so that the interface doesn't come up unless I ask it too (usually via /etc/rc.d/netif start em0) With this patch applied, even if I've never started it, the interface gets started. If I have a cable plugged in, it grabs a dhcp address and takes off. My devd.conf is stock. g. ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: IBM T42 freezes when going to sleep under X11
Jacques Garrigue writes: From: George Hartzell [EMAIL PROTECTED] Jacques Garrigue writes: From: Jacques Garrigue [EMAIL PROTECTED] I've got a strange problem with my IBM T42 / Radeon M10 setup. When using the 6.0-RELEASE kernel (including GENERIC), I cannot go to sleep when X11 is running: the machine freezes, display still on. I tried disabling DRI, but this does not seem to be the problem: I have no DRM anyway. On the other hand, everything works fines with a 6.0-RC1 kernel. Was there a big change in between, such that I need to change my configuration? I finally found the cause of my problems: there has been changes in the em driver (Gb ethernet), such that the machine freezes when trying to switch automatically from the X11 VT to the system console, before going to sleep. The interaction is surprising, but clearly the problem disappears when I remove device em from the kernel configuration, and it reappears when I do kldload if_em. Since I'm using only ath (wireless) anyway, this is fine with me... I don't seem to have any problem with my T42p using a kernel compiled on 11/29 11:21 My copy of if_em.c is: /*$FreeBSD: src/sys/dev/em/if_em.c,v 1.65.2.8 2005/11/25 14:11:59 glebius Exp $*/ The very same version I could reproduce the bug with... I suppose the cause is a complex interaction. For instance it only appears under X11. So part of the reason might be the difference between the radeon M10 and the FIRE GL T2. Or the fact I'm simultaneously using ath. Or anything else... My point was just that the direct trigger was a change in em between 6.0-RC1 and 6.0-RELEASE. But if it cannot be reproduced on any other machine, this is going to be difficult to track down. [...] I've been enabling more of the laptop-y features as I polish off my upgrade (I'm going from 5.4BETAsomething to 6.0-STABLE, encouraged by losing my hard drive and being handed the clean slate). I *have* started getting occasional hangs after a suspend/resume cycle. It seems to be related to the mouse. I get it with both X and on the console. I've disabled the psm flag that mega-kicks the device (0x30?) and end up with a dead mouse. Restarting the moused via /etc/rc.d/moused gets my mouse back, but I'll frequently hand immediately afterwards. I've disabled synaptics support and am waiting to see if that makes a difference, other than disabling my middle mouse button g. ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: IBM T42 freezes when going to sleep under X11
Jacques Garrigue writes: From: Jacques Garrigue [EMAIL PROTECTED] I've got a strange problem with my IBM T42 / Radeon M10 setup. When using the 6.0-RELEASE kernel (including GENERIC), I cannot go to sleep when X11 is running: the machine freezes, display still on. I tried disabling DRI, but this does not seem to be the problem: I have no DRM anyway. On the other hand, everything works fines with a 6.0-RC1 kernel. Was there a big change in between, such that I need to change my configuration? I finally found the cause of my problems: there has been changes in the em driver (Gb ethernet), such that the machine freezes when trying to switch automatically from the X11 VT to the system console, before going to sleep. The interaction is surprising, but clearly the problem disappears when I remove device em from the kernel configuration, and it reappears when I do kldload if_em. Since I'm using only ath (wireless) anyway, this is fine with me... A previous partial solution suggested to me was to add hw.syscons.sc_no_suspend_vtswitch=1 to sysctl.conf, but this means the screen gets garbled and I have to do the switch by hand anyway, which is a real pain. Worse still: the machine would still freeze when going to sleep while the disk is active. The last step is to track down the bug in em, as it still seems to be there in yesterday's STABLE. I don't seem to have any problem with my T42p using a kernel compiled on 11/29 11:21 My copy of if_em.c is: /*$FreeBSD: src/sys/dev/em/if_em.c,v 1.65.2.8 2005/11/25 14:11:59 glebius Exp $*/ g. ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: IBM T42 freezes when going to sleep under X11
From: George Hartzell [EMAIL PROTECTED] Jacques Garrigue writes: From: Jacques Garrigue [EMAIL PROTECTED] I've got a strange problem with my IBM T42 / Radeon M10 setup. When using the 6.0-RELEASE kernel (including GENERIC), I cannot go to sleep when X11 is running: the machine freezes, display still on. I tried disabling DRI, but this does not seem to be the problem: I have no DRM anyway. On the other hand, everything works fines with a 6.0-RC1 kernel. Was there a big change in between, such that I need to change my configuration? I finally found the cause of my problems: there has been changes in the em driver (Gb ethernet), such that the machine freezes when trying to switch automatically from the X11 VT to the system console, before going to sleep. The interaction is surprising, but clearly the problem disappears when I remove device em from the kernel configuration, and it reappears when I do kldload if_em. Since I'm using only ath (wireless) anyway, this is fine with me... I don't seem to have any problem with my T42p using a kernel compiled on 11/29 11:21 My copy of if_em.c is: /*$FreeBSD: src/sys/dev/em/if_em.c,v 1.65.2.8 2005/11/25 14:11:59 glebius Exp $*/ The very same version I could reproduce the bug with... I suppose the cause is a complex interaction. For instance it only appears under X11. So part of the reason might be the difference between the radeon M10 and the FIRE GL T2. Or the fact I'm simultaneously using ath. Or anything else... My point was just that the direct trigger was a change in em between 6.0-RC1 and 6.0-RELEASE. But if it cannot be reproduced on any other machine, this is going to be difficult to track down. By the way, I have another problem: if I set my display background to an image (under KDE or xfce4), then the bottom half of the image gets garbled after resume. Do you observer anything like that? Might this be a sign of something wrong in the X11 driver? (I just use the default Xorg) Jacques Garrigue ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: IBM T42 freezes when going to sleep under X11
From: Jacques Garrigue [EMAIL PROTECTED] I've got a strange problem with my IBM T42 / Radeon M10 setup. When using the 6.0-RELEASE kernel (including GENERIC), I cannot go to sleep when X11 is running: the machine freezes, display still on. I tried disabling DRI, but this does not seem to be the problem: I have no DRM anyway. On the other hand, everything works fines with a 6.0-RC1 kernel. Was there a big change in between, such that I need to change my configuration? I finally found the cause of my problems: there has been changes in the em driver (Gb ethernet), such that the machine freezes when trying to switch automatically from the X11 VT to the system console, before going to sleep. The interaction is surprising, but clearly the problem disappears when I remove device em from the kernel configuration, and it reappears when I do kldload if_em. Since I'm using only ath (wireless) anyway, this is fine with me... A previous partial solution suggested to me was to add hw.syscons.sc_no_suspend_vtswitch=1 to sysctl.conf, but this means the screen gets garbled and I have to do the switch by hand anyway, which is a real pain. Worse still: the machine would still freeze when going to sleep while the disk is active. The last step is to track down the bug in em, as it still seems to be there in yesterday's STABLE. Jacques Garrigue ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
IBM T42 freezes when going to sleep under X11
I've got a strange problem with my IBM T42 / Radeon M10 setup. When using the 6.0-RELEASE kernel (including GENERIC), I cannot go to sleep when X11 is running: the machine freezes, display still on. I tried disabling DRI, but this does not seem to be the problem: I have no DRM anyway. On the other hand, everything works fines with a 6.0-RC1 kernel. Was there a big change in between, such that I need to change my configuration? I can give more information if it helps. --- Jacques Garrigue Nagoya University garrigue at math.nagoya-u.ac.jp A HREF=http://www.math.nagoya-u.ac.jp/~garrigue/JG/A ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: IBM T42 freezes when going to sleep under X11
When using the 6.0-RELEASE kernel (including GENERIC), I cannot go to sleep when X11 is running: the machine freezes, display still on. I tried disabling DRI, but this does not seem to be the problem: I have no DRM anyway. I upgraded my T42 to -current from the 6.0 release kernel but from what I remember it worked fine with suspend/resume if acpi_video.ko was loaded at boot time. My T42 has Radeon M7 -- not sure if that makes a difference. If I want DRM (for openGL) the T42 has to be booted without acpi_video.ko. And then I usually forget and put the laptop to sleep = instant reboot on wakeup! When I upgraded to -current I did not make any changes with X11. For what it is worth, this is my /boot/loader.conf if_em_load=YES if_ath_load=YES if_iwi_load=YES wlan_tkip_load=YES wlan_wep_load=YES snd_ich_load=YES cpufreq_load=YES acpi_ibm_load=YES acpi_video_load=YES hw.psm.synaptics_support=1 ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: IBM T42 freezes when going to sleep under X11
Date: Mon, 14 Nov 2005 17:50:31 +0900 (JST) From: Jacques Garrigue [EMAIL PROTECTED] Sender: [EMAIL PROTECTED] I've got a strange problem with my IBM T42 / Radeon M10 setup. When using the 6.0-RELEASE kernel (including GENERIC), I cannot go to sleep when X11 is running: the machine freezes, display still on. I tried disabling DRI, but this does not seem to be the problem: I have no DRM anyway. On the other hand, everything works fines with a 6.0-RC1 kernel. Was there a big change in between, such that I need to change my configuration? I can give more information if it helps. First, you really want to install and use radeontool. It can properly turn off the Radeon display, backlight, and DAC which (as far as i know) xorg does not. It also does better than jhb's patch to acpi_video. (I suspect that the patch does not turn off the DAC.) You need to add acpi_video_load=YES and probably want to add vesa_load=YES and acpi_ibm_load=YES, although those are probably not related to your current problem. You may also need to add hw.acpi.reset_video=0 and hw.syscons.sc_no_suspend_vtswitch=1 to /etc/sysctl.conf. -- R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: [EMAIL PROTECTED] Phone: +1 510 486-8634 ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: IBM T42 freezes when going to sleep under X11
Thanks for answerring. (And thanks to Bakul too) From: Kevin Oberman [EMAIL PROTECTED] From: Jacques Garrigue [EMAIL PROTECTED] I've got a strange problem with my IBM T42 / Radeon M10 setup. When using the 6.0-RELEASE kernel (including GENERIC), I cannot go to sleep when X11 is running: the machine freezes, display still on. First, you really want to install and use radeontool. It can properly turn off the Radeon display, backlight, and DAC which (as far as i know) xorg does not. It also does better than jhb's patch to acpi_video. (I suspect that the patch does not turn off the DAC.) Is this connected with this supspend/resume problem? I have not installed it yet. You need to add acpi_video_load=YES and probably want to add vesa_load=YES and acpi_ibm_load=YES, although those are probably not related to your current problem. You may also need to add hw.acpi.reset_video=0 and hw.syscons.sc_no_suspend_vtswitch=1 to /etc/sysctl.conf. I had already acpi_ibm. I added acpi_video and acpi_vesa, with no visible improvement. But hw.syscons.sc_no_suspend_vtswitch=1 made the trick. At least it can now suspend... in most cases. It still fails to do so in random cases, mostly when there is disk activity. And even if it suspends correctly, I must still switch to the console and back by hand. As I wrote in my first mail, what is really strange is that everything works fine with a 6.0-RC1 kernel (without any special tuning!), whereas the changes are supposed to be very limited. So there should be a way to track down the problem... In particular, I didn't need acpi_video at all. My current solution is to keep an RC1 kernel, as there are no incompatibilities for the time being. Just in case, here are my loader.conf and sysctl.conf (working with RC1) /boot/loader.conf: acpi_ibm_load=YES if_ath_load=YES snd_ich_load=YES umodem_load=YES cpufreq_load=YES hw.ata.atapi_dma=1 hw.cbb.start_memory=0xc021 hint.sio.0.disabled=1 hint.sio.1.disabled=1 /etc/sysctl.conf: hw.acpi.sleep_button_state=S3 hw.acpi.lid_switch_state=S3 Jacques --- Jacques Garrigue Nagoya University garrigue at math.nagoya-u.ac.jp A HREF=http://www.math.nagoya-u.ac.jp/~garrigue/JG/A ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]