Skip to content

Commit

Permalink
drm/i915: avoid non-atomic sysrq execution
Browse files Browse the repository at this point in the history
The sysrq functions are executed in hardirq context, so we shouldn't be
calling sleeping functions from them, like mutex_locks or memory
allocations.

Fix up the i915 sysrq handler to avoid this.

Signed-off-by: Jesse Barnes <[email protected]>
Signed-off-by: Eric Anholt <[email protected]>
  • Loading branch information
jbarnes993 authored and anholt committed Jun 5, 2009
1 parent 42c2798 commit b66d18d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/gpu/drm/i915/intel_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,9 +857,15 @@ void intelfb_restore(void)
drm_crtc_helper_set_config(&kernelfb_mode);
}

static void intelfb_restore_work_fn(struct work_struct *ignored)
{
intelfb_restore();
}
static DECLARE_WORK(intelfb_restore_work, intelfb_restore_work_fn);

static void intelfb_sysrq(int dummy1, struct tty_struct *dummy3)
{
intelfb_restore();
schedule_work(&intelfb_restore_work);
}

static struct sysrq_key_op sysrq_intelfb_restore_op = {
Expand Down

0 comments on commit b66d18d

Please sign in to comment.