Merge tag 'irq-core-2022-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / drivers / irqchip / irq-gic-v3.c
index 2d25bca..262658f 100644 (file)
@@ -1783,7 +1783,7 @@ static void gic_enable_nmi_support(void)
         * the security state of the GIC (controlled by the GICD_CTRL.DS bit)
         * and if Group 0 interrupts can be delivered to Linux in the non-secure
         * world as FIQs (controlled by the SCR_EL3.FIQ bit). These affect the
-        * the ICC_PMR_EL1 register and the priority that software assigns to
+        * ICC_PMR_EL1 register and the priority that software assigns to
         * interrupts:
         *
         * GICD_CTRL.DS | SCR_EL3.FIQ | ICC_PMR_EL1 | Group 1 priority
@@ -2381,11 +2381,17 @@ static void __init gic_acpi_setup_kvm_info(void)
        vgic_set_kvm_info(&gic_v3_kvm_info);
 }
 
+static struct fwnode_handle *gsi_domain_handle;
+
+static struct fwnode_handle *gic_v3_get_gsi_domain_id(u32 gsi)
+{
+       return gsi_domain_handle;
+}
+
 static int __init
 gic_acpi_init(union acpi_subtable_headers *header, const unsigned long end)
 {
        struct acpi_madt_generic_distributor *dist;
-       struct fwnode_handle *domain_handle;
        size_t size;
        int i, err;
 
@@ -2417,18 +2423,18 @@ gic_acpi_init(union acpi_subtable_headers *header, const unsigned long end)
        if (err)
                goto out_redist_unmap;
 
-       domain_handle = irq_domain_alloc_fwnode(&dist->base_address);
-       if (!domain_handle) {
+       gsi_domain_handle = irq_domain_alloc_fwnode(&dist->base_address);
+       if (!gsi_domain_handle) {
                err = -ENOMEM;
                goto out_redist_unmap;
        }
 
        err = gic_init_bases(acpi_data.dist_base, acpi_data.redist_regs,
-                            acpi_data.nr_redist_regions, 0, domain_handle);
+                            acpi_data.nr_redist_regions, 0, gsi_domain_handle);
        if (err)
                goto out_fwhandle_free;
 
-       acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle);
+       acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, gic_v3_get_gsi_domain_id);
 
        if (static_branch_likely(&supports_deactivate_key))
                gic_acpi_setup_kvm_info();
@@ -2436,7 +2442,7 @@ gic_acpi_init(union acpi_subtable_headers *header, const unsigned long end)
        return 0;
 
 out_fwhandle_free:
-       irq_domain_free_fwnode(domain_handle);
+       irq_domain_free_fwnode(gsi_domain_handle);
 out_redist_unmap:
        for (i = 0; i < acpi_data.nr_redist_regions; i++)
                if (acpi_data.redist_regs[i].redist_base)