Skip to content

Commit

Permalink
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (30 commits)
  ACPI: work around duplicate name "VID" problem on T61
  acpiphp_ibm: add missing '\n' to error message
  ACPI: add dump_stack() to trace acpi_format_exception programming errors
  make drivers/acpi/scan.c:create_modalias() static
  ACPI: Fix a warning of discarding qualifiers from pointer target type
  ACPI: "ACPI handle has no context!" should be KERN_DEBUG
  ACPI video hotkey: export missing ACPI video hotkey events via input layer
  ACPI: Validate XSDT, use RSDT if XSDT fails
  ACPI: /proc/acpi/thermal_zone trip points are now read-only, mark them as such
  ACPI: fix ia64 allnoconfig build
  PNP: remove null pointer checks
  PNP: remove MODULE infrastructure
  ISAPNP: removed unused isapnp_detected and ISAPNP_DEBUG
  PNPACPI: remove unnecessary casts of "void *"
  PNPACPI: simplify irq_flags()
  PNP: fix up after Lindent
  ACPI: enable GPEs before calling _WAK on resume
  asus-laptop: Fix rmmod of asus_laptop
  sony-laptop: call sonypi_compat_init earlier
  sony-laptop: enable Vaio FZ events
  ...
  • Loading branch information
Linus Torvalds committed Aug 25, 2007
2 parents d1caeb0 + 136c4bb commit 0b887d0
Show file tree
Hide file tree
Showing 47 changed files with 502 additions and 336 deletions.
8 changes: 8 additions & 0 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ Who: Len Brown <len.brown@intel.com>

---------------------------

What: /proc/acpi/event
When: February 2008
Why: /proc/acpi/event has been replaced by events via the input layer
and netlink since 2.6.23.
Who: Len Brown <len.brown@intel.com>

---------------------------

What: Compaq touchscreen device emulation
When: Oct 2007
Files: drivers/input/tsdev.c
Expand Down
19 changes: 10 additions & 9 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -952,14 +952,10 @@ 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.
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.
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.

max_addr=[KMG] [KNL,BOOT,ia64] All physical memory greater than or
equal to this physical address is ignored.
Expand Down Expand Up @@ -1184,7 +1180,8 @@ 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.
nosmp [SMP] Tells an SMP kernel to act as a UP kernel,
and disable the IO APIC. legacy for "maxcpus=0".

nosoftlockup [KNL] Disable the soft-lockup detector.

Expand Down Expand Up @@ -1826,6 +1823,10 @@ 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: 0 additions & 8 deletions arch/i386/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,14 +754,6 @@ 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: 3 additions & 5 deletions arch/x86_64/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,14 +397,12 @@ static void clear_IO_APIC (void)
int skip_ioapic_setup;
int ioapic_force;

/* dummy parsing: see setup.c */

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

/* Actually the next is obsolete, but keep it for paranoid reasons -AK */
static int __init disable_timer_pin_setup(char *arg)
Expand Down
14 changes: 14 additions & 0 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@ config ACPI_PROCFS

Say N to delete /proc/acpi/ files that have moved to /sys/

config ACPI_PROC_EVENT
bool "Deprecated /proc/acpi/event support"
depends on PROC_FS
---help---
A user-space daemon, acpi, typically read /proc/acpi/event
and handled all ACPI sub-system generated events.

These events are now delivered to user-space via
either the input layer, or as netlink events.

This build option enables the old code for for legacy
user-space implementation. After some time, this will
be moved under CONFIG_ACPI_PROCFS, and then deleted.

config ACPI_AC
tristate "AC Adapter"
depends on X86
Expand Down
5 changes: 4 additions & 1 deletion drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
case ACPI_NOTIFY_BUS_CHECK:
case ACPI_NOTIFY_DEVICE_CHECK:
acpi_ac_get_state(ac);
acpi_bus_generate_event(device, event, (u32) ac->state);
acpi_bus_generate_proc_event(device, event, (u32) ac->state);
acpi_bus_generate_netlink_event(device->pnp.device_class,
device->dev.bus_id, event,
(u32) ac->state);
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/asus_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
hotk->brightness = (event & ~((u32) BR_DOWN));
}

acpi_bus_generate_event(hotk->device, event,
acpi_bus_generate_proc_event(hotk->device, event,
hotk->event_count[event % 128]++);

return;
Expand Down
52 changes: 34 additions & 18 deletions 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,14 +129,13 @@ 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 @@ -236,10 +235,10 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
return 0;

/* Evaluate _BIF */
mutex_lock(&battery->lock);
status = acpi_evaluate_object(acpi_battery_handle(battery), "_BIF",
NULL, &buffer);
mutex_unlock(&battery->lock);

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

/* Evaluate _BST */
mutex_lock(&battery->lock);
status = acpi_evaluate_object(acpi_battery_handle(battery), "_BST",
NULL, &buffer);
mutex_unlock(&battery->lock);

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

arg0.integer.value = alarm;

mutex_lock(&battery->lock);
status = acpi_evaluate_object(acpi_battery_handle(battery), "_BTP",
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 @@ -660,6 +658,8 @@ 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,7 +688,9 @@ acpi_battery_write_alarm(struct file *file,
acpi_battery_check_result(battery, result);

if (!result)
return count;
result = count;

mutex_unlock(&battery->mutex);

return result;
}
Expand All @@ -712,6 +714,8 @@ 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 @@ -729,6 +733,7 @@ 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 @@ -867,8 +872,11 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
case ACPI_NOTIFY_DEVICE_CHECK:
device = battery->device;
acpi_battery_notify_update(battery);
acpi_bus_generate_event(device, event,
acpi_bus_generate_proc_event(device, event,
acpi_battery_present(battery));
acpi_bus_generate_netlink_event(device->pnp.device_class,
device->dev.bus_id, event,
acpi_battery_present(battery));
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
Expand All @@ -892,7 +900,10 @@ static int acpi_battery_add(struct acpi_device *device)
if (!battery)
return -ENOMEM;

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

mutex_lock(&battery->mutex);

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

mutex_unlock(&battery->mutex);

return result;
}
Expand All @@ -942,6 +954,8 @@ 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 @@ -952,7 +966,9 @@ static int acpi_battery_remove(struct acpi_device *device, int type)

kfree(battery->bst_data.pointer);

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

mutex_destroy(&battery->mutex);

kfree(battery);

Expand Down
10 changes: 4 additions & 6 deletions drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,15 @@ EXPORT_SYMBOL(acpi_bus_set_power);
Event Management
-------------------------------------------------------------------------- */

#ifdef CONFIG_ACPI_PROC_EVENT
static DEFINE_SPINLOCK(acpi_bus_event_lock);

LIST_HEAD(acpi_bus_event_list);
DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);

extern int event_is_open;

int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data)
int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
{
struct acpi_bus_event *event = NULL;
unsigned long flags = 0;
Expand All @@ -292,10 +293,6 @@ int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data)
if (!device)
return -EINVAL;

if (acpi_bus_generate_genetlink_event(device, type, data))
printk(KERN_WARNING PREFIX
"Failed to generate an ACPI event via genetlink!\n");

/* drop event on the floor if no one's listening */
if (!event_is_open)
return 0;
Expand All @@ -318,7 +315,7 @@ int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data)
return 0;
}

EXPORT_SYMBOL(acpi_bus_generate_event);
EXPORT_SYMBOL(acpi_bus_generate_proc_event);

int acpi_bus_receive_event(struct acpi_bus_event *event)
{
Expand Down Expand Up @@ -364,6 +361,7 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
}

EXPORT_SYMBOL(acpi_bus_receive_event);
#endif /* CONFIG_ACPI_PROC_EVENT */

/* --------------------------------------------------------------------------
Notification Handling
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
}
input_sync(input);

acpi_bus_generate_event(button->device, event,
acpi_bus_generate_proc_event(button->device, event,
++button->pushed);
break;
default:
Expand Down
Loading

0 comments on commit 0b887d0

Please sign in to comment.