diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-04-13 12:15:40 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-04-13 12:15:40 -0400 |
| commit | 66bbf58b55619061b110460ee1c5485137fdf0e0 (patch) | |
| tree | fafc3d284d39ada9fea930714d66bb65b235a80b | |
| parent | 1f4f8eeaec56e793d31c11f5162d6de4aed5a29d (diff) | |
| parent | 24a1a47562b0fbb97321191dcc3a67b337b20f8f (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/avr32-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/avr32-2.6:
avr32: add ATAG_BOARDINFO
don't check platform_get_irq's return value against zero
avr32: init cannot ignore signals sent by force_sig_info()
avr32: fix deadlock when reading clock list in debugfs
avr32: Fix .size directive for cpu_enter_idle
avr32: At32ap: pio fix typo "))" on gpio_irq_unmask prototype
fix the wrong argument of the functions definition
| -rw-r--r-- | arch/avr32/include/asm/setup.h | 9 | ||||
| -rw-r--r-- | arch/avr32/kernel/setup.c | 15 | ||||
| -rw-r--r-- | arch/avr32/kernel/traps.c | 22 | ||||
| -rw-r--r-- | arch/avr32/mach-at32ap/clock.c | 24 | ||||
| -rw-r--r-- | arch/avr32/mach-at32ap/extint.c | 22 | ||||
| -rw-r--r-- | arch/avr32/mach-at32ap/pio.c | 2 | ||||
| -rw-r--r-- | arch/avr32/mach-at32ap/pm-at32ap700x.S | 2 |
7 files changed, 53 insertions, 43 deletions
diff --git a/arch/avr32/include/asm/setup.h b/arch/avr32/include/asm/setup.h index ff5b7cf6be4d..160543dbec7e 100644 --- a/arch/avr32/include/asm/setup.h +++ b/arch/avr32/include/asm/setup.h | |||
| @@ -94,6 +94,13 @@ struct tag_ethernet { | |||
| 94 | 94 | ||
| 95 | #define ETH_INVALID_PHY 0xff | 95 | #define ETH_INVALID_PHY 0xff |
| 96 | 96 | ||
| 97 | /* board information */ | ||
| 98 | #define ATAG_BOARDINFO 0x54410008 | ||
| 99 | |||
| 100 | struct tag_boardinfo { | ||
| 101 | u32 board_number; | ||
| 102 | }; | ||
| 103 | |||
| 97 | struct tag { | 104 | struct tag { |
| 98 | struct tag_header hdr; | 105 | struct tag_header hdr; |
| 99 | union { | 106 | union { |
| @@ -102,6 +109,7 @@ struct tag { | |||
| 102 | struct tag_cmdline cmdline; | 109 | struct tag_cmdline cmdline; |
| 103 | struct tag_clock clock; | 110 | struct tag_clock clock; |
| 104 | struct tag_ethernet ethernet; | 111 | struct tag_ethernet ethernet; |
| 112 | struct tag_boardinfo boardinfo; | ||
| 105 | } u; | 113 | } u; |
| 106 | }; | 114 | }; |
| 107 | 115 | ||
| @@ -128,6 +136,7 @@ extern struct tag *bootloader_tags; | |||
| 128 | 136 | ||
| 129 | extern resource_size_t fbmem_start; | 137 | extern resource_size_t fbmem_start; |
| 130 | extern resource_size_t fbmem_size; | 138 | extern resource_size_t fbmem_size; |
| 139 | extern u32 board_number; | ||
| 131 | 140 | ||
| 132 | void setup_processor(void); | 141 | void setup_processor(void); |
| 133 | 142 | ||
diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c index 5c7083916c33..bb0974cce4ac 100644 --- a/arch/avr32/kernel/setup.c +++ b/arch/avr32/kernel/setup.c | |||
| @@ -391,6 +391,21 @@ static int __init parse_tag_clock(struct tag *tag) | |||
| 391 | __tagtable(ATAG_CLOCK, parse_tag_clock); | 391 | __tagtable(ATAG_CLOCK, parse_tag_clock); |
| 392 | 392 | ||
| 393 | /* | 393 | /* |
| 394 | * The board_number correspond to the bd->bi_board_number in U-Boot. This | ||
| 395 | * parameter is only available during initialisation and can be used in some | ||
| 396 | * kind of board identification. | ||
| 397 | */ | ||
| 398 | u32 __initdata board_number; | ||
| 399 | |||
| 400 | static int __init parse_tag_boardinfo(struct tag *tag) | ||
| 401 | { | ||
| 402 | board_number = tag->u.boardinfo.board_number; | ||
| 403 | |||
| 404 | return 0; | ||
| 405 | } | ||
| 406 | __tagtable(ATAG_BOARDINFO, parse_tag_boardinfo); | ||
| 407 | |||
| 408 | /* | ||
| 394 | * Scan the tag table for this tag, and call its parse function. The | 409 | * Scan the tag table for this tag, and call its parse function. The |
| 395 | * tag table is built by the linker from all the __tagtable | 410 | * tag table is built by the linker from all the __tagtable |
| 396 | * declarations. | 411 | * declarations. |
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c index b91b2044af9c..7aa25756412f 100644 --- a/arch/avr32/kernel/traps.c +++ b/arch/avr32/kernel/traps.c | |||
| @@ -95,28 +95,6 @@ void _exception(long signr, struct pt_regs *regs, int code, | |||
| 95 | info.si_code = code; | 95 | info.si_code = code; |
| 96 | info.si_addr = (void __user *)addr; | 96 | info.si_addr = (void __user *)addr; |
| 97 | force_sig_info(signr, &info, current); | 97 | force_sig_info(signr, &info, current); |
| 98 | |||
| 99 | /* | ||
| 100 | * Init gets no signals that it doesn't have a handler for. | ||
| 101 | * That's all very well, but if it has caused a synchronous | ||
| 102 | * exception and we ignore the resulting signal, it will just | ||
| 103 | * generate the same exception over and over again and we get | ||
| 104 | * nowhere. Better to kill it and let the kernel panic. | ||
| 105 | */ | ||
| 106 | if (is_global_init(current)) { | ||
| 107 | __sighandler_t handler; | ||
| 108 | |||
| 109 | spin_lock_irq(¤t->sighand->siglock); | ||
| 110 | handler = current->sighand->action[signr-1].sa.sa_handler; | ||
| 111 | spin_unlock_irq(¤t->sighand->siglock); | ||
| 112 | if (handler == SIG_DFL) { | ||
| 113 | /* init has generated a synchronous exception | ||
| 114 | and it doesn't have a handler for the signal */ | ||
| 115 | printk(KERN_CRIT "init has generated signal %ld " | ||
| 116 | "but has no handler for it\n", signr); | ||
| 117 | do_exit(signr); | ||
| 118 | } | ||
| 119 | } | ||
| 120 | } | 98 | } |
| 121 | 99 | ||
| 122 | asmlinkage void do_nmi(unsigned long ecr, struct pt_regs *regs) | 100 | asmlinkage void do_nmi(unsigned long ecr, struct pt_regs *regs) |
diff --git a/arch/avr32/mach-at32ap/clock.c b/arch/avr32/mach-at32ap/clock.c index 442f08c5e641..86925fd6ea5b 100644 --- a/arch/avr32/mach-at32ap/clock.c +++ b/arch/avr32/mach-at32ap/clock.c | |||
| @@ -35,22 +35,30 @@ void at32_clk_register(struct clk *clk) | |||
| 35 | spin_unlock(&clk_list_lock); | 35 | spin_unlock(&clk_list_lock); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | struct clk *clk_get(struct device *dev, const char *id) | 38 | static struct clk *__clk_get(struct device *dev, const char *id) |
| 39 | { | 39 | { |
| 40 | struct clk *clk; | 40 | struct clk *clk; |
| 41 | 41 | ||
| 42 | spin_lock(&clk_list_lock); | ||
| 43 | |||
| 44 | list_for_each_entry(clk, &at32_clock_list, list) { | 42 | list_for_each_entry(clk, &at32_clock_list, list) { |
| 45 | if (clk->dev == dev && strcmp(id, clk->name) == 0) { | 43 | if (clk->dev == dev && strcmp(id, clk->name) == 0) { |
| 46 | spin_unlock(&clk_list_lock); | ||
| 47 | return clk; | 44 | return clk; |
| 48 | } | 45 | } |
| 49 | } | 46 | } |
| 50 | 47 | ||
| 51 | spin_unlock(&clk_list_lock); | ||
| 52 | return ERR_PTR(-ENOENT); | 48 | return ERR_PTR(-ENOENT); |
| 53 | } | 49 | } |
| 50 | |||
| 51 | struct clk *clk_get(struct device *dev, const char *id) | ||
| 52 | { | ||
| 53 | struct clk *clk; | ||
| 54 | |||
| 55 | spin_lock(&clk_list_lock); | ||
| 56 | clk = __clk_get(dev, id); | ||
| 57 | spin_unlock(&clk_list_lock); | ||
| 58 | |||
| 59 | return clk; | ||
| 60 | } | ||
| 61 | |||
| 54 | EXPORT_SYMBOL(clk_get); | 62 | EXPORT_SYMBOL(clk_get); |
| 55 | 63 | ||
| 56 | void clk_put(struct clk *clk) | 64 | void clk_put(struct clk *clk) |
| @@ -257,15 +265,15 @@ static int clk_show(struct seq_file *s, void *unused) | |||
| 257 | spin_lock(&clk_list_lock); | 265 | spin_lock(&clk_list_lock); |
| 258 | 266 | ||
| 259 | /* show clock tree as derived from the three oscillators */ | 267 | /* show clock tree as derived from the three oscillators */ |
| 260 | clk = clk_get(NULL, "osc32k"); | 268 | clk = __clk_get(NULL, "osc32k"); |
| 261 | dump_clock(clk, &r); | 269 | dump_clock(clk, &r); |
| 262 | clk_put(clk); | 270 | clk_put(clk); |
| 263 | 271 | ||
| 264 | clk = clk_get(NULL, "osc0"); | 272 | clk = __clk_get(NULL, "osc0"); |
| 265 | dump_clock(clk, &r); | 273 | dump_clock(clk, &r); |
| 266 | clk_put(clk); | 274 | clk_put(clk); |
| 267 | 275 | ||
| 268 | clk = clk_get(NULL, "osc1"); | 276 | clk = __clk_get(NULL, "osc1"); |
| 269 | dump_clock(clk, &r); | 277 | dump_clock(clk, &r); |
| 270 | clk_put(clk); | 278 | clk_put(clk); |
| 271 | 279 | ||
diff --git a/arch/avr32/mach-at32ap/extint.c b/arch/avr32/mach-at32ap/extint.c index 47ba4b9b6db1..fbc2aeaebddb 100644 --- a/arch/avr32/mach-at32ap/extint.c +++ b/arch/avr32/mach-at32ap/extint.c | |||
| @@ -61,34 +61,34 @@ struct eic { | |||
| 61 | static struct eic *nmi_eic; | 61 | static struct eic *nmi_eic; |
| 62 | static bool nmi_enabled; | 62 | static bool nmi_enabled; |
| 63 | 63 | ||
| 64 | static void eic_ack_irq(struct irq_chip *d) | 64 | static void eic_ack_irq(struct irq_data *d) |
| 65 | { | 65 | { |
| 66 | struct eic *eic = irq_data_get_irq_chip_data(data); | 66 | struct eic *eic = irq_data_get_irq_chip_data(d); |
| 67 | eic_writel(eic, ICR, 1 << (d->irq - eic->first_irq)); | 67 | eic_writel(eic, ICR, 1 << (d->irq - eic->first_irq)); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | static void eic_mask_irq(struct irq_chip *d) | 70 | static void eic_mask_irq(struct irq_data *d) |
| 71 | { | 71 | { |
| 72 | struct eic *eic = irq_data_get_irq_chip_data(data); | 72 | struct eic *eic = irq_data_get_irq_chip_data(d); |
| 73 | eic_writel(eic, IDR, 1 << (d->irq - eic->first_irq)); | 73 | eic_writel(eic, IDR, 1 << (d->irq - eic->first_irq)); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | static void eic_mask_ack_irq(struct irq_chip *d) | 76 | static void eic_mask_ack_irq(struct irq_data *d) |
| 77 | { | 77 | { |
| 78 | struct eic *eic = irq_data_get_irq_chip_data(data); | 78 | struct eic *eic = irq_data_get_irq_chip_data(d); |
| 79 | eic_writel(eic, ICR, 1 << (d->irq - eic->first_irq)); | 79 | eic_writel(eic, ICR, 1 << (d->irq - eic->first_irq)); |
| 80 | eic_writel(eic, IDR, 1 << (d->irq - eic->first_irq)); | 80 | eic_writel(eic, IDR, 1 << (d->irq - eic->first_irq)); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | static void eic_unmask_irq(struct irq_chip *d) | 83 | static void eic_unmask_irq(struct irq_data *d) |
| 84 | { | 84 | { |
| 85 | struct eic *eic = irq_data_get_irq_chip_data(data); | 85 | struct eic *eic = irq_data_get_irq_chip_data(d); |
| 86 | eic_writel(eic, IER, 1 << (d->irq - eic->first_irq)); | 86 | eic_writel(eic, IER, 1 << (d->irq - eic->first_irq)); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | static int eic_set_irq_type(struct irq_chip *d, unsigned int flow_type) | 89 | static int eic_set_irq_type(struct irq_data *d, unsigned int flow_type) |
| 90 | { | 90 | { |
| 91 | struct eic *eic = irq_data_get_irq_chip_data(data); | 91 | struct eic *eic = irq_data_get_irq_chip_data(d); |
| 92 | unsigned int irq = d->irq; | 92 | unsigned int irq = d->irq; |
| 93 | unsigned int i = irq - eic->first_irq; | 93 | unsigned int i = irq - eic->first_irq; |
| 94 | u32 mode, edge, level; | 94 | u32 mode, edge, level; |
| @@ -191,7 +191,7 @@ static int __init eic_probe(struct platform_device *pdev) | |||
| 191 | 191 | ||
| 192 | regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 192 | regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 193 | int_irq = platform_get_irq(pdev, 0); | 193 | int_irq = platform_get_irq(pdev, 0); |
| 194 | if (!regs || !int_irq) { | 194 | if (!regs || (int)int_irq <= 0) { |
| 195 | dev_dbg(&pdev->dev, "missing regs and/or irq resource\n"); | 195 | dev_dbg(&pdev->dev, "missing regs and/or irq resource\n"); |
| 196 | return -ENXIO; | 196 | return -ENXIO; |
| 197 | } | 197 | } |
diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c index f308e1ddc629..2e0aa853a4bc 100644 --- a/arch/avr32/mach-at32ap/pio.c +++ b/arch/avr32/mach-at32ap/pio.c | |||
| @@ -257,7 +257,7 @@ static void gpio_irq_mask(struct irq_data *d) | |||
| 257 | pio_writel(pio, IDR, 1 << (gpio & 0x1f)); | 257 | pio_writel(pio, IDR, 1 << (gpio & 0x1f)); |
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | static void gpio_irq_unmask(struct irq_data *d)) | 260 | static void gpio_irq_unmask(struct irq_data *d) |
| 261 | { | 261 | { |
| 262 | unsigned gpio = irq_to_gpio(d->irq); | 262 | unsigned gpio = irq_to_gpio(d->irq); |
| 263 | struct pio_device *pio = &pio_dev[gpio >> 5]; | 263 | struct pio_device *pio = &pio_dev[gpio >> 5]; |
diff --git a/arch/avr32/mach-at32ap/pm-at32ap700x.S b/arch/avr32/mach-at32ap/pm-at32ap700x.S index 17503b0ed6c9..f868f4ce761b 100644 --- a/arch/avr32/mach-at32ap/pm-at32ap700x.S +++ b/arch/avr32/mach-at32ap/pm-at32ap700x.S | |||
| @@ -53,7 +53,7 @@ cpu_enter_idle: | |||
| 53 | st.w r8[TI_flags], r9 | 53 | st.w r8[TI_flags], r9 |
| 54 | unmask_interrupts | 54 | unmask_interrupts |
| 55 | sleep CPU_SLEEP_IDLE | 55 | sleep CPU_SLEEP_IDLE |
| 56 | .size cpu_idle_sleep, . - cpu_idle_sleep | 56 | .size cpu_enter_idle, . - cpu_enter_idle |
| 57 | 57 | ||
| 58 | /* | 58 | /* |
| 59 | * Common return path for PM functions that don't run from | 59 | * Common return path for PM functions that don't run from |
