powernv/opal: Convert opal message events to opal irq domain
This patch converts the opal message event to use the new opal irq domain. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
79231448c9
commit
a295af24d0
@ -362,33 +362,34 @@ static void opal_handle_message(void)
|
|||||||
opal_message_do_notify(type, (void *)&msg);
|
opal_message_do_notify(type, (void *)&msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int opal_message_notify(struct notifier_block *nb,
|
static irqreturn_t opal_message_notify(int irq, void *data)
|
||||||
unsigned long events, void *change)
|
|
||||||
{
|
{
|
||||||
if (events & OPAL_EVENT_MSG_PENDING)
|
opal_handle_message();
|
||||||
opal_handle_message();
|
return IRQ_HANDLED;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct notifier_block opal_message_nb = {
|
|
||||||
.notifier_call = opal_message_notify,
|
|
||||||
.next = NULL,
|
|
||||||
.priority = 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int __init opal_message_init(void)
|
static int __init opal_message_init(void)
|
||||||
{
|
{
|
||||||
int ret, i;
|
int ret, i, irq;
|
||||||
|
|
||||||
for (i = 0; i < OPAL_MSG_TYPE_MAX; i++)
|
for (i = 0; i < OPAL_MSG_TYPE_MAX; i++)
|
||||||
ATOMIC_INIT_NOTIFIER_HEAD(&opal_msg_notifier_head[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) {
|
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);
|
__func__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user