Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64407
b: refs/heads/master
c: ead7759
h: refs/heads/master
i:
  64405: 2d1d50a
  64403: 4fd7981
  64399: dd7f2a9
v: v3
  • Loading branch information
Shaohua Li authored and Len Brown committed Aug 25, 2007
1 parent 209526c commit 88677d2
Show file tree
Hide file tree
Showing 30 changed files with 286 additions and 369 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: a3a1b26e79db743c3289632238cd5f930f91bf27
refs/heads/master: ead77594af3a49e48ceec61a1824362be4b5cafa
19 changes: 9 additions & 10 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -952,10 +952,14 @@ and is between 256 and 4096 characters. It is defined in the file
Format: <1-256>

maxcpus= [SMP] Maximum number of processors that an SMP kernel
should make use of. maxcpus=n : n >= 0 limits the
kernel to using 'n' processors. n=0 is a special case,
it is equivalent to "nosmp", which also disables
the IO APIC.
should make use of.
Using "nosmp" or "maxcpus=0" will disable SMP
entirely (the MPS table probe still happens, though).
A command-line option of "maxcpus=<NUM>", where <NUM>
is an integer greater than 0, limits the maximum number
of CPUs activated in SMP mode to <NUM>.
Using "maxcpus=1" on an SMP kernel is the trivial
case of an SMP kernel with only one CPU.

max_addr=[KMG] [KNL,BOOT,ia64] All physical memory greater than or
equal to this physical address is ignored.
Expand Down Expand Up @@ -1180,8 +1184,7 @@ and is between 256 and 4096 characters. It is defined in the file

nosep [BUGS=X86-32] Disables x86 SYSENTER/SYSEXIT support.

nosmp [SMP] Tells an SMP kernel to act as a UP kernel,
and disable the IO APIC. legacy for "maxcpus=0".
nosmp [SMP] Tells an SMP kernel to act as a UP kernel.

nosoftlockup [KNL] Disable the soft-lockup detector.

Expand Down Expand Up @@ -1823,10 +1826,6 @@ and is between 256 and 4096 characters. It is defined in the file
-1: disable all active trip points in all thermal zones
<degrees C>: override all lowest active trip points

thermal.crt= [HW,ACPI]
-1: disable all critical trip points in all thermal zones
<degrees C>: lower all critical trip points

thermal.nocrt= [HW,ACPI]
Set to disable actions on ACPI thermal zone
critical and hot trip points.
Expand Down
8 changes: 8 additions & 0 deletions trunk/arch/i386/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,14 @@ static int pirq_entries [MAX_PIRQS];
static int pirqs_enabled;
int skip_ioapic_setup;

static int __init ioapic_setup(char *str)
{
skip_ioapic_setup = 1;
return 1;
}

__setup("noapic", ioapic_setup);

static int __init ioapic_pirq_setup(char *str)
{
int i, max;
Expand Down
8 changes: 5 additions & 3 deletions trunk/arch/x86_64/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,14 @@ static void clear_IO_APIC (void)
int skip_ioapic_setup;
int ioapic_force;

static int __init parse_noapic(char *str)
/* dummy parsing: see setup.c */

static int __init disable_ioapic_setup(char *str)
{
disable_ioapic_setup();
skip_ioapic_setup = 1;
return 0;
}
early_param("noapic", parse_noapic);
early_param("noapic", disable_ioapic_setup);

/* Actually the next is obsolete, but keep it for paranoid reasons -AK */
static int __init disable_timer_pin_setup(char *arg)
Expand Down
47 changes: 17 additions & 30 deletions trunk/drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ struct acpi_battery_info {
acpi_string oem_info;
};

enum acpi_battery_files{
enum acpi_battery_files {
ACPI_BATTERY_INFO = 0,
ACPI_BATTERY_STATE,
ACPI_BATTERY_ALARM,
Expand All @@ -129,13 +129,14 @@ struct acpi_battery_flags {
};

struct acpi_battery {
struct mutex mutex;
struct acpi_device *device;
struct acpi_battery_flags flags;
struct acpi_buffer bif_data;
struct acpi_buffer bst_data;
struct mutex lock;
unsigned long alarm;
unsigned long update_time[ACPI_BATTERY_NUMFILES];

};

inline int acpi_battery_present(struct acpi_battery *battery)
Expand Down Expand Up @@ -235,10 +236,10 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
return 0;

/* Evaluate _BIF */

status =
acpi_evaluate_object(acpi_battery_handle(battery), "_BIF", NULL,
&buffer);
mutex_lock(&battery->lock);
status = acpi_evaluate_object(acpi_battery_handle(battery), "_BIF",
NULL, &buffer);
mutex_unlock(&battery->lock);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF"));
return -ENODEV;
Expand Down Expand Up @@ -285,10 +286,10 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
return 0;

/* Evaluate _BST */

status =
acpi_evaluate_object(acpi_battery_handle(battery), "_BST", NULL,
&buffer);
mutex_lock(&battery->lock);
status = acpi_evaluate_object(acpi_battery_handle(battery), "_BST",
NULL, &buffer);
mutex_unlock(&battery->lock);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST"));
return -ENODEV;
Expand Down Expand Up @@ -336,9 +337,10 @@ static int acpi_battery_set_alarm(struct acpi_battery *battery,

arg0.integer.value = alarm;

status =
acpi_evaluate_object(acpi_battery_handle(battery), "_BTP",
mutex_lock(&battery->lock);
status = acpi_evaluate_object(acpi_battery_handle(battery), "_BTP",
&arg_list, NULL);
mutex_unlock(&battery->lock);
if (ACPI_FAILURE(status))
return -ENODEV;

Expand Down Expand Up @@ -658,8 +660,6 @@ acpi_battery_write_alarm(struct file *file,
if (!battery || (count > sizeof(alarm_string) - 1))
return -EINVAL;

mutex_lock(&battery->mutex);

result = acpi_battery_update(battery, 1, &update_result);
if (result) {
result = -ENODEV;
Expand Down Expand Up @@ -688,9 +688,7 @@ acpi_battery_write_alarm(struct file *file,
acpi_battery_check_result(battery, result);

if (!result)
result = count;

mutex_unlock(&battery->mutex);
return count;

return result;
}
Expand All @@ -714,8 +712,6 @@ static int acpi_battery_read(int fid, struct seq_file *seq)
int update_result = ACPI_BATTERY_NONE_UPDATE;
int update = 0;

mutex_lock(&battery->mutex);

update = (get_seconds() - battery->update_time[fid] >= update_time);
update = (update | battery->flags.update[fid]);

Expand All @@ -733,7 +729,6 @@ static int acpi_battery_read(int fid, struct seq_file *seq)
result = acpi_read_funcs[fid].print(seq, result);
acpi_battery_check_result(battery, result);
battery->flags.update[fid] = result;
mutex_unlock(&battery->mutex);
return result;
}

Expand Down Expand Up @@ -897,10 +892,7 @@ static int acpi_battery_add(struct acpi_device *device)
if (!battery)
return -ENOMEM;

mutex_init(&battery->mutex);

mutex_lock(&battery->mutex);

mutex_init(&battery->lock);
battery->device = device;
strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS);
Expand Down Expand Up @@ -936,7 +928,6 @@ static int acpi_battery_add(struct acpi_device *device)
kfree(battery);
}

mutex_unlock(&battery->mutex);

return result;
}
Expand All @@ -951,8 +942,6 @@ static int acpi_battery_remove(struct acpi_device *device, int type)

battery = acpi_driver_data(device);

mutex_lock(&battery->mutex);

status = acpi_remove_notify_handler(device->handle,
ACPI_ALL_NOTIFY,
acpi_battery_notify);
Expand All @@ -963,9 +952,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type)

kfree(battery->bst_data.pointer);

mutex_unlock(&battery->mutex);

mutex_destroy(&battery->mutex);
mutex_destroy(&battery->lock);

kfree(battery);

Expand Down
47 changes: 16 additions & 31 deletions trunk/drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,14 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
return AE_CTRL_TERMINATE;
}

static void ec_remove_handlers(struct acpi_ec *ec)
{
acpi_remove_address_space_handler(ec->handle,
ACPI_ADR_SPACE_EC,
&acpi_ec_space_handler);
acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
}

static int acpi_ec_add(struct acpi_device *device)
{
struct acpi_ec *ec = NULL;
Expand All @@ -719,16 +727,13 @@ static int acpi_ec_add(struct acpi_device *device)
/* Check if we found the boot EC */
if (boot_ec) {
if (boot_ec->gpe == ec->gpe) {
/* We might have incorrect info for GL at boot time */
mutex_lock(&boot_ec->lock);
boot_ec->global_lock = ec->global_lock;
/* Copy handlers from new ec into boot ec */
list_splice(&ec->list, &boot_ec->list);
mutex_unlock(&boot_ec->lock);
kfree(ec);
ec = boot_ec;
ec_remove_handlers(boot_ec);
mutex_destroy(&boot_ec->lock);
kfree(boot_ec);
first_ec = boot_ec = NULL;
}
} else
}
if (!first_ec)
first_ec = ec;
ec->handle = device->handle;
acpi_driver_data(device) = ec;
Expand Down Expand Up @@ -757,9 +762,6 @@ static int acpi_ec_remove(struct acpi_device *device, int type)
if (ec == first_ec)
first_ec = NULL;

/* Don't touch boot EC */
if (boot_ec != ec)
kfree(ec);
return 0;
}

Expand Down Expand Up @@ -823,9 +825,7 @@ static int acpi_ec_start(struct acpi_device *device)
if (!ec)
return -EINVAL;

/* Boot EC is already working */
if (ec != boot_ec)
ret = ec_install_handlers(ec);
ret = ec_install_handlers(ec);

/* EC is fully operational, allow queries */
atomic_set(&ec->query_pending, 0);
Expand All @@ -835,7 +835,6 @@ static int acpi_ec_start(struct acpi_device *device)

static int acpi_ec_stop(struct acpi_device *device, int type)
{
acpi_status status;
struct acpi_ec *ec;

if (!device)
Expand All @@ -844,21 +843,7 @@ static int acpi_ec_stop(struct acpi_device *device, int type)
ec = acpi_driver_data(device);
if (!ec)
return -EINVAL;

/* Don't touch boot EC */
if (ec == boot_ec)
return 0;

status = acpi_remove_address_space_handler(ec->handle,
ACPI_ADR_SPACE_EC,
&acpi_ec_space_handler);
if (ACPI_FAILURE(status))
return -ENODEV;

status = acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
if (ACPI_FAILURE(status))
return -ENODEV;

ec_remove_handlers(ec);
return 0;
}

Expand Down
19 changes: 8 additions & 11 deletions trunk/drivers/acpi/hardware/hwsleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,10 +576,13 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
ACPI_EXCEPTION((AE_INFO, status, "During Method _BFS"));
}

status = acpi_evaluate_object(NULL, METHOD_NAME__WAK, &arg_list, NULL);
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "During Method _WAK"));
}
/* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */

/*
* GPEs must be enabled before _WAK is called as GPEs
* might get fired there
*
* Restore the GPEs:
* 1) Disable/Clear all GPEs
* 2) Enable all runtime GPEs
Expand All @@ -588,19 +591,13 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
acpi_gbl_system_awake_and_running = TRUE;

status = acpi_hw_enable_all_runtime_gpes();
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}

status = acpi_evaluate_object(NULL, METHOD_NAME__WAK, &arg_list, NULL);
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "During Method _WAK"));
}
/* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */

acpi_gbl_system_awake_and_running = TRUE;

/* Enable power button */

(void)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/sleep/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
unsigned long d_min, d_max;

if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
printk(KERN_ERR "ACPI handle has no context!\n");
printk(KERN_DEBUG "ACPI handle has no context!\n");
return -ENODEV;
}

Expand Down
Loading

0 comments on commit 88677d2

Please sign in to comment.