From: Kevin Hilman <khilman(a)linaro.org>
Using the current exynos_defconfig on the exynos5422-odroid-xu3, only
6 of 8 CPUs come online with MCPM boot. CPU0 is an A7, CPUs 1-4 are
A15s and CPU5-7 are the other A7s, but with the current code, CPUs 5
and 7 do not boot:
[...]
Exynos MCPM support installed
CPU1: update cpu_capacity 1535
CPU1: thread -1, cpu 0, socket 0, mpidr 80000000
CPU2: update cpu_capacity 1535
CPU2: thread -1, cpu 1, socket 0, mpidr 80000001
CPU3: update cpu_capacity 1535
CPU3: thread -1, cpu 2, socket 0, mpidr 80000002
CPU4: update cpu_capacity 1535
CPU4: thread -1, cpu 3, socket 0, mpidr 80000003
CPU5: failed to come online
CPU6: update cpu_capacity 448
CPU6: thread -1, cpu 2, socket 1, mpidr 80000102
CPU7: failed to come online
Brought up 6 CPUs
CPU: WARNING: CPU(s) started in wrong/inconsistent modes
(primary CPU mode 0x13)
CPU: This may indicate a broken bootloader or firmware.
Thanks to a tip from Abhilash, this patch gets all 8 CPUs booting
again, but the warning about CPUs started in inconsistent modes
remains. Also, not being terribly familiar with Exynos internals,
it's not at all obvious to me why this register write (done for *all*
secondaries) makes things work works for the 2 secondary CPUs that
didn't come online. It's also not obvious whether this is the right
general fix, since it doesn't seem to be needed on other 542x or 5800
platforms.
I suspect the "right" fix is in the bootloader someplace, but not
knowing this hardware well, I'm not sure if the fix is in u-boot
proper, or somewhere in the binary blobs (bl1/bl2/tz) that start
before u-boot. The u-boot I'm using is from the hardkernel u-boot
repo[1], and I'd welcome any suggestions to try. I'm able to rebuild
my own u-boot from there, but only have binaries for bl1/bl2/tz.
[1] branch "odroidxu3-v2012.07" of: https://github.com/hardkernel/u-boot.git
Cc: Mauro Ribeiro <mauro.ribeiro(a)hardkernel.com>
Cc: Abhilash Kesavan <a.kesavan(a)samsung.com>,
Cc: Andrew Bresticker <abrestic(a)chromium.org>
Cc: Doug Anderson <dianders(a)chromium.org>
Cc: Nicolas Pitre <nicolas.pitre(a)linaro.org>
Signed-off-by: Kevin Hilman <khilman(a)linaro.org>
---
arch/arm/mach-exynos/mcpm-exynos.c | 2 ++
arch/arm/mach-exynos/regs-pmu.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c
index b0d3c2e876fb..612a770d5284 100644
--- a/arch/arm/mach-exynos/mcpm-exynos.c
+++ b/arch/arm/mach-exynos/mcpm-exynos.c
@@ -88,6 +88,8 @@ static int exynos_power_up(unsigned int cpu, unsigned int cluster)
cluster >= EXYNOS5420_NR_CLUSTERS)
return -EINVAL;
+ pmu_raw_writel(0x1, S5P_PMU_SPARE2);
+
/*
* Since this is called with IRQs enabled, and no arch_spin_lock_irq
* variant exists, we need to disable IRQs manually here.
diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h
index b5f4406fc1b5..70d9eb5a4fcc 100644
--- a/arch/arm/mach-exynos/regs-pmu.h
+++ b/arch/arm/mach-exynos/regs-pmu.h
@@ -49,6 +49,7 @@
#define S5P_INFORM5 0x0814
#define S5P_INFORM6 0x0818
#define S5P_INFORM7 0x081C
+#define S5P_PMU_SPARE2 0x0908
#define S5P_PMU_SPARE3 0x090C
#define EXYNOS_IROM_DATA2 0x0988
--
2.1.3
From: Rob Clark <robdclark(a)gmail.com>
For devices which have constraints about maximum number of segments in
an sglist. For example, a device which could only deal with contiguous
buffers would set max_segment_count to 1.
The initial motivation is for devices sharing buffers via dma-buf,
to allow the buffer exporter to know the constraints of other
devices which have attached to the buffer. The dma_mask and fields
in 'struct device_dma_parameters' tell the exporter everything else
that is needed, except whether the importer has constraints about
maximum number of segments.
Signed-off-by: Rob Clark <robdclark(a)gmail.com>
[sumits: Minor updates wrt comments]
Signed-off-by: Sumit Semwal <sumit.semwal(a)linaro.org>
---
v3: include Robin Murphy's fix[1] for handling '0' as a value for
max_segment_count
v2: minor updates wrt comments on the first version
[1]: http://article.gmane.org/gmane.linux.kernel.iommu/8175/
include/linux/device.h | 1 +
include/linux/dma-mapping.h | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/include/linux/device.h b/include/linux/device.h
index fb506738f7b7..a32f9b67315c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -647,6 +647,7 @@ struct device_dma_parameters {
* sg limitations.
*/
unsigned int max_segment_size;
+ unsigned int max_segment_count; /* INT_MAX for unlimited */
unsigned long segment_boundary_mask;
};
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index c3007cb4bfa6..d3351a36d5ec 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -154,6 +154,25 @@ static inline unsigned int dma_set_max_seg_size(struct device *dev,
return -EIO;
}
+#define DMA_SEGMENTS_MAX_SEG_COUNT ((unsigned int) INT_MAX)
+
+static inline unsigned int dma_get_max_seg_count(struct device *dev)
+{
+ if (dev->dma_parms && dev->dma_parms->max_segment_count)
+ return dev->dma_parms->max_segment_count;
+ return DMA_SEGMENTS_MAX_SEG_COUNT;
+}
+
+static inline int dma_set_max_seg_count(struct device *dev,
+ unsigned int count)
+{
+ if (dev->dma_parms) {
+ dev->dma_parms->max_segment_count = count;
+ return 0;
+ }
+ return -EIO;
+}
+
static inline unsigned long dma_get_seg_boundary(struct device *dev)
{
return dev->dma_parms ?
--
1.9.1
Hi Rafael,
The aim of this series is to stop managing cpufreq sysfs directories on CPU
hotplugs.
Currently on removal of a 'cpu != policy->cpu', we remove its sysfs directories
by removing the soft-link. And on removal of policy->cpu, we migrate the sysfs
directories to the next cpu. But if policy->cpu was the last CPU, we remove the
policy completely and allocate it again as soon as the CPUs come back. This has
shortcomings:
- Code Complexity
- Slower hotplug
- sysfs file permissions are reset after all policy->cpus are offlined
- CPUFreq stats history lost after all policy->cpus are offlined
- Special management of sysfs stuff during suspend/resume
To make things simple we stop playing with sysfs files unless the driver is
getting removed. Also the policy is kept intact to be used later.
First few patches provide a clean base for others *more important* patches.
Rebased-over: your bleeding edge branch as there were dependencies on my earlier
patches.
Pushed here:
git://git.linaro.org/people/viresh.kumar/linux.git cpufreq/core/sysfs
v1->V2:
- Dropped the idea of using policy-lists for getting policy for any cpu
- Also dropped fallback list and its per-cpu variable
- Stopped cleaning cpufreq_cpu_data and doing list_del(policy) on logical
hotplug.
- Added support for physical hotplug of CPUs (Untested).
@Srivatsa: Can you please have a look at the above change? I have cc'd you only
on this one.
Saravana Kannan (1):
cpufreq: Track cpu managing sysfs kobjects separately
Cc: Srivatsa Bhat <srivatsa(a)mit.edu>
Viresh Kumar (19):
cpufreq: Add doc style comment about cpufreq_cpu_{get|put}()
cpufreq: Merge __cpufreq_add_dev() and cpufreq_add_dev()
cpufreq: Throw warning when we try to get policy for an invalid CPU
cpufreq: Keep a single path for adding managed CPUs
cpufreq: Clear policy->cpus even for the last CPU
cpufreq: Create for_each_{in}active_policy()
cpufreq: Call schedule_work() for the last active policy
cpufreq: Don't clear cpufreq_cpu_data and policy list for inactive
policies
cpufreq: Get rid of cpufreq_cpu_data_fallback
cpufreq: Don't traverse list of all policies for adding policy for a
cpu
cpufreq: Manage governor usage history with 'policy->last_governor'
cpufreq: Mark policy->governor = NULL for inactive policies
cpufreq: Don't allow updating inactive-policies from sysfs
cpufreq: Stop migrating sysfs files on hotplug
cpufreq: Remove cpufreq_update_policy()
cpufreq: Initialize policy->kobj while allocating policy
cpufreq: Call cpufreq_policy_put_kobj() from cpufreq_policy_free()
cpufreq: Restart governor as soon as possible
cpufreq: Add support for physical hoplug of CPUs
drivers/cpufreq/cpufreq.c | 593 ++++++++++++++++++++++++++--------------------
include/linux/cpufreq.h | 5 +-
2 files changed, 340 insertions(+), 258 deletions(-)
--
2.3.0.rc0.44.ga94655d
This patchset consolidates several changes in the capacity and the usage
tracking of the CPU. It provides a frequency invariant metric of the usage of
CPUs and generally improves the accuracy of load/usage tracking in the
scheduler. The frequency invariant metric is the foundation required for the
consolidation of cpufreq and implementation of a fully invariant load tracking.
These are currently WIP and require several changes to the load balancer
(including how it will use and interprets load and capacity metrics) and
extensive validation. The frequency invariance is done with
arch_scale_freq_capacity and this patchset doesn't provide the backends of
the function which are architecture dependent.
As discussed at LPC14, Morten and I have consolidated our changes into a single
patchset to make it easier to review and merge.
During load balance, the scheduler evaluates the number of tasks that a group
of CPUs can handle. The current method assumes that tasks have a fix load of
SCHED_LOAD_SCALE and CPUs have a default capacity of SCHED_CAPACITY_SCALE.
This assumption generates wrong decision by creating ghost cores or by
removing real ones when the original capacity of CPUs is different from the
default SCHED_CAPACITY_SCALE. With this patch set, we don't try anymore to
evaluate the number of available cores based on the group_capacity but instead
we evaluate the usage of a group and compare it with its capacity.
This patchset mainly replaces the old capacity_factor method by a new one and
keeps the general policy almost unchanged. These new metrics will be also used
in later patches.
The CPU usage is based on a running time tracking version of the current
implementation of the load average tracking. I also have a version that is
based on the new implementation proposal [1] but I haven't provide the patches
and results as [1] is still under review. I can provide change above [1] to
change how CPU usage is computed and to adapt to new mecanism.
Change since V9
- add a dedicated patch for removing unused capacity_orig
- update some comments and fix typo
- change the condition for actively migrating task on CPU with higher capacity
Change since V8
- reorder patches
Change since V7
- add freq invariance for usage tracking
- add freq invariance for scale_rt
- update comments and commits' message
- fix init of utilization_avg_contrib
- fix prefer_sibling
Change since V6
- add group usage tracking
- fix some commits' messages
- minor fix like comments and argument order
Change since V5
- remove patches that have been merged since v5 : patches 01, 02, 03, 04, 05, 07
- update commit log and add more details on the purpose of the patches
- fix/remove useless code with the rebase on patchset [2]
- remove capacity_orig in sched_group_capacity as it is not used
- move code in the right patch
- add some helper function to factorize code
Change since V4
- rebase to manage conflicts with changes in selection of busiest group
Change since V3:
- add usage_avg_contrib statistic which sums the running time of tasks on a rq
- use usage_avg_contrib instead of runnable_avg_sum for cpu_utilization
- fix replacement power by capacity
- update some comments
Change since V2:
- rebase on top of capacity renaming
- fix wake_affine statistic update
- rework nohz_kick_needed
- optimize the active migration of a task from CPU with reduced capacity
- rename group_activity by group_utilization and remove unused total_utilization
- repair SD_PREFER_SIBLING and use it for SMT level
- reorder patchset to gather patches with same topics
Change since V1:
- add 3 fixes
- correct some commit messages
- replace capacity computation by activity
- take into account current cpu capacity
[1] https://lkml.org/lkml/2014/10/10/131
[2] https://lkml.org/lkml/2014/7/25/589
Morten Rasmussen (2):
sched: Track group sched_entity usage contributions
sched: Make sched entity usage tracking scale-invariant
Vincent Guittot (9):
sched: add utilization_avg_contrib
sched: remove frequency scaling from cpu_capacity
sched: make scale_rt invariant with frequency
sched: add per rq cpu_capacity_orig
sched: get CPU's usage statistic
sched: replace capacity_factor by usage
sched; remove unused capacity_orig from
sched: add SD_PREFER_SIBLING for SMT level
sched: move cfs task on a CPU with higher capacity
include/linux/sched.h | 21 ++-
kernel/sched/core.c | 15 +--
kernel/sched/debug.c | 12 +-
kernel/sched/fair.c | 366 +++++++++++++++++++++++++++++++-------------------
kernel/sched/sched.h | 15 ++-
5 files changed, 271 insertions(+), 158 deletions(-)
--
1.9.1
Some ARM platforms mux the PMU interrupt of every core into a single
SPI. On such platforms if the PMU of any core except 0 raises an interrupt
then it cannot be serviced and eventually, if you are lucky, the spurious
irq detection might forcefully disable the interrupt.
On these SoCs it is not possible to determine which core raised the
interrupt so workaround this issue by queuing irqwork on the other
cores whenever the primary interrupt handler is unable to service the
interrupt.
The u8500 platform has an alternative workaround that dynamically alters
the affinity of the PMU interrupt. This workaround logic is no longer
required so the original code is removed as is the hook it relied upon.
Tested on imx6q (which has fours cores/PMUs all muxed to a single SPI).
Signed-off-by: Daniel Thompson <daniel.thompson(a)linaro.org>
---
Notes:
Thanks to Lucas Stach, Russell King and Thomas Gleixner for critiquing
an older, completely different way to tackle the same problem.
arch/arm/include/asm/pmu.h | 10 +++++
arch/arm/kernel/perf_event.c | 11 ++---
arch/arm/kernel/perf_event_cpu.c | 94 ++++++++++++++++++++++++++++++++++++++++
arch/arm/mach-ux500/cpu-db8500.c | 29 -------------
4 files changed, 107 insertions(+), 37 deletions(-)
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
index 0b648c541293..36472c3cc283 100644
--- a/arch/arm/include/asm/pmu.h
+++ b/arch/arm/include/asm/pmu.h
@@ -81,6 +81,12 @@ struct pmu_hw_events {
raw_spinlock_t pmu_lock;
};
+struct arm_pmu_work {
+ struct irq_work work;
+ struct arm_pmu *arm_pmu;
+ atomic_t ret;
+};
+
struct arm_pmu {
struct pmu pmu;
cpumask_t active_irqs;
@@ -101,6 +107,7 @@ struct arm_pmu {
void (*reset)(void *);
int (*request_irq)(struct arm_pmu *, irq_handler_t handler);
void (*free_irq)(struct arm_pmu *);
+ irqreturn_t (*handle_irq_none)(struct arm_pmu *);
int (*map_event)(struct perf_event *event);
int num_events;
atomic_t active_events;
@@ -108,6 +115,9 @@ struct arm_pmu {
u64 max_period;
struct platform_device *plat_device;
struct pmu_hw_events *(*get_hw_events)(void);
+ int single_irq;
+ struct arm_pmu_work __percpu *work;
+ atomic_t remaining_work;
};
#define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu))
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index b50a770f8c99..0792c913b9bb 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -306,22 +306,17 @@ validate_group(struct perf_event *event)
static irqreturn_t armpmu_dispatch_irq(int irq, void *dev)
{
struct arm_pmu *armpmu;
- struct platform_device *plat_device;
- struct arm_pmu_platdata *plat;
int ret;
u64 start_clock, finish_clock;
if (irq_is_percpu(irq))
dev = *(void **)dev;
armpmu = dev;
- plat_device = armpmu->plat_device;
- plat = dev_get_platdata(&plat_device->dev);
start_clock = sched_clock();
- if (plat && plat->handle_irq)
- ret = plat->handle_irq(irq, dev, armpmu->handle_irq);
- else
- ret = armpmu->handle_irq(irq, dev);
+ ret = armpmu->handle_irq(irq, dev);
+ if (ret == IRQ_NONE && armpmu->handle_irq_none)
+ ret = armpmu->handle_irq_none(dev);
finish_clock = sched_clock();
perf_sample_event_took(finish_clock - start_clock);
diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c
index eb2c4d55666b..e7153dc3b489 100644
--- a/arch/arm/kernel/perf_event_cpu.c
+++ b/arch/arm/kernel/perf_event_cpu.c
@@ -88,6 +88,75 @@ static void cpu_pmu_disable_percpu_irq(void *data)
disable_percpu_irq(irq);
}
+/*
+ * Workaround logic that is distributed to all cores if the PMU has only
+ * a single IRQ and the CPU receiving that IRQ cannot handle it. Its
+ * job is to try to service the interrupt on the current CPU. It will
+ * also enable the IRQ again if all the other CPUs have already tried to
+ * service it.
+ */
+static void cpu_pmu_do_percpu_work(struct irq_work *w)
+{
+ struct arm_pmu_work *work = container_of(w, struct arm_pmu_work, work);
+ struct arm_pmu *cpu_pmu = work->arm_pmu;
+
+ atomic_set(&work->ret,
+ cpu_pmu->handle_irq(cpu_pmu->single_irq, cpu_pmu));
+
+ if (atomic_dec_and_test(&cpu_pmu->remaining_work))
+ enable_irq(cpu_pmu->single_irq);
+}
+
+/*
+ * This callback, which is enabled only on SMP platforms that are
+ * running with a single IRQ, is called when the PMU handler running in
+ * the current CPU cannot service the interrupt.
+ *
+ * It will disable the interrupt and distribute irqwork to all other
+ * processors in the system. Hopefully one of them will clear the
+ * interrupt...
+ */
+static irqreturn_t cpu_pmu_handle_irq_none(struct arm_pmu *cpu_pmu)
+{
+ int num_online = num_online_cpus();
+ irqreturn_t ret = IRQ_NONE;
+ int cpu, cret;
+
+ if (num_online <= 1)
+ return IRQ_NONE;
+
+ disable_irq_nosync(cpu_pmu->single_irq);
+ atomic_add(num_online, &cpu_pmu->remaining_work);
+ smp_mb__after_atomic();
+
+ for_each_online_cpu(cpu) {
+ struct arm_pmu_work *work = per_cpu_ptr(cpu_pmu->work, cpu);
+
+ if (cpu == smp_processor_id())
+ continue;
+
+ /*
+ * We can be extremely relaxed about memory ordering
+ * here. All we are doing is gathering information
+ * about the past to help us give a return value that
+ * will keep the spurious interrupt detector both happy
+ * *and* functional. We are not shared so we can
+ * tolerate the occasional spurious IRQ_HANDLED.
+ */
+ cret = atomic_read(&work->ret);
+ if (cret != IRQ_NONE)
+ ret = cret;
+
+ if (!irq_work_queue_on(&work->work, cpu))
+ atomic_dec(&cpu_pmu->remaining_work);
+ }
+
+ if (atomic_dec_and_test(&cpu_pmu->remaining_work))
+ enable_irq(cpu_pmu->single_irq);
+
+ return ret;
+}
+
static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu)
{
int i, irq, irqs;
@@ -107,6 +176,9 @@ static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu)
if (irq >= 0)
free_irq(irq, cpu_pmu);
}
+
+ cpu_pmu->handle_irq_none = cpu_pmu_handle_irq_none;
+ free_percpu(cpu_pmu->work);
}
}
@@ -162,6 +234,28 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
cpumask_set_cpu(i, &cpu_pmu->active_irqs);
}
+
+ /*
+ * If we are running SMP and have only one interrupt source
+ * then get ready to share that single irq among the cores.
+ */
+ if (nr_cpu_ids > 1 && irqs == 1) {
+ cpu_pmu->single_irq = platform_get_irq(pmu_device, 0);
+ cpu_pmu->work = alloc_percpu(struct arm_pmu_work);
+ if (!cpu_pmu->work) {
+ pr_err("no memory for shared IRQ workaround\n");
+ return -ENOMEM;
+ }
+
+ for_each_possible_cpu(i) {
+ struct arm_pmu_work *w =
+ per_cpu_ptr(cpu_pmu->work, i);
+ init_irq_work(&w->work, cpu_pmu_do_percpu_work);
+ w->arm_pmu = cpu_pmu;
+ }
+
+ cpu_pmu->handle_irq_none = cpu_pmu_handle_irq_none;
+ }
}
return 0;
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 6f63954c8bde..917774999c5c 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -12,8 +12,6 @@
#include <linux/init.h>
#include <linux/device.h>
#include <linux/amba/bus.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/mfd/abx500/ab8500.h>
@@ -23,7 +21,6 @@
#include <linux/regulator/machine.h>
#include <linux/random.h>
-#include <asm/pmu.h>
#include <asm/mach/map.h>
#include "setup.h"
@@ -99,30 +96,6 @@ static void __init u8500_map_io(void)
iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc));
}
-/*
- * The PMU IRQ lines of two cores are wired together into a single interrupt.
- * Bounce the interrupt to the other core if it's not ours.
- */
-static irqreturn_t db8500_pmu_handler(int irq, void *dev, irq_handler_t handler)
-{
- irqreturn_t ret = handler(irq, dev);
- int other = !smp_processor_id();
-
- if (ret == IRQ_NONE && cpu_online(other))
- irq_set_affinity(irq, cpumask_of(other));
-
- /*
- * We should be able to get away with the amount of IRQ_NONEs we give,
- * while still having the spurious IRQ detection code kick in if the
- * interrupt really starts hitting spuriously.
- */
- return ret;
-}
-
-static struct arm_pmu_platdata db8500_pmu_platdata = {
- .handle_irq = db8500_pmu_handler,
-};
-
static const char *db8500_read_soc_id(void)
{
void __iomem *uid = __io_address(U8500_BB_UID_BASE);
@@ -143,8 +116,6 @@ static struct device * __init db8500_soc_device_init(void)
}
static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
- /* Requires call-back bindings. */
- OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata),
/* Requires DMA bindings. */
OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000,
"ux500-msp-i2s.0", &msp0_platform_data),
--
1.9.3
Now that I have received an verbal Ack from Rob Herring (in a personal
conversation) about the bindings, I am showing how the code looks like with
these new bindings.
Some part is still now done:
- Interface for adding new detailed OPPs from platform code instead of DT
- Providing cpufreq helpers for the next OPPs
- Providing regulator helpers for the target/min/max ranges
Please provide feedback on how this looks like..
--
viresh
Viresh Kumar (7):
OPP: Redefine bindings to overcome shortcomings
opp: Relocate few routines
OPP: Break _opp_add_dynamic() into smaller functions
opp: Parse new (v2) bindings
opp: convert device_opp->dev to a list of devices
opp: Add helpers for initializing CPU opps
cpufreq-dt: Use DT to set policy->cpus/related_cpus
Documentation/devicetree/bindings/power/opp.txt | 407 ++++++++-
drivers/base/power/opp.c | 1041 +++++++++++++++++------
drivers/cpufreq/cpufreq-dt.c | 16 +-
include/linux/pm_opp.h | 23 +
4 files changed, 1232 insertions(+), 255 deletions(-)
--
2.3.0.rc0.44.ga94655d
Hi Thomas/Ingo,
This is in response to the suggestions Ingo gave [1] on the shortcomings of
clockevents core's state machine.
This first separates out the RESUME functionality from other states as its a
special case. Then it defines a new enum to map possible states of a clockevent
device.
Ideally it should only be available for the core, but as bL switcher is using it
today, it is exposed in clockchips.h. That dependency will go away after
applying the Thomas's work (Sent out be Peter) and then we can move this enum to
somewhere in kernel/time/.
The last patch moves the legacy check to the legacy code.
Please see if this meets your expectation or if you have some suggestions on it.
Rebased of tip/master as there were some dependencies:
575daeea39a3 Merge branch 'tools/kvm'
This along with migration of few clockevents drivers is pushed here:
git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/linux.git clkevt/manage-state
--
Viresh
[1] https://lkml.org/lkml/2015/2/20/107
Viresh Kumar (3):
clockevents: Handle tick device's resume separately
clockevents: Manage device's state separately for the core
clockevents: Don't validate dev->mode against CLOCK_EVT_MODE_UNUSED
for new interface
arch/arm/common/bL_switcher.c | 8 +--
include/linux/clockchips.h | 48 +++++++++++------
kernel/time/clockevents.c | 118 ++++++++++++++++++++++++------------------
kernel/time/tick-broadcast.c | 22 ++++----
kernel/time/tick-common.c | 9 ++--
kernel/time/tick-internal.h | 1 +
kernel/time/tick-oneshot.c | 6 +--
kernel/time/timer_list.c | 16 +++---
8 files changed, 134 insertions(+), 94 deletions(-)
--
2.3.0.rc0.44.ga94655d
This patchset modifies the GIC driver to allow it, on supported
platforms, to route IPI interrupts to FIQ. It then uses this
feature to implement arch_trigger_all_cpu_backtrace for arm.
In order to neatly (and safely) bring in the changes for the arm
we also make the sched_clock implementation NMI-safe and rearrange
some of the existing x86 NMI code to make it architecture neutral.
This patchset touches a fairly large number of different sub-systems
(irq, generic sched_clock, printk, x86, arm). However, of the eight
patches, five fall under one of tglx's maintainerships (either through
irq, time or x86). Thus unless there are objections I'd like to gather
acks from some of the folks Cc:ed on the patches. Then I can wrap it up
nicely and send it to Thomas.
The patches have been runtime tested on two systems capable of
supporting FIQ (Freescale i.MX6 and STiH416) and two that do not
(vexpress-a9 and Qualcomm Snapdragon 600), the changes to the x86
logic were tested on qemu and all patches have been compile tested
on x86, arm and arm64.
Note: On platforms not capable of supporting FIQ, the IPI to generate a
backtrace will fall back to using IRQ for propagation instead.
The backtrace logic contains a timeout to we will not wedge the
requesting CPU if other CPUs are not responsive.
v15:
* Added a patch to make sched_clock safe to call from NMI (Stephen
Boyd). Note that sched_clock() is not called by the NMI handlers that
have been added for the arm but it could be called if tools such as
ftrace are deployed.
* Fixed some warnings picked up during bisectability testing.
v14:
* Moved a nmi_vprintk() and friends from arch/x86/kernel/apic/hw_nmi.c
to printk.c (Steven Rostedt)
v13:
* Updated the code to print the backtrace to replicate Steven Rostedt's
x86 work to make SysRq-l safe. This is pretty much a total rewrite of
patches 4 and 5.
v12:
* Squash first two patches into a single one and re-describe
(Thomas Gleixner).
* Improve description of "irqchip: gic: Make gic_raise_softirq FIQ-safe"
(Thomas Gleixner).
v11:
* Optimized gic_raise_softirq() by replacing a register read with
a memory read (Jason Cooper).
v10:
* Add a further patch to optimize away some of the locking on systems
where CONFIG_BL_SWITCHER is not set (Marc Zyngier). Compiles OK with
exynos_defconfig (which is the only defconfig to set this option).
* Whitespace fixes in patch 4. That patch previously used spaces for
alignment of new constants but the rest of the file used tabs.
v9:
* Improved documentation and structure of initial patch (now initial
two patches) to make gic_raise_softirq() safe to call from FIQ
(Thomas Gleixner).
* Avoid masking interrupts during gic_raise_softirq(). The use of the
read lock makes this redundant (because we can safely re-enter the
function).
v8:
* Fixed build on arm64 causes by a spurious include file in irq-gic.c.
v7-2 (accidentally released twice with same number):
* Fixed boot regression on vexpress-a9 (reported by Russell King).
* Rebased on v3.18-rc3; removed one patch from set that is already
included in mainline.
* Dropped arm64/fiq.h patch from the set (still useful but not related
to issuing backtraces).
v7:
* Re-arranged code within the patch series to fix a regression
introduced midway through the series and corrected by a later patch
(testing by Olof's autobuilder). Tested offending patch in isolation
using defconfig identified by the autobuilder.
v6:
* Renamed svc_entry's call_trace argument to just trace (example code
from Russell King).
* Fixed mismatched ENDPROC() in __fiq_abt (example code from Russell
King).
* Modified usr_entry to optional avoid calling into the trace code and
used this in FIQ entry from usr path. Modified corresponding exit code
to avoid calling into trace code and the scheduler (example code from
Russell King).
* Ensured the default FIQ register state is restored when the default
FIQ handler is reinstalled (example code from Russell King).
* Renamed no_fiq_insn to dfl_fiq_insn to reflect the effect of adopting
a default FIQ handler.
* Re-instated fiq_safe_migration_lock and associated logic in
gic_raise_softirq(). gic_raise_softirq() is called by wake_up_klogd()
in the console unlock logic.
v5:
* Rebased on 3.17-rc4.
* Removed a spurious line from the final "glue it together" patch
that broke the build.
v4:
* Replaced push/pop with stmfd/ldmfd respectively (review of Nicolas
Pitre).
* Really fix bad pt_regs pointer generation in __fiq_abt.
* Remove fiq_safe_migration_lock and associated logic in
gic_raise_softirq() (review of Russell King)
* Restructured to introduce the default FIQ handler first, before the
new features (review of Russell King).
v3:
* Removed redundant header guards from arch/arm64/include/asm/fiq.h
(review of Catalin Marinas).
* Moved svc_exit_via_fiq macro to entry-header.S (review of Nicolas
Pitre).
v2:
* Restructured to sit nicely on a similar FYI patchset from Russell
King. It now effectively replaces the work in progress final patch
with something much more complete.
* Implemented (and tested) a Thumb-2 implementation of svc_exit_via_fiq
(review of Nicolas Pitre)
* Dropped the GIC group 0 workaround patch. The issue of FIQ interrupts
being acknowledged by the IRQ handler does still exist but should be
harmless because the IRQ handler will still wind up calling
ipi_cpu_backtrace().
* Removed any dependency on CONFIG_FIQ; all cpu backtrace effectively
becomes a platform feature (although the use of non-maskable
interrupts to implement it is best effort rather than guaranteed).
* Better comments highlighting usage of RAZ/WI registers (and parts of
registers) in the GIC code.
Changes *before* v1:
* This patchset is a hugely cut-down successor to "[PATCH v11 00/19]
arm: KGDB NMI/FIQ support". Thanks to Thomas Gleixner for suggesting
the new structure. For historic details see:
https://lkml.org/lkml/2014/9/2/227
* Fix bug in __fiq_abt (no longer passes a bad struct pt_regs value).
In fixing this we also remove the useless indirection previously
found in the fiq_handler macro.
* Make default fiq handler "always on" by migrating from fiq.c to
traps.c and replace do_unexp_fiq with the new handler (review
of Russell King).
* Add arm64 version of fiq.h (review of Russell King)
* Removed conditional branching and code from irq-gic.c, this is
replaced by much simpler code that relies on the GIC specification's
heavy use of read-as-zero/write-ignored (review of Russell King)
Daniel Thompson (8):
irqchip: gic: Optimize locking in gic_raise_softirq
irqchip: gic: Make gic_raise_softirq FIQ-safe
irqchip: gic: Introduce plumbing for IPI FIQ
sched_clock: Avoid deadlock during read from NMI
printk: Simple implementation for NMI backtracing
x86/nmi: Use common printk functions
ARM: Add support for on-demand backtrace of other CPUs
ARM: Fix on-demand backtrace triggered by IRQ
arch/Kconfig | 3 +
arch/arm/Kconfig | 1 +
arch/arm/include/asm/hardirq.h | 2 +-
arch/arm/include/asm/irq.h | 5 +
arch/arm/include/asm/smp.h | 3 +
arch/arm/kernel/smp.c | 81 ++++++++++++++++
arch/arm/kernel/traps.c | 8 +-
arch/x86/Kconfig | 1 +
arch/x86/kernel/apic/hw_nmi.c | 97 ++-----------------
drivers/irqchip/irq-gic.c | 203 +++++++++++++++++++++++++++++++++++++---
include/linux/irqchip/arm-gic.h | 8 ++
include/linux/printk.h | 22 +++++
kernel/printk/printk.c | 122 ++++++++++++++++++++++++
kernel/time/sched_clock.c | 157 ++++++++++++++++++++-----------
14 files changed, 549 insertions(+), 164 deletions(-)
--
1.9.3