Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166478
b: refs/heads/master
c: ba77d20
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Sep 26, 2009
1 parent cfa892b commit 95e4cfd
Show file tree
Hide file tree
Showing 103 changed files with 4,399 additions and 1,590 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: 2c86963b093c1a0887dfc6b32c6e5ea3a80f2922
refs/heads/master: ba77d20ff56028128259a9282d06b938073f169c
48 changes: 27 additions & 21 deletions trunk/Documentation/laptops/thinkpad-acpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,22 @@ kind to allow it (and it often doesn't!).

Not all bits in the mask can be modified. Not all bits that can be
modified do anything. Not all hot keys can be individually controlled
by the mask. Some models do not support the mask at all, and in those
models, hot keys cannot be controlled individually. The behaviour of
the mask is, therefore, highly dependent on the ThinkPad model.
by the mask. Some models do not support the mask at all. The behaviour
of the mask is, therefore, highly dependent on the ThinkPad model.

The driver will filter out any unmasked hotkeys, so even if the firmware
doesn't allow disabling an specific hotkey, the driver will not report
events for unmasked hotkeys.

Note that unmasking some keys prevents their default behavior. For
example, if Fn+F5 is unmasked, that key will no longer enable/disable
Bluetooth by itself.
Bluetooth by itself in firmware.

Note also that not all Fn key combinations are supported through ACPI.
For example, on the X40, the brightness, volume and "Access IBM" buttons
do not generate ACPI events even with this driver. They *can* be used
through the "ThinkPad Buttons" utility, see http://www.nongnu.org/tpb/
Note also that not all Fn key combinations are supported through ACPI
depending on the ThinkPad model and firmware version. On those
ThinkPads, it is still possible to support some extra hotkeys by
polling the "CMOS NVRAM" at least 10 times per second. The driver
attempts to enables this functionality automatically when required.

procfs notes:

Expand Down Expand Up @@ -255,18 +259,11 @@ sysfs notes:
1: does nothing

hotkey_mask:
bit mask to enable driver-handling (and depending on
bit mask to enable reporting (and depending on
the firmware, ACPI event generation) for each hot key
(see above). Returns the current status of the hot keys
mask, and allows one to modify it.

Note: when NVRAM polling is active, the firmware mask
will be different from the value returned by
hotkey_mask. The driver will retain enabled bits for
hotkeys that are under NVRAM polling even if the
firmware refuses them, and will not set these bits on
the firmware hot key mask.

hotkey_all_mask:
bit mask that should enable event reporting for all
supported hot keys, when echoed to hotkey_mask above.
Expand All @@ -279,17 +276,19 @@ sysfs notes:
bit mask that should enable event reporting for all
supported hot keys, except those which are always
handled by the firmware anyway. Echo it to
hotkey_mask above, to use.
hotkey_mask above, to use. This is the default mask
used by the driver.

hotkey_source_mask:
bit mask that selects which hot keys will the driver
poll the NVRAM for. This is auto-detected by the driver
based on the capabilities reported by the ACPI firmware,
but it can be overridden at runtime.

Hot keys whose bits are set in both hotkey_source_mask
and also on hotkey_mask are polled for in NVRAM. Only a
few hot keys are available through CMOS NVRAM polling.
Hot keys whose bits are set in hotkey_source_mask are
polled for in NVRAM, and reported as hotkey events if
enabled in hotkey_mask. Only a few hot keys are
available through CMOS NVRAM polling.

Warning: when in NVRAM mode, the volume up/down/mute
keys are synthesized according to changes in the mixer,
Expand Down Expand Up @@ -525,14 +524,14 @@ compatibility purposes when hotkey_report_mode is set to 1.
0x2305 System is waking up from suspend to eject bay
0x2404 System is waking up from hibernation to undock
0x2405 System is waking up from hibernation to eject bay
0x5010 Brightness level changed/control event

The above events are never propagated by the driver.

0x3003 Bay ejection (see 0x2x05) complete, can sleep again
0x4003 Undocked (see 0x2x04), can sleep again
0x500B Tablet pen inserted into its storage bay
0x500C Tablet pen removed from its storage bay
0x5010 Brightness level changed (newer Lenovo BIOSes)

The above events are propagated by the driver.

Expand Down Expand Up @@ -621,6 +620,8 @@ For Lenovo models *with* ACPI backlight control:
2. Do *NOT* load up ACPI video, enable the hotkeys in thinkpad-acpi,
and map them to KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN. Process
these keys on userspace somehow (e.g. by calling xbacklight).
The driver will do this automatically if it detects that ACPI video
has been disabled.


Bluetooth
Expand Down Expand Up @@ -1459,3 +1460,8 @@ Sysfs interface changelog:
0x020400: Marker for 16 LEDs support. Also, LEDs that are known
to not exist in a given model are not registered with
the LED sysfs class anymore.

0x020500: Updated hotkey driver, hotkey_mask is always available
and it is always able to disable hot keys. Very old
thinkpads are properly supported. hotkey_bios_mask
is deprecated and marked for removal.
1 change: 1 addition & 0 deletions trunk/arch/alpha/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <asm-generic/vmlinux.lds.h>
#include <asm/thread_info.h>
#include <asm/page.h>
#include <asm/thread_info.h>

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/kernel/entry-header.S
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
ldr r0, [sp]
strex r1, r2, [sp] @ clear the exclusive monitor
ldmib sp, {r1 - pc}^ @ load r1 - pc, cpsr
#else
ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
#endif
.endm

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/mips/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Makefile for the Linux/MIPS kernel.
#

CPPFLAGS_vmlinux.lds := $(KBUILD_CFLAGS)

extra-y := head.o init_task.o vmlinux.lds

obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \
Expand Down
12 changes: 6 additions & 6 deletions trunk/arch/mips/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ PHDRS {
note PT_NOTE FLAGS(4); /* R__ */
}

ifdef CONFIG_32BIT
ifdef CONFIG_CPU_LITTLE_ENDIAN
#ifdef CONFIG_32BIT
#ifdef CONFIG_CPU_LITTLE_ENDIAN
jiffies = jiffies_64;
else
#else
jiffies = jiffies_64 + 4;
endif
else
#endif
#else
jiffies = jiffies_64;
endif
#endif

SECTIONS
{
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/sparc/include/asm/vio.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,6 @@ static inline void *vio_dring_entry(struct vio_dring_state *dr,
static inline u32 vio_dring_avail(struct vio_dring_state *dr,
unsigned int ring_size)
{
MAYBE_BUILD_BUG_ON(!is_power_of_2(ring_size));

return (dr->pending -
((dr->prod - dr->cons) & (ring_size - 1)));
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86/boot/compressed/head_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
*/
.text

#include <linux/init.h>
#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/page_types.h>
#include <asm/boot.h>
#include <asm/asm-offsets.h>

.section ".text.head","ax",@progbits
__HEAD
ENTRY(startup_32)
cld
/*
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86/boot/compressed/head_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
.code32
.text

#include <linux/init.h>
#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/pgtable_types.h>
Expand All @@ -33,7 +34,7 @@
#include <asm/processor-flags.h>
#include <asm/asm-offsets.h>

.section ".text.head"
__HEAD
.code32
ENTRY(startup_32)
cld
Expand Down
6 changes: 4 additions & 2 deletions trunk/arch/x86/boot/compressed/vmlinux.lds.S
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <asm-generic/vmlinux.lds.h>

OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT)

#undef i386
Expand All @@ -18,9 +20,9 @@ SECTIONS
* address 0.
*/
. = 0;
.text.head : {
.head.text : {
_head = . ;
*(.text.head)
HEAD_TEXT
_ehead = . ;
}
.rodata.compressed : {
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/pgtable_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ static inline pteval_t pte_flags(pte_t pte)
typedef struct page *pgtable_t;

extern pteval_t __supported_pte_mask;
extern void set_nx(void);
extern int nx_enabled;

#define pgprot_writecombine pgprot_writecombine
Expand Down
10 changes: 0 additions & 10 deletions trunk/arch/x86/include/asm/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,11 @@ static inline int numa_node_id(void)
return 0;
}

static inline int cpu_to_node(int cpu)
{
return 0;
}

static inline int early_cpu_to_node(int cpu)
{
return 0;
}

static inline const struct cpumask *cpumask_of_node(int node)
{
return cpu_online_mask;
}

static inline void setup_node_to_cpumask_map(void) { }

#endif
Expand Down
7 changes: 4 additions & 3 deletions trunk/arch/x86/kernel/cpu/mcheck/mce-inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ static struct notifier_block mce_raise_nb = {
};

/* Inject mce on current CPU */
static int raise_local(struct mce *m)
static int raise_local(void)
{
struct mce *m = &__get_cpu_var(injectm);
int context = MCJ_CTX(m->inject_flags);
int ret = 0;
int cpu = m->extcpu;
Expand Down Expand Up @@ -167,12 +168,12 @@ static void raise_mce(struct mce *m)
}
cpu_relax();
}
raise_local(m);
raise_local();
put_cpu();
put_online_cpus();
} else
#endif
raise_local(m);
raise_local();
}

/* Error injection interface */
Expand Down
23 changes: 21 additions & 2 deletions trunk/arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,20 +305,33 @@ static int msr_to_offset(u32 msr)
static u64 mce_rdmsrl(u32 msr)
{
u64 v;

if (__get_cpu_var(injectm).finished) {
int offset = msr_to_offset(msr);

if (offset < 0)
return 0;
return *(u64 *)((char *)&__get_cpu_var(injectm) + offset);
}
rdmsrl(msr, v);

if (rdmsrl_safe(msr, &v)) {
WARN_ONCE(1, "mce: Unable to read msr %d!\n", msr);
/*
* Return zero in case the access faulted. This should
* not happen normally but can happen if the CPU does
* something weird, or if the code is buggy.
*/
v = 0;
}

return v;
}

static void mce_wrmsrl(u32 msr, u64 v)
{
if (__get_cpu_var(injectm).finished) {
int offset = msr_to_offset(msr);

if (offset >= 0)
*(u64 *)((char *)&__get_cpu_var(injectm) + offset) = v;
return;
Expand Down Expand Up @@ -415,7 +428,7 @@ static inline void mce_get_rip(struct mce *m, struct pt_regs *regs)
m->ip = mce_rdmsrl(rip_msr);
}

#ifdef CONFIG_X86_LOCAL_APIC
#ifdef CONFIG_X86_LOCAL_APIC
/*
* Called after interrupts have been reenabled again
* when a MCE happened during an interrupts off region
Expand Down Expand Up @@ -1172,6 +1185,7 @@ static int mce_banks_init(void)
return -ENOMEM;
for (i = 0; i < banks; i++) {
struct mce_bank *b = &mce_banks[i];

b->ctl = -1ULL;
b->init = 1;
}
Expand Down Expand Up @@ -1203,6 +1217,7 @@ static int __cpuinit mce_cap_init(void)
banks = b;
if (!mce_banks) {
int err = mce_banks_init();

if (err)
return err;
}
Expand Down Expand Up @@ -1237,6 +1252,7 @@ static void mce_init(void)

for (i = 0; i < banks; i++) {
struct mce_bank *b = &mce_banks[i];

if (!b->init)
continue;
wrmsrl(MSR_IA32_MCx_CTL(i), b->ctl);
Expand Down Expand Up @@ -1626,6 +1642,7 @@ static int mce_disable(void)

for (i = 0; i < banks; i++) {
struct mce_bank *b = &mce_banks[i];

if (b->init)
wrmsrl(MSR_IA32_MCx_CTL(i), 0);
}
Expand Down Expand Up @@ -1911,6 +1928,7 @@ static void mce_disable_cpu(void *h)
cmci_clear();
for (i = 0; i < banks; i++) {
struct mce_bank *b = &mce_banks[i];

if (b->init)
wrmsrl(MSR_IA32_MCx_CTL(i), 0);
}
Expand All @@ -1928,6 +1946,7 @@ static void mce_reenable_cpu(void *h)
cmci_reenable();
for (i = 0; i < banks; i++) {
struct mce_bank *b = &mce_banks[i];

if (b->init)
wrmsrl(MSR_IA32_MCx_CTL(i), b->ctl);
}
Expand Down
Loading

0 comments on commit 95e4cfd

Please sign in to comment.