This set of 3 patches makes it a little more likely we'll get panic output onto the screen even when X is running, assuming a KMS enabled stack anyway.
It gets me from a blank or very sparsely populated black screen at panic time, to one including the full backtrace and panic output at panic time (tested with "echo c > /proc/sysrq-trigger" from an X session).
It doesn't cover every case; for instance I think it'll fail when X has disabled the display, but those cases need to be handled with separate patches anyway (need to add atomic DPMS paths for instance).
Anyway, please test these out and let me know if they work for you.
Needed for panic and kdb, since we need to avoid taking the mode_config mutex.
Signed-off-by: Jesse Barnes jbarnes@virtuousgeek.org --- drivers/gpu/drm/drm_fb_helper.c | 42 +++++++++++++++++++++++++++++++++----- 1 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 6929f5b..962eadb 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -242,18 +242,22 @@ static int drm_fb_helper_parse_command_line(struct drm_fb_helper *fb_helper) return 0; }
-bool drm_fb_helper_force_kernel_mode(void) +bool drm_fb_helper_force_kernel_mode_locked(void) { int i = 0; bool ret, error = false; struct drm_fb_helper *helper; - - if (list_empty(&kernel_fb_helper_list)) - return false; + struct drm_mode_set *mode_set; + struct drm_crtc *crtc;
list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) { for (i = 0; i < helper->crtc_count; i++) { - struct drm_mode_set *mode_set = &helper->crtc_info[i].mode_set; + mode_set = &helper->crtc_info[i].mode_set; + crtc = helper->crtc_info[i].mode_set.crtc; + + if (!crtc->enabled) + continue; + ret = drm_crtc_helper_set_config(mode_set); if (ret) error = true; @@ -262,11 +266,37 @@ bool drm_fb_helper_force_kernel_mode(void) return error; }
+bool drm_fb_helper_force_kernel_mode(void) +{ + bool ret; + struct drm_device *dev; + struct drm_fb_helper *helper; + struct drm_mode_set *mode_set; + + if (list_empty(&kernel_fb_helper_list)) { + DRM_DEBUG_KMS("no fb helper list??\n"); + return false; + } + + /* Get the DRM device */ + helper = list_first_entry(&kernel_fb_helper_list, + struct drm_fb_helper, + kernel_fb_list); + mode_set = &helper->crtc_info[0].mode_set; + dev = mode_set->crtc->dev; + + mutex_lock(&dev->mode_config.mutex); + ret = drm_fb_helper_force_kernel_mode_locked(); + mutex_unlock(&dev->mode_config.mutex); + + return ret; +} + int drm_fb_helper_panic(struct notifier_block *n, unsigned long ununsed, void *panic_str) { DRM_ERROR("panic occurred, switching back to text console\n"); - return drm_fb_helper_force_kernel_mode(); + drm_fb_helper_force_kernel_mode_locked(); return 0; } EXPORT_SYMBOL(drm_fb_helper_panic);
On Sat, Apr 10, 2010 at 8:11 AM, Jesse Barnes jbarnes@virtuousgeek.org wrote:
Needed for panic and kdb, since we need to avoid taking the mode_config mutex.
One comment below.
Signed-off-by: Jesse Barnes jbarnes@virtuousgeek.org
drivers/gpu/drm/drm_fb_helper.c | 42 +++++++++++++++++++++++++++++++++----- 1 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 6929f5b..962eadb 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -242,18 +242,22 @@ static int drm_fb_helper_parse_command_line(struct drm_fb_helper *fb_helper) return 0; }
-bool drm_fb_helper_force_kernel_mode(void) +bool drm_fb_helper_force_kernel_mode_locked(void) { int i = 0; bool ret, error = false; struct drm_fb_helper *helper;
- if (list_empty(&kernel_fb_helper_list))
- return false;
- struct drm_mode_set *mode_set;
- struct drm_crtc *crtc;
list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) { for (i = 0; i < helper->crtc_count; i++) {
- struct drm_mode_set *mode_set = &helper->crtc_info[i].mode_set;
- mode_set = &helper->crtc_info[i].mode_set;
- crtc = helper->crtc_info[i].mode_set.crtc;
- if (!crtc->enabled)
- continue;
ret = drm_crtc_helper_set_config(mode_set); if (ret) error = true; @@ -262,11 +266,37 @@ bool drm_fb_helper_force_kernel_mode(void) return error; }
+bool drm_fb_helper_force_kernel_mode(void) +{
- bool ret;
- struct drm_device *dev;
- struct drm_fb_helper *helper;
- struct drm_mode_set *mode_set;
- if (list_empty(&kernel_fb_helper_list)) {
- DRM_DEBUG_KMS("no fb helper list??\n");
- return false;
- }
- /* Get the DRM device */
- helper = list_first_entry(&kernel_fb_helper_list,
- struct drm_fb_helper,
- kernel_fb_list);
- mode_set = &helper->crtc_info[0].mode_set;
- dev = mode_set->crtc->dev;
- mutex_lock(&dev->mode_config.mutex);
- ret = drm_fb_helper_force_kernel_mode_locked();
- mutex_unlock(&dev->mode_config.mutex);
- return ret;
+}
int drm_fb_helper_panic(struct notifier_block *n, unsigned long ununsed, void *panic_str) { DRM_ERROR("panic occurred, switching back to text console\n");
- return drm_fb_helper_force_kernel_mode();
- drm_fb_helper_force_kernel_mode_locked();
Any reason to drop the return here?
not just remove the return 0?
Dave.
return 0; } EXPORT_SYMBOL(drm_fb_helper_panic); -- 1.6.6.1
On Mon, 12 Apr 2010 10:05:00 +1000 Dave Airlie airlied@gmail.com wrote:
On Sat, Apr 10, 2010 at 8:11 AM, Jesse Barnes jbarnes@virtuousgeek.org wrote:
Needed for panic and kdb, since we need to avoid taking the mode_config mutex.
One comment below.
Signed-off-by: Jesse Barnes jbarnes@virtuousgeek.org
drivers/gpu/drm/drm_fb_helper.c | 42 +++++++++++++++++++++++++++++++++----- 1 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 6929f5b..962eadb 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -242,18 +242,22 @@ static int drm_fb_helper_parse_command_line(struct drm_fb_helper *fb_helper) return 0; }
-bool drm_fb_helper_force_kernel_mode(void) +bool drm_fb_helper_force_kernel_mode_locked(void) { int i = 0; bool ret, error = false; struct drm_fb_helper *helper;
- if (list_empty(&kernel_fb_helper_list))
- return false;
- struct drm_mode_set *mode_set;
- struct drm_crtc *crtc;
list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) { for (i = 0; i < helper->crtc_count; i++) {
- struct drm_mode_set *mode_set = &helper->crtc_info[i].mode_set;
- mode_set = &helper->crtc_info[i].mode_set;
- crtc = helper->crtc_info[i].mode_set.crtc;
- if (!crtc->enabled)
- continue;
ret = drm_crtc_helper_set_config(mode_set); if (ret) error = true; @@ -262,11 +266,37 @@ bool drm_fb_helper_force_kernel_mode(void) return error; }
+bool drm_fb_helper_force_kernel_mode(void) +{
- bool ret;
- struct drm_device *dev;
- struct drm_fb_helper *helper;
- struct drm_mode_set *mode_set;
- if (list_empty(&kernel_fb_helper_list)) {
- DRM_DEBUG_KMS("no fb helper list??\n");
- return false;
- }
- /* Get the DRM device */
- helper = list_first_entry(&kernel_fb_helper_list,
- struct drm_fb_helper,
- kernel_fb_list);
- mode_set = &helper->crtc_info[0].mode_set;
- dev = mode_set->crtc->dev;
- mutex_lock(&dev->mode_config.mutex);
- ret = drm_fb_helper_force_kernel_mode_locked();
- mutex_unlock(&dev->mode_config.mutex);
- return ret;
+}
int drm_fb_helper_panic(struct notifier_block *n, unsigned long ununsed, void *panic_str) { DRM_ERROR("panic occurred, switching back to text console\n");
- return drm_fb_helper_force_kernel_mode();
- drm_fb_helper_force_kernel_mode_locked();
Any reason to drop the return here?
not just remove the return 0?
Oh no; I don't think the return value is checked anywhere but we may as well return it anyway.
On Mon, 12 Apr 2010 10:05:00 +1000 Dave Airlie airlied@gmail.com wrote:
On Sat, Apr 10, 2010 at 8:11 AM, Jesse Barnes jbarnes@virtuousgeek.org wrote:
Needed for panic and kdb, since we need to avoid taking the mode_config mutex.
One comment below.
Updated patch below.
At panic time (i.e. when oops_in_progress is set) we should try a bit harder to update the screen and make sure output gets to the VT, since some drivers are capable of flipping back to it.
So make sure we try to unblank and update the display if called from a panic context.
Signed-off-by: Jesse Barnes jbarnes@virtuousgeek.org --- drivers/char/vt.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index bd1d116..29ec1c9 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -698,7 +698,10 @@ void redraw_screen(struct vc_data *vc, int is_switch) update_attr(vc); clear_buffer_attributes(vc); } - if (update && vc->vc_mode != KD_GRAPHICS) + + /* Forcibly update if we're panicing */ + if ((update && vc->vc_mode != KD_GRAPHICS) || + oops_in_progress) do_update_region(vc, vc->vc_origin, vc->vc_screenbuf_size / 2); } set_cursor(vc); @@ -2498,7 +2501,7 @@ static void vt_console_print(struct console *co, const char *b, unsigned count) goto quit; }
- if (vc->vc_mode != KD_TEXT) + if (vc->vc_mode != KD_TEXT && !oops_in_progress) goto quit;
/* undraw cursor first */ @@ -3703,7 +3706,8 @@ void do_unblank_screen(int leaving_gfx) return; } vc = vc_cons[fg_console].d; - if (vc->vc_mode != KD_TEXT) + /* Try to unblank in oops case too */ + if (vc->vc_mode != KD_TEXT && !oops_in_progress) return; /* but leave console_blanked != 0 */
if (blankinterval) { @@ -3712,7 +3716,7 @@ void do_unblank_screen(int leaving_gfx) }
console_blanked = 0; - if (vc->vc_sw->con_blank(vc, 0, leaving_gfx)) + if (vc->vc_sw->con_blank(vc, 0, leaving_gfx) || oops_in_progress) /* Low-level driver cannot restore -> do it ourselves */ update_screen(vc); if (console_blank_hook)
This allows us to draw to the fbcon buffer in a panic situation, in case the low level driver can flip to it at panic time.
Signed-off-by: Jesse Barnes jbarnes@virtuousgeek.org --- drivers/video/console/fbcon.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index b0a3fa0..6ca1051 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -283,7 +283,7 @@ static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info) struct fbcon_ops *ops = info->fbcon_par;
return (info->state != FBINFO_STATE_RUNNING || - vc->vc_mode != KD_TEXT || ops->graphics); + vc->vc_mode != KD_TEXT || ops->graphics) && !oops_in_progress; }
static inline int get_color(struct vc_data *vc, struct fb_info *info,
On Fri, 9 Apr 2010 15:10:50 -0700 Jesse Barnes jbarnes@virtuousgeek.org wrote:
This set of 3 patches makes it a little more likely we'll get panic output onto the screen even when X is running, assuming a KMS enabled stack anyway.
It gets me from a blank or very sparsely populated black screen at panic time, to one including the full backtrace and panic output at panic time (tested with "echo c > /proc/sysrq-trigger" from an X session).
It doesn't cover every case; for instance I think it'll fail when X has disabled the display, but those cases need to be handled with separate patches anyway (need to add atomic DPMS paths for instance).
Anyway, please test these out and let me know if they work for you.
Linus, did you get a chance to try these at all? They're small, and if they work for you I thought maybe they had a chance to get into 2.6.34.
Thanks,
On Fri, 9 Apr 2010 15:10:50 -0700 Jesse Barnes jbarnes@virtuousgeek.org wrote:
This set of 3 patches makes it a little more likely we'll get panic output onto the screen even when X is running, assuming a KMS enabled stack anyway.
It gets me from a blank or very sparsely populated black screen at panic time, to one including the full backtrace and panic output at panic time (tested with "echo c > /proc/sysrq-trigger" from an X session).
It doesn't cover every case; for instance I think it'll fail when X has disabled the display, but those cases need to be handled with separate patches anyway (need to add atomic DPMS paths for instance).
Anyway, please test these out and let me know if they work for you.
Ping Linus & Dave again. Have you guys tried these? Really, it's cool.
On Wed, 2010-05-19 at 17:34 -0700, Jesse Barnes wrote:
On Fri, 9 Apr 2010 15:10:50 -0700 Jesse Barnes jbarnes@virtuousgeek.org wrote:
This set of 3 patches makes it a little more likely we'll get panic output onto the screen even when X is running, assuming a KMS enabled stack anyway.
It gets me from a blank or very sparsely populated black screen at panic time, to one including the full backtrace and panic output at panic time (tested with "echo c > /proc/sysrq-trigger" from an X session).
It doesn't cover every case; for instance I think it'll fail when X has disabled the display, but those cases need to be handled with separate patches anyway (need to add atomic DPMS paths for instance).
Anyway, please test these out and let me know if they work for you.
Ping Linus & Dave again. Have you guys tried these? Really, it's cool.
Second that, just tested these patches, and these work perfectly. One more reason for me to dump nvidia driver for nouveau.
Best regards, Maxim Levitsky
On Thu, 2010-05-20 at 04:13 +0300, Maxim Levitsky wrote:
On Wed, 2010-05-19 at 17:34 -0700, Jesse Barnes wrote:
On Fri, 9 Apr 2010 15:10:50 -0700 Jesse Barnes jbarnes@virtuousgeek.org wrote:
This set of 3 patches makes it a little more likely we'll get panic output onto the screen even when X is running, assuming a KMS enabled stack anyway.
It gets me from a blank or very sparsely populated black screen at panic time, to one including the full backtrace and panic output at panic time (tested with "echo c > /proc/sysrq-trigger" from an X session).
It doesn't cover every case; for instance I think it'll fail when X has disabled the display, but those cases need to be handled with separate patches anyway (need to add atomic DPMS paths for instance).
Anyway, please test these out and let me know if they work for you.
Ping Linus & Dave again. Have you guys tried these? Really, it's cool.
Second that, just tested these patches, and these work perfectly. One more reason for me to dump nvidia driver for nouveau.
Unfortunately I spoke too soon.
After suspend to ram, system doesn't properly resume now.
My system is based on nvidia G86, I use latest nouveau drivers, and suspend with compiz running.
I also patched kernel not to do vt switch on suspend/resume:
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 062b7f6..b3ef08b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c @@ -31,6 +31,7 @@ #include "drm_crtc_helper.h" #include <linux/vgaarb.h> #include <linux/vga_switcheroo.h> +#include <linux/suspend.h>
#include "nouveau_drv.h" #include "nouveau_drm.h" @@ -771,6 +772,8 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) int ret = nouveau_card_init(dev); if (ret) return ret; + + pm_set_vt_switch(0); }
return 0;
Best regards, Maxim Levitsky
On Thu, 20 May 2010 04:27:07 +0300 Maxim Levitsky maximlevitsky@gmail.com wrote:
On Thu, 2010-05-20 at 04:13 +0300, Maxim Levitsky wrote:
On Wed, 2010-05-19 at 17:34 -0700, Jesse Barnes wrote:
On Fri, 9 Apr 2010 15:10:50 -0700 Jesse Barnes jbarnes@virtuousgeek.org wrote:
This set of 3 patches makes it a little more likely we'll get panic output onto the screen even when X is running, assuming a KMS enabled stack anyway.
It gets me from a blank or very sparsely populated black screen at panic time, to one including the full backtrace and panic output at panic time (tested with "echo c > /proc/sysrq-trigger" from an X session).
It doesn't cover every case; for instance I think it'll fail when X has disabled the display, but those cases need to be handled with separate patches anyway (need to add atomic DPMS paths for instance).
Anyway, please test these out and let me know if they work for you.
Ping Linus & Dave again. Have you guys tried these? Really, it's cool.
Second that, just tested these patches, and these work perfectly. One more reason for me to dump nvidia driver for nouveau.
Unfortunately I spoke too soon.
After suspend to ram, system doesn't properly resume now.
My system is based on nvidia G86, I use latest nouveau drivers, and suspend with compiz running.
I also patched kernel not to do vt switch on suspend/resume:
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 062b7f6..b3ef08b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c @@ -31,6 +31,7 @@ #include "drm_crtc_helper.h" #include <linux/vgaarb.h> #include <linux/vga_switcheroo.h> +#include <linux/suspend.h>
#include "nouveau_drv.h" #include "nouveau_drm.h" @@ -771,6 +772,8 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) int ret = nouveau_card_init(dev); if (ret) return ret;
pm_set_vt_switch(0); } return 0;
Hm I don't see how my patches would have affected suspend/resume, since they just add "oops_in_progress" checks to a few places. Are you sure something else isn't breaking your resume path?
On Thu, 2010-05-20 at 09:28 -0700, Jesse Barnes wrote:
On Thu, 20 May 2010 04:27:07 +0300 Maxim Levitsky maximlevitsky@gmail.com wrote:
On Thu, 2010-05-20 at 04:13 +0300, Maxim Levitsky wrote:
On Wed, 2010-05-19 at 17:34 -0700, Jesse Barnes wrote:
On Fri, 9 Apr 2010 15:10:50 -0700 Jesse Barnes jbarnes@virtuousgeek.org wrote:
This set of 3 patches makes it a little more likely we'll get panic output onto the screen even when X is running, assuming a KMS enabled stack anyway.
It gets me from a blank or very sparsely populated black screen at panic time, to one including the full backtrace and panic output at panic time (tested with "echo c > /proc/sysrq-trigger" from an X session).
It doesn't cover every case; for instance I think it'll fail when X has disabled the display, but those cases need to be handled with separate patches anyway (need to add atomic DPMS paths for instance).
Anyway, please test these out and let me know if they work for you.
Ping Linus & Dave again. Have you guys tried these? Really, it's cool.
Second that, just tested these patches, and these work perfectly. One more reason for me to dump nvidia driver for nouveau.
Unfortunately I spoke too soon.
After suspend to ram, system doesn't properly resume now.
My system is based on nvidia G86, I use latest nouveau drivers, and suspend with compiz running.
I also patched kernel not to do vt switch on suspend/resume:
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 062b7f6..b3ef08b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c @@ -31,6 +31,7 @@ #include "drm_crtc_helper.h" #include <linux/vgaarb.h> #include <linux/vga_switcheroo.h> +#include <linux/suspend.h>
#include "nouveau_drv.h" #include "nouveau_drm.h" @@ -771,6 +772,8 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) int ret = nouveau_card_init(dev); if (ret) return ret;
pm_set_vt_switch(0); } return 0;
Hm I don't see how my patches would have affected suspend/resume, since they just add "oops_in_progress" checks to a few places. Are you sure something else isn't breaking your resume path?
I am sure. I just reverted them, and everything works again. I refer to 3 patches in this thread.
Best regards, Maxim Levitsky
On Fri, 2010-05-21 at 00:14 +0300, Maxim Levitsky wrote:
On Thu, 2010-05-20 at 09:28 -0700, Jesse Barnes wrote:
On Thu, 20 May 2010 04:27:07 +0300 Maxim Levitsky maximlevitsky@gmail.com wrote:
On Thu, 2010-05-20 at 04:13 +0300, Maxim Levitsky wrote:
On Wed, 2010-05-19 at 17:34 -0700, Jesse Barnes wrote:
On Fri, 9 Apr 2010 15:10:50 -0700 Jesse Barnes jbarnes@virtuousgeek.org wrote:
This set of 3 patches makes it a little more likely we'll get panic output onto the screen even when X is running, assuming a KMS enabled stack anyway.
It gets me from a blank or very sparsely populated black screen at panic time, to one including the full backtrace and panic output at panic time (tested with "echo c > /proc/sysrq-trigger" from an X session).
It doesn't cover every case; for instance I think it'll fail when X has disabled the display, but those cases need to be handled with separate patches anyway (need to add atomic DPMS paths for instance).
Anyway, please test these out and let me know if they work for you.
Ping Linus & Dave again. Have you guys tried these? Really, it's cool.
Second that, just tested these patches, and these work perfectly. One more reason for me to dump nvidia driver for nouveau.
Unfortunately I spoke too soon.
After suspend to ram, system doesn't properly resume now.
My system is based on nvidia G86, I use latest nouveau drivers, and suspend with compiz running.
I also patched kernel not to do vt switch on suspend/resume:
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 062b7f6..b3ef08b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c @@ -31,6 +31,7 @@ #include "drm_crtc_helper.h" #include <linux/vgaarb.h> #include <linux/vga_switcheroo.h> +#include <linux/suspend.h>
#include "nouveau_drv.h" #include "nouveau_drm.h" @@ -771,6 +772,8 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) int ret = nouveau_card_init(dev); if (ret) return ret;
pm_set_vt_switch(0); } return 0;
Hm I don't see how my patches would have affected suspend/resume, since they just add "oops_in_progress" checks to a few places. Are you sure something else isn't breaking your resume path?
I am sure. I just reverted them, and everything works again. I refer to 3 patches in this thread.
In fact I might look a bit silly, but I applied these patches on top of linus master tree + nouveau master, and suspend to ram works just fine.
Maybe it shows up when kgdb+kdb isn't compiled in or so. Maybe it just triggered some bug in nouveau drivers...
(Note that I also enabled kgdb, and kdb, and breaking into kdb (SysRQ+g) doesn't switch console mode, just hangs till I press 'g'.
Best regards, Maxim Levitsky
On Sat, 22 May 2010 00:57:30 +0300 Maxim Levitsky maximlevitsky@gmail.com wrote:
On Fri, 2010-05-21 at 00:14 +0300, Maxim Levitsky wrote:
On Thu, 2010-05-20 at 09:28 -0700, Jesse Barnes wrote:
On Thu, 20 May 2010 04:27:07 +0300 Maxim Levitsky maximlevitsky@gmail.com wrote:
On Thu, 2010-05-20 at 04:13 +0300, Maxim Levitsky wrote:
On Wed, 2010-05-19 at 17:34 -0700, Jesse Barnes wrote:
On Fri, 9 Apr 2010 15:10:50 -0700 Jesse Barnes jbarnes@virtuousgeek.org wrote:
> This set of 3 patches makes it a little more likely we'll get panic > output onto the screen even when X is running, assuming a KMS enabled > stack anyway. > > It gets me from a blank or very sparsely populated black screen at > panic time, to one including the full backtrace and panic output at > panic time (tested with "echo c > /proc/sysrq-trigger" from an X > session). > > It doesn't cover every case; for instance I think it'll fail when X has > disabled the display, but those cases need to be handled with separate > patches anyway (need to add atomic DPMS paths for instance). > > Anyway, please test these out and let me know if they work for you.
Ping Linus & Dave again. Have you guys tried these? Really, it's cool.
Second that, just tested these patches, and these work perfectly. One more reason for me to dump nvidia driver for nouveau.
Unfortunately I spoke too soon.
After suspend to ram, system doesn't properly resume now.
My system is based on nvidia G86, I use latest nouveau drivers, and suspend with compiz running.
I also patched kernel not to do vt switch on suspend/resume:
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 062b7f6..b3ef08b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c @@ -31,6 +31,7 @@ #include "drm_crtc_helper.h" #include <linux/vgaarb.h> #include <linux/vga_switcheroo.h> +#include <linux/suspend.h>
#include "nouveau_drv.h" #include "nouveau_drm.h" @@ -771,6 +772,8 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) int ret = nouveau_card_init(dev); if (ret) return ret;
pm_set_vt_switch(0); } return 0;
Hm I don't see how my patches would have affected suspend/resume, since they just add "oops_in_progress" checks to a few places. Are you sure something else isn't breaking your resume path?
I am sure. I just reverted them, and everything works again. I refer to 3 patches in this thread.
In fact I might look a bit silly, but I applied these patches on top of linus master tree + nouveau master, and suspend to ram works just fine.
Maybe it shows up when kgdb+kdb isn't compiled in or so. Maybe it just triggered some bug in nouveau drivers...
(Note that I also enabled kgdb, and kdb, and breaking into kdb (SysRQ+g) doesn't switch console mode, just hangs till I press 'g'.
Ok so it sounds like these particular patches are innocent?
As for kdb, I think the latest tree is probably missing the graphics switch support on the driver side...
On Fri, 2010-05-21 at 15:02 -0700, Jesse Barnes wrote:
On Sat, 22 May 2010 00:57:30 +0300 Maxim Levitsky maximlevitsky@gmail.com wrote:
On Fri, 2010-05-21 at 00:14 +0300, Maxim Levitsky wrote:
On Thu, 2010-05-20 at 09:28 -0700, Jesse Barnes wrote:
On Thu, 20 May 2010 04:27:07 +0300 Maxim Levitsky maximlevitsky@gmail.com wrote:
On Thu, 2010-05-20 at 04:13 +0300, Maxim Levitsky wrote:
On Wed, 2010-05-19 at 17:34 -0700, Jesse Barnes wrote: > On Fri, 9 Apr 2010 15:10:50 -0700 > Jesse Barnes jbarnes@virtuousgeek.org wrote: > > > This set of 3 patches makes it a little more likely we'll get panic > > output onto the screen even when X is running, assuming a KMS enabled > > stack anyway. > > > > It gets me from a blank or very sparsely populated black screen at > > panic time, to one including the full backtrace and panic output at > > panic time (tested with "echo c > /proc/sysrq-trigger" from an X > > session). > > > > It doesn't cover every case; for instance I think it'll fail when X has > > disabled the display, but those cases need to be handled with separate > > patches anyway (need to add atomic DPMS paths for instance). > > > > Anyway, please test these out and let me know if they work for you. > > Ping Linus & Dave again. Have you guys tried these? Really, it's cool. > Second that, just tested these patches, and these work perfectly. One more reason for me to dump nvidia driver for nouveau.
Unfortunately I spoke too soon.
After suspend to ram, system doesn't properly resume now.
My system is based on nvidia G86, I use latest nouveau drivers, and suspend with compiz running.
I also patched kernel not to do vt switch on suspend/resume:
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 062b7f6..b3ef08b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c @@ -31,6 +31,7 @@ #include "drm_crtc_helper.h" #include <linux/vgaarb.h> #include <linux/vga_switcheroo.h> +#include <linux/suspend.h>
#include "nouveau_drv.h" #include "nouveau_drm.h" @@ -771,6 +772,8 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) int ret = nouveau_card_init(dev); if (ret) return ret;
pm_set_vt_switch(0); } return 0;
Hm I don't see how my patches would have affected suspend/resume, since they just add "oops_in_progress" checks to a few places. Are you sure something else isn't breaking your resume path?
I am sure. I just reverted them, and everything works again. I refer to 3 patches in this thread.
In fact I might look a bit silly, but I applied these patches on top of linus master tree + nouveau master, and suspend to ram works just fine.
Maybe it shows up when kgdb+kdb isn't compiled in or so. Maybe it just triggered some bug in nouveau drivers...
(Note that I also enabled kgdb, and kdb, and breaking into kdb (SysRQ+g) doesn't switch console mode, just hangs till I press 'g'.
Ok so it sounds like these particular patches are innocent?
As for kdb, I think the latest tree is probably missing the graphics switch support on the driver side...
In what part? nouveau or kdb?
Screen does switch to text mode and displays the backtrace on 'panic' (Tested with sysrq+c). (If kdb is enabled, screen doesn't switch, but allowing kdb to continue via 'g' command eventually breaks into it.)
Best regards, Maxim Levitsky
On Sat, 2010-05-22 at 01:26 +0300, Maxim Levitsky wrote:
On Fri, 2010-05-21 at 15:02 -0700, Jesse Barnes wrote:
On Sat, 22 May 2010 00:57:30 +0300 Maxim Levitsky maximlevitsky@gmail.com wrote:
On Fri, 2010-05-21 at 00:14 +0300, Maxim Levitsky wrote:
On Thu, 2010-05-20 at 09:28 -0700, Jesse Barnes wrote:
On Thu, 20 May 2010 04:27:07 +0300 Maxim Levitsky maximlevitsky@gmail.com wrote:
On Thu, 2010-05-20 at 04:13 +0300, Maxim Levitsky wrote: > On Wed, 2010-05-19 at 17:34 -0700, Jesse Barnes wrote: > > On Fri, 9 Apr 2010 15:10:50 -0700 > > Jesse Barnes jbarnes@virtuousgeek.org wrote: > > > > > This set of 3 patches makes it a little more likely we'll get panic > > > output onto the screen even when X is running, assuming a KMS enabled > > > stack anyway. > > > > > > It gets me from a blank or very sparsely populated black screen at > > > panic time, to one including the full backtrace and panic output at > > > panic time (tested with "echo c > /proc/sysrq-trigger" from an X > > > session). > > > > > > It doesn't cover every case; for instance I think it'll fail when X has > > > disabled the display, but those cases need to be handled with separate > > > patches anyway (need to add atomic DPMS paths for instance). > > > > > > Anyway, please test these out and let me know if they work for you. > > > > Ping Linus & Dave again. Have you guys tried these? Really, it's cool. > > > Second that, just tested these patches, and these work perfectly. > One more reason for me to dump nvidia driver for nouveau.
Unfortunately I spoke too soon.
After suspend to ram, system doesn't properly resume now.
My system is based on nvidia G86, I use latest nouveau drivers, and suspend with compiz running.
I also patched kernel not to do vt switch on suspend/resume:
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 062b7f6..b3ef08b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c @@ -31,6 +31,7 @@ #include "drm_crtc_helper.h" #include <linux/vgaarb.h> #include <linux/vga_switcheroo.h> +#include <linux/suspend.h>
#include "nouveau_drv.h" #include "nouveau_drm.h" @@ -771,6 +772,8 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) int ret = nouveau_card_init(dev); if (ret) return ret;
pm_set_vt_switch(0); } return 0;
Hm I don't see how my patches would have affected suspend/resume, since they just add "oops_in_progress" checks to a few places. Are you sure something else isn't breaking your resume path?
I am sure. I just reverted them, and everything works again. I refer to 3 patches in this thread.
In fact I might look a bit silly, but I applied these patches on top of linus master tree + nouveau master, and suspend to ram works just fine.
Maybe it shows up when kgdb+kdb isn't compiled in or so. Maybe it just triggered some bug in nouveau drivers...
(Note that I also enabled kgdb, and kdb, and breaking into kdb (SysRQ+g) doesn't switch console mode, just hangs till I press 'g'.
Ok so it sounds like these particular patches are innocent?
As for kdb, I think the latest tree is probably missing the graphics switch support on the driver side...
In what part? nouveau or kdb?
Screen does switch to text mode and displays the backtrace on 'panic' (Tested with sysrq+c). (If kdb is enabled, screen doesn't switch, but allowing kdb to continue via 'g' command eventually breaks into it.)
Ping.
Best regards, Maxim Levitsky
On Fri, 9 Apr 2010 15:10:50 -0700 Jesse Barnes jbarnes@virtuousgeek.org wrote:
This set of 3 patches makes it a little more likely we'll get panic output onto the screen even when X is running, assuming a KMS enabled stack anyway.
It gets me from a blank or very sparsely populated black screen at panic time, to one including the full backtrace and panic output at panic time (tested with "echo c > /proc/sysrq-trigger" from an X session).
It doesn't cover every case; for instance I think it'll fail when X has disabled the display, but those cases need to be handled with separate patches anyway (need to add atomic DPMS paths for instance).
Anyway, please test these out and let me know if they work for you.
Ping Linus & Dave again. Have you guys tried these? Really, it's cool.
Is this safe with UMS and vgacon/sticon? With a oops while using vgacon you can now touch the hardware buffer while not in vga text mode.
On Sun, 6 Jun 2010 17:36:24 +0100 (BST) James Simmons jsimmons@infradead.org wrote:
On Fri, 9 Apr 2010 15:10:50 -0700 Jesse Barnes jbarnes@virtuousgeek.org wrote:
This set of 3 patches makes it a little more likely we'll get panic output onto the screen even when X is running, assuming a KMS enabled stack anyway.
It gets me from a blank or very sparsely populated black screen at panic time, to one including the full backtrace and panic output at panic time (tested with "echo c > /proc/sysrq-trigger" from an X session).
It doesn't cover every case; for instance I think it'll fail when X has disabled the display, but those cases need to be handled with separate patches anyway (need to add atomic DPMS paths for instance).
Anyway, please test these out and let me know if they work for you.
Ping Linus & Dave again. Have you guys tried these? Really, it's cool.
Is this safe with UMS and vgacon/sticon? With a oops while using vgacon you can now touch the hardware buffer while not in vga text mode.
Seems unlikely that poking VGA memory at that point would cause data corruption. There shouldn't be any other harm either, since the system is already wedged...
dri-devel@lists.freedesktop.org