genirq: Fix uninitialized request_mutex
PATCH 1/1 genirq: Fix uninitialized request_mutex
When !CONFIG_SPARSE_IRQ, request_mutex of struct irq_desc won't be initialiezed, it leads to system hung, fix it.
Fixes 9114014cf4e6 ("genirq: Add mutex to irq desc to serialize request/free_irq()")
Signed-off-by Kefeng Wang <[email protected]>
--- kernel/irq/irqdesc.c | 1 + 1 file changed, 1 insertion(+)
kernel/irq/irqdesc.c +1 -0
@@ -558,6 +558,7 @@ int __init early_irq_init(void)alloc_masks (&desc[i], node);raw_spin_lock_init (&desc[i].lock);lockdep_set_class (&desc[i].lock, &irq_desc_lock_class); +mutex_init (&desc[i].request_mutex);desc_set_defaults (i, &desc[i], node,NULL ,NULL ); }return arch_early_irq_init ();
Signature · 1 line
2.20.1
Quoted 5 lines · Kefeng Wang
When !CONFIG_SPARSE_IRQ,
request_mutexof structirq_descwon't be initialiezed, it leads to system hung, fix it.Fixes 9114014cf4e6 ("genirq: Add mutex to irq desc to serialize request/free_irq()")Signed-off-by Kefeng Wang <[email protected]>
Reviewed-by Mukesh Ojha <[email protected]>
Cheers,
-Mukesh
Quoted 16 lines
--- kernel/irq/irqdesc.c | 1 + 1 file changed, 1 insertion(+)kernel/irq/irqdesc.c +1
-0@@ -558,6 +558,7 @@ int __init early_irq_init(void)alloc_masks (&desc[i], node);raw_spin_lock_init (&desc[i].lock);lockdep_set_class (&desc[i].lock, &irq_desc_lock_class); +mutex_init (&desc[i].request_mutex);desc_set_defaults (i, &desc[i], node,NULL ,NULL ); }return arch_early_irq_init ();
tip-bot for Kefeng Wang
merge bot[tip:irq/urgent] genirq: Initialize request_mutex if CONFIG_SPARSE_IRQ=n
In reply to Kefeng Wanggenirq: Initialize request_mutex if CONFIG_SPARSE_IRQ=n
Commit-ID: e8458e7afa855317b14915d7b86ab3caceea7eb6 Gitweb: https://git.kernel.org/tip/e8458e7afa855317b14915d7b86ab3caceea7eb6 Author: Kefeng Wang <[email protected]> AuthorDate: Thu, 4 Apr 2019 15:45:12 +0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 5 Apr 2019 14:37:56 +0200
genirq: Initialize request_mutex if CONFIG_SPARSE_IRQ=n
When CONFIG_SPARSE_IRQ is disable, the request_mutex in struct irq_desc is not initialized which causes malfunction.
Fixes 9114014cf4e6 ("genirq: Add mutex to irq desc to serialize request/free_irq()")
Signed-off-by Kefeng Wang <[email protected]>
Signed-off-by Thomas Gleixner <[email protected]>
Reviewed-by Mukesh Ojha <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc <[email protected]>
--- kernel/irq/irqdesc.c | 1 + 1 file changed, 1 insertion(+)
kernel/irq/irqdesc.c +1 -0
@@ -558,6 +558,7 @@ int __init early_irq_init(void)alloc_masks (&desc[i], node);raw_spin_lock_init (&desc[i].lock);lockdep_set_class (&desc[i].lock, &irq_desc_lock_class); +mutex_init (&desc[i].request_mutex);desc_set_defaults (i, &desc[i], node,NULL ,NULL ); }return arch_early_irq_init ();