Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165257
b: refs/heads/master
c: ddcd62d
h: refs/heads/master
i:
  165255: bdbbdbe
v: v3
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Jun 25, 2009
1 parent 2d4b0bc commit 4411088
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 85 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4e0526184199e23ac1460fe59b8a3741b17a8b5
refs/heads/master: ddcd62d89e8c919cc75aeffd2ca37c986141b0f0
168 changes: 84 additions & 84 deletions trunk/drivers/acpi/processor_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,90 @@ static int acpi_processor_get_info(struct acpi_device *device)

static DEFINE_PER_CPU(void *, processor_device_array);

static void acpi_processor_notify(struct acpi_device *device, u32 event)
{
struct acpi_processor *pr = acpi_driver_data(device);
int saved;

if (!pr)
return;

switch (event) {
case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
saved = pr->performance_platform_limit;
acpi_processor_ppc_has_changed(pr);
if (saved == pr->performance_platform_limit)
break;
acpi_bus_generate_proc_event(device, event,
pr->performance_platform_limit);
acpi_bus_generate_netlink_event(device->pnp.device_class,
dev_name(&device->dev), event,
pr->performance_platform_limit);
break;
case ACPI_PROCESSOR_NOTIFY_POWER:
acpi_processor_cst_has_changed(pr);
acpi_bus_generate_proc_event(device, event, 0);
acpi_bus_generate_netlink_event(device->pnp.device_class,
dev_name(&device->dev), event, 0);
break;
case ACPI_PROCESSOR_NOTIFY_THROTTLING:
acpi_processor_tstate_has_changed(pr);
acpi_bus_generate_proc_event(device, event, 0);
acpi_bus_generate_netlink_event(device->pnp.device_class,
dev_name(&device->dev), event, 0);
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Unsupported event [0x%x]\n", event));
break;
}

return;
}

static int acpi_cpu_soft_notify(struct notifier_block *nfb,
unsigned long action, void *hcpu)
{
unsigned int cpu = (unsigned long)hcpu;
struct acpi_processor *pr = per_cpu(processors, cpu);

if (action == CPU_ONLINE && pr) {
acpi_processor_ppc_has_changed(pr);
acpi_processor_cst_has_changed(pr);
acpi_processor_tstate_has_changed(pr);
}
return NOTIFY_OK;
}

static struct notifier_block acpi_cpu_notifier =
{
.notifier_call = acpi_cpu_soft_notify,
};

static int acpi_processor_add(struct acpi_device *device)
{
struct acpi_processor *pr = NULL;


if (!device)
return -EINVAL;

pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
if (!pr)
return -ENOMEM;

if (!zalloc_cpumask_var(&pr->throttling.shared_cpu_map, GFP_KERNEL)) {
kfree(pr);
return -ENOMEM;
}

pr->handle = device->handle;
strcpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
device->driver_data = pr;

return 0;
}

static int __cpuinit acpi_processor_start(struct acpi_device *device)
{
int result = 0;
Expand Down Expand Up @@ -799,90 +883,6 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
return result;
}

static void acpi_processor_notify(struct acpi_device *device, u32 event)
{
struct acpi_processor *pr = acpi_driver_data(device);
int saved;

if (!pr)
return;

switch (event) {
case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
saved = pr->performance_platform_limit;
acpi_processor_ppc_has_changed(pr);
if (saved == pr->performance_platform_limit)
break;
acpi_bus_generate_proc_event(device, event,
pr->performance_platform_limit);
acpi_bus_generate_netlink_event(device->pnp.device_class,
dev_name(&device->dev), event,
pr->performance_platform_limit);
break;
case ACPI_PROCESSOR_NOTIFY_POWER:
acpi_processor_cst_has_changed(pr);
acpi_bus_generate_proc_event(device, event, 0);
acpi_bus_generate_netlink_event(device->pnp.device_class,
dev_name(&device->dev), event, 0);
break;
case ACPI_PROCESSOR_NOTIFY_THROTTLING:
acpi_processor_tstate_has_changed(pr);
acpi_bus_generate_proc_event(device, event, 0);
acpi_bus_generate_netlink_event(device->pnp.device_class,
dev_name(&device->dev), event, 0);
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Unsupported event [0x%x]\n", event));
break;
}

return;
}

static int acpi_cpu_soft_notify(struct notifier_block *nfb,
unsigned long action, void *hcpu)
{
unsigned int cpu = (unsigned long)hcpu;
struct acpi_processor *pr = per_cpu(processors, cpu);

if (action == CPU_ONLINE && pr) {
acpi_processor_ppc_has_changed(pr);
acpi_processor_cst_has_changed(pr);
acpi_processor_tstate_has_changed(pr);
}
return NOTIFY_OK;
}

static struct notifier_block acpi_cpu_notifier =
{
.notifier_call = acpi_cpu_soft_notify,
};

static int acpi_processor_add(struct acpi_device *device)
{
struct acpi_processor *pr = NULL;


if (!device)
return -EINVAL;

pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
if (!pr)
return -ENOMEM;

if (!zalloc_cpumask_var(&pr->throttling.shared_cpu_map, GFP_KERNEL)) {
kfree(pr);
return -ENOMEM;
}

pr->handle = device->handle;
strcpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
device->driver_data = pr;

return 0;
}

static int acpi_processor_remove(struct acpi_device *device, int type)
{
struct acpi_processor *pr = NULL;
Expand Down

0 comments on commit 4411088

Please sign in to comment.