From: Alistair Popple <alistair@popple.id.au>
To: linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au
Cc: linux-kernel@vger.kernel.org, Alistair Popple <alistair@popple.id.au>
Subject: [PATCH v4 7/9] powernv/elog: Convert elog to opal irq domain
Date: Fri, 15 May 2015 14:06:42 +1000 [thread overview]
Message-ID: <1431662804-16851-8-git-send-email-alistair@popple.id.au> (raw)
In-Reply-To: <1431662804-16851-1-git-send-email-alistair@popple.id.au>
This patch converts the elog code to use the opal irq domain instead
of notifier events.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
---
arch/powerpc/platforms/powernv/opal-elog.c | 32 +++++++++++++++---------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
index 38ce757..4949ef0 100644
--- a/arch/powerpc/platforms/powernv/opal-elog.c
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -10,6 +10,7 @@
*/
#include <linux/kernel.h>
#include <linux/init.h>
+#include <linux/interrupt.h>
#include <linux/of.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
@@ -276,24 +277,15 @@ static void elog_work_fn(struct work_struct *work)
static DECLARE_WORK(elog_work, elog_work_fn);
-static int elog_event(struct notifier_block *nb,
- unsigned long events, void *change)
+static irqreturn_t elog_event(int irq, void *data)
{
- /* check for error log event */
- if (events & OPAL_EVENT_ERROR_LOG_AVAIL)
- schedule_work(&elog_work);
- return 0;
+ schedule_work(&elog_work);
+ return IRQ_HANDLED;
}
-static struct notifier_block elog_nb = {
- .notifier_call = elog_event,
- .next = NULL,
- .priority = 0
-};
-
int __init opal_elog_init(void)
{
- int rc = 0;
+ int rc = 0, irq;
/* ELOG not supported by firmware */
if (!opal_check_token(OPAL_ELOG_READ))
@@ -305,10 +297,18 @@ int __init opal_elog_init(void)
return -1;
}
- rc = opal_notifier_register(&elog_nb);
+ irq = opal_event_request(ilog2(OPAL_EVENT_ERROR_LOG_AVAIL));
+ if (!irq) {
+ pr_err("%s: Can't register OPAL event irq (%d)\n",
+ __func__, irq);
+ return irq;
+ }
+
+ rc = request_irq(irq, elog_event,
+ IRQ_TYPE_LEVEL_HIGH, "opal-elog", NULL);
if (rc) {
- pr_err("%s: Can't register OPAL event notifier (%d)\n",
- __func__, rc);
+ pr_err("%s: Can't request OPAL event irq (%d)\n",
+ __func__, rc);
return rc;
}
--
1.8.3.2
next prev parent reply other threads:[~2015-05-15 4:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 4:06 [PATCH v4 0/9] Convert OPAL notifier events to an irqchip Alistair Popple
2015-05-15 4:06 ` [PATCH v4 1/9] powerpc/powernv: Reorder OPAL subsystem initialisation Alistair Popple
2015-05-15 4:06 ` [PATCH v4 2/9] powerpc/powernv: Add a virtual irqchip for opal events Alistair Popple
2015-05-15 4:06 ` [PATCH v4 3/9] ipmi/powernv: Convert to irq event interface Alistair Popple
2015-05-15 4:06 ` [PATCH v4 4/9] hvc: Convert to using interrupts instead of opal events Alistair Popple
2015-05-19 4:33 ` Michael Ellerman
2015-05-19 5:09 ` Alistair Popple
2015-05-19 9:23 ` Michael Ellerman
2015-05-15 4:06 ` [PATCH v4 5/9] powernv/eeh: Update the EEH code to use the opal irq domain Alistair Popple
2015-05-15 4:06 ` [PATCH v4 6/9] powernv/opal: Convert opal message events to " Alistair Popple
2015-05-15 4:06 ` Alistair Popple [this message]
2015-05-15 4:06 ` [PATCH v4 8/9] powernv/opal-dump: Convert to " Alistair Popple
2015-05-15 4:06 ` [PATCH v4 9/9] 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=1431662804-16851-8-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).