From: Alistair Popple <alistair@popple.id.au>
To: linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au
Cc: Alistair Popple <alistair@popple.id.au>, linux-kernel@vger.kernel.org
Subject: [PATCH v3 5/8] powernv/opal: Convert opal message events to opal irq domain
Date: Thu, 7 May 2015 13:16:15 +1000 [thread overview]
Message-ID: <1430968578-23527-5-git-send-email-alistair@popple.id.au> (raw)
In-Reply-To: <1430968578-23527-1-git-send-email-alistair@popple.id.au>
This patch converts the opal message event to use the new opal irq
domain.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
---
arch/powerpc/platforms/powernv/opal.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index 4399ff2..0196220 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -362,33 +362,34 @@ static void opal_handle_message(void)
opal_message_do_notify(type, (void *)&msg);
}
-static int opal_message_notify(struct notifier_block *nb,
- unsigned long events, void *change)
+static irqreturn_t opal_message_notify(int irq, void *data)
{
- if (events & OPAL_EVENT_MSG_PENDING)
- opal_handle_message();
- return 0;
+ opal_handle_message();
+ return IRQ_HANDLED;
}
-static struct notifier_block opal_message_nb = {
- .notifier_call = opal_message_notify,
- .next = NULL,
- .priority = 0,
-};
-
static int __init opal_message_init(void)
{
- int ret, i;
+ int ret, i, irq;
for (i = 0; i < OPAL_MSG_TYPE_MAX; i++)
ATOMIC_INIT_NOTIFIER_HEAD(&opal_msg_notifier_head[i]);
- ret = opal_notifier_register(&opal_message_nb);
+ irq = opal_event_request(ilog2(OPAL_EVENT_MSG_PENDING));
+ if (!irq) {
+ pr_err("%s: Can't register OPAL event irq (%d)\n",
+ __func__, irq);
+ return irq;
+ }
+
+ ret = request_irq(irq, opal_message_notify,
+ IRQ_TYPE_LEVEL_HIGH, "opal-msg", NULL);
if (ret) {
- pr_err("%s: Can't register OPAL event notifier (%d)\n",
+ pr_err("%s: Can't request OPAL event irq (%d)\n",
__func__, ret);
return ret;
}
+
return 0;
}
machine_early_initcall(powernv, opal_message_init);
--
1.8.3.2
next prev parent reply other threads:[~2015-05-07 3:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-07 3:16 [PATCH v3 1/8] powerpc/powernv: Add a virtual irqchip for opal events Alistair Popple
2015-05-07 3:16 ` [PATCH v3 2/8] ipmi/powernv: Convert to irq event interface Alistair Popple
2015-05-07 17:43 ` Corey Minyard
2015-05-11 2:07 ` Alistair Popple
2015-05-07 3:16 ` [PATCH v3 3/8] hvc: Convert to using interrupts instead of opal events Alistair Popple
2015-05-07 3:16 ` [PATCH v3 4/8] powernv/eeh: Update the EEH code to use the opal irq domain Alistair Popple
2015-05-07 3:16 ` Alistair Popple [this message]
2015-05-11 9:18 ` [v3, 5/8] powernv/opal: Convert opal message events to " Michael Ellerman
2015-05-07 3:16 ` [PATCH v3 6/8] powernv/elog: Convert elog " Alistair Popple
2015-05-07 3:16 ` [PATCH v3 7/8] powernv/opal-dump: Convert to " Alistair Popple
2015-05-07 3:16 ` [PATCH v3 8/8] opal: Remove events notifier Alistair Popple
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=1430968578-23527-5-git-send-email-alistair@popple.id.au \
--to=alistair@popple.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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;
as well as URLs for NNTP newsgroup(s).