HACK: ARM: disable sleeping while atomic warning in do_signal

ARM disables interrupts in do_signal, which triggers a warning in
try_to_freeze, see details at https://lkml.org/lkml/2011/8/23/221.
To prevent the warnings, add try_to_freeze_nowarn and call it from
do_signal.

Change-Id: If7482de21c386adc705fa1ac4ecb8c7ece5bb356
Signed-off-by: Colin Cross <ccross@android.com>
This commit is contained in:
Colin Cross 2012-08-15 13:10:04 -07:00 committed by Iliyan Malchev
parent 1b23972213
commit a997718e25
3 changed files with 13 additions and 2 deletions

View file

@ -642,7 +642,7 @@ static void do_signal(struct pt_regs *regs, int syscall)
}
}
if (try_to_freeze())
if (try_to_freeze_nowarn())
goto no_signal;
/*

View file

@ -41,6 +41,17 @@ extern int freeze_kernel_threads(void);
extern void thaw_processes(void);
extern void thaw_kernel_threads(void);
/*
* HACK: prevent sleeping while atomic warnings due to ARM signal handling
* disabling irqs
*/
static inline bool try_to_freeze_nowarn(void)
{
if (likely(!freezing(current)))
return false;
return __refrigerator(false);
}
static inline bool try_to_freeze(void)
{
might_sleep();

View file

@ -2211,7 +2211,7 @@ relock:
* Now that we woke up, it's crucial if we're supposed to be
* frozen that we freeze now before running anything substantial.
*/
try_to_freeze();
try_to_freeze_nowarn();
spin_lock_irq(&sighand->siglock);
/*