提交 ae96841e 编写于 作者: L Lin Ruizhe 提交者: Zheng Zengkai

amba-pl011: Fix no irq issue due to no IRQ domain found

hulk inclusion
category: bugfix
bugzilla: 176552 https://gitee.com/openeuler/kernel/issues/I4DDEL

-------------------------------------------------

If pl011 interrupt is connected to MBIGEN interrupt controller,
because the mbigen initialization is too late, which will lead
to no IRQ due to no IRQ domain found, logs is shown below,
"irq: no irq domain found for uart0 !"

When dev->irq[0] is zero, try to get IRQ by of_irq_get() again,
and return -EPROBE_DEFER if the IRQ domain is not yet created.

Using deferred probing mechanism to fix the issue.
Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NLin ruizhe <linruizhe@huawei.com>
Signed-off-by: NHe Ying <heying24@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 816fb911
......@@ -41,6 +41,7 @@
#include <linux/sizes.h>
#include <linux/io.h>
#include <linux/acpi.h>
#include <linux/of_irq.h>
#include "amba-pl011.h"
......@@ -2665,9 +2666,18 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
uap->vendor = vendor;
uap->fifosize = vendor->get_fifosize(dev);
uap->port.iotype = vendor->access_32b ? UPIO_MEM32 : UPIO_MEM;
uap->port.irq = dev->irq[0];
uap->port.ops = &amba_pl011_pops;
/* if no irq domain found, irq number is 0, try again */
if (!dev->irq[0] && dev->dev.of_node) {
ret = of_irq_get(dev->dev.of_node, 0);
if (ret < 0)
return ret;
dev->irq[0] = ret;
}
uap->port.irq = dev->irq[0];
snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev));
ret = pl011_setup_port(&dev->dev, uap, &dev->res, portnr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册