提交 a8956a7b 编写于 作者: A Alistair Popple 提交者: Michael Ellerman

powerpc/powernv: Fix opal-elog interrupt handler

The conversion of opal events to a proper irqchip means that handlers
are called until the relevant opal event has been cleared by
processing it. Events that queue work should therefore use a threaded
handler to mask the event until processing is complete.
Signed-off-by: NAlistair Popple <alistair@popple.id.au>
Tested-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 aaf6fd5c
...@@ -237,7 +237,7 @@ static struct elog_obj *create_elog_obj(uint64_t id, size_t size, uint64_t type) ...@@ -237,7 +237,7 @@ static struct elog_obj *create_elog_obj(uint64_t id, size_t size, uint64_t type)
return elog; return elog;
} }
static void elog_work_fn(struct work_struct *work) static irqreturn_t elog_event(int irq, void *data)
{ {
__be64 size; __be64 size;
__be64 id; __be64 id;
...@@ -251,7 +251,7 @@ static void elog_work_fn(struct work_struct *work) ...@@ -251,7 +251,7 @@ static void elog_work_fn(struct work_struct *work)
rc = opal_get_elog_size(&id, &size, &type); rc = opal_get_elog_size(&id, &size, &type);
if (rc != OPAL_SUCCESS) { if (rc != OPAL_SUCCESS) {
pr_err("ELOG: OPAL log info read failed\n"); pr_err("ELOG: OPAL log info read failed\n");
return; return IRQ_HANDLED;
} }
elog_size = be64_to_cpu(size); elog_size = be64_to_cpu(size);
...@@ -270,16 +270,10 @@ static void elog_work_fn(struct work_struct *work) ...@@ -270,16 +270,10 @@ static void elog_work_fn(struct work_struct *work)
* entries. * entries.
*/ */
if (kset_find_obj(elog_kset, name)) if (kset_find_obj(elog_kset, name))
return; return IRQ_HANDLED;
create_elog_obj(log_id, elog_size, elog_type); create_elog_obj(log_id, elog_size, elog_type);
}
static DECLARE_WORK(elog_work, elog_work_fn);
static irqreturn_t elog_event(int irq, void *data)
{
schedule_work(&elog_work);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -304,8 +298,8 @@ int __init opal_elog_init(void) ...@@ -304,8 +298,8 @@ int __init opal_elog_init(void)
return irq; return irq;
} }
rc = request_irq(irq, elog_event, rc = request_threaded_irq(irq, NULL, elog_event,
IRQ_TYPE_LEVEL_HIGH, "opal-elog", NULL); IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "opal-elog", NULL);
if (rc) { if (rc) {
pr_err("%s: Can't request OPAL event irq (%d)\n", pr_err("%s: Can't request OPAL event irq (%d)\n",
__func__, rc); __func__, rc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册