irqchip fixes for 5.19, take #2

- Gracefully handle failure to request MMIO resources in the GICv3 driver
 
 - Make a static key static in the Apple AIC driver
 
 - Fix the Xilinx intc driver dependency on OF_ADDRESS
 -----BEGIN PGP SIGNATURE-----
 
 iQJDBAABCgAtFiEEn9UcU+C1Yxj9lZw9I9DQutE9ekMFAmK+9tgPHG1hekBrZXJu
 ZWwub3JnAAoJECPQ0LrRPXpDPQUP+wZR+sOzF9lLGtf3fgygJmOmkhWZhDi9t/B/
 hrcStY3eHuK1Qnu7Y4oOzskEK2IFH0LKjyo6cDIgPuJi+64pGq827gQsJld0+XDQ
 U3iiz24FNzKAHYDy+adQmlG935O0Mzm71hxSso7XQie8AktaCwjFLR4q1H0yeaC4
 IZ2rRtEPbJCsqapcyR2I7SkZ0n1BfzIR57lpmxhRZ3iG8PJuhgVH1FX/jvs96jit
 N6RcK1mfB8n2vdg6tK9mqHbLmcbWUY+LUcGglh04o+mvth2wjPXv42/0Ci9I4VMs
 AkaapWBVvzKs3Aq9vwXX8iW1JScnJdFFgOvVzqkZN17KWOusIThW3uh3KzWjEC3b
 lztuSZFoPkGnXXpEYFX1ZHvVrSt+4ChgMPAfpKBbu+WScjm+rR6CTBzTerSdjWkb
 Rhai/TqYGj0b93zqiB/qJUEOqwZk/9Hu8Jc5+GzvYWQKG1kwTKDvYqYCKO0uOriW
 mLaStAkKdA+p12mzHl7CX4qWfa2Tj1Ekwhb1OO1CLyGIqolH+Bf4F38EAOOO5ECs
 A0AiHn5/IGWEf0kn+iFRPrv0+iYhZhLsBhsQkMgcF/F96meXJB1rcuEJr14915GR
 765UvzQ4sggw3fY1A0085ccpOa+5Zl9iJa5nFntQ1H1vUwpBEvQTVLM0rukQVlhN
 z4mKX0aP
 =YqtL
 -----END PGP SIGNATURE-----

Merge tag 'irqchip-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent

Pull irqchip fixes from Marc Zygnier:

 - Gracefully handle failure to request MMIO resources in the GICv3 driver

 - Make a static key static in the Apple AIC driver

 - Fix the Xilinx intc driver dependency on OF_ADDRESS

Link: https://lore.kernel.org/all/20220701133531.1545319-1-maz@kernel.org
This commit is contained in:
Thomas Gleixner 2022-07-06 18:31:59 +02:00
commit 80f2a248a2
3 changed files with 33 additions and 12 deletions

View File

@ -298,7 +298,7 @@ config XTENSA_MX
config XILINX_INTC
bool "Xilinx Interrupt Controller IP"
depends on OF
depends on OF_ADDRESS
select IRQ_DOMAIN
help
Support for the Xilinx Interrupt Controller IP core.

View File

@ -228,7 +228,7 @@
#define AIC_TMR_EL02_PHYS AIC_TMR_GUEST_PHYS
#define AIC_TMR_EL02_VIRT AIC_TMR_GUEST_VIRT
DEFINE_STATIC_KEY_TRUE(use_fast_ipi);
static DEFINE_STATIC_KEY_TRUE(use_fast_ipi);
struct aic_info {
int version;

View File

@ -2042,15 +2042,40 @@ static void __init gic_of_setup_kvm_info(struct device_node *node)
vgic_set_kvm_info(&gic_v3_kvm_info);
}
static void gic_request_region(resource_size_t base, resource_size_t size,
const char *name)
{
if (!request_mem_region(base, size, name))
pr_warn_once(FW_BUG "%s region %pa has overlapping address\n",
name, &base);
}
static void __iomem *gic_of_iomap(struct device_node *node, int idx,
const char *name, struct resource *res)
{
void __iomem *base;
int ret;
ret = of_address_to_resource(node, idx, res);
if (ret)
return IOMEM_ERR_PTR(ret);
gic_request_region(res->start, resource_size(res), name);
base = of_iomap(node, idx);
return base ?: IOMEM_ERR_PTR(-ENOMEM);
}
static int __init gic_of_init(struct device_node *node, struct device_node *parent)
{
void __iomem *dist_base;
struct redist_region *rdist_regs;
struct resource res;
u64 redist_stride;
u32 nr_redist_regions;
int err, i;
dist_base = of_io_request_and_map(node, 0, "GICD");
dist_base = gic_of_iomap(node, 0, "GICD", &res);
if (IS_ERR(dist_base)) {
pr_err("%pOF: unable to map gic dist registers\n", node);
return PTR_ERR(dist_base);
@ -2073,12 +2098,8 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare
}
for (i = 0; i < nr_redist_regions; i++) {
struct resource res;
int ret;
ret = of_address_to_resource(node, 1 + i, &res);
rdist_regs[i].redist_base = of_io_request_and_map(node, 1 + i, "GICR");
if (ret || IS_ERR(rdist_regs[i].redist_base)) {
rdist_regs[i].redist_base = gic_of_iomap(node, 1 + i, "GICR", &res);
if (IS_ERR(rdist_regs[i].redist_base)) {
pr_err("%pOF: couldn't map region %d\n", node, i);
err = -ENODEV;
goto out_unmap_rdist;
@ -2151,7 +2172,7 @@ gic_acpi_parse_madt_redist(union acpi_subtable_headers *header,
pr_err("Couldn't map GICR region @%llx\n", redist->base_address);
return -ENOMEM;
}
request_mem_region(redist->base_address, redist->length, "GICR");
gic_request_region(redist->base_address, redist->length, "GICR");
gic_acpi_register_redist(redist->base_address, redist_base);
return 0;
@ -2174,7 +2195,7 @@ gic_acpi_parse_madt_gicc(union acpi_subtable_headers *header,
redist_base = ioremap(gicc->gicr_base_address, size);
if (!redist_base)
return -ENOMEM;
request_mem_region(gicc->gicr_base_address, size, "GICR");
gic_request_region(gicc->gicr_base_address, size, "GICR");
gic_acpi_register_redist(gicc->gicr_base_address, redist_base);
return 0;
@ -2376,7 +2397,7 @@ gic_acpi_init(union acpi_subtable_headers *header, const unsigned long end)
pr_err("Unable to map GICD registers\n");
return -ENOMEM;
}
request_mem_region(dist->base_address, ACPI_GICV3_DIST_MEM_SIZE, "GICD");
gic_request_region(dist->base_address, ACPI_GICV3_DIST_MEM_SIZE, "GICD");
err = gic_validate_dist_version(acpi_data.dist_base);
if (err) {