Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75571
b: refs/heads/master
c: 9559cc2
h: refs/heads/master
i:
  75569: 3f22d02
  75567: c2d8d78
v: v3
  • Loading branch information
Jeff Garzik committed Jan 18, 2008
1 parent 8e1ef75 commit fa02afb
Show file tree
Hide file tree
Showing 39 changed files with 265 additions and 194 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: d101f6496d51cbeb285f531dff059ce0ef28ffe3
refs/heads/master: 9559cc239d6cf50bf64de0bd7662103238e84274
23 changes: 0 additions & 23 deletions trunk/Documentation/local_ops.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,6 @@ long fails. The definition looks like :
typedef struct { atomic_long_t a; } local_t;


* Rules to follow when using local atomic operations

- Variables touched by local ops must be per cpu variables.
- _Only_ the CPU owner of these variables must write to them.
- This CPU can use local ops from any context (process, irq, softirq, nmi, ...)
to update its local_t variables.
- Preemption (or interrupts) must be disabled when using local ops in
process context to make sure the process won't be migrated to a
different CPU between getting the per-cpu variable and doing the
actual local op.
- When using local ops in interrupt context, no special care must be
taken on a mainline kernel, since they will run on the local CPU with
preemption already disabled. I suggest, however, to explicitly
disable preemption anyway to make sure it will still work correctly on
-rt kernels.
- Reading the local cpu variable will provide the current copy of the
variable.
- Reads of these variables can be done from any CPU, because updates to
"long", aligned, variables are always atomic. Since no memory
synchronization is done by the writer CPU, an outdated copy of the
variable can be read when reading some _other_ cpu's variables.


* Rules to follow when using local atomic operations

- Variables touched by local ops must be per cpu variables.
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/math-emu/math.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ alpha_fp_emul (unsigned long pc)
FP_UNPACK_SP(SB, &vb);
DR_c = DB_c;
DR_s = DB_s;
DR_e = DB_e;
DR_e = DB_e + (1024 - 128);
DR_f = SB_f << (52 - 23);
goto pack_d;
}
Expand Down
33 changes: 15 additions & 18 deletions trunk/arch/cris/arch-v10/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
*/

#include <asm-generic/vmlinux.lds.h>

#include <asm/page.h>

jiffies = jiffies_64;
SECTIONS
{
Expand All @@ -23,7 +24,7 @@ SECTIONS
_stext = .;
__stext = .;
.text : {
*(.text)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
*(.fixup)
Expand All @@ -49,10 +50,10 @@ SECTIONS
__edata = . ; /* End of data section */
_edata = . ;

. = ALIGN(8192); /* init_task and stack, must be aligned */
. = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned */
.data.init_task : { *(.data.init_task) }

. = ALIGN(8192); /* Init code and data */
. = ALIGN(PAGE_SIZE); /* Init code and data */
__init_begin = .;
.init.text : {
_sinittext = .;
Expand All @@ -66,13 +67,7 @@ SECTIONS
__setup_end = .;
.initcall.init : {
__initcall_start = .;
*(.initcall1.init);
*(.initcall2.init);
*(.initcall3.init);
*(.initcall4.init);
*(.initcall5.init);
*(.initcall6.init);
*(.initcall7.init);
INITCALLS
__initcall_end = .;
}

Expand All @@ -88,16 +83,18 @@ SECTIONS
__initramfs_start = .;
*(.init.ramfs)
__initramfs_end = .;
/* We fill to the next page, so we can discard all init
pages without needing to consider what payload might be
appended to the kernel image. */
FILL (0);
. = ALIGN (8192);
}
#endif

__vmlinux_end = .; /* last address of the physical file */
__init_end = .;

/*
* We fill to the next page, so we can discard all init
* pages without needing to consider what payload might be
* appended to the kernel image.
*/
. = ALIGN(PAGE_SIZE);

__init_end = .;

__data_end = . ; /* Move to _edata ? */
__bss_start = .; /* BSS */
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/sparc64/kernel/sun4v_tlb_miss.S
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ sun4v_itlb_error:

1: ba,pt %xcc, etrap
2: or %g7, %lo(2b), %g7
mov %l4, %o1
call sun4v_itlb_error_report
add %sp, PTREGS_OFF, %o0

Expand All @@ -241,6 +242,7 @@ sun4v_dtlb_error:

1: ba,pt %xcc, etrap
2: or %g7, %lo(2b), %g7
mov %l4, %o1
call sun4v_dtlb_error_report
add %sp, PTREGS_OFF, %o0

Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/sparc64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1950,6 +1950,8 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
regs->tpc, tl);
print_symbol(KERN_EMERG "SUN4V-ITLB: TPC<%s>\n", regs->tpc);
printk(KERN_EMERG "SUN4V-ITLB: O7[%lx]\n", regs->u_regs[UREG_I7]);
print_symbol(KERN_EMERG "SUN4V-ITLB: O7<%s>\n", regs->u_regs[UREG_I7]);
printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] "
"pte[%lx] error[%lx]\n",
sun4v_err_itlb_vaddr, sun4v_err_itlb_ctx,
Expand All @@ -1971,6 +1973,8 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl)
printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n",
regs->tpc, tl);
print_symbol(KERN_EMERG "SUN4V-DTLB: TPC<%s>\n", regs->tpc);
printk(KERN_EMERG "SUN4V-DTLB: O7[%lx]\n", regs->u_regs[UREG_I7]);
print_symbol(KERN_EMERG "SUN4V-DTLB: O7<%s>\n", regs->u_regs[UREG_I7]);
printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] "
"pte[%lx] error[%lx]\n",
sun4v_err_dtlb_vaddr, sun4v_err_dtlb_ctx,
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/kernel/traps_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ fastcall void do_##name(struct pt_regs * regs, long error_code) \
info.si_errno = 0; \
info.si_code = sicode; \
info.si_addr = (void __user *)siaddr; \
trace_hardirqs_fixup(); \
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
== NOTIFY_STOP) \
return; \
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/kernel/traps_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
info.si_errno = 0; \
info.si_code = sicode; \
info.si_addr = (void __user *)siaddr; \
trace_hardirqs_fixup(); \
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
== NOTIFY_STOP) \
return; \
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/cpufreq/cpufreq_conservative.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,5 +603,9 @@ MODULE_DESCRIPTION ("'cpufreq_conservative' - A dynamic cpufreq governor for "
"optimised for use in a battery environment");
MODULE_LICENSE ("GPL");

#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
fs_initcall(cpufreq_gov_dbs_init);
#else
module_init(cpufreq_gov_dbs_init);
#endif
module_exit(cpufreq_gov_dbs_exit);
5 changes: 4 additions & 1 deletion trunk/drivers/cpufreq/cpufreq_ondemand.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,9 @@ MODULE_DESCRIPTION("'cpufreq_ondemand' - A dynamic cpufreq governor for "
"Low Latency Frequency Transition capable processors");
MODULE_LICENSE("GPL");

#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
fs_initcall(cpufreq_gov_dbs_init);
#else
module_init(cpufreq_gov_dbs_init);
#endif
module_exit(cpufreq_gov_dbs_exit);

4 changes: 4 additions & 0 deletions trunk/drivers/cpufreq/cpufreq_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,9 @@ MODULE_AUTHOR ("Dominik Brodowski <linux@brodo.de>, Russell King <rmk@arm.linux.
MODULE_DESCRIPTION ("CPUfreq policy governor 'userspace'");
MODULE_LICENSE ("GPL");

#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
fs_initcall(cpufreq_gov_userspace_init);
#else
module_init(cpufreq_gov_userspace_init);
#endif
module_exit(cpufreq_gov_userspace_exit);
2 changes: 1 addition & 1 deletion trunk/drivers/input/mouse/alps.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static const struct alps_model_info alps_model_data[] = {
{ { 0x20, 0x02, 0x0e }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* XXX */
{ { 0x22, 0x02, 0x0a }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT },
{ { 0x22, 0x02, 0x14 }, 0xff, 0xff, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude D600 */
{ { 0x73, 0x02, 0x50 }, 0xcf, 0xff, ALPS_FW_BK_1 } /* Dell Vostro 1400 */
{ { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FW_BK_1 } /* Dell Vostro 1400 */
};

/*
Expand Down
7 changes: 6 additions & 1 deletion trunk/drivers/input/mouse/lifebook.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,13 @@ static void lifebook_set_resolution(struct psmouse *psmouse, unsigned int resolu

static void lifebook_disconnect(struct psmouse *psmouse)
{
struct lifebook_data *priv = psmouse->private;

psmouse_reset(psmouse);
kfree(psmouse->private);
if (priv) {
input_unregister_device(priv->dev2);
kfree(priv);
}
psmouse->private = NULL;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/input/mouse/psmouse-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,8 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv)
err_pt_deactivate:
if (parent && parent->pt_deactivate)
parent->pt_deactivate(parent);
input_unregister_device(psmouse->dev);
input_dev = NULL; /* so we don't try to free it below */
err_protocol_disconnect:
if (psmouse->disconnect)
psmouse->disconnect(psmouse);
Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/input/mousedev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,15 @@ static const struct input_device_id mousedev_ids[] = {
BIT_MASK(ABS_PRESSURE) |
BIT_MASK(ABS_TOOL_WIDTH) },
}, /* A touchpad */
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_KEYBIT |
INPUT_DEVICE_ID_MATCH_ABSBIT,
.evbit = { BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_SYN) },
.keybit = { [BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) },
.absbit = { BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) },
}, /* Mouse-like device with absolute X and Y but ordinary
clicks, like hp ILO2 High Performance mouse */

{ }, /* Terminating entry */
};
Expand Down
55 changes: 33 additions & 22 deletions trunk/drivers/input/touchscreen/usbtouchscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* - DMC TSC-10/25
* - IRTOUCHSYSTEMS/UNITOP
* - IdealTEK URTC1000
* - General Touch
* - GoTop Super_Q2/GogoPen/PenPower tablets
*
* Copyright (C) 2004-2007 by Daniel Ritz <daniel.ritz@gmx.ch>
Expand Down Expand Up @@ -50,7 +51,7 @@
#include <linux/usb/input.h>


#define DRIVER_VERSION "v0.5"
#define DRIVER_VERSION "v0.6"
#define DRIVER_AUTHOR "Daniel Ritz <daniel.ritz@gmx.ch>"
#define DRIVER_DESC "USB Touchscreen Driver"

Expand All @@ -65,17 +66,21 @@ struct usbtouch_device_info {
int min_yc, max_yc;
int min_press, max_press;
int rept_size;
int flags;

void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len);

/*
* used to get the packet len. possible return values:
* > 0: packet len
* = 0: skip one byte
* < 0: -return value more bytes needed
*/
int (*get_pkt_len) (unsigned char *pkt, int len);

int (*read_data) (struct usbtouch_usb *usbtouch, unsigned char *pkt);
int (*init) (struct usbtouch_usb *usbtouch);
};

#define USBTOUCH_FLG_BUFFER 0x01


/* a usbtouch device */
struct usbtouch_usb {
unsigned char *data;
Expand All @@ -94,15 +99,6 @@ struct usbtouch_usb {
};


#if defined(CONFIG_TOUCHSCREEN_USB_EGALAX) || defined(CONFIG_TOUCHSCREEN_USB_ETURBO) || defined(CONFIG_TOUCHSCREEN_USB_IDEALTEK)
#define MULTI_PACKET
#endif

#ifdef MULTI_PACKET
static void usbtouch_process_multi(struct usbtouch_usb *usbtouch,
unsigned char *pkt, int len);
#endif

/* device types */
enum {
DEVTPYE_DUMMY = -1,
Expand Down Expand Up @@ -186,6 +182,10 @@ static struct usb_device_id usbtouch_devices[] = {

#ifdef CONFIG_TOUCHSCREEN_USB_EGALAX

#ifndef MULTI_PACKET
#define MULTI_PACKET
#endif

#define EGALAX_PKT_TYPE_MASK 0xFE
#define EGALAX_PKT_TYPE_REPT 0x80
#define EGALAX_PKT_TYPE_DIAG 0x0A
Expand Down Expand Up @@ -323,6 +323,9 @@ static int itm_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
* eTurboTouch part
*/
#ifdef CONFIG_TOUCHSCREEN_USB_ETURBO
#ifndef MULTI_PACKET
#define MULTI_PACKET
#endif
static int eturbo_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
{
unsigned int shift;
Expand Down Expand Up @@ -461,6 +464,9 @@ static int irtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
* IdealTEK URTC1000 Part
*/
#ifdef CONFIG_TOUCHSCREEN_USB_IDEALTEK
#ifndef MULTI_PACKET
#define MULTI_PACKET
#endif
static int idealtek_get_pkt_len(unsigned char *buf, int len)
{
if (buf[0] & 0x80)
Expand Down Expand Up @@ -525,6 +531,11 @@ static int gotop_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
/*****************************************************************************
* the different device descriptors
*/
#ifdef MULTI_PACKET
static void usbtouch_process_multi(struct usbtouch_usb *usbtouch,
unsigned char *pkt, int len);
#endif

static struct usbtouch_device_info usbtouch_dev_info[] = {
#ifdef CONFIG_TOUCHSCREEN_USB_EGALAX
[DEVTYPE_EGALAX] = {
Expand All @@ -533,7 +544,6 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
.min_yc = 0x0,
.max_yc = 0x07ff,
.rept_size = 16,
.flags = USBTOUCH_FLG_BUFFER,
.process_pkt = usbtouch_process_multi,
.get_pkt_len = egalax_get_pkt_len,
.read_data = egalax_read_data,
Expand Down Expand Up @@ -582,7 +592,6 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
.min_yc = 0x0,
.max_yc = 0x07ff,
.rept_size = 8,
.flags = USBTOUCH_FLG_BUFFER,
.process_pkt = usbtouch_process_multi,
.get_pkt_len = eturbo_get_pkt_len,
.read_data = eturbo_read_data,
Expand Down Expand Up @@ -630,7 +639,6 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
.min_yc = 0x0,
.max_yc = 0x0fff,
.rept_size = 8,
.flags = USBTOUCH_FLG_BUFFER,
.process_pkt = usbtouch_process_multi,
.get_pkt_len = idealtek_get_pkt_len,
.read_data = idealtek_read_data,
Expand Down Expand Up @@ -738,11 +746,14 @@ static void usbtouch_process_multi(struct usbtouch_usb *usbtouch,
pos = 0;
while (pos < buf_len) {
/* get packet len */
pkt_len = usbtouch->type->get_pkt_len(buffer + pos, len);
pkt_len = usbtouch->type->get_pkt_len(buffer + pos,
buf_len - pos);

/* unknown packet: drop everything */
if (unlikely(!pkt_len))
goto out_flush_buf;
/* unknown packet: skip one byte */
if (unlikely(!pkt_len)) {
pos++;
continue;
}

/* full packet: process */
if (likely((pkt_len > 0) && (pkt_len <= buf_len - pos))) {
Expand Down Expand Up @@ -857,7 +868,7 @@ static int usbtouch_probe(struct usb_interface *intf,
if (!usbtouch->data)
goto out_free;

if (type->flags & USBTOUCH_FLG_BUFFER) {
if (type->get_pkt_len) {
usbtouch->buffer = kmalloc(type->rept_size, GFP_KERNEL);
if (!usbtouch->buffer)
goto out_free_buffers;
Expand Down
Loading

0 comments on commit fa02afb

Please sign in to comment.