Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190837
b: refs/heads/master
c: e6114fa
h: refs/heads/master
i:
  190835: 3e9993d
v: v3
  • Loading branch information
Anatolij Gustschin authored and Greg Kroah-Hartman committed May 13, 2010
1 parent ad1bde6 commit 9ec9f97
Show file tree
Hide file tree
Showing 41 changed files with 280 additions and 288 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: 4462dc02842698f173f518c1f5ce79c0fb89395a
refs/heads/master: e6114fa1d1d6a588766f28081b971047dd3e5def
38 changes: 38 additions & 0 deletions trunk/arch/powerpc/include/asm/hw_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,43 @@ static inline int irqs_disabled_flags(unsigned long flags)
*/
struct irq_chip;

#ifdef CONFIG_PERF_EVENTS

#ifdef CONFIG_PPC64
static inline unsigned long test_perf_event_pending(void)
{
unsigned long x;

asm volatile("lbz %0,%1(13)"
: "=r" (x)
: "i" (offsetof(struct paca_struct, perf_event_pending)));
return x;
}

static inline void set_perf_event_pending(void)
{
asm volatile("stb %0,%1(13)" : :
"r" (1),
"i" (offsetof(struct paca_struct, perf_event_pending)));
}

static inline void clear_perf_event_pending(void)
{
asm volatile("stb %0,%1(13)" : :
"r" (0),
"i" (offsetof(struct paca_struct, perf_event_pending)));
}
#endif /* CONFIG_PPC64 */

#else /* CONFIG_PERF_EVENTS */

static inline unsigned long test_perf_event_pending(void)
{
return 0;
}

static inline void clear_perf_event_pending(void) {}
#endif /* CONFIG_PERF_EVENTS */

#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_HW_IRQ_H */
1 change: 1 addition & 0 deletions trunk/arch/powerpc/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ int main(void)
DEFINE(PACAKMSR, offsetof(struct paca_struct, kernel_msr));
DEFINE(PACASOFTIRQEN, offsetof(struct paca_struct, soft_enabled));
DEFINE(PACAHARDIRQEN, offsetof(struct paca_struct, hard_enabled));
DEFINE(PACAPERFPEND, offsetof(struct paca_struct, perf_event_pending));
DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
#ifdef CONFIG_PPC_MM_SLICES
DEFINE(PACALOWSLICESPSIZE, offsetof(struct paca_struct,
Expand Down
5 changes: 2 additions & 3 deletions trunk/arch/powerpc/kernel/dma-swiotlb.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/*
* Contains routines needed to support swiotlb for ppc.
*
* Copyright (C) 2009-2010 Freescale Semiconductor, Inc.
* Author: Becky Bruce
* Copyright (C) 2009 Becky Bruce, Freescale Semiconductor
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Expand Down Expand Up @@ -71,7 +70,7 @@ static int ppc_swiotlb_bus_notify(struct notifier_block *nb,
sd->max_direct_dma_addr = 0;

/* May need to bounce if the device can't address all of DRAM */
if ((dma_get_mask(dev) + 1) < lmb_end_of_DRAM())
if (dma_get_mask(dev) < lmb_end_of_DRAM())
set_dma_ops(dev, &swiotlb_dma_ops);

return NOTIFY_DONE;
Expand Down
9 changes: 9 additions & 0 deletions trunk/arch/powerpc/kernel/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,15 @@ ALT_FW_FTR_SECTION_END_IFCLR(FW_FEATURE_ISERIES)
2:
TRACE_AND_RESTORE_IRQ(r5);

#ifdef CONFIG_PERF_EVENTS
/* check paca->perf_event_pending if we're enabling ints */
lbz r3,PACAPERFPEND(r13)
and. r3,r3,r5
beq 27f
bl .perf_event_do_pending
27:
#endif /* CONFIG_PERF_EVENTS */

/* extract EE bit and use it to restore paca->hard_enabled */
ld r3,_MSR(r1)
rldicl r4,r3,49,63 /* r0 = (r3 >> 15) & 1 */
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <linux/bootmem.h>
#include <linux/pci.h>
#include <linux/debugfs.h>
#include <linux/perf_event.h>

#include <asm/uaccess.h>
#include <asm/system.h>
Expand Down Expand Up @@ -144,6 +145,11 @@ notrace void raw_local_irq_restore(unsigned long en)
}
#endif /* CONFIG_PPC_STD_MMU_64 */

if (test_perf_event_pending()) {
clear_perf_event_pending();
perf_event_do_pending();
}

/*
* if (get_paca()->hard_enabled) return;
* But again we need to take care that gcc gets hard_enabled directly
Expand Down
60 changes: 12 additions & 48 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,60 +532,25 @@ void __init iSeries_time_init_early(void)
}
#endif /* CONFIG_PPC_ISERIES */

#ifdef CONFIG_PERF_EVENTS

/*
* 64-bit uses a byte in the PACA, 32-bit uses a per-cpu variable...
*/
#ifdef CONFIG_PPC64
static inline unsigned long test_perf_event_pending(void)
{
unsigned long x;

asm volatile("lbz %0,%1(13)"
: "=r" (x)
: "i" (offsetof(struct paca_struct, perf_event_pending)));
return x;
}

static inline void set_perf_event_pending_flag(void)
{
asm volatile("stb %0,%1(13)" : :
"r" (1),
"i" (offsetof(struct paca_struct, perf_event_pending)));
}

static inline void clear_perf_event_pending(void)
{
asm volatile("stb %0,%1(13)" : :
"r" (0),
"i" (offsetof(struct paca_struct, perf_event_pending)));
}

#else /* 32-bit */

#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_PPC32)
DEFINE_PER_CPU(u8, perf_event_pending);

#define set_perf_event_pending_flag() __get_cpu_var(perf_event_pending) = 1
#define test_perf_event_pending() __get_cpu_var(perf_event_pending)
#define clear_perf_event_pending() __get_cpu_var(perf_event_pending) = 0

#endif /* 32 vs 64 bit */

void set_perf_event_pending(void)
{
preempt_disable();
set_perf_event_pending_flag();
get_cpu_var(perf_event_pending) = 1;
set_dec(1);
preempt_enable();
put_cpu_var(perf_event_pending);
}

#else /* CONFIG_PERF_EVENTS */
#define test_perf_event_pending() __get_cpu_var(perf_event_pending)
#define clear_perf_event_pending() __get_cpu_var(perf_event_pending) = 0

#else /* CONFIG_PERF_EVENTS && CONFIG_PPC32 */

#define test_perf_event_pending() 0
#define clear_perf_event_pending()

#endif /* CONFIG_PERF_EVENTS */
#endif /* CONFIG_PERF_EVENTS && CONFIG_PPC32 */

/*
* For iSeries shared processors, we have to let the hypervisor
Expand Down Expand Up @@ -617,6 +582,10 @@ void timer_interrupt(struct pt_regs * regs)
set_dec(DECREMENTER_MAX);

#ifdef CONFIG_PPC32
if (test_perf_event_pending()) {
clear_perf_event_pending();
perf_event_do_pending();
}
if (atomic_read(&ppc_n_lost_interrupts) != 0)
do_IRQ(regs);
#endif
Expand All @@ -635,11 +604,6 @@ void timer_interrupt(struct pt_regs * regs)

calculate_steal_time();

if (test_perf_event_pending()) {
clear_perf_event_pending();
perf_event_do_pending();
}

#ifdef CONFIG_PPC_ISERIES
if (firmware_has_feature(FW_FEATURE_ISERIES))
get_lppaca()->int_dword.fields.decr_int = 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/kernel/head31.S
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ startup_continue:
_ehead:

#ifdef CONFIG_SHARED_KERNEL
.org 0x100000 - 0x11000 # head.o ends at 0x11000
.org 0x100000
#endif

#
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/kernel/head64.S
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ startup_continue:
_ehead:

#ifdef CONFIG_SHARED_KERNEL
.org 0x100000 - 0x11000 # head.o ends at 0x11000
.org 0x100000
#endif

#
Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/s390/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,

asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
{
long ret = 0;
long ret;

/* Do the secure computing check first. */
secure_computing(regs->gprs[2]);
Expand All @@ -649,6 +649,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
* The sysc_tracesys code in entry.S stored the system
* call number to gprs[2].
*/
ret = regs->gprs[2];
if (test_thread_flag(TIF_SYSCALL_TRACE) &&
(tracehook_report_syscall_entry(regs) ||
regs->gprs[2] >= NR_syscalls)) {
Expand All @@ -670,7 +671,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
regs->gprs[2], regs->orig_gpr2,
regs->gprs[3], regs->gprs[4],
regs->gprs[5]);
return ret ?: regs->gprs[2];
return ret;
}

asmlinkage void do_syscall_trace_exit(struct pt_regs *regs)
Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/input/joystick/iforce/iforce-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ static signed short btn_avb_wheel[] =
static signed short abs_joystick[] =
{ ABS_X, ABS_Y, ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y, -1 };

static signed short abs_joystick_rudder[] =
{ ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER, ABS_HAT0X, ABS_HAT0Y, -1 };

static signed short abs_avb_pegasus[] =
{ ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER, ABS_HAT0X, ABS_HAT0Y,
ABS_HAT1X, ABS_HAT1Y, -1 };
Expand All @@ -79,9 +76,8 @@ static struct iforce_device iforce_device[] = {
{ 0x061c, 0xc0a4, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce }, //?
{ 0x061c, 0xc084, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce },
{ 0x06f8, 0x0001, "Guillemot Race Leader Force Feedback", btn_wheel, abs_wheel, ff_iforce }, //?
{ 0x06f8, 0x0001, "Guillemot Jet Leader Force Feedback", btn_joystick, abs_joystick_rudder, ff_iforce },
{ 0x06f8, 0x0004, "Guillemot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //?
{ 0x06f8, 0xa302, "Guillemot Jet Leader 3D", btn_joystick, abs_joystick, ff_iforce }, //?
{ 0x06f8, 0x0004, "Gullemot Jet Leader 3D", btn_joystick, abs_joystick, ff_iforce }, //?
{ 0x06d6, 0x29bc, "Trust Force Feedback Race Master", btn_wheel, abs_wheel, ff_iforce },
{ 0x0000, 0x0000, "Unknown I-Force Device [%04x:%04x]", btn_joystick, abs_joystick, ff_iforce }
};
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/input/joystick/iforce/iforce-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ static struct usb_device_id iforce_usb_ids [] = {
{ USB_DEVICE(0x061c, 0xc0a4) }, /* ACT LABS Force RS */
{ USB_DEVICE(0x061c, 0xc084) }, /* ACT LABS Force RS */
{ USB_DEVICE(0x06f8, 0x0001) }, /* Guillemot Race Leader Force Feedback */
{ USB_DEVICE(0x06f8, 0x0003) }, /* Guillemot Jet Leader Force Feedback */
{ USB_DEVICE(0x06f8, 0x0004) }, /* Guillemot Force Feedback Racing Wheel */
{ USB_DEVICE(0x06f8, 0xa302) }, /* Guillemot Jet Leader 3D */
{ } /* Terminating entry */
Expand Down
24 changes: 12 additions & 12 deletions trunk/drivers/input/mouse/elantech.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
int fingers;
static int old_fingers;

if (etd->fw_version < 0x020000) {
if (etd->fw_version_maj == 0x01) {
/*
* byte 0: D U p1 p2 1 p3 R L
* byte 1: f 0 th tw x9 x8 y9 y8
Expand Down Expand Up @@ -227,7 +227,7 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);

if (etd->fw_version < 0x020000 &&
if ((etd->fw_version_maj == 0x01) &&
(etd->capabilities & ETP_CAP_HAS_ROCKER)) {
/* rocker up */
input_report_key(dev, BTN_FORWARD, packet[0] & 0x40);
Expand Down Expand Up @@ -321,7 +321,7 @@ static int elantech_check_parity_v1(struct psmouse *psmouse)
unsigned char p1, p2, p3;

/* Parity bits are placed differently */
if (etd->fw_version < 0x020000) {
if (etd->fw_version_maj == 0x01) {
/* byte 0: D U p1 p2 1 p3 R L */
p1 = (packet[0] & 0x20) >> 5;
p2 = (packet[0] & 0x10) >> 4;
Expand Down Expand Up @@ -457,7 +457,7 @@ static void elantech_set_input_params(struct psmouse *psmouse)
switch (etd->hw_version) {
case 1:
/* Rocker button */
if (etd->fw_version < 0x020000 &&
if ((etd->fw_version_maj == 0x01) &&
(etd->capabilities & ETP_CAP_HAS_ROCKER)) {
__set_bit(BTN_FORWARD, dev->keybit);
__set_bit(BTN_BACK, dev->keybit);
Expand Down Expand Up @@ -686,14 +686,15 @@ int elantech_init(struct psmouse *psmouse)
pr_err("elantech.c: failed to query firmware version.\n");
goto init_fail;
}

etd->fw_version = (param[0] << 16) | (param[1] << 8) | param[2];
etd->fw_version_maj = param[0];
etd->fw_version_min = param[2];

/*
* Assume every version greater than this is new EeePC style
* hardware with 6 byte packets
*/
if (etd->fw_version >= 0x020030) {
if ((etd->fw_version_maj == 0x02 && etd->fw_version_min >= 0x30) ||
etd->fw_version_maj > 0x02) {
etd->hw_version = 2;
/* For now show extra debug information */
etd->debug = 1;
Expand All @@ -703,9 +704,8 @@ int elantech_init(struct psmouse *psmouse)
etd->hw_version = 1;
etd->paritycheck = 1;
}

pr_info("elantech.c: assuming hardware version %d, firmware version %d.%d.%d\n",
etd->hw_version, param[0], param[1], param[2]);
pr_info("elantech.c: assuming hardware version %d, firmware version %d.%d\n",
etd->hw_version, etd->fw_version_maj, etd->fw_version_min);

if (synaptics_send_cmd(psmouse, ETP_CAPABILITIES_QUERY, param)) {
pr_err("elantech.c: failed to query capabilities.\n");
Expand All @@ -720,8 +720,8 @@ int elantech_init(struct psmouse *psmouse)
* a touch action starts causing the mouse cursor or scrolled page
* to jump. Enable a workaround.
*/
if (etd->fw_version == 0x020022) {
pr_info("elantech.c: firmware version 2.0.34 detected, "
if (etd->fw_version_maj == 0x02 && etd->fw_version_min == 0x22) {
pr_info("elantech.c: firmware version 2.34 detected, "
"enabling jumpy cursor workaround\n");
etd->jumpy_cursor = 1;
}
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/input/mouse/elantech.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ struct elantech_data {
unsigned char reg_26;
unsigned char debug;
unsigned char capabilities;
unsigned char fw_version_maj;
unsigned char fw_version_min;
unsigned char hw_version;
unsigned char paritycheck;
unsigned char jumpy_cursor;
unsigned char hw_version;
unsigned int fw_version;
unsigned char parity[256];
};

Expand Down
14 changes: 4 additions & 10 deletions trunk/drivers/input/mouse/psmouse-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,6 @@ static int psmouse_reconnect(struct serio *serio)
struct psmouse *psmouse = serio_get_drvdata(serio);
struct psmouse *parent = NULL;
struct serio_driver *drv = serio->drv;
unsigned char type;
int rc = -1;

if (!drv || !psmouse) {
Expand All @@ -1414,15 +1413,10 @@ static int psmouse_reconnect(struct serio *serio)
if (psmouse->reconnect) {
if (psmouse->reconnect(psmouse))
goto out;
} else {
psmouse_reset(psmouse);

if (psmouse_probe(psmouse) < 0)
goto out;

type = psmouse_extensions(psmouse, psmouse_max_proto, false);
if (psmouse->type != type)
goto out;
} else if (psmouse_probe(psmouse) < 0 ||
psmouse->type != psmouse_extensions(psmouse,
psmouse_max_proto, false)) {
goto out;
}

/* ok, the device type (and capabilities) match the old one,
Expand Down
Loading

0 comments on commit 9ec9f97

Please sign in to comment.