You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'master' [vanilla Linus master] into libata-dev.git/upstream
Two bits were appended to the end of the bitfield list in struct scsi_device. Resolve that conflict by including both bits. Conflicts: include/scsi/scsi_device.h
This commit is contained in:
+12
-5
@@ -61,7 +61,6 @@ static int acpi_ac_open_fs(struct inode *inode, struct file *file);
|
||||
|
||||
static int acpi_ac_add(struct acpi_device *device);
|
||||
static int acpi_ac_remove(struct acpi_device *device, int type);
|
||||
static int acpi_ac_resume(struct acpi_device *device);
|
||||
static void acpi_ac_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
static const struct acpi_device_id ac_device_ids[] = {
|
||||
@@ -70,6 +69,9 @@ static const struct acpi_device_id ac_device_ids[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, ac_device_ids);
|
||||
|
||||
static int acpi_ac_resume(struct device *dev);
|
||||
static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
|
||||
|
||||
static struct acpi_driver acpi_ac_driver = {
|
||||
.name = "ac",
|
||||
.class = ACPI_AC_CLASS,
|
||||
@@ -78,9 +80,9 @@ static struct acpi_driver acpi_ac_driver = {
|
||||
.ops = {
|
||||
.add = acpi_ac_add,
|
||||
.remove = acpi_ac_remove,
|
||||
.resume = acpi_ac_resume,
|
||||
.notify = acpi_ac_notify,
|
||||
},
|
||||
.drv.pm = &acpi_ac_pm,
|
||||
};
|
||||
|
||||
struct acpi_ac {
|
||||
@@ -309,13 +311,18 @@ static int acpi_ac_add(struct acpi_device *device)
|
||||
return result;
|
||||
}
|
||||
|
||||
static int acpi_ac_resume(struct acpi_device *device)
|
||||
static int acpi_ac_resume(struct device *dev)
|
||||
{
|
||||
struct acpi_ac *ac;
|
||||
unsigned old_state;
|
||||
if (!device || !acpi_driver_data(device))
|
||||
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
ac = acpi_driver_data(device);
|
||||
|
||||
ac = acpi_driver_data(to_acpi_device(dev));
|
||||
if (!ac)
|
||||
return -EINVAL;
|
||||
|
||||
old_state = ac->state;
|
||||
if (acpi_ac_get_state(ac))
|
||||
return 0;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
|
||||
#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
|
||||
static DEFINE_MUTEX(isolated_cpus_lock);
|
||||
static DEFINE_MUTEX(round_robin_lock);
|
||||
|
||||
static unsigned long power_saving_mwait_eax;
|
||||
|
||||
@@ -107,7 +108,7 @@ static void round_robin_cpu(unsigned int tsk_index)
|
||||
if (!alloc_cpumask_var(&tmp, GFP_KERNEL))
|
||||
return;
|
||||
|
||||
mutex_lock(&isolated_cpus_lock);
|
||||
mutex_lock(&round_robin_lock);
|
||||
cpumask_clear(tmp);
|
||||
for_each_cpu(cpu, pad_busy_cpus)
|
||||
cpumask_or(tmp, tmp, topology_thread_cpumask(cpu));
|
||||
@@ -116,7 +117,7 @@ static void round_robin_cpu(unsigned int tsk_index)
|
||||
if (cpumask_empty(tmp))
|
||||
cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus);
|
||||
if (cpumask_empty(tmp)) {
|
||||
mutex_unlock(&isolated_cpus_lock);
|
||||
mutex_unlock(&round_robin_lock);
|
||||
return;
|
||||
}
|
||||
for_each_cpu(cpu, tmp) {
|
||||
@@ -131,7 +132,7 @@ static void round_robin_cpu(unsigned int tsk_index)
|
||||
tsk_in_cpu[tsk_index] = preferred_cpu;
|
||||
cpumask_set_cpu(preferred_cpu, pad_busy_cpus);
|
||||
cpu_weight[preferred_cpu]++;
|
||||
mutex_unlock(&isolated_cpus_lock);
|
||||
mutex_unlock(&round_robin_lock);
|
||||
|
||||
set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu));
|
||||
}
|
||||
|
||||
@@ -95,18 +95,6 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags)
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
if (sleep_state != ACPI_STATE_S5) {
|
||||
/*
|
||||
* Disable BM arbitration. This feature is contained within an
|
||||
* optional register (PM2 Control), so ignore a BAD_ADDRESS
|
||||
* exception.
|
||||
*/
|
||||
status = acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 1);
|
||||
if (ACPI_FAILURE(status) && (status != AE_BAD_ADDRESS)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 1) Disable/Clear all GPEs
|
||||
* 2) Enable all wakeup GPEs
|
||||
@@ -364,16 +352,6 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state, u8 flags)
|
||||
[ACPI_EVENT_POWER_BUTTON].
|
||||
status_register_id, ACPI_CLEAR_STATUS);
|
||||
|
||||
/*
|
||||
* Enable BM arbitration. This feature is contained within an
|
||||
* optional register (PM2 Control), so ignore a BAD_ADDRESS
|
||||
* exception.
|
||||
*/
|
||||
status = acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 0);
|
||||
if (ACPI_FAILURE(status) && (status != AE_BAD_ADDRESS)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
@@ -638,7 +638,7 @@ acpi_ns_check_package(struct acpi_predefined_data *data,
|
||||
/* Create the new outer package and populate it */
|
||||
|
||||
status =
|
||||
acpi_ns_wrap_with_package(data, *elements,
|
||||
acpi_ns_wrap_with_package(data, return_object,
|
||||
return_object_ptr);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return (status);
|
||||
|
||||
@@ -243,7 +243,7 @@ static int pre_map_gar_callback(struct apei_exec_context *ctx,
|
||||
u8 ins = entry->instruction;
|
||||
|
||||
if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER)
|
||||
return acpi_os_map_generic_address(&entry->register_region);
|
||||
return apei_map_generic_address(&entry->register_region);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -276,7 +276,7 @@ static int post_unmap_gar_callback(struct apei_exec_context *ctx,
|
||||
u8 ins = entry->instruction;
|
||||
|
||||
if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER)
|
||||
acpi_os_unmap_generic_address(&entry->register_region);
|
||||
apei_unmap_generic_address(&entry->register_region);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -606,6 +606,19 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int apei_map_generic_address(struct acpi_generic_address *reg)
|
||||
{
|
||||
int rc;
|
||||
u32 access_bit_width;
|
||||
u64 address;
|
||||
|
||||
rc = apei_check_gar(reg, &address, &access_bit_width);
|
||||
if (rc)
|
||||
return rc;
|
||||
return acpi_os_map_generic_address(reg);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(apei_map_generic_address);
|
||||
|
||||
/* read GAR in interrupt (including NMI) or process context */
|
||||
int apei_read(u64 *val, struct acpi_generic_address *reg)
|
||||
{
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#define APEI_INTERNAL_H
|
||||
|
||||
#include <linux/cper.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/acpi_io.h>
|
||||
|
||||
struct apei_exec_context;
|
||||
|
||||
@@ -68,6 +70,13 @@ static inline int apei_exec_run_optional(struct apei_exec_context *ctx, u8 actio
|
||||
/* IP has been set in instruction function */
|
||||
#define APEI_EXEC_SET_IP 1
|
||||
|
||||
int apei_map_generic_address(struct acpi_generic_address *reg);
|
||||
|
||||
static inline void apei_unmap_generic_address(struct acpi_generic_address *reg)
|
||||
{
|
||||
acpi_os_unmap_generic_address(reg);
|
||||
}
|
||||
|
||||
int apei_read(u64 *val, struct acpi_generic_address *reg);
|
||||
int apei_write(u64 val, struct acpi_generic_address *reg);
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic)
|
||||
if (!ghes)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
ghes->generic = generic;
|
||||
rc = acpi_os_map_generic_address(&generic->error_status_address);
|
||||
rc = apei_map_generic_address(&generic->error_status_address);
|
||||
if (rc)
|
||||
goto err_free;
|
||||
error_block_length = generic->error_block_length;
|
||||
@@ -321,7 +321,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic)
|
||||
return ghes;
|
||||
|
||||
err_unmap:
|
||||
acpi_os_unmap_generic_address(&generic->error_status_address);
|
||||
apei_unmap_generic_address(&generic->error_status_address);
|
||||
err_free:
|
||||
kfree(ghes);
|
||||
return ERR_PTR(rc);
|
||||
@@ -330,7 +330,7 @@ err_free:
|
||||
static void ghes_fini(struct ghes *ghes)
|
||||
{
|
||||
kfree(ghes->estatus);
|
||||
acpi_os_unmap_generic_address(&ghes->generic->error_status_address);
|
||||
apei_unmap_generic_address(&ghes->generic->error_status_address);
|
||||
}
|
||||
|
||||
enum {
|
||||
|
||||
+11
-4
@@ -1044,17 +1044,24 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
|
||||
}
|
||||
|
||||
/* this is needed to learn about changes made in suspended state */
|
||||
static int acpi_battery_resume(struct acpi_device *device)
|
||||
static int acpi_battery_resume(struct device *dev)
|
||||
{
|
||||
struct acpi_battery *battery;
|
||||
if (!device)
|
||||
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
battery = acpi_driver_data(device);
|
||||
|
||||
battery = acpi_driver_data(to_acpi_device(dev));
|
||||
if (!battery)
|
||||
return -EINVAL;
|
||||
|
||||
battery->update_time = 0;
|
||||
acpi_battery_update(battery);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(acpi_battery_pm, NULL, acpi_battery_resume);
|
||||
|
||||
static struct acpi_driver acpi_battery_driver = {
|
||||
.name = "battery",
|
||||
.class = ACPI_BATTERY_CLASS,
|
||||
@@ -1062,10 +1069,10 @@ static struct acpi_driver acpi_battery_driver = {
|
||||
.flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS,
|
||||
.ops = {
|
||||
.add = acpi_battery_add,
|
||||
.resume = acpi_battery_resume,
|
||||
.remove = acpi_battery_remove,
|
||||
.notify = acpi_battery_notify,
|
||||
},
|
||||
.drv.pm = &acpi_battery_pm,
|
||||
};
|
||||
|
||||
static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)
|
||||
|
||||
@@ -76,19 +76,21 @@ MODULE_DEVICE_TABLE(acpi, button_device_ids);
|
||||
|
||||
static int acpi_button_add(struct acpi_device *device);
|
||||
static int acpi_button_remove(struct acpi_device *device, int type);
|
||||
static int acpi_button_resume(struct acpi_device *device);
|
||||
static void acpi_button_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
static int acpi_button_resume(struct device *dev);
|
||||
static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume);
|
||||
|
||||
static struct acpi_driver acpi_button_driver = {
|
||||
.name = "button",
|
||||
.class = ACPI_BUTTON_CLASS,
|
||||
.ids = button_device_ids,
|
||||
.ops = {
|
||||
.add = acpi_button_add,
|
||||
.resume = acpi_button_resume,
|
||||
.remove = acpi_button_remove,
|
||||
.notify = acpi_button_notify,
|
||||
},
|
||||
.drv.pm = &acpi_button_pm,
|
||||
};
|
||||
|
||||
struct acpi_button {
|
||||
@@ -308,8 +310,9 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
|
||||
}
|
||||
}
|
||||
|
||||
static int acpi_button_resume(struct acpi_device *device)
|
||||
static int acpi_button_resume(struct device *dev)
|
||||
{
|
||||
struct acpi_device *device = to_acpi_device(dev);
|
||||
struct acpi_button *button = acpi_driver_data(device);
|
||||
|
||||
if (button->type == ACPI_BUTTON_TYPE_LID)
|
||||
|
||||
+11
-10
@@ -46,8 +46,6 @@ MODULE_LICENSE("GPL");
|
||||
|
||||
static int acpi_fan_add(struct acpi_device *device);
|
||||
static int acpi_fan_remove(struct acpi_device *device, int type);
|
||||
static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state);
|
||||
static int acpi_fan_resume(struct acpi_device *device);
|
||||
|
||||
static const struct acpi_device_id fan_device_ids[] = {
|
||||
{"PNP0C0B", 0},
|
||||
@@ -55,6 +53,10 @@ static const struct acpi_device_id fan_device_ids[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, fan_device_ids);
|
||||
|
||||
static int acpi_fan_suspend(struct device *dev);
|
||||
static int acpi_fan_resume(struct device *dev);
|
||||
static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume);
|
||||
|
||||
static struct acpi_driver acpi_fan_driver = {
|
||||
.name = "fan",
|
||||
.class = ACPI_FAN_CLASS,
|
||||
@@ -62,9 +64,8 @@ static struct acpi_driver acpi_fan_driver = {
|
||||
.ops = {
|
||||
.add = acpi_fan_add,
|
||||
.remove = acpi_fan_remove,
|
||||
.suspend = acpi_fan_suspend,
|
||||
.resume = acpi_fan_resume,
|
||||
},
|
||||
.drv.pm = &acpi_fan_pm,
|
||||
};
|
||||
|
||||
/* thermal cooling device callbacks */
|
||||
@@ -183,24 +184,24 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state)
|
||||
static int acpi_fan_suspend(struct device *dev)
|
||||
{
|
||||
if (!device)
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
||||
acpi_bus_set_power(device->handle, ACPI_STATE_D0);
|
||||
acpi_bus_set_power(to_acpi_device(dev)->handle, ACPI_STATE_D0);
|
||||
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
static int acpi_fan_resume(struct acpi_device *device)
|
||||
static int acpi_fan_resume(struct device *dev)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (!device)
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
||||
result = acpi_bus_update_power(device->handle, NULL);
|
||||
result = acpi_bus_update_power(to_acpi_device(dev)->handle, NULL);
|
||||
if (result)
|
||||
printk(KERN_ERR PREFIX "Error updating fan power state\n");
|
||||
|
||||
|
||||
@@ -505,6 +505,8 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
|
||||
strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS);
|
||||
device->driver_data = root;
|
||||
|
||||
root->mcfg_addr = acpi_pci_root_get_mcfg_addr(device->handle);
|
||||
|
||||
/*
|
||||
* All supported architectures that use ACPI have support for
|
||||
* PCI domains, so we indicate this in _OSC support capabilities.
|
||||
|
||||
@@ -60,7 +60,6 @@ ACPI_MODULE_NAME("power");
|
||||
|
||||
static int acpi_power_add(struct acpi_device *device);
|
||||
static int acpi_power_remove(struct acpi_device *device, int type);
|
||||
static int acpi_power_resume(struct acpi_device *device);
|
||||
|
||||
static const struct acpi_device_id power_device_ids[] = {
|
||||
{ACPI_POWER_HID, 0},
|
||||
@@ -68,6 +67,9 @@ static const struct acpi_device_id power_device_ids[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, power_device_ids);
|
||||
|
||||
static int acpi_power_resume(struct device *dev);
|
||||
static SIMPLE_DEV_PM_OPS(acpi_power_pm, NULL, acpi_power_resume);
|
||||
|
||||
static struct acpi_driver acpi_power_driver = {
|
||||
.name = "power",
|
||||
.class = ACPI_POWER_CLASS,
|
||||
@@ -75,8 +77,8 @@ static struct acpi_driver acpi_power_driver = {
|
||||
.ops = {
|
||||
.add = acpi_power_add,
|
||||
.remove = acpi_power_remove,
|
||||
.resume = acpi_power_resume,
|
||||
},
|
||||
.drv.pm = &acpi_power_pm,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -773,14 +775,16 @@ static int acpi_power_remove(struct acpi_device *device, int type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_power_resume(struct acpi_device *device)
|
||||
static int acpi_power_resume(struct device *dev)
|
||||
{
|
||||
int result = 0, state;
|
||||
struct acpi_device *device;
|
||||
struct acpi_power_resource *resource;
|
||||
|
||||
if (!device)
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
||||
device = to_acpi_device(dev);
|
||||
resource = acpi_driver_data(device);
|
||||
if (!resource)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -189,10 +189,12 @@ int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id)
|
||||
* Processor (CPU3, 0x03, 0x00000410, 0x06) {}
|
||||
* }
|
||||
*
|
||||
* Ignores apic_id and always return 0 for CPU0's handle.
|
||||
* Ignores apic_id and always returns 0 for the processor
|
||||
* handle with acpi id 0 if nr_cpu_ids is 1.
|
||||
* This should be the case if SMP tables are not found.
|
||||
* Return -1 for other CPU's handle.
|
||||
*/
|
||||
if (acpi_id == 0)
|
||||
if (nr_cpu_ids <= 1 && acpi_id == 0)
|
||||
return acpi_id;
|
||||
else
|
||||
return apic_id;
|
||||
|
||||
@@ -93,6 +93,9 @@ static const struct acpi_device_id processor_device_ids[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, processor_device_ids);
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(acpi_processor_pm,
|
||||
acpi_processor_suspend, acpi_processor_resume);
|
||||
|
||||
static struct acpi_driver acpi_processor_driver = {
|
||||
.name = "processor",
|
||||
.class = ACPI_PROCESSOR_CLASS,
|
||||
@@ -100,10 +103,9 @@ static struct acpi_driver acpi_processor_driver = {
|
||||
.ops = {
|
||||
.add = acpi_processor_add,
|
||||
.remove = acpi_processor_remove,
|
||||
.suspend = acpi_processor_suspend,
|
||||
.resume = acpi_processor_resume,
|
||||
.notify = acpi_processor_notify,
|
||||
},
|
||||
.drv.pm = &acpi_processor_pm,
|
||||
};
|
||||
|
||||
#define INSTALL_NOTIFY_HANDLER 1
|
||||
@@ -427,18 +429,11 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
|
||||
* Initialize missing things
|
||||
*/
|
||||
if (pr->flags.need_hotplug_init) {
|
||||
struct cpuidle_driver *idle_driver =
|
||||
cpuidle_get_driver();
|
||||
|
||||
printk(KERN_INFO "Will online and init hotplugged "
|
||||
"CPU: %d\n", pr->id);
|
||||
WARN(acpi_processor_start(pr), "Failed to start CPU:"
|
||||
" %d\n", pr->id);
|
||||
pr->flags.need_hotplug_init = 0;
|
||||
if (idle_driver && !strcmp(idle_driver->name,
|
||||
"intel_idle")) {
|
||||
intel_idle_cpu_init(pr->id);
|
||||
}
|
||||
/* Normal CPU soft online event */
|
||||
} else {
|
||||
acpi_processor_ppc_has_changed(pr, 0);
|
||||
|
||||
@@ -221,9 +221,6 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr,
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Suspend / resume control
|
||||
*/
|
||||
static u32 saved_bm_rld;
|
||||
|
||||
static void acpi_idle_bm_rld_save(void)
|
||||
@@ -240,13 +237,13 @@ static void acpi_idle_bm_rld_restore(void)
|
||||
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld);
|
||||
}
|
||||
|
||||
int acpi_processor_suspend(struct acpi_device * device, pm_message_t state)
|
||||
int acpi_processor_suspend(struct device *dev)
|
||||
{
|
||||
acpi_idle_bm_rld_save();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpi_processor_resume(struct acpi_device * device)
|
||||
int acpi_processor_resume(struct device *dev)
|
||||
{
|
||||
acpi_idle_bm_rld_restore();
|
||||
return 0;
|
||||
@@ -586,7 +583,6 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
|
||||
*/
|
||||
cx->valid = 1;
|
||||
|
||||
cx->latency_ticks = cx->latency;
|
||||
/*
|
||||
* On older chipsets, BM_RLD needs to be set
|
||||
* in order for Bus Master activity to wake the
|
||||
@@ -619,7 +615,6 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
|
||||
if (!cx->address)
|
||||
break;
|
||||
cx->valid = 1;
|
||||
cx->latency_ticks = cx->latency; /* Normalize latency */
|
||||
break;
|
||||
|
||||
case ACPI_STATE_C3:
|
||||
@@ -754,6 +749,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
|
||||
|
||||
local_irq_disable();
|
||||
|
||||
|
||||
lapic_timer_state_broadcast(pr, cx, 1);
|
||||
kt1 = ktime_get_real();
|
||||
acpi_idle_do_entry(cx);
|
||||
@@ -764,7 +760,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
|
||||
dev->last_residency = (int)idle_time;
|
||||
|
||||
local_irq_enable();
|
||||
cx->usage++;
|
||||
lapic_timer_state_broadcast(pr, cx, 0);
|
||||
|
||||
return index;
|
||||
@@ -823,6 +818,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
|
||||
|
||||
local_irq_disable();
|
||||
|
||||
|
||||
if (cx->entry_method != ACPI_CSTATE_FFH) {
|
||||
current_thread_info()->status &= ~TS_POLLING;
|
||||
/*
|
||||
@@ -866,10 +862,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
|
||||
if (cx->entry_method != ACPI_CSTATE_FFH)
|
||||
current_thread_info()->status |= TS_POLLING;
|
||||
|
||||
cx->usage++;
|
||||
|
||||
lapic_timer_state_broadcast(pr, cx, 0);
|
||||
cx->time += idle_time;
|
||||
return index;
|
||||
}
|
||||
|
||||
@@ -909,12 +902,13 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
|
||||
local_irq_disable();
|
||||
acpi_safe_halt();
|
||||
local_irq_enable();
|
||||
return -EINVAL;
|
||||
return -EBUSY;
|
||||
}
|
||||
}
|
||||
|
||||
local_irq_disable();
|
||||
|
||||
|
||||
if (cx->entry_method != ACPI_CSTATE_FFH) {
|
||||
current_thread_info()->status &= ~TS_POLLING;
|
||||
/*
|
||||
@@ -986,10 +980,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
|
||||
if (cx->entry_method != ACPI_CSTATE_FFH)
|
||||
current_thread_info()->status |= TS_POLLING;
|
||||
|
||||
cx->usage++;
|
||||
|
||||
lapic_timer_state_broadcast(pr, cx, 0);
|
||||
cx->time += idle_time;
|
||||
return index;
|
||||
}
|
||||
|
||||
|
||||
+6
-4
@@ -988,16 +988,18 @@ static void acpi_sbs_rmdirs(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int acpi_sbs_resume(struct acpi_device *device)
|
||||
static int acpi_sbs_resume(struct device *dev)
|
||||
{
|
||||
struct acpi_sbs *sbs;
|
||||
if (!device)
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
sbs = device->driver_data;
|
||||
sbs = to_acpi_device(dev)->driver_data;
|
||||
acpi_sbs_callback(sbs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume);
|
||||
|
||||
static struct acpi_driver acpi_sbs_driver = {
|
||||
.name = "sbs",
|
||||
.class = ACPI_SBS_CLASS,
|
||||
@@ -1005,8 +1007,8 @@ static struct acpi_driver acpi_sbs_driver = {
|
||||
.ops = {
|
||||
.add = acpi_sbs_add,
|
||||
.remove = acpi_sbs_remove,
|
||||
.resume = acpi_sbs_resume,
|
||||
},
|
||||
.drv.pm = &acpi_sbs_pm,
|
||||
};
|
||||
|
||||
static int __init acpi_sbs_init(void)
|
||||
|
||||
@@ -290,26 +290,6 @@ static void acpi_device_release(struct device *dev)
|
||||
kfree(acpi_dev);
|
||||
}
|
||||
|
||||
static int acpi_device_suspend(struct device *dev, pm_message_t state)
|
||||
{
|
||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||
struct acpi_driver *acpi_drv = acpi_dev->driver;
|
||||
|
||||
if (acpi_drv && acpi_drv->ops.suspend)
|
||||
return acpi_drv->ops.suspend(acpi_dev, state);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_device_resume(struct device *dev)
|
||||
{
|
||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||
struct acpi_driver *acpi_drv = acpi_dev->driver;
|
||||
|
||||
if (acpi_drv && acpi_drv->ops.resume)
|
||||
return acpi_drv->ops.resume(acpi_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_bus_match(struct device *dev, struct device_driver *drv)
|
||||
{
|
||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||
@@ -441,8 +421,6 @@ static int acpi_device_remove(struct device * dev)
|
||||
|
||||
struct bus_type acpi_bus_type = {
|
||||
.name = "acpi",
|
||||
.suspend = acpi_device_suspend,
|
||||
.resume = acpi_device_resume,
|
||||
.match = acpi_bus_match,
|
||||
.probe = acpi_device_probe,
|
||||
.remove = acpi_device_remove,
|
||||
|
||||
+19
-5
@@ -716,8 +716,9 @@ int acpi_suspend(u32 acpi_state)
|
||||
* @dev: device to examine; its driver model wakeup flags control
|
||||
* whether it should be able to wake up the system
|
||||
* @d_min_p: used to store the upper limit of allowed states range
|
||||
* Return value: preferred power state of the device on success, -ENODEV on
|
||||
* failure (ie. if there's no 'struct acpi_device' for @dev)
|
||||
* @d_max_in: specify the lowest allowed states
|
||||
* Return value: preferred power state of the device on success, -ENODEV
|
||||
* (ie. if there's no 'struct acpi_device' for @dev) or -EINVAL on failure
|
||||
*
|
||||
* Find the lowest power (highest number) ACPI device power state that
|
||||
* device @dev can be in while the system is in the sleep state represented
|
||||
@@ -732,13 +733,15 @@ int acpi_suspend(u32 acpi_state)
|
||||
* via @wake.
|
||||
*/
|
||||
|
||||
int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
|
||||
int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in)
|
||||
{
|
||||
acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
|
||||
struct acpi_device *adev;
|
||||
char acpi_method[] = "_SxD";
|
||||
unsigned long long d_min, d_max;
|
||||
|
||||
if (d_max_in < ACPI_STATE_D0 || d_max_in > ACPI_STATE_D3)
|
||||
return -EINVAL;
|
||||
if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
|
||||
printk(KERN_DEBUG "ACPI handle has no context!\n");
|
||||
return -ENODEV;
|
||||
@@ -746,8 +749,10 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
|
||||
|
||||
acpi_method[2] = '0' + acpi_target_sleep_state;
|
||||
/*
|
||||
* If the sleep state is S0, we will return D3, but if the device has
|
||||
* _S0W, we will use the value from _S0W
|
||||
* If the sleep state is S0, the lowest limit from ACPI is D3,
|
||||
* but if the device has _S0W, we will use the value from _S0W
|
||||
* as the lowest limit from ACPI. Finally, we will constrain
|
||||
* the lowest limit with the specified one.
|
||||
*/
|
||||
d_min = ACPI_STATE_D0;
|
||||
d_max = ACPI_STATE_D3;
|
||||
@@ -791,8 +796,17 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
|
||||
}
|
||||
}
|
||||
|
||||
if (d_max_in < d_min)
|
||||
return -EINVAL;
|
||||
if (d_min_p)
|
||||
*d_min_p = d_min;
|
||||
/* constrain d_max with specified lowest limit (max number) */
|
||||
if (d_max > d_max_in) {
|
||||
for (d_max = d_max_in; d_max > d_min; d_max--) {
|
||||
if (adev->power.states[d_max].flags.valid)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return d_max;
|
||||
}
|
||||
EXPORT_SYMBOL(acpi_pm_device_sleep_state);
|
||||
|
||||
@@ -173,7 +173,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if (!strncmp(val, "enable", strlen("enable") - 1)) {
|
||||
if (!strncmp(val, "enable", strlen("enable"))) {
|
||||
result = acpi_debug_trace(trace_method_name, trace_debug_level,
|
||||
trace_debug_layer, 0);
|
||||
if (result)
|
||||
@@ -181,7 +181,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!strncmp(val, "disable", strlen("disable") - 1)) {
|
||||
if (!strncmp(val, "disable", strlen("disable"))) {
|
||||
int name = 0;
|
||||
result = acpi_debug_trace((char *)&name, trace_debug_level,
|
||||
trace_debug_layer, 0);
|
||||
|
||||
+10
-7
@@ -98,7 +98,6 @@ MODULE_PARM_DESC(psv, "Disable or override all passive trip points.");
|
||||
|
||||
static int acpi_thermal_add(struct acpi_device *device);
|
||||
static int acpi_thermal_remove(struct acpi_device *device, int type);
|
||||
static int acpi_thermal_resume(struct acpi_device *device);
|
||||
static void acpi_thermal_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
static const struct acpi_device_id thermal_device_ids[] = {
|
||||
@@ -107,6 +106,9 @@ static const struct acpi_device_id thermal_device_ids[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, thermal_device_ids);
|
||||
|
||||
static int acpi_thermal_resume(struct device *dev);
|
||||
static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume);
|
||||
|
||||
static struct acpi_driver acpi_thermal_driver = {
|
||||
.name = "thermal",
|
||||
.class = ACPI_THERMAL_CLASS,
|
||||
@@ -114,9 +116,9 @@ static struct acpi_driver acpi_thermal_driver = {
|
||||
.ops = {
|
||||
.add = acpi_thermal_add,
|
||||
.remove = acpi_thermal_remove,
|
||||
.resume = acpi_thermal_resume,
|
||||
.notify = acpi_thermal_notify,
|
||||
},
|
||||
.drv.pm = &acpi_thermal_pm,
|
||||
};
|
||||
|
||||
struct acpi_thermal_state {
|
||||
@@ -1041,16 +1043,17 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_thermal_resume(struct acpi_device *device)
|
||||
static int acpi_thermal_resume(struct device *dev)
|
||||
{
|
||||
struct acpi_thermal *tz = NULL;
|
||||
struct acpi_thermal *tz;
|
||||
int i, j, power_state, result;
|
||||
|
||||
|
||||
if (!device || !acpi_driver_data(device))
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
||||
tz = acpi_driver_data(device);
|
||||
tz = acpi_driver_data(to_acpi_device(dev));
|
||||
if (!tz)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
|
||||
if (!(&tz->trips.active[i]))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user