lib: utils: Fix irqchip registration for PLIC and APLIC

Currently, the same irqchip instance is registered for multiple PLIC
and APLIC instances which causes the sbi_list_for_each_entry() loop
in the sbi_irqchip_init() to hang at boot-time.

To address the above issue, register a separate irqchip instance for
each PLIC and APLIC instance.

Fixes: 2dd6eaf680 ("lib: sbi_irqchip: Call driver warm_init from SBI core")
Reported-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
This commit is contained in:
Anup Patel
2024-12-24 13:29:17 +05:30
committed by Anup Patel
parent 551ac0f2d4
commit 7150db29d7
4 changed files with 11 additions and 11 deletions

View File

@@ -12,6 +12,7 @@
#define __IRQCHIP_APLIC_H__
#include <sbi/sbi_types.h>
#include <sbi/sbi_irqchip.h>
#define APLIC_MAX_DELEGATE 16
@@ -30,6 +31,9 @@ struct aplic_delegate_data {
};
struct aplic_data {
/* Private members */
struct sbi_irqchip_device irqchip;
/* Public members */
unsigned long addr;
unsigned long size;
unsigned long num_idc;

View File

@@ -11,8 +11,12 @@
#define __IRQCHIP_PLIC_H__
#include <sbi/sbi_types.h>
#include <sbi/sbi_irqchip.h>
struct plic_data {
/* Private members */
struct sbi_irqchip_device irqchip;
/* Public members */
unsigned long addr;
unsigned long size;
unsigned long num_src;