[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cbd74fa5-d4ad-4ed0-a680-6ff5e3b8ff84@kernel.org>
Date: Mon, 22 Jul 2024 14:39:20 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: ysionneau@...rayinc.com, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>
Cc: Jonathan Borne <jborne@...rayinc.com>,
Julian Vetter <jvetter@...rayinc.com>,
Clement Leger <clement@...ment-leger.fr>,
Guillaume Thouvenin <thouveng@...il.com>, Luc Michel <luc@...chel.fr>,
Jules Maselbas <jmaselbas@...v.net>, bpf@...r.kernel.org
Subject: Re: [RFC PATCH v3 35/37] kvx: Add IPI driver
On 22/07/2024 11:41, ysionneau@...rayinc.com wrote:
> From: Yann Sionneau <ysionneau@...rayinc.com>
>
> The Inter-Processor Interrupt Controller (IPI) provides a fast
> synchronization mechanism to the software. It exposes eight independent
> sets of registers that can be used to notify each processor in the cluster.
>
> Co-developed-by: Clement Leger <clement@...ment-leger.fr>
> Signed-off-by: Clement Leger <clement@...ment-leger.fr>
> Co-developed-by: Guillaume Thouvenin <thouveng@...il.com>
> Signed-off-by: Guillaume Thouvenin <thouveng@...il.com>
> Co-developed-by: Julian Vetter <jvetter@...rayinc.com>
> Signed-off-by: Julian Vetter <jvetter@...rayinc.com>
> Co-developed-by: Luc Michel <luc@...chel.fr>
> Signed-off-by: Luc Michel <luc@...chel.fr>
> Signed-off-by: Jules Maselbas <jmaselbas@...v.net>
> Signed-off-by: Yann Sionneau <ysionneau@...rayinc.com>
...
> +
> +int __init kvx_ipi_ctrl_init(struct device_node *node,
> + struct device_node *parent)
> +{
> + int ret;
> + unsigned int ipi_irq;
> + void __iomem *ipi_base;
> +
> + BUG_ON(!node);
Fix your code instead.
> +
> + ipi_base = of_iomap(node, 0);
> + BUG_ON(!ipi_base);
No, handle it by returning.
> +
> + kvx_ipi_controller.regs = ipi_base;
> +
> + /* Init mask for interrupts to PE0 -> PE15 */
> + writel(KVX_IPI_CPU_MASK, kvx_ipi_controller.regs + IPI_MASK_OFFSET);
> +
> + ipi_irq = irq_of_parse_and_map(node, 0);
> + if (!ipi_irq) {
> + pr_err("Failed to parse irq: %d\n", ipi_irq);
> + return -EINVAL;
> + }
> +
> + ret = request_percpu_irq(ipi_irq, ipi_irq_handler,
> + "kvx_ipi", &kvx_ipi_controller);
> + if (ret) {
> + pr_err("can't register interrupt %d (%d)\n",
> + ipi_irq, ret);
> + return ret;
> + }
> + kvx_ipi_controller.ipi_irq = ipi_irq;
> +
> + ret = cpuhp_setup_state(CPUHP_AP_IRQ_KVX_STARTING,
> + "kvx/ipi:online",
> + kvx_ipi_starting_cpu,
> + kvx_ipi_dying_cpu);
> + if (ret < 0) {
> + pr_err("Failed to setup hotplug state");
> + return ret;
> + }
> +
> + set_smp_cross_call(kvx_ipi_send);
> + pr_info("controller probed\n");
Drop this simple probe successes. This is not the way to trace system
bootup. Keep only reasonable amount, not every driver printing that its
initcall started.
Best regards,
Krzysztof
Powered by blists - more mailing lists