]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0284-genirq-Add-default-affinity-mask-command-line-option.patch
WAR:media:i2c:ov5693: add flip and mirror setting
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0284-genirq-Add-default-affinity-mask-command-line-option.patch
1 From 830a9d2fb0c571544760f8e9b5a3e36f9c7c69f9 Mon Sep 17 00:00:00 2001
2 From: Thomas Gleixner <tglx@linutronix.de>
3 Date: Fri, 25 May 2012 16:59:47 +0200
4 Subject: [PATCH 284/365] genirq: Add default affinity mask command line option
5
6 If we isolate CPUs, then we don't want random device interrupts on them. Even
7 w/o the user space irq balancer enabled we can end up with irqs on non boot
8 cpus and chasing newly requested interrupts is a tedious task.
9
10 Allow to restrict the default irq affinity mask.
11
12 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
13 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
14 ---
15  Documentation/kernel-parameters.txt |  9 +++++++++
16  kernel/irq/irqdesc.c                | 21 +++++++++++++++++++--
17  2 files changed, 28 insertions(+), 2 deletions(-)
18
19 diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
20 index 1154924..5d097a6 100644
21 --- a/Documentation/kernel-parameters.txt
22 +++ b/Documentation/kernel-parameters.txt
23 @@ -1642,6 +1642,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
24         ip=             [IP_PNP]
25                         See Documentation/filesystems/nfs/nfsroot.txt.
26  
27 +       irqaffinity=    [SMP] Set the default irq affinity mask
28 +                       Format:
29 +                       <cpu number>,...,<cpu number>
30 +                       or
31 +                       <cpu number>-<cpu number>
32 +                       (must be a positive range in ascending order)
33 +                       or a mixture
34 +                       <cpu number>,...,<cpu number>-<cpu number>
35 +
36         irqfixup        [HW]
37                         When an interrupt is not handled search all handlers
38                         for it. Intended to get systems with badly broken
39 diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
40 index 239e2ae..0b73349 100644
41 --- a/kernel/irq/irqdesc.c
42 +++ b/kernel/irq/irqdesc.c
43 @@ -24,10 +24,27 @@
44  static struct lock_class_key irq_desc_lock_class;
45  
46  #if defined(CONFIG_SMP)
47 +static int __init irq_affinity_setup(char *str)
48 +{
49 +       zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
50 +       cpulist_parse(str, irq_default_affinity);
51 +       /*
52 +        * Set at least the boot cpu. We don't want to end up with
53 +        * bugreports caused by random comandline masks
54 +        */
55 +       cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
56 +       return 1;
57 +}
58 +__setup("irqaffinity=", irq_affinity_setup);
59 +
60  static void __init init_irq_default_affinity(void)
61  {
62 -       alloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
63 -       cpumask_setall(irq_default_affinity);
64 +#ifdef CONFIG_CPUMASK_OFFSTACK
65 +       if (!irq_default_affinity)
66 +               zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
67 +#endif
68 +       if (cpumask_empty(irq_default_affinity))
69 +               cpumask_setall(irq_default_affinity);
70  }
71  #else
72  static void __init init_irq_default_affinity(void)
73 -- 
74 2.7.4
75