Register an ACPI hook in the ACPI interrupt management code for GICv5 to retrieve the ACPI interrupt controller handle (if any) of the controller handling a specific GSI, by updating the acpi_set_irq_model() call with the gic_v5_get_gsi_handle() function pointer parameter. gicv5_get_gsi_handle() allows ACPI core to detect the ACPI handle of the controller that manages a specific GSI interrupt. Update the IWB driver to clear device dependencies in ACPI core once the IWB driver has probed.
Unified · Split
| @@ -269,6 +269,8 @@ static int gicv5_iwb_device_probe(struct platform_device *pdev) · 268 unmodified lines | ||
| 269 | 269 | if (IS_ERR(iwb_node)) |
| 270 | 270 | return PTR_ERR(iwb_node); |
| 271 | 271 | |
| 272 | + acpi_device_clear_deps(&pdev->dev); | |
| 273 | + | |
| 272 | 274 | return 0; |
| 273 | 275 | } |
| 274 | 276 | |
| @@ -1231,6 +1231,14 @@ static struct fwnode_handle *gic_v5_get_gsi_domain_id(u32 gsi) · 1230 unmodified lines | ||
| 1231 | 1231 | return gsi_domain_handle; |
| 1232 | 1232 | } |
| 1233 | 1233 | |
| 1234 | +static acpi_handle gic_v5_get_gsi_handle(u32 gsi) | |
| 1235 | +{ | |
| 1236 | + if (FIELD_GET(GICV5_GSI_IC_TYPE, gsi) == GICV5_GSI_IWB_TYPE) | |
| 1237 | + return iort_iwb_handle(FIELD_GET(GICV5_GSI_IWB_FRAME_ID, gsi)); | |
| 1238 | + | |
| 1239 | + return NULL; | |
| 1240 | +} | |
| 1241 | + | |
| 1234 | 1242 | static int __init gic_acpi_init(union acpi_subtable_headers *header, const unsigned long end) |
| 1235 | 1243 | { |
| 1236 | 1244 | struct acpi_madt_gicv5_irs *irs = (struct acpi_madt_gicv5_irs *)header; |
| @@ -1251,7 +1259,8 @@ static int __init gic_acpi_init(union acpi_subtable_headers *header, const unsig · 14 unmodified lines | ||
| 1251 | 1259 | if (ret) |
| 1252 | 1260 | goto out_irs; |
| 1253 | 1261 | |
| 1254 | − acpi_set_irq_model(ACPI_IRQ_MODEL_GIC_V5, gic_v5_get_gsi_domain_id, NULL); | |
| 1262 | + acpi_set_irq_model(ACPI_IRQ_MODEL_GIC_V5, gic_v5_get_gsi_domain_id, | |
| 1263 | + gic_v5_get_gsi_handle); | |
| 1255 | 1264 | |
| 1256 | 1265 | return 0; |
| 1257 | 1266 | |