From: Lin Ruizhe linruizhe@huawei.com
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: Kefeng Wang wangkefeng.wang@huawei.com Signed-off-by: Lin ruizhe linruizhe@huawei.com Signed-off-by: He Ying heying24@huawei.com Signed-off-by: Chen Jun chenjun102@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com
conflicts: drivers/tty/serial/amba-pl011.c
Signed-off-by: Lin Yujun linyujun809@huawei.com --- drivers/tty/serial/amba-pl011.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 3dc9b0fcab1c..648f99d4774c 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2815,10 +2815,20 @@ 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; uap->port.rs485_config = pl011_rs485_config; uap->port.rs485_supported = pl011_rs485_supported; + + /* 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));
if (device_property_read_u32(&dev->dev, "reg-io-width", &val) == 0) {
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/3351 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/U...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/3351 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/U...
这个应该不需要了,我记得我在社区已经修过了
On 2023/12/12 9:26, Lin Yujun wrote:
From: Lin Ruizhe linruizhe@huawei.com
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: Kefeng Wang wangkefeng.wang@huawei.com Signed-off-by: Lin ruizhe linruizhe@huawei.com Signed-off-by: He Ying heying24@huawei.com Signed-off-by: Chen Jun chenjun102@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com
conflicts: drivers/tty/serial/amba-pl011.c
Signed-off-by: Lin Yujun linyujun809@huawei.com
drivers/tty/serial/amba-pl011.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 3dc9b0fcab1c..648f99d4774c 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2815,10 +2815,20 @@ 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; uap->port.rs485_config = pl011_rs485_config; uap->port.rs485_supported = pl011_rs485_supported;
/* 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));
if (device_property_read_u32(&dev->dev, "reg-io-width", &val) == 0) {