mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: gengdongjiu <gengdongjiu@huawei.com>
To: <tglx@linutronix.de>, <jason@lakedaemon.net>,
	<benh@kernel.crashing.org>, <linux-kernel@vger.kernel.org>,
	<zhanghaibin7@huawei.com>, <huangshaoyu@huawei.com>
Subject: [PATCH] irqdomain: handle the per-CPU irq trigger type settings
Date: Fri, 10 Mar 2017 12:52:44 +0800	[thread overview]
Message-ID: <c13445cc-59e1-b5c0-1626-6a20759593a3@huawei.com> (raw)

    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@huawei.com>
                   Zhanghai bin <zhanghaibin7@huawei.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);

             reply	other threads:[~2017-03-10  4:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10  4:52 gengdongjiu [this message]
2017-03-10 10:35 ` Thomas Gleixner
     [not found] <7d436524-73d4-5379-a409-d170e3ca70fe@huawei.com>
2017-03-11  5:00 ` gengdongjiu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c13445cc-59e1-b5c0-1626-6a20759593a3@huawei.com \
    --to=gengdongjiu@huawei.com \
    --cc=benh@kernel.crashing.org \
    --cc=huangshaoyu@huawei.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=zhanghaibin7@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®