Merge branch 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm

* 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm: (47 commits)
  CLKDEV: Fix clkdev return value for NULL clk case
  ARM: 6891/1: prevent heap corruption in OABI semtimedop
  ARM: kprobes: Tidy-up kprobes-decode.c
  ARM: kprobes: Add emulation of hint instructions like NOP and WFI
  ARM: kprobes: Add emulation of SBFX, UBFX, BFI and BFC instructions
  ARM: kprobes: Add emulation of MOVW and MOVT instructions
  ARM: kprobes: Reject probing of undefined data processing instructions
  ARM: kprobes: Remove redundant code in space_1111
  ARM: kprobes: Fix emulation of PLD instructions
  ARM: kprobes: Reject probing of SETEND instructions
  ARM: kprobes: Consolidate stub decoding functions
  ARM: kprobes: Reject probing of all coprocessor instructions
  ARM: kprobes: Fix emulation of USAD8 instructions
  ARM: kprobes: Fix emulation of SMUAD, SMUSD and SMMUL instructions
  ARM: kprobes: Fix emulation of SXTB16, SXTB, SXTH, UXTB16, UXTB and UXTH instructions
  ARM: kprobes: Reject probing of undefined media instructions
  ARM: kprobes: Add emulation of RBIT instruction
  ARM: kprobes: Reject probing of LDRB instructions which load PC
  ARM: kprobes: Fix emulation of LDRD and STRD instructions
  ARM: kprobes: Reject probing of LDR/STR instructions which update PC unpredictably
  ...
This commit is contained in:
Linus Torvalds 2011-05-02 12:17:05 -07:00
commit 625a3b6057
20 changed files with 536 additions and 361 deletions

View file

@ -39,10 +39,13 @@ typedef u32 kprobe_opcode_t;
struct kprobe; struct kprobe;
typedef void (kprobe_insn_handler_t)(struct kprobe *, struct pt_regs *); typedef void (kprobe_insn_handler_t)(struct kprobe *, struct pt_regs *);
typedef unsigned long (kprobe_check_cc)(unsigned long);
/* Architecture specific copy of original instruction. */ /* Architecture specific copy of original instruction. */
struct arch_specific_insn { struct arch_specific_insn {
kprobe_opcode_t *insn; kprobe_opcode_t *insn;
kprobe_insn_handler_t *insn_handler; kprobe_insn_handler_t *insn_handler;
kprobe_check_cc *insn_check_cc;
}; };
struct prev_kprobe { struct prev_kprobe {

File diff suppressed because it is too large Load diff

View file

@ -134,7 +134,8 @@ static void __kprobes singlestep(struct kprobe *p, struct pt_regs *regs,
struct kprobe_ctlblk *kcb) struct kprobe_ctlblk *kcb)
{ {
regs->ARM_pc += 4; regs->ARM_pc += 4;
p->ainsn.insn_handler(p, regs); if (p->ainsn.insn_check_cc(regs->ARM_cpsr))
p->ainsn.insn_handler(p, regs);
} }
/* /*

View file

@ -746,7 +746,8 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
tail = (struct frame_tail __user *)regs->ARM_fp - 1; tail = (struct frame_tail __user *)regs->ARM_fp - 1;
while (tail && !((unsigned long)tail & 0x3)) while ((entry->nr < PERF_MAX_STACK_DEPTH) &&
tail && !((unsigned long)tail & 0x3))
tail = user_backtrace(tail, entry); tail = user_backtrace(tail, entry);
} }

View file

@ -479,7 +479,7 @@ static void broadcast_timer_set_mode(enum clock_event_mode mode,
{ {
} }
static void broadcast_timer_setup(struct clock_event_device *evt) static void __cpuinit broadcast_timer_setup(struct clock_event_device *evt)
{ {
evt->name = "dummy_timer"; evt->name = "dummy_timer";
evt->features = CLOCK_EVT_FEAT_ONESHOT | evt->features = CLOCK_EVT_FEAT_ONESHOT |

View file

@ -311,7 +311,7 @@ asmlinkage long sys_oabi_semtimedop(int semid,
long err; long err;
int i; int i;
if (nsops < 1) if (nsops < 1 || nsops > SEMOPM)
return -EINVAL; return -EINVAL;
sops = kmalloc(sizeof(*sops) * nsops, GFP_KERNEL); sops = kmalloc(sizeof(*sops) * nsops, GFP_KERNEL);
if (!sops) if (!sops)

View file

@ -63,6 +63,7 @@ config MACH_DAVINCI_EVM
depends on ARCH_DAVINCI_DM644x depends on ARCH_DAVINCI_DM644x
select MISC_DEVICES select MISC_DEVICES
select EEPROM_AT24 select EEPROM_AT24
select I2C
help help
Configure this option to specify the whether the board used Configure this option to specify the whether the board used
for development is a DM644x EVM for development is a DM644x EVM
@ -72,6 +73,7 @@ config MACH_SFFSDR
depends on ARCH_DAVINCI_DM644x depends on ARCH_DAVINCI_DM644x
select MISC_DEVICES select MISC_DEVICES
select EEPROM_AT24 select EEPROM_AT24
select I2C
help help
Say Y here to select the Lyrtech Small Form Factor Say Y here to select the Lyrtech Small Form Factor
Software Defined Radio (SFFSDR) board. Software Defined Radio (SFFSDR) board.
@ -105,6 +107,7 @@ config MACH_DAVINCI_DM6467_EVM
select MACH_DAVINCI_DM6467TEVM select MACH_DAVINCI_DM6467TEVM
select MISC_DEVICES select MISC_DEVICES
select EEPROM_AT24 select EEPROM_AT24
select I2C
help help
Configure this option to specify the whether the board used Configure this option to specify the whether the board used
for development is a DM6467 EVM for development is a DM6467 EVM
@ -118,6 +121,7 @@ config MACH_DAVINCI_DM365_EVM
depends on ARCH_DAVINCI_DM365 depends on ARCH_DAVINCI_DM365
select MISC_DEVICES select MISC_DEVICES
select EEPROM_AT24 select EEPROM_AT24
select I2C
help help
Configure this option to specify whether the board used Configure this option to specify whether the board used
for development is a DM365 EVM for development is a DM365 EVM
@ -129,6 +133,7 @@ config MACH_DAVINCI_DA830_EVM
select GPIO_PCF857X select GPIO_PCF857X
select MISC_DEVICES select MISC_DEVICES
select EEPROM_AT24 select EEPROM_AT24
select I2C
help help
Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module. Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module.
@ -205,6 +210,7 @@ config MACH_MITYOMAPL138
depends on ARCH_DAVINCI_DA850 depends on ARCH_DAVINCI_DA850
select MISC_DEVICES select MISC_DEVICES
select EEPROM_AT24 select EEPROM_AT24
select I2C
help help
Say Y here to select the Critical Link MityDSP-L138/MityARM-1808 Say Y here to select the Critical Link MityDSP-L138/MityARM-1808
System on Module. Information on this SoM may be found at System on Module. Information on this SoM may be found at

View file

@ -29,7 +29,7 @@
#include <mach/mux.h> #include <mach/mux.h>
#include <mach/spi.h> #include <mach/spi.h>
#define MITYOMAPL138_PHY_ID "0:03" #define MITYOMAPL138_PHY_ID ""
#define FACTORY_CONFIG_MAGIC 0x012C0138 #define FACTORY_CONFIG_MAGIC 0x012C0138
#define FACTORY_CONFIG_VERSION 0x00010001 #define FACTORY_CONFIG_VERSION 0x00010001
@ -414,7 +414,7 @@ static struct resource mityomapl138_nandflash_resource[] = {
static struct platform_device mityomapl138_nandflash_device = { static struct platform_device mityomapl138_nandflash_device = {
.name = "davinci_nand", .name = "davinci_nand",
.id = 0, .id = 1,
.dev = { .dev = {
.platform_data = &mityomapl138_nandflash_data, .platform_data = &mityomapl138_nandflash_data,
}, },

View file

@ -39,7 +39,8 @@
#define DA8XX_GPIO_BASE 0x01e26000 #define DA8XX_GPIO_BASE 0x01e26000
#define DA8XX_I2C1_BASE 0x01e28000 #define DA8XX_I2C1_BASE 0x01e28000
#define DA8XX_SPI0_BASE 0x01c41000 #define DA8XX_SPI0_BASE 0x01c41000
#define DA8XX_SPI1_BASE 0x01f0e000 #define DA830_SPI1_BASE 0x01e12000
#define DA850_SPI1_BASE 0x01f0e000
#define DA8XX_EMAC_CTRL_REG_OFFSET 0x3000 #define DA8XX_EMAC_CTRL_REG_OFFSET 0x3000
#define DA8XX_EMAC_MOD_REG_OFFSET 0x2000 #define DA8XX_EMAC_MOD_REG_OFFSET 0x2000
@ -762,8 +763,8 @@ static struct resource da8xx_spi0_resources[] = {
static struct resource da8xx_spi1_resources[] = { static struct resource da8xx_spi1_resources[] = {
[0] = { [0] = {
.start = DA8XX_SPI1_BASE, .start = DA830_SPI1_BASE,
.end = DA8XX_SPI1_BASE + SZ_4K - 1, .end = DA830_SPI1_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
@ -832,5 +833,10 @@ int __init da8xx_register_spi(int instance, struct spi_board_info *info,
da8xx_spi_pdata[instance].num_chipselect = len; da8xx_spi_pdata[instance].num_chipselect = len;
if (instance == 1 && cpu_is_davinci_da850()) {
da8xx_spi1_resources[0].start = DA850_SPI1_BASE;
da8xx_spi1_resources[0].end = DA850_SPI1_BASE + SZ_4K - 1;
}
return platform_device_register(&da8xx_spi_device[instance]); return platform_device_register(&da8xx_spi_device[instance]);
} }

View file

@ -24,6 +24,9 @@
#define UART_SHIFT 2 #define UART_SHIFT 2
#define davinci_uart_v2p(x) ((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
#define davinci_uart_p2v(x) ((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET)
.pushsection .data .pushsection .data
davinci_uart_phys: .word 0 davinci_uart_phys: .word 0
davinci_uart_virt: .word 0 davinci_uart_virt: .word 0
@ -34,7 +37,7 @@ davinci_uart_virt: .word 0
/* Use davinci_uart_phys/virt if already configured */ /* Use davinci_uart_phys/virt if already configured */
10: mrc p15, 0, \rp, c1, c0 10: mrc p15, 0, \rp, c1, c0
tst \rp, #1 @ MMU enabled? tst \rp, #1 @ MMU enabled?
ldreq \rp, =__virt_to_phys(davinci_uart_phys) ldreq \rp, =davinci_uart_v2p(davinci_uart_phys)
ldrne \rp, =davinci_uart_phys ldrne \rp, =davinci_uart_phys
add \rv, \rp, #4 @ davinci_uart_virt add \rv, \rp, #4 @ davinci_uart_virt
ldr \rp, [\rp, #0] ldr \rp, [\rp, #0]
@ -48,18 +51,18 @@ davinci_uart_virt: .word 0
tst \rp, #1 @ MMU enabled? tst \rp, #1 @ MMU enabled?
/* Copy uart phys address from decompressor uart info */ /* Copy uart phys address from decompressor uart info */
ldreq \rv, =__virt_to_phys(davinci_uart_phys) ldreq \rv, =davinci_uart_v2p(davinci_uart_phys)
ldrne \rv, =davinci_uart_phys ldrne \rv, =davinci_uart_phys
ldreq \rp, =DAVINCI_UART_INFO ldreq \rp, =DAVINCI_UART_INFO
ldrne \rp, =__phys_to_virt(DAVINCI_UART_INFO) ldrne \rp, =davinci_uart_p2v(DAVINCI_UART_INFO)
ldr \rp, [\rp, #0] ldr \rp, [\rp, #0]
str \rp, [\rv] str \rp, [\rv]
/* Copy uart virt address from decompressor uart info */ /* Copy uart virt address from decompressor uart info */
ldreq \rv, =__virt_to_phys(davinci_uart_virt) ldreq \rv, =davinci_uart_v2p(davinci_uart_virt)
ldrne \rv, =davinci_uart_virt ldrne \rv, =davinci_uart_virt
ldreq \rp, =DAVINCI_UART_INFO ldreq \rp, =DAVINCI_UART_INFO
ldrne \rp, =__phys_to_virt(DAVINCI_UART_INFO) ldrne \rp, =davinci_uart_p2v(DAVINCI_UART_INFO)
ldr \rp, [\rp, #4] ldr \rp, [\rp, #4]
str \rp, [\rv] str \rp, [\rv]

View file

@ -22,7 +22,7 @@
* *
* This area sits just below the page tables (see arch/arm/kernel/head.S). * This area sits just below the page tables (see arch/arm/kernel/head.S).
*/ */
#define DAVINCI_UART_INFO (PHYS_OFFSET + 0x3ff8) #define DAVINCI_UART_INFO (PLAT_PHYS_OFFSET + 0x3ff8)
#define DAVINCI_UART0_BASE (IO_PHYS + 0x20000) #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000)
#define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400)

View file

@ -257,11 +257,16 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
.workaround = FLS_USB2_WORKAROUND_ENGCM09152, .workaround = FLS_USB2_WORKAROUND_ENGCM09152,
}; };
static int vpr200_usbh_init(struct platform_device *pdev)
{
return mx35_initialize_usb_hw(pdev->id,
MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY);
}
/* USB HOST config */ /* USB HOST config */
static const struct mxc_usbh_platform_data usb_host_pdata __initconst = { static const struct mxc_usbh_platform_data usb_host_pdata __initconst = {
.portsc = MXC_EHCI_MODE_SERIAL, .init = vpr200_usbh_init,
.flags = MXC_EHCI_INTERFACE_SINGLE_UNI | .portsc = MXC_EHCI_MODE_SERIAL,
MXC_EHCI_INTERNAL_PHY,
}; };
static struct platform_device *devices[] __initdata = { static struct platform_device *devices[] __initdata = {

View file

@ -193,7 +193,7 @@ static iomux_v3_cfg_t mx53_loco_pads[] = {
.wakeup = wake, \ .wakeup = wake, \
} }
static const struct gpio_keys_button loco_buttons[] __initconst = { static struct gpio_keys_button loco_buttons[] = {
GPIO_BUTTON(MX53_LOCO_POWER, KEY_POWER, 1, "power", 0), GPIO_BUTTON(MX53_LOCO_POWER, KEY_POWER, 1, "power", 0),
GPIO_BUTTON(MX53_LOCO_UI1, KEY_VOLUMEUP, 1, "volume-up", 0), GPIO_BUTTON(MX53_LOCO_UI1, KEY_VOLUMEUP, 1, "volume-up", 0),
GPIO_BUTTON(MX53_LOCO_UI2, KEY_VOLUMEDOWN, 1, "volume-down", 0), GPIO_BUTTON(MX53_LOCO_UI2, KEY_VOLUMEDOWN, 1, "volume-down", 0),

View file

@ -295,11 +295,11 @@ static int name##_set_rate(struct clk *clk, unsigned long rate) \
unsigned long diff, parent_rate, calc_rate; \ unsigned long diff, parent_rate, calc_rate; \
int i; \ int i; \
\ \
parent_rate = clk_get_rate(clk->parent); \
div_max = BM_CLKCTRL_##dr##_DIV >> BP_CLKCTRL_##dr##_DIV; \ div_max = BM_CLKCTRL_##dr##_DIV >> BP_CLKCTRL_##dr##_DIV; \
bm_busy = BM_CLKCTRL_##dr##_BUSY; \ bm_busy = BM_CLKCTRL_##dr##_BUSY; \
\ \
if (clk->parent == &ref_xtal_clk) { \ if (clk->parent == &ref_xtal_clk) { \
parent_rate = clk_get_rate(clk->parent); \
div = DIV_ROUND_UP(parent_rate, rate); \ div = DIV_ROUND_UP(parent_rate, rate); \
if (clk == &cpu_clk) { \ if (clk == &cpu_clk) { \
div_max = BM_CLKCTRL_CPU_DIV_XTAL >> \ div_max = BM_CLKCTRL_CPU_DIV_XTAL >> \
@ -309,6 +309,11 @@ static int name##_set_rate(struct clk *clk, unsigned long rate) \
if (div == 0 || div > div_max) \ if (div == 0 || div > div_max) \
return -EINVAL; \ return -EINVAL; \
} else { \ } else { \
/* \
* hack alert: this block modifies clk->parent, too, \
* so the base to use it the grand parent. \
*/ \
parent_rate = clk_get_rate(clk->parent->parent); \
rate >>= PARENT_RATE_SHIFT; \ rate >>= PARENT_RATE_SHIFT; \
parent_rate >>= PARENT_RATE_SHIFT; \ parent_rate >>= PARENT_RATE_SHIFT; \
diff = parent_rate; \ diff = parent_rate; \

View file

@ -711,7 +711,7 @@ static struct regulator_consumer_supply bq24022_consumers[] = {
static struct regulator_init_data bq24022_init_data = { static struct regulator_init_data bq24022_init_data = {
.constraints = { .constraints = {
.max_uA = 500000, .max_uA = 500000,
.valid_ops_mask = REGULATOR_CHANGE_CURRENT, .valid_ops_mask = REGULATOR_CHANGE_CURRENT|REGULATOR_CHANGE_STATUS,
}, },
.num_consumer_supplies = ARRAY_SIZE(bq24022_consumers), .num_consumer_supplies = ARRAY_SIZE(bq24022_consumers),
.consumer_supplies = bq24022_consumers, .consumer_supplies = bq24022_consumers,

View file

@ -599,7 +599,7 @@ static struct regulator_consumer_supply bq24022_consumers[] = {
static struct regulator_init_data bq24022_init_data = { static struct regulator_init_data bq24022_init_data = {
.constraints = { .constraints = {
.max_uA = 500000, .max_uA = 500000,
.valid_ops_mask = REGULATOR_CHANGE_CURRENT, .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
}, },
.num_consumer_supplies = ARRAY_SIZE(bq24022_consumers), .num_consumer_supplies = ARRAY_SIZE(bq24022_consumers),
.consumer_supplies = bq24022_consumers, .consumer_supplies = bq24022_consumers,

View file

@ -395,7 +395,7 @@ ENTRY(xscale_dma_a0_map_area)
teq r2, #DMA_TO_DEVICE teq r2, #DMA_TO_DEVICE
beq xscale_dma_clean_range beq xscale_dma_clean_range
b xscale_dma_flush_range b xscale_dma_flush_range
ENDPROC(xscsale_dma_a0_map_area) ENDPROC(xscale_dma_a0_map_area)
/* /*
* dma_unmap_area(start, size, dir) * dma_unmap_area(start, size, dir)

View file

@ -295,6 +295,12 @@ static int mxc_gpio_direction_output(struct gpio_chip *chip,
return 0; return 0;
} }
/*
* This lock class tells lockdep that GPIO irqs are in a different
* category than their parents, so it won't report false recursion.
*/
static struct lock_class_key gpio_lock_class;
int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt) int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
{ {
int i, j; int i, j;
@ -311,6 +317,7 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
__raw_writel(~0, port[i].base + GPIO_ISR); __raw_writel(~0, port[i].base + GPIO_ISR);
for (j = port[i].virtual_irq_start; for (j = port[i].virtual_irq_start;
j < port[i].virtual_irq_start + 32; j++) { j < port[i].virtual_irq_start + 32; j++) {
irq_set_lockdep_class(j, &gpio_lock_class);
irq_set_chip_and_handler(j, &gpio_irq_chip, irq_set_chip_and_handler(j, &gpio_irq_chip,
handle_level_irq); handle_level_irq);
set_irq_flags(j, IRQF_VALID); set_irq_flags(j, IRQF_VALID);

View file

@ -124,6 +124,8 @@ imx_ssi_fiq_start:
1: 1:
@ return from FIQ @ return from FIQ
subs pc, lr, #4 subs pc, lr, #4
.align
imx_ssi_fiq_base: imx_ssi_fiq_base:
.word 0x0 .word 0x0
imx_ssi_fiq_rx_buffer: imx_ssi_fiq_rx_buffer:

View file

@ -32,10 +32,9 @@ static DEFINE_MUTEX(clocks_mutex);
* Then we take the most specific entry - with the following * Then we take the most specific entry - with the following
* order of precedence: dev+con > dev only > con only. * order of precedence: dev+con > dev only > con only.
*/ */
static struct clk *clk_find(const char *dev_id, const char *con_id) static struct clk_lookup *clk_find(const char *dev_id, const char *con_id)
{ {
struct clk_lookup *p; struct clk_lookup *p, *cl = NULL;
struct clk *clk = NULL;
int match, best = 0; int match, best = 0;
list_for_each_entry(p, &clocks, node) { list_for_each_entry(p, &clocks, node) {
@ -52,27 +51,27 @@ static struct clk *clk_find(const char *dev_id, const char *con_id)
} }
if (match > best) { if (match > best) {
clk = p->clk; cl = p;
if (match != 3) if (match != 3)
best = match; best = match;
else else
break; break;
} }
} }
return clk; return cl;
} }
struct clk *clk_get_sys(const char *dev_id, const char *con_id) struct clk *clk_get_sys(const char *dev_id, const char *con_id)
{ {
struct clk *clk; struct clk_lookup *cl;
mutex_lock(&clocks_mutex); mutex_lock(&clocks_mutex);
clk = clk_find(dev_id, con_id); cl = clk_find(dev_id, con_id);
if (clk && !__clk_get(clk)) if (cl && !__clk_get(cl->clk))
clk = NULL; cl = NULL;
mutex_unlock(&clocks_mutex); mutex_unlock(&clocks_mutex);
return clk ? clk : ERR_PTR(-ENOENT); return cl ? cl->clk : ERR_PTR(-ENOENT);
} }
EXPORT_SYMBOL(clk_get_sys); EXPORT_SYMBOL(clk_get_sys);