From: Jason Wessel Date: Thu, 5 Aug 2010 14:22:24 +0000 (-0500) Subject: mm,kdb,kgdb: Add a debug reference for the kdb kmap usage X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eac790059b22883763759aeb468ff862bae4627e;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git mm,kdb,kgdb: Add a debug reference for the kdb kmap usage The kdb kmap should never get used outside of the kernel debugger exception context. Signed-off-by: Jason Wessel CC: Andrew Morton CC: Ingo Molnar CC: linux-mm@kvack.org --- diff --git a/mm/highmem.c b/mm/highmem.c index 66baa20f78f5..7a0aa1be4993 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -26,6 +26,7 @@ #include #include #include +#include #include /* @@ -470,6 +471,12 @@ void debug_kmap_atomic(enum km_type type) warn_count--; } } +#ifdef CONFIG_KGDB_KDB + if (unlikely(type == KM_KDB && atomic_read(&kgdb_active) == -1)) { + WARN_ON(1); + warn_count--; + } +#endif /* CONFIG_KGDB_KDB */ } #endif