Re: [BUG RT] dump-capture kernel not executed for panic in interrupt context

From: Andrew Morton
Date: Mon Jul 27 2020 - 19:36:58 EST


On Wed, 22 Jul 2020 06:30:53 +0200 Joerg Vehlow <lkml@xxxxxxxxxxx> wrote:

> >> About 12 years ago this was not implemented using a mutex, but using xchg.
> >> See: 8c5a1cf0ad3ac5fcdf51314a63b16a440870f6a2
> > Yes, that commit is wrong, because mutex_trylock() is not to be taken in
> > interrupt context, where crash_kexec() looks like it can be called.

Yup, mutex_trylock() from interrupt is improper. Well dang, that's a
bit silly. Presumably the 2006 spin_lock_mutex() wasn't taken with
irqs-off.

Ho hum, did you look at switching the kexec code back to the xchg
approach?