Skip to content
Snippets Groups Projects
Commit ec1a454d authored by Jon Hunter's avatar Jon Hunter Committed by Marc Zyngier
Browse files

irqchip/gic: Don't unnecessarily write the IRQ configuration


If the interrupt configuration matches the current configuration, then
don't bother writing the configuration again.

Signed-off-by: default avatarJon Hunter <jonathanh@nvidia.com>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent a2a8fa55
No related branches found
No related tags found
No related merge requests found
...@@ -50,13 +50,17 @@ int gic_configure_irq(unsigned int irq, unsigned int type, ...@@ -50,13 +50,17 @@ int gic_configure_irq(unsigned int irq, unsigned int type,
else if (type & IRQ_TYPE_EDGE_BOTH) else if (type & IRQ_TYPE_EDGE_BOTH)
val |= confmask; val |= confmask;
/* If the current configuration is the same, then we are done */
if (val == oldval)
return 0;
/* /*
* Write back the new configuration, and possibly re-enable * Write back the new configuration, and possibly re-enable
* the interrupt. If we tried to write a new configuration and failed, * the interrupt. If we fail to write a new configuration,
* return an error. * return an error.
*/ */
writel_relaxed(val, base + GIC_DIST_CONFIG + confoff); writel_relaxed(val, base + GIC_DIST_CONFIG + confoff);
if (readl_relaxed(base + GIC_DIST_CONFIG + confoff) != val && val != oldval) if (readl_relaxed(base + GIC_DIST_CONFIG + confoff) != val)
ret = -EINVAL; ret = -EINVAL;
if (sync_access) if (sync_access)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment