aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/irqchip/irq-gic.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-04 21:10:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-04 21:10:13 -0500
commit0d51ce9ca1116e8f4dc87cb51db8dd250327e9bb (patch)
treef845ff44f40f102c5143f94d3c9734e65544712d /drivers/irqchip/irq-gic.c
parent41ecf1404b34d9975eb97f5005d9e4274eaeb76a (diff)
parent1ab68460b1d0671968b35e04f21efcf1ce051916 (diff)
Merge tag 'pm+acpi-4.4-rc1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management and ACPI updates from Rafael Wysocki: "Quite a new features are included this time. First off, the Collaborative Processor Performance Control interface (version 2) defined by ACPI will now be supported on ARM64 along with a cpufreq frontend for CPU performance scaling. Second, ACPI gets a new infrastructure for the early probing of IRQ chips and clock sources (along the lines of the existing similar mechanism for DT). Next, the ACPI core and the generic device properties API will now support a recently introduced hierarchical properties extension of the _DSD (Device Specific Data) ACPI device configuration object. If the ACPI platform firmware uses that extension to organize device properties in a hierarchical way, the kernel will automatically handle it and make those properties available to device drivers via the generic device properties API. It also will be possible to build the ACPICA's AML interpreter debugger into the kernel now and use that to diagnose AML-related problems more efficiently. In the future, this should make it possible to single-step AML execution and do similar things. Interesting stuff, although somewhat experimental at this point. Finally, the PM core gets a new mechanism that can be used by device drivers to distinguish between suspend-to-RAM (based on platform firmware support) and suspend-to-idle (or other variants of system suspend the platform firmware is not involved in) and possibly optimize their device suspend/resume handling accordingly. In addition to that, some existing features are re-organized quite substantially. First, the ACPI-based handling of PCI host bridges on x86 and ia64 is unified and the common code goes into the ACPI core (so as to reduce code duplication and eliminate non-essential differences between the two architectures in that area). Second, the Operating Performance Points (OPP) framework is reorganized to make the code easier to find and follow. Next, the cpufreq core's sysfs interface is reorganized to get rid of the "primary CPU" concept for configurations in which the same performance scaling settings are shared between multiple CPUs. Finally, some interfaces that aren't necessary any more are dropped from the generic power domains framework. On top of the above we have some minor extensions, cleanups and bug fixes in multiple places, as usual. Specifics: - ACPICA update to upstream revision 20150930 (Bob Moore, Lv Zheng). The most significant change is to allow the AML debugger to be built into the kernel. On top of that there is an update related to the NFIT table (the ACPI persistent memory interface) and a few fixes and cleanups. - ACPI CPPC2 (Collaborative Processor Performance Control v2) support along with a cpufreq frontend (Ashwin Chaugule). This can only be enabled on ARM64 at this point. - New ACPI infrastructure for the early probing of IRQ chips and clock sources (Marc Zyngier). - Support for a new hierarchical properties extension of the ACPI _DSD (Device Specific Data) device configuration object allowing the kernel to handle hierarchical properties (provided by the platform firmware this way) automatically and make them available to device drivers via the generic device properties interface (Rafael Wysocki). - Generic device properties API extension to obtain an index of certain string value in an array of strings, along the lines of of_property_match_string(), but working for all of the supported firmware node types, and support for the "dma-names" device property based on it (Mika Westerberg). - ACPI core fix to parse the MADT (Multiple APIC Description Table) entries in the order expected by platform firmware (and mandated by the specification) to avoid confusion on systems with more than 255 logical CPUs (Lukasz Anaczkowski). - Consolidation of the ACPI-based handling of PCI host bridges on x86 and ia64 (Jiang Liu). - ACPI core fixes to ensure that the correct IRQ number is used to represent the SCI (System Control Interrupt) in the cases when it has been re-mapped (Chen Yu). - New ACPI backlight quirk for Lenovo IdeaPad S405 (Hans de Goede). - ACPI EC driver fixes (Lv Zheng). - Assorted ACPI fixes and cleanups (Dan Carpenter, Insu Yun, Jiri Kosina, Rami Rosen, Rasmus Villemoes). - New mechanism in the PM core allowing drivers to check if the platform firmware is going to be involved in the upcoming system suspend or if it has been involved in the suspend the system is resuming from at the moment (Rafael Wysocki). This should allow drivers to optimize their suspend/resume handling in some cases and the changes include a couple of users of it (the i8042 input driver, PCI PM). - PCI PM fix to prevent runtime-suspended devices with PME enabled from being resumed during system suspend even if they aren't configured to wake up the system from sleep (Rafael Wysocki). - New mechanism to report the number of a wakeup IRQ that woke up the system from sleep last time (Alexandra Yates). - Removal of unused interfaces from the generic power domains framework and fixes related to latency measurements in that code (Ulf Hansson, Daniel Lezcano). - cpufreq core sysfs interface rework to make it handle CPUs that share performance scaling settings (represented by a common cpufreq policy object) more symmetrically (Viresh Kumar). This should help to simplify the CPU offline/online handling among other things. - cpufreq core fixes and cleanups (Viresh Kumar). - intel_pstate fixes related to the Turbo Activation Ratio (TAR) mechanism on client platforms which causes the turbo P-states range to vary depending on platform firmware settings (Srinivas Pandruvada). - intel_pstate sysfs interface fix (Prarit Bhargava). - Assorted cpufreq driver (imx, tegra20, powernv, integrator) fixes and cleanups (Bai Ping, Bartlomiej Zolnierkiewicz, Shilpasri G Bhat, Luis de Bethencourt). - cpuidle mvebu driver cleanups (Russell King). - OPP (Operating Performance Points) framework code reorganization to make it more maintainable (Viresh Kumar). - Intel Broxton support for the RAPL (Running Average Power Limits) power capping driver (Amy Wiles). - Assorted power management code fixes and cleanups (Dan Carpenter, Geert Uytterhoeven, Geliang Tang, Luis de Bethencourt, Rasmus Villemoes)" * tag 'pm+acpi-4.4-rc1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (108 commits) cpufreq: postfix policy directory with the first CPU in related_cpus cpufreq: create cpu/cpufreq/policyX directories cpufreq: remove cpufreq_sysfs_{create|remove}_file() cpufreq: create cpu/cpufreq at boot time cpufreq: Use cpumask_copy instead of cpumask_or to copy a mask cpufreq: ondemand: Drop unnecessary locks from update_sampling_rate() PM / Domains: Merge measurements for PM QoS device latencies PM / Domains: Don't measure ->start|stop() latency in system PM callbacks PM / clk: Fix broken build due to non-matching code and header #ifdefs ACPI / Documentation: add copy_dsdt to ACPI format options ACPI / sysfs: correctly check failing memory allocation ACPI / video: Add a quirk to force native backlight on Lenovo IdeaPad S405 ACPI / CPPC: Fix potential memory leak ACPI / CPPC: signedness bug in register_pcc_channel() ACPI / PAD: power_saving_thread() is not freezable ACPI / PM: Fix incorrect wakeup IRQ setting during suspend-to-idle ACPI: Using correct irq when waiting for events ACPI: Use correct IRQ when uninstalling ACPI interrupt handler cpuidle: mvebu: disable the bind/unbind attributes and use builtin_platform_driver cpuidle: mvebu: clean up multiple platform drivers ...
Diffstat (limited to 'drivers/irqchip/irq-gic.c')
-rw-r--r--drivers/irqchip/irq-gic.c69
1 files changed, 35 insertions, 34 deletions
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 1d0e76855106..515c823c1c95 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -41,7 +41,6 @@
41#include <linux/irqchip.h> 41#include <linux/irqchip.h>
42#include <linux/irqchip/chained_irq.h> 42#include <linux/irqchip/chained_irq.h>
43#include <linux/irqchip/arm-gic.h> 43#include <linux/irqchip/arm-gic.h>
44#include <linux/irqchip/arm-gic-acpi.h>
45 44
46#include <asm/cputype.h> 45#include <asm/cputype.h>
47#include <asm/irq.h> 46#include <asm/irq.h>
@@ -1219,7 +1218,7 @@ IRQCHIP_DECLARE(pl390, "arm,pl390", gic_of_init);
1219#endif 1218#endif
1220 1219
1221#ifdef CONFIG_ACPI 1220#ifdef CONFIG_ACPI
1222static phys_addr_t dist_phy_base, cpu_phy_base __initdata; 1221static phys_addr_t cpu_phy_base __initdata;
1223 1222
1224static int __init 1223static int __init
1225gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, 1224gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
@@ -1247,61 +1246,57 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
1247 return 0; 1246 return 0;
1248} 1247}
1249 1248
1250static int __init 1249/* The things you have to do to just *count* something... */
1251gic_acpi_parse_madt_distributor(struct acpi_subtable_header *header, 1250static int __init acpi_dummy_func(struct acpi_subtable_header *header,
1252 const unsigned long end) 1251 const unsigned long end)
1253{ 1252{
1254 struct acpi_madt_generic_distributor *dist; 1253 return 0;
1254}
1255 1255
1256 dist = (struct acpi_madt_generic_distributor *)header; 1256static bool __init acpi_gic_redist_is_present(void)
1257{
1258 return acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR,
1259 acpi_dummy_func, 0) > 0;
1260}
1257 1261
1258 if (BAD_MADT_ENTRY(dist, end)) 1262static bool __init gic_validate_dist(struct acpi_subtable_header *header,
1259 return -EINVAL; 1263 struct acpi_probe_entry *ape)
1264{
1265 struct acpi_madt_generic_distributor *dist;
1266 dist = (struct acpi_madt_generic_distributor *)header;
1260 1267
1261 dist_phy_base = dist->base_address; 1268 return (dist->version == ape->driver_data &&
1262 return 0; 1269 (dist->version != ACPI_MADT_GIC_VERSION_NONE ||
1270 !acpi_gic_redist_is_present()));
1263} 1271}
1264 1272
1265int __init 1273#define ACPI_GICV2_DIST_MEM_SIZE (SZ_4K)
1266gic_v2_acpi_init(struct acpi_table_header *table) 1274#define ACPI_GIC_CPU_IF_MEM_SIZE (SZ_8K)
1275
1276static int __init gic_v2_acpi_init(struct acpi_subtable_header *header,
1277 const unsigned long end)
1267{ 1278{
1279 struct acpi_madt_generic_distributor *dist;
1268 void __iomem *cpu_base, *dist_base; 1280 void __iomem *cpu_base, *dist_base;
1269 struct fwnode_handle *domain_handle; 1281 struct fwnode_handle *domain_handle;
1270 int count; 1282 int count;
1271 1283
1272 /* Collect CPU base addresses */ 1284 /* Collect CPU base addresses */
1273 count = acpi_parse_entries(ACPI_SIG_MADT, 1285 count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_INTERRUPT,
1274 sizeof(struct acpi_table_madt), 1286 gic_acpi_parse_madt_cpu, 0);
1275 gic_acpi_parse_madt_cpu, table,
1276 ACPI_MADT_TYPE_GENERIC_INTERRUPT, 0);
1277 if (count <= 0) { 1287 if (count <= 0) {
1278 pr_err("No valid GICC entries exist\n"); 1288 pr_err("No valid GICC entries exist\n");
1279 return -EINVAL; 1289 return -EINVAL;
1280 } 1290 }
1281 1291
1282 /*
1283 * Find distributor base address. We expect one distributor entry since
1284 * ACPI 5.1 spec neither support multi-GIC instances nor GIC cascade.
1285 */
1286 count = acpi_parse_entries(ACPI_SIG_MADT,
1287 sizeof(struct acpi_table_madt),
1288 gic_acpi_parse_madt_distributor, table,
1289 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR, 0);
1290 if (count <= 0) {
1291 pr_err("No valid GICD entries exist\n");
1292 return -EINVAL;
1293 } else if (count > 1) {
1294 pr_err("More than one GICD entry detected\n");
1295 return -EINVAL;
1296 }
1297
1298 cpu_base = ioremap(cpu_phy_base, ACPI_GIC_CPU_IF_MEM_SIZE); 1292 cpu_base = ioremap(cpu_phy_base, ACPI_GIC_CPU_IF_MEM_SIZE);
1299 if (!cpu_base) { 1293 if (!cpu_base) {
1300 pr_err("Unable to map GICC registers\n"); 1294 pr_err("Unable to map GICC registers\n");
1301 return -ENOMEM; 1295 return -ENOMEM;
1302 } 1296 }
1303 1297
1304 dist_base = ioremap(dist_phy_base, ACPI_GICV2_DIST_MEM_SIZE); 1298 dist = (struct acpi_madt_generic_distributor *)header;
1299 dist_base = ioremap(dist->base_address, ACPI_GICV2_DIST_MEM_SIZE);
1305 if (!dist_base) { 1300 if (!dist_base) {
1306 pr_err("Unable to map GICD registers\n"); 1301 pr_err("Unable to map GICD registers\n");
1307 iounmap(cpu_base); 1302 iounmap(cpu_base);
@@ -1332,4 +1327,10 @@ gic_v2_acpi_init(struct acpi_table_header *table)
1332 acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle); 1327 acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle);
1333 return 0; 1328 return 0;
1334} 1329}
1330IRQCHIP_ACPI_DECLARE(gic_v2, ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR,
1331 gic_validate_dist, ACPI_MADT_GIC_VERSION_V2,
1332 gic_v2_acpi_init);
1333IRQCHIP_ACPI_DECLARE(gic_v2_maybe, ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR,
1334 gic_validate_dist, ACPI_MADT_GIC_VERSION_NONE,
1335 gic_v2_acpi_init);
1335#endif 1336#endif