lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 10 Mar 2017 12:52:44 +0800
From:   gengdongjiu <gengdongjiu@...wei.com>
To:     <tglx@...utronix.de>, <jason@...edaemon.net>,
        <benh@...nel.crashing.org>, <linux-kernel@...r.kernel.org>,
        <zhanghaibin7@...wei.com>, <huangshaoyu@...wei.com>
Subject: [PATCH] irqdomain: handle the per-CPU irq trigger type settings

    when devices parse and map an per-cpu interrupt into linux virq space
    using irq_of_parse_and_map API, it will always be failed if needs to set
    the specified irq trigger type, because irq_set_irq_type is only for 1-N
    mode interrupt source, not for per-cpu interrupt source. so handle per-cpu
    IRQs for this failure.

    Signed-off-by: Dongjiu Geng <gengdongjiu@...wei.com>
                   Zhanghai bin <zhanghaibin7@...wei.com>

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 9fd618d..8116cf2 100755
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -542,8 +542,16 @@ unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data)

        /* Set type if specified and different than the current one */
        if (type != IRQ_TYPE_NONE &&
-           type != irq_get_trigger_type(virq))
-               irq_set_irq_type(virq, type);
+           type != irq_get_trigger_type(virq)) {
+               int ret = 0;
+               struct irq_data *irq_data = irq_get_irq_data(virq);
+
+               ret = irq_set_irq_type(virq, type);
+
+                /* Handle per-cpu IRQ: just save type in irq_data */
+               if (-EINVAL == ret && irq_data)
+                       irqd_set_trigger_type(irq_data, type);
+       }
        return virq;
 }
 EXPORT_SYMBOL_GPL(irq_create_of_mapping);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ