diff mbox series

[1/7] lib: utils/ipi: Skip initialize ipi when dt is not enabled

Message ID 20240611111937.1459876-2-wxjstz@126.com
State Accepted
Headers show
Series Fix someting about dt match | expand

Commit Message

Xiang W June 11, 2024, 11:19 a.m. UTC
When the dt node has a status property and the value is not ok or
okay, skip initializing ipi.

Signed-off-by: Xiang W <wxjstz@126.com>
---
 lib/utils/ipi/fdt_ipi.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Anup Patel June 13, 2024, 1:24 p.m. UTC | #1
On Tue, Jun 11, 2024 at 4:49 PM Xiang W <wxjstz@126.com> wrote:
>
> When the dt node has a status property and the value is not ok or
> okay, skip initializing ipi.
>
> Signed-off-by: Xiang W <wxjstz@126.com>

LGTM.

Reviewed-by: Anup Patel <anup@brainfault.org>

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

> ---
>  lib/utils/ipi/fdt_ipi.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/lib/utils/ipi/fdt_ipi.c b/lib/utils/ipi/fdt_ipi.c
> index 7762aba..0b75093 100644
> --- a/lib/utils/ipi/fdt_ipi.c
> +++ b/lib/utils/ipi/fdt_ipi.c
> @@ -44,6 +44,9 @@ static int fdt_ipi_cold_init(void)
>                 noff = -1;
>                 while ((noff = fdt_find_match(fdt, noff,
>                                         drv->match_table, &match)) >= 0) {
> +                       if (!fdt_node_is_enabled(fdt, noff))
> +                               continue;
> +
>                         /* drv->cold_init must not be NULL */
>                         if (drv->cold_init == NULL)
>                                 return SBI_EFAIL;
> --
> 2.43.0
>
diff mbox series

Patch

diff --git a/lib/utils/ipi/fdt_ipi.c b/lib/utils/ipi/fdt_ipi.c
index 7762aba..0b75093 100644
--- a/lib/utils/ipi/fdt_ipi.c
+++ b/lib/utils/ipi/fdt_ipi.c
@@ -44,6 +44,9 @@  static int fdt_ipi_cold_init(void)
 		noff = -1;
 		while ((noff = fdt_find_match(fdt, noff,
 					drv->match_table, &match)) >= 0) {
+			if (!fdt_node_is_enabled(fdt, noff))
+				continue;
+
 			/* drv->cold_init must not be NULL */
 			if (drv->cold_init == NULL)
 				return SBI_EFAIL;