mirror of
https://github.com/torvalds/linux.git
synced 2024-11-13 23:51:39 +00:00
arm: perf: kill off unused pm callbacks
Currently the arm perf code has platdata callbacks for runtime PM and irq handling, but no platform implements the hooks for the former. Kill these off. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
This commit is contained in:
parent
7a2a24cb43
commit
ed61f9851d
@ -24,22 +24,10 @@
|
|||||||
* interrupt and passed the address of the low level handler,
|
* interrupt and passed the address of the low level handler,
|
||||||
* and can be used to implement any platform specific handling
|
* and can be used to implement any platform specific handling
|
||||||
* before or after calling it.
|
* before or after calling it.
|
||||||
* @runtime_resume: an optional handler which will be called by the
|
|
||||||
* runtime PM framework following a call to pm_runtime_get().
|
|
||||||
* Note that if pm_runtime_get() is called more than once in
|
|
||||||
* succession this handler will only be called once.
|
|
||||||
* @runtime_suspend: an optional handler which will be called by the
|
|
||||||
* runtime PM framework following a call to pm_runtime_put().
|
|
||||||
* Note that if pm_runtime_get() is called more than once in
|
|
||||||
* succession this handler will only be called following the
|
|
||||||
* final call to pm_runtime_put() that actually disables the
|
|
||||||
* hardware.
|
|
||||||
*/
|
*/
|
||||||
struct arm_pmu_platdata {
|
struct arm_pmu_platdata {
|
||||||
irqreturn_t (*handle_irq)(int irq, void *dev,
|
irqreturn_t (*handle_irq)(int irq, void *dev,
|
||||||
irq_handler_t pmu_handler);
|
irq_handler_t pmu_handler);
|
||||||
int (*runtime_resume)(struct device *dev);
|
|
||||||
int (*runtime_suspend)(struct device *dev);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_HW_PERF_EVENTS
|
#ifdef CONFIG_HW_PERF_EVENTS
|
||||||
@ -123,8 +111,6 @@ struct arm_pmu {
|
|||||||
|
|
||||||
#define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu))
|
#define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu))
|
||||||
|
|
||||||
extern const struct dev_pm_ops armpmu_dev_pm_ops;
|
|
||||||
|
|
||||||
int armpmu_register(struct arm_pmu *armpmu, int type);
|
int armpmu_register(struct arm_pmu *armpmu, int type);
|
||||||
|
|
||||||
u64 armpmu_event_update(struct perf_event *event);
|
u64 armpmu_event_update(struct perf_event *event);
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
#include <linux/cpumask.h>
|
#include <linux/cpumask.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/pm_runtime.h>
|
|
||||||
#include <linux/irq.h>
|
#include <linux/irq.h>
|
||||||
#include <linux/irqdesc.h>
|
#include <linux/irqdesc.h>
|
||||||
|
|
||||||
@ -349,20 +348,12 @@ static void
|
|||||||
armpmu_release_hardware(struct arm_pmu *armpmu)
|
armpmu_release_hardware(struct arm_pmu *armpmu)
|
||||||
{
|
{
|
||||||
armpmu->free_irq(armpmu);
|
armpmu->free_irq(armpmu);
|
||||||
pm_runtime_put_sync(&armpmu->plat_device->dev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
armpmu_reserve_hardware(struct arm_pmu *armpmu)
|
armpmu_reserve_hardware(struct arm_pmu *armpmu)
|
||||||
{
|
{
|
||||||
int err;
|
int err = armpmu->request_irq(armpmu, armpmu_dispatch_irq);
|
||||||
struct platform_device *pmu_device = armpmu->plat_device;
|
|
||||||
|
|
||||||
if (!pmu_device)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
pm_runtime_get_sync(&pmu_device->dev);
|
|
||||||
err = armpmu->request_irq(armpmu, armpmu_dispatch_irq);
|
|
||||||
if (err) {
|
if (err) {
|
||||||
armpmu_release_hardware(armpmu);
|
armpmu_release_hardware(armpmu);
|
||||||
return err;
|
return err;
|
||||||
@ -536,32 +527,6 @@ static int armpmu_filter_match(struct perf_event *event)
|
|||||||
return cpumask_test_cpu(cpu, &armpmu->supported_cpus);
|
return cpumask_test_cpu(cpu, &armpmu->supported_cpus);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
static int armpmu_runtime_resume(struct device *dev)
|
|
||||||
{
|
|
||||||
struct arm_pmu_platdata *plat = dev_get_platdata(dev);
|
|
||||||
|
|
||||||
if (plat && plat->runtime_resume)
|
|
||||||
return plat->runtime_resume(dev);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int armpmu_runtime_suspend(struct device *dev)
|
|
||||||
{
|
|
||||||
struct arm_pmu_platdata *plat = dev_get_platdata(dev);
|
|
||||||
|
|
||||||
if (plat && plat->runtime_suspend)
|
|
||||||
return plat->runtime_suspend(dev);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const struct dev_pm_ops armpmu_dev_pm_ops = {
|
|
||||||
SET_RUNTIME_PM_OPS(armpmu_runtime_suspend, armpmu_runtime_resume, NULL)
|
|
||||||
};
|
|
||||||
|
|
||||||
static void armpmu_init(struct arm_pmu *armpmu)
|
static void armpmu_init(struct arm_pmu *armpmu)
|
||||||
{
|
{
|
||||||
atomic_set(&armpmu->active_events, 0);
|
atomic_set(&armpmu->active_events, 0);
|
||||||
@ -583,7 +548,6 @@ static void armpmu_init(struct arm_pmu *armpmu)
|
|||||||
int armpmu_register(struct arm_pmu *armpmu, int type)
|
int armpmu_register(struct arm_pmu *armpmu, int type)
|
||||||
{
|
{
|
||||||
armpmu_init(armpmu);
|
armpmu_init(armpmu);
|
||||||
pm_runtime_enable(&armpmu->plat_device->dev);
|
|
||||||
pr_info("enabled with %s PMU driver, %d counters available\n",
|
pr_info("enabled with %s PMU driver, %d counters available\n",
|
||||||
armpmu->name, armpmu->num_events);
|
armpmu->name, armpmu->num_events);
|
||||||
return perf_pmu_register(&armpmu->pmu, armpmu->name, type);
|
return perf_pmu_register(&armpmu->pmu, armpmu->name, type);
|
||||||
|
@ -408,7 +408,6 @@ out_free:
|
|||||||
static struct platform_driver cpu_pmu_driver = {
|
static struct platform_driver cpu_pmu_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "arm-pmu",
|
.name = "arm-pmu",
|
||||||
.pm = &armpmu_dev_pm_ops,
|
|
||||||
.of_match_table = cpu_pmu_of_device_ids,
|
.of_match_table = cpu_pmu_of_device_ids,
|
||||||
},
|
},
|
||||||
.probe = cpu_pmu_device_probe,
|
.probe = cpu_pmu_device_probe,
|
||||||
|
Loading…
Reference in New Issue
Block a user