diff options
Diffstat (limited to 'arch/sparc/kernel')
62 files changed, 556 insertions, 282 deletions
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile index c6316142db4e..0c2dc1f24a9a 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile | |||
| @@ -13,6 +13,14 @@ extra-y += init_task.o | |||
| 13 | CPPFLAGS_vmlinux.lds := -Usparc -m$(BITS) | 13 | CPPFLAGS_vmlinux.lds := -Usparc -m$(BITS) |
| 14 | extra-y += vmlinux.lds | 14 | extra-y += vmlinux.lds |
| 15 | 15 | ||
| 16 | ifdef CONFIG_FUNCTION_TRACER | ||
| 17 | # Do not profile debug and lowlevel utilities | ||
| 18 | CFLAGS_REMOVE_ftrace.o := -pg | ||
| 19 | CFLAGS_REMOVE_time_$(BITS).o := -pg | ||
| 20 | CFLAGS_REMOVE_perf_event.o := -pg | ||
| 21 | CFLAGS_REMOVE_pcr.o := -pg | ||
| 22 | endif | ||
| 23 | |||
| 16 | obj-$(CONFIG_SPARC32) += entry.o wof.o wuf.o | 24 | obj-$(CONFIG_SPARC32) += entry.o wof.o wuf.o |
| 17 | obj-$(CONFIG_SPARC32) += etrap_32.o | 25 | obj-$(CONFIG_SPARC32) += etrap_32.o |
| 18 | obj-$(CONFIG_SPARC32) += rtrap_32.o | 26 | obj-$(CONFIG_SPARC32) += rtrap_32.o |
| @@ -85,7 +93,7 @@ obj-$(CONFIG_KGDB) += kgdb_$(BITS).o | |||
| 85 | 93 | ||
| 86 | 94 | ||
| 87 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o | 95 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o |
| 88 | CFLAGS_REMOVE_ftrace.o := -pg | 96 | obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o |
| 89 | 97 | ||
| 90 | obj-$(CONFIG_EARLYFB) += btext.o | 98 | obj-$(CONFIG_EARLYFB) += btext.o |
| 91 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 99 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c index 71ec90b9e316..b27476caa133 100644 --- a/arch/sparc/kernel/apc.c +++ b/arch/sparc/kernel/apc.c | |||
| @@ -174,8 +174,11 @@ static struct of_device_id __initdata apc_match[] = { | |||
| 174 | MODULE_DEVICE_TABLE(of, apc_match); | 174 | MODULE_DEVICE_TABLE(of, apc_match); |
| 175 | 175 | ||
| 176 | static struct of_platform_driver apc_driver = { | 176 | static struct of_platform_driver apc_driver = { |
| 177 | .name = "apc", | 177 | .driver = { |
| 178 | .match_table = apc_match, | 178 | .name = "apc", |
| 179 | .owner = THIS_MODULE, | ||
| 180 | .of_match_table = apc_match, | ||
| 181 | }, | ||
| 179 | .probe = apc_probe, | 182 | .probe = apc_probe, |
| 180 | }; | 183 | }; |
| 181 | 184 | ||
diff --git a/arch/sparc/kernel/auxio_64.c b/arch/sparc/kernel/auxio_64.c index 9f52db2d441c..ddc84128b3c2 100644 --- a/arch/sparc/kernel/auxio_64.c +++ b/arch/sparc/kernel/auxio_64.c | |||
| @@ -104,7 +104,7 @@ MODULE_DEVICE_TABLE(of, auxio_match); | |||
| 104 | 104 | ||
| 105 | static int __devinit auxio_probe(struct of_device *dev, const struct of_device_id *match) | 105 | static int __devinit auxio_probe(struct of_device *dev, const struct of_device_id *match) |
| 106 | { | 106 | { |
| 107 | struct device_node *dp = dev->node; | 107 | struct device_node *dp = dev->dev.of_node; |
| 108 | unsigned long size; | 108 | unsigned long size; |
| 109 | 109 | ||
| 110 | if (!strcmp(dp->parent->name, "ebus")) { | 110 | if (!strcmp(dp->parent->name, "ebus")) { |
| @@ -132,10 +132,11 @@ static int __devinit auxio_probe(struct of_device *dev, const struct of_device_i | |||
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | static struct of_platform_driver auxio_driver = { | 134 | static struct of_platform_driver auxio_driver = { |
| 135 | .match_table = auxio_match, | ||
| 136 | .probe = auxio_probe, | 135 | .probe = auxio_probe, |
| 137 | .driver = { | 136 | .driver = { |
| 138 | .name = "auxio", | 137 | .name = "auxio", |
| 138 | .owner = THIS_MODULE, | ||
| 139 | .of_match_table = auxio_match, | ||
| 139 | }, | 140 | }, |
| 140 | }; | 141 | }; |
| 141 | 142 | ||
diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c index 4589ca33220f..434335f65823 100644 --- a/arch/sparc/kernel/central.c +++ b/arch/sparc/kernel/central.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
| 7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
| 8 | #include <linux/slab.h> | ||
| 8 | #include <linux/string.h> | 9 | #include <linux/string.h> |
| 9 | #include <linux/init.h> | 10 | #include <linux/init.h> |
| 10 | #include <linux/of_device.h> | 11 | #include <linux/of_device.h> |
| @@ -148,10 +149,11 @@ static struct of_device_id __initdata clock_board_match[] = { | |||
| 148 | }; | 149 | }; |
| 149 | 150 | ||
| 150 | static struct of_platform_driver clock_board_driver = { | 151 | static struct of_platform_driver clock_board_driver = { |
| 151 | .match_table = clock_board_match, | ||
| 152 | .probe = clock_board_probe, | 152 | .probe = clock_board_probe, |
| 153 | .driver = { | 153 | .driver = { |
| 154 | .name = "clock_board", | 154 | .name = "clock_board", |
| 155 | .owner = THIS_MODULE, | ||
| 156 | .of_match_table = clock_board_match, | ||
| 155 | }, | 157 | }, |
| 156 | }; | 158 | }; |
| 157 | 159 | ||
| @@ -167,7 +169,7 @@ static int __devinit fhc_probe(struct of_device *op, | |||
| 167 | goto out; | 169 | goto out; |
| 168 | } | 170 | } |
| 169 | 171 | ||
| 170 | if (!strcmp(op->node->parent->name, "central")) | 172 | if (!strcmp(op->dev.of_node->parent->name, "central")) |
| 171 | p->central = true; | 173 | p->central = true; |
| 172 | 174 | ||
| 173 | p->pregs = of_ioremap(&op->resource[0], 0, | 175 | p->pregs = of_ioremap(&op->resource[0], 0, |
| @@ -182,7 +184,7 @@ static int __devinit fhc_probe(struct of_device *op, | |||
| 182 | reg = upa_readl(p->pregs + FHC_PREGS_BSR); | 184 | reg = upa_readl(p->pregs + FHC_PREGS_BSR); |
| 183 | p->board_num = ((reg >> 16) & 1) | ((reg >> 12) & 0x0e); | 185 | p->board_num = ((reg >> 16) & 1) | ((reg >> 12) & 0x0e); |
| 184 | } else { | 186 | } else { |
| 185 | p->board_num = of_getintprop_default(op->node, "board#", -1); | 187 | p->board_num = of_getintprop_default(op->dev.of_node, "board#", -1); |
| 186 | if (p->board_num == -1) { | 188 | if (p->board_num == -1) { |
| 187 | printk(KERN_ERR "fhc: No board# property\n"); | 189 | printk(KERN_ERR "fhc: No board# property\n"); |
| 188 | goto out_unmap_pregs; | 190 | goto out_unmap_pregs; |
| @@ -253,10 +255,11 @@ static struct of_device_id __initdata fhc_match[] = { | |||
| 253 | }; | 255 | }; |
| 254 | 256 | ||
| 255 | static struct of_platform_driver fhc_driver = { | 257 | static struct of_platform_driver fhc_driver = { |
| 256 | .match_table = fhc_match, | ||
| 257 | .probe = fhc_probe, | 258 | .probe = fhc_probe, |
| 258 | .driver = { | 259 | .driver = { |
| 259 | .name = "fhc", | 260 | .name = "fhc", |
| 261 | .owner = THIS_MODULE, | ||
| 262 | .of_match_table = fhc_match, | ||
| 260 | }, | 263 | }, |
| 261 | }; | 264 | }; |
| 262 | 265 | ||
diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c index e1a9598e2a4d..870cb65b3f21 100644 --- a/arch/sparc/kernel/chmc.c +++ b/arch/sparc/kernel/chmc.c | |||
| @@ -425,7 +425,7 @@ static int __devinit jbusmc_probe(struct of_device *op, | |||
| 425 | INIT_LIST_HEAD(&p->list); | 425 | INIT_LIST_HEAD(&p->list); |
| 426 | 426 | ||
| 427 | err = -ENODEV; | 427 | err = -ENODEV; |
| 428 | prop = of_get_property(op->node, "portid", &len); | 428 | prop = of_get_property(op->dev.of_node, "portid", &len); |
| 429 | if (!prop || len != 4) { | 429 | if (!prop || len != 4) { |
| 430 | printk(KERN_ERR PFX "Cannot find portid.\n"); | 430 | printk(KERN_ERR PFX "Cannot find portid.\n"); |
| 431 | goto out_free; | 431 | goto out_free; |
| @@ -433,7 +433,7 @@ static int __devinit jbusmc_probe(struct of_device *op, | |||
| 433 | 433 | ||
| 434 | p->portid = *prop; | 434 | p->portid = *prop; |
| 435 | 435 | ||
| 436 | prop = of_get_property(op->node, "memory-control-register-1", &len); | 436 | prop = of_get_property(op->dev.of_node, "memory-control-register-1", &len); |
| 437 | if (!prop || len != 8) { | 437 | if (!prop || len != 8) { |
| 438 | printk(KERN_ERR PFX "Cannot get memory control register 1.\n"); | 438 | printk(KERN_ERR PFX "Cannot get memory control register 1.\n"); |
| 439 | goto out_free; | 439 | goto out_free; |
| @@ -449,7 +449,7 @@ static int __devinit jbusmc_probe(struct of_device *op, | |||
| 449 | } | 449 | } |
| 450 | 450 | ||
| 451 | err = -ENODEV; | 451 | err = -ENODEV; |
| 452 | ml = of_get_property(op->node, "memory-layout", &p->layout_len); | 452 | ml = of_get_property(op->dev.of_node, "memory-layout", &p->layout_len); |
| 453 | if (!ml) { | 453 | if (!ml) { |
| 454 | printk(KERN_ERR PFX "Cannot get memory layout property.\n"); | 454 | printk(KERN_ERR PFX "Cannot get memory layout property.\n"); |
| 455 | goto out_iounmap; | 455 | goto out_iounmap; |
| @@ -466,7 +466,7 @@ static int __devinit jbusmc_probe(struct of_device *op, | |||
| 466 | mc_list_add(&p->list); | 466 | mc_list_add(&p->list); |
| 467 | 467 | ||
| 468 | printk(KERN_INFO PFX "UltraSPARC-IIIi memory controller at %s\n", | 468 | printk(KERN_INFO PFX "UltraSPARC-IIIi memory controller at %s\n", |
| 469 | op->node->full_name); | 469 | op->dev.of_node->full_name); |
| 470 | 470 | ||
| 471 | dev_set_drvdata(&op->dev, p); | 471 | dev_set_drvdata(&op->dev, p); |
| 472 | 472 | ||
| @@ -693,7 +693,7 @@ static void chmc_fetch_decode_regs(struct chmc *p) | |||
| 693 | static int __devinit chmc_probe(struct of_device *op, | 693 | static int __devinit chmc_probe(struct of_device *op, |
| 694 | const struct of_device_id *match) | 694 | const struct of_device_id *match) |
| 695 | { | 695 | { |
| 696 | struct device_node *dp = op->node; | 696 | struct device_node *dp = op->dev.of_node; |
| 697 | unsigned long ver; | 697 | unsigned long ver; |
| 698 | const void *pval; | 698 | const void *pval; |
| 699 | int len, portid; | 699 | int len, portid; |
| @@ -811,8 +811,11 @@ static const struct of_device_id us3mc_match[] = { | |||
| 811 | MODULE_DEVICE_TABLE(of, us3mc_match); | 811 | MODULE_DEVICE_TABLE(of, us3mc_match); |
| 812 | 812 | ||
| 813 | static struct of_platform_driver us3mc_driver = { | 813 | static struct of_platform_driver us3mc_driver = { |
| 814 | .name = "us3mc", | 814 | .driver = { |
| 815 | .match_table = us3mc_match, | 815 | .name = "us3mc", |
| 816 | .owner = THIS_MODULE, | ||
| 817 | .of_match_table = us3mc_match, | ||
| 818 | }, | ||
| 816 | .probe = us3mc_probe, | 819 | .probe = us3mc_probe, |
| 817 | .remove = __devexit_p(us3mc_remove), | 820 | .remove = __devexit_p(us3mc_remove), |
| 818 | }; | 821 | }; |
diff --git a/arch/sparc/kernel/cpumap.c b/arch/sparc/kernel/cpumap.c index 7430ed080b23..8de64c8126bc 100644 --- a/arch/sparc/kernel/cpumap.c +++ b/arch/sparc/kernel/cpumap.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | #include <linux/module.h> | 6 | #include <linux/module.h> |
| 7 | #include <linux/slab.h> | ||
| 7 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
| 8 | #include <linux/init.h> | 9 | #include <linux/init.h> |
| 9 | #include <linux/cpumask.h> | 10 | #include <linux/cpumask.h> |
diff --git a/arch/sparc/kernel/ftrace.c b/arch/sparc/kernel/ftrace.c index 9103a56b39e8..03ab022e51c5 100644 --- a/arch/sparc/kernel/ftrace.c +++ b/arch/sparc/kernel/ftrace.c | |||
| @@ -13,7 +13,7 @@ static const u32 ftrace_nop = 0x01000000; | |||
| 13 | 13 | ||
| 14 | static u32 ftrace_call_replace(unsigned long ip, unsigned long addr) | 14 | static u32 ftrace_call_replace(unsigned long ip, unsigned long addr) |
| 15 | { | 15 | { |
| 16 | static u32 call; | 16 | u32 call; |
| 17 | s32 off; | 17 | s32 off; |
| 18 | 18 | ||
| 19 | off = ((s32)addr - (s32)ip); | 19 | off = ((s32)addr - (s32)ip); |
| @@ -91,3 +91,61 @@ int __init ftrace_dyn_arch_init(void *data) | |||
| 91 | return 0; | 91 | return 0; |
| 92 | } | 92 | } |
| 93 | #endif | 93 | #endif |
| 94 | |||
| 95 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 96 | |||
| 97 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
| 98 | extern void ftrace_graph_call(void); | ||
| 99 | |||
| 100 | int ftrace_enable_ftrace_graph_caller(void) | ||
| 101 | { | ||
| 102 | unsigned long ip = (unsigned long)(&ftrace_graph_call); | ||
| 103 | u32 old, new; | ||
| 104 | |||
| 105 | old = *(u32 *) &ftrace_graph_call; | ||
| 106 | new = ftrace_call_replace(ip, (unsigned long) &ftrace_graph_caller); | ||
| 107 | return ftrace_modify_code(ip, old, new); | ||
| 108 | } | ||
| 109 | |||
| 110 | int ftrace_disable_ftrace_graph_caller(void) | ||
| 111 | { | ||
| 112 | unsigned long ip = (unsigned long)(&ftrace_graph_call); | ||
| 113 | u32 old, new; | ||
| 114 | |||
| 115 | old = *(u32 *) &ftrace_graph_call; | ||
| 116 | new = ftrace_call_replace(ip, (unsigned long) &ftrace_stub); | ||
| 117 | |||
| 118 | return ftrace_modify_code(ip, old, new); | ||
| 119 | } | ||
| 120 | |||
| 121 | #endif /* !CONFIG_DYNAMIC_FTRACE */ | ||
| 122 | |||
| 123 | /* | ||
| 124 | * Hook the return address and push it in the stack of return addrs | ||
| 125 | * in current thread info. | ||
| 126 | */ | ||
| 127 | unsigned long prepare_ftrace_return(unsigned long parent, | ||
| 128 | unsigned long self_addr, | ||
| 129 | unsigned long frame_pointer) | ||
| 130 | { | ||
| 131 | unsigned long return_hooker = (unsigned long) &return_to_handler; | ||
| 132 | struct ftrace_graph_ent trace; | ||
| 133 | |||
| 134 | if (unlikely(atomic_read(¤t->tracing_graph_pause))) | ||
| 135 | return parent + 8UL; | ||
| 136 | |||
| 137 | if (ftrace_push_return_trace(parent, self_addr, &trace.depth, | ||
| 138 | frame_pointer) == -EBUSY) | ||
| 139 | return parent + 8UL; | ||
| 140 | |||
| 141 | trace.func = self_addr; | ||
| 142 | |||
| 143 | /* Only trace if the calling function expects to */ | ||
| 144 | if (!ftrace_graph_entry(&trace)) { | ||
| 145 | current->curr_ret_stack--; | ||
| 146 | return parent + 8UL; | ||
| 147 | } | ||
| 148 | |||
| 149 | return return_hooker; | ||
| 150 | } | ||
| 151 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | ||
diff --git a/arch/sparc/kernel/helpers.S b/arch/sparc/kernel/helpers.S index 314dd0c9fc5b..92090cc9e829 100644 --- a/arch/sparc/kernel/helpers.S +++ b/arch/sparc/kernel/helpers.S | |||
| @@ -46,6 +46,81 @@ stack_trace_flush: | |||
| 46 | nop | 46 | nop |
| 47 | .size stack_trace_flush,.-stack_trace_flush | 47 | .size stack_trace_flush,.-stack_trace_flush |
| 48 | 48 | ||
| 49 | #ifdef CONFIG_PERF_EVENTS | ||
| 50 | .globl perf_arch_fetch_caller_regs | ||
| 51 | .type perf_arch_fetch_caller_regs,#function | ||
| 52 | perf_arch_fetch_caller_regs: | ||
| 53 | /* We always read the %pstate into %o5 since we will use | ||
| 54 | * that to construct a fake %tstate to store into the regs. | ||
| 55 | */ | ||
| 56 | rdpr %pstate, %o5 | ||
| 57 | brz,pn %o2, 50f | ||
| 58 | mov %o2, %g7 | ||
| 59 | |||
| 60 | /* Turn off interrupts while we walk around the register | ||
| 61 | * window by hand. | ||
| 62 | */ | ||
| 63 | wrpr %o5, PSTATE_IE, %pstate | ||
| 64 | |||
| 65 | /* The %canrestore tells us how many register windows are | ||
| 66 | * still live in the chip above us, past that we have to | ||
| 67 | * walk the frame as saved on the stack. We stash away | ||
| 68 | * the %cwp in %g1 so we can return back to the original | ||
| 69 | * register window. | ||
| 70 | */ | ||
| 71 | rdpr %cwp, %g1 | ||
| 72 | rdpr %canrestore, %g2 | ||
| 73 | sub %g1, 1, %g3 | ||
| 74 | |||
| 75 | /* We have the skip count in %g7, if it hits zero then | ||
| 76 | * %fp/%i7 are the registers we need. Otherwise if our | ||
| 77 | * %canrestore count maintained in %g2 hits zero we have | ||
| 78 | * to start traversing the stack. | ||
| 79 | */ | ||
| 80 | 10: brz,pn %g2, 4f | ||
| 81 | sub %g2, 1, %g2 | ||
| 82 | wrpr %g3, %cwp | ||
| 83 | subcc %g7, 1, %g7 | ||
| 84 | bne,pt %xcc, 10b | ||
| 85 | sub %g3, 1, %g3 | ||
| 86 | |||
| 87 | /* We found the values we need in the cpu's register | ||
| 88 | * windows. | ||
| 89 | */ | ||
| 90 | mov %fp, %g3 | ||
| 91 | ba,pt %xcc, 3f | ||
| 92 | mov %i7, %g2 | ||
| 93 | |||
| 94 | 50: mov %fp, %g3 | ||
| 95 | ba,pt %xcc, 2f | ||
| 96 | mov %i7, %g2 | ||
| 97 | |||
| 98 | /* We hit the end of the valid register windows in the | ||
| 99 | * cpu, start traversing the stack frame. | ||
| 100 | */ | ||
| 101 | 4: mov %fp, %g3 | ||
| 102 | |||
| 103 | 20: ldx [%g3 + STACK_BIAS + RW_V9_I7], %g2 | ||
| 104 | subcc %g7, 1, %g7 | ||
| 105 | bne,pn %xcc, 20b | ||
| 106 | ldx [%g3 + STACK_BIAS + RW_V9_I6], %g3 | ||
| 107 | |||
| 108 | /* Restore the current register window position and | ||
| 109 | * re-enable interrupts. | ||
| 110 | */ | ||
| 111 | 3: wrpr %g1, %cwp | ||
| 112 | wrpr %o5, %pstate | ||
| 113 | |||
| 114 | 2: stx %g3, [%o0 + PT_V9_FP] | ||
| 115 | sllx %o5, 8, %o5 | ||
| 116 | stx %o5, [%o0 + PT_V9_TSTATE] | ||
| 117 | stx %g2, [%o0 + PT_V9_TPC] | ||
| 118 | add %g2, 4, %g2 | ||
| 119 | retl | ||
| 120 | stx %g2, [%o0 + PT_V9_TNPC] | ||
| 121 | .size perf_arch_fetch_caller_regs,.-perf_arch_fetch_caller_regs | ||
| 122 | #endif /* CONFIG_PERF_EVENTS */ | ||
| 123 | |||
| 49 | #ifdef CONFIG_SMP | 124 | #ifdef CONFIG_SMP |
| 50 | .globl hard_smp_processor_id | 125 | .globl hard_smp_processor_id |
| 51 | .type hard_smp_processor_id,#function | 126 | .type hard_smp_processor_id,#function |
diff --git a/arch/sparc/kernel/hvapi.c b/arch/sparc/kernel/hvapi.c index 1d272c3b5740..7c60afb835b0 100644 --- a/arch/sparc/kernel/hvapi.c +++ b/arch/sparc/kernel/hvapi.c | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
| 6 | #include <linux/module.h> | 6 | #include <linux/module.h> |
| 7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
| 8 | #include <linux/slab.h> | ||
| 9 | 8 | ||
| 10 | #include <asm/hypervisor.h> | 9 | #include <asm/hypervisor.h> |
| 11 | #include <asm/oplib.h> | 10 | #include <asm/oplib.h> |
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c index 8414549c1834..47977a77f6c6 100644 --- a/arch/sparc/kernel/iommu.c +++ b/arch/sparc/kernel/iommu.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
| 8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
| 9 | #include <linux/slab.h> | ||
| 9 | #include <linux/delay.h> | 10 | #include <linux/delay.h> |
| 10 | #include <linux/device.h> | 11 | #include <linux/device.h> |
| 11 | #include <linux/dma-mapping.h> | 12 | #include <linux/dma-mapping.h> |
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 84e5386714cd..703e4aa9bc38 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c | |||
| @@ -290,7 +290,7 @@ static void *sbus_alloc_coherent(struct device *dev, size_t len, | |||
| 290 | if (mmu_map_dma_area(dev, dma_addrp, va, res->start, len_total) != 0) | 290 | if (mmu_map_dma_area(dev, dma_addrp, va, res->start, len_total) != 0) |
| 291 | goto err_noiommu; | 291 | goto err_noiommu; |
| 292 | 292 | ||
| 293 | res->name = op->node->name; | 293 | res->name = op->dev.of_node->name; |
| 294 | 294 | ||
| 295 | return (void *)(unsigned long)res->start; | 295 | return (void *)(unsigned long)res->start; |
| 296 | 296 | ||
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c index e1cbdb94d97b..830d70a3e20b 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c | |||
| @@ -20,7 +20,9 @@ | |||
| 20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
| 21 | #include <linux/proc_fs.h> | 21 | #include <linux/proc_fs.h> |
| 22 | #include <linux/seq_file.h> | 22 | #include <linux/seq_file.h> |
| 23 | #include <linux/ftrace.h> | ||
| 23 | #include <linux/irq.h> | 24 | #include <linux/irq.h> |
| 25 | #include <linux/kmemleak.h> | ||
| 24 | 26 | ||
| 25 | #include <asm/ptrace.h> | 27 | #include <asm/ptrace.h> |
| 26 | #include <asm/processor.h> | 28 | #include <asm/processor.h> |
| @@ -45,6 +47,7 @@ | |||
| 45 | 47 | ||
| 46 | #include "entry.h" | 48 | #include "entry.h" |
| 47 | #include "cpumap.h" | 49 | #include "cpumap.h" |
| 50 | #include "kstack.h" | ||
| 48 | 51 | ||
| 49 | #define NUM_IVECS (IMAP_INR + 1) | 52 | #define NUM_IVECS (IMAP_INR + 1) |
| 50 | 53 | ||
| @@ -647,6 +650,14 @@ unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino) | |||
| 647 | bucket = kzalloc(sizeof(struct ino_bucket), GFP_ATOMIC); | 650 | bucket = kzalloc(sizeof(struct ino_bucket), GFP_ATOMIC); |
| 648 | if (unlikely(!bucket)) | 651 | if (unlikely(!bucket)) |
| 649 | return 0; | 652 | return 0; |
| 653 | |||
| 654 | /* The only reference we store to the IRQ bucket is | ||
| 655 | * by physical address which kmemleak can't see, tell | ||
| 656 | * it that this object explicitly is not a leak and | ||
| 657 | * should be scanned. | ||
| 658 | */ | ||
| 659 | kmemleak_not_leak(bucket); | ||
| 660 | |||
| 650 | __flush_dcache_range((unsigned long) bucket, | 661 | __flush_dcache_range((unsigned long) bucket, |
| 651 | ((unsigned long) bucket + | 662 | ((unsigned long) bucket + |
| 652 | sizeof(struct ino_bucket))); | 663 | sizeof(struct ino_bucket))); |
| @@ -703,25 +714,7 @@ void ack_bad_irq(unsigned int virt_irq) | |||
| 703 | void *hardirq_stack[NR_CPUS]; | 714 | void *hardirq_stack[NR_CPUS]; |
| 704 | void *softirq_stack[NR_CPUS]; | 715 | void *softirq_stack[NR_CPUS]; |
| 705 | 716 | ||
| 706 | static __attribute__((always_inline)) void *set_hardirq_stack(void) | 717 | void __irq_entry handler_irq(int irq, struct pt_regs *regs) |
| 707 | { | ||
| 708 | void *orig_sp, *sp = hardirq_stack[smp_processor_id()]; | ||
| 709 | |||
| 710 | __asm__ __volatile__("mov %%sp, %0" : "=r" (orig_sp)); | ||
| 711 | if (orig_sp < sp || | ||
| 712 | orig_sp > (sp + THREAD_SIZE)) { | ||
| 713 | sp += THREAD_SIZE - 192 - STACK_BIAS; | ||
| 714 | __asm__ __volatile__("mov %0, %%sp" : : "r" (sp)); | ||
| 715 | } | ||
| 716 | |||
| 717 | return orig_sp; | ||
| 718 | } | ||
| 719 | static __attribute__((always_inline)) void restore_hardirq_stack(void *orig_sp) | ||
| 720 | { | ||
| 721 | __asm__ __volatile__("mov %0, %%sp" : : "r" (orig_sp)); | ||
| 722 | } | ||
| 723 | |||
| 724 | void handler_irq(int irq, struct pt_regs *regs) | ||
| 725 | { | 718 | { |
| 726 | unsigned long pstate, bucket_pa; | 719 | unsigned long pstate, bucket_pa; |
| 727 | struct pt_regs *old_regs; | 720 | struct pt_regs *old_regs; |
diff --git a/arch/sparc/kernel/kgdb_32.c b/arch/sparc/kernel/kgdb_32.c index 04df4edc0073..539243b236fa 100644 --- a/arch/sparc/kernel/kgdb_32.c +++ b/arch/sparc/kernel/kgdb_32.c | |||
| @@ -158,6 +158,12 @@ void kgdb_arch_exit(void) | |||
| 158 | { | 158 | { |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) | ||
| 162 | { | ||
| 163 | regs->pc = ip; | ||
| 164 | regs->npc = regs->pc + 4; | ||
| 165 | } | ||
| 166 | |||
| 161 | struct kgdb_arch arch_kgdb_ops = { | 167 | struct kgdb_arch arch_kgdb_ops = { |
| 162 | /* Breakpoint instruction: ta 0x7d */ | 168 | /* Breakpoint instruction: ta 0x7d */ |
| 163 | .gdb_bpt_instr = { 0x91, 0xd0, 0x20, 0x7d }, | 169 | .gdb_bpt_instr = { 0x91, 0xd0, 0x20, 0x7d }, |
diff --git a/arch/sparc/kernel/kgdb_64.c b/arch/sparc/kernel/kgdb_64.c index f5a0fd490b59..768290a6c028 100644 --- a/arch/sparc/kernel/kgdb_64.c +++ b/arch/sparc/kernel/kgdb_64.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include <linux/kgdb.h> | 6 | #include <linux/kgdb.h> |
| 7 | #include <linux/kdebug.h> | 7 | #include <linux/kdebug.h> |
| 8 | #include <linux/ftrace.h> | ||
| 8 | 9 | ||
| 9 | #include <asm/kdebug.h> | 10 | #include <asm/kdebug.h> |
| 10 | #include <asm/ptrace.h> | 11 | #include <asm/ptrace.h> |
| @@ -108,7 +109,7 @@ void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs) | |||
| 108 | } | 109 | } |
| 109 | 110 | ||
| 110 | #ifdef CONFIG_SMP | 111 | #ifdef CONFIG_SMP |
| 111 | void smp_kgdb_capture_client(int irq, struct pt_regs *regs) | 112 | void __irq_entry smp_kgdb_capture_client(int irq, struct pt_regs *regs) |
| 112 | { | 113 | { |
| 113 | unsigned long flags; | 114 | unsigned long flags; |
| 114 | 115 | ||
| @@ -180,6 +181,12 @@ void kgdb_arch_exit(void) | |||
| 180 | { | 181 | { |
| 181 | } | 182 | } |
| 182 | 183 | ||
| 184 | void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) | ||
| 185 | { | ||
| 186 | regs->tpc = ip; | ||
| 187 | regs->tnpc = regs->tpc + 4; | ||
| 188 | } | ||
| 189 | |||
| 183 | struct kgdb_arch arch_kgdb_ops = { | 190 | struct kgdb_arch arch_kgdb_ops = { |
| 184 | /* Breakpoint instruction: ta 0x72 */ | 191 | /* Breakpoint instruction: ta 0x72 */ |
| 185 | .gdb_bpt_instr = { 0x91, 0xd0, 0x20, 0x72 }, | 192 | .gdb_bpt_instr = { 0x91, 0xd0, 0x20, 0x72 }, |
diff --git a/arch/sparc/kernel/kprobes.c b/arch/sparc/kernel/kprobes.c index 6716584e48ab..a39d1ba5a119 100644 --- a/arch/sparc/kernel/kprobes.c +++ b/arch/sparc/kernel/kprobes.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/kprobes.h> | 7 | #include <linux/kprobes.h> |
| 8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
| 9 | #include <linux/kdebug.h> | 9 | #include <linux/kdebug.h> |
| 10 | #include <linux/slab.h> | ||
| 10 | #include <asm/signal.h> | 11 | #include <asm/signal.h> |
| 11 | #include <asm/cacheflush.h> | 12 | #include <asm/cacheflush.h> |
| 12 | #include <asm/uaccess.h> | 13 | #include <asm/uaccess.h> |
diff --git a/arch/sparc/kernel/kstack.h b/arch/sparc/kernel/kstack.h index 5247283d1c03..53dfb92e09fb 100644 --- a/arch/sparc/kernel/kstack.h +++ b/arch/sparc/kernel/kstack.h | |||
| @@ -61,4 +61,23 @@ check_magic: | |||
| 61 | 61 | ||
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | static inline __attribute__((always_inline)) void *set_hardirq_stack(void) | ||
| 65 | { | ||
| 66 | void *orig_sp, *sp = hardirq_stack[smp_processor_id()]; | ||
| 67 | |||
| 68 | __asm__ __volatile__("mov %%sp, %0" : "=r" (orig_sp)); | ||
| 69 | if (orig_sp < sp || | ||
| 70 | orig_sp > (sp + THREAD_SIZE)) { | ||
| 71 | sp += THREAD_SIZE - 192 - STACK_BIAS; | ||
| 72 | __asm__ __volatile__("mov %0, %%sp" : : "r" (sp)); | ||
| 73 | } | ||
| 74 | |||
| 75 | return orig_sp; | ||
| 76 | } | ||
| 77 | |||
| 78 | static inline __attribute__((always_inline)) void restore_hardirq_stack(void *orig_sp) | ||
| 79 | { | ||
| 80 | __asm__ __volatile__("mov %0, %%sp" : : "r" (orig_sp)); | ||
| 81 | } | ||
| 82 | |||
| 64 | #endif /* _KSTACK_H */ | 83 | #endif /* _KSTACK_H */ |
diff --git a/arch/sparc/kernel/led.c b/arch/sparc/kernel/led.c index 00d034ea2164..3ae36f36e758 100644 --- a/arch/sparc/kernel/led.c +++ b/arch/sparc/kernel/led.c | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | #include <linux/init.h> | 3 | #include <linux/init.h> |
| 4 | #include <linux/proc_fs.h> | 4 | #include <linux/proc_fs.h> |
| 5 | #include <linux/seq_file.h> | 5 | #include <linux/seq_file.h> |
| 6 | #include <linux/slab.h> | ||
| 6 | #include <linux/string.h> | 7 | #include <linux/string.h> |
| 7 | #include <linux/jiffies.h> | 8 | #include <linux/jiffies.h> |
| 8 | #include <linux/timer.h> | 9 | #include <linux/timer.h> |
diff --git a/arch/sparc/kernel/leon_kernel.c b/arch/sparc/kernel/leon_kernel.c index 0409d62d8ca2..6a7b4dbc8e09 100644 --- a/arch/sparc/kernel/leon_kernel.c +++ b/arch/sparc/kernel/leon_kernel.c | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
| 8 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
| 9 | #include <linux/mutex.h> | 9 | #include <linux/mutex.h> |
| 10 | #include <linux/slab.h> | ||
| 11 | #include <linux/of.h> | 10 | #include <linux/of.h> |
| 12 | #include <linux/of_platform.h> | 11 | #include <linux/of_platform.h> |
| 13 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c index 85787577f683..e1656fc41ccb 100644 --- a/arch/sparc/kernel/leon_smp.c +++ b/arch/sparc/kernel/leon_smp.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/profile.h> | 22 | #include <linux/profile.h> |
| 23 | #include <linux/pm.h> | 23 | #include <linux/pm.h> |
| 24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
| 25 | #include <linux/gfp.h> | ||
| 25 | 26 | ||
| 26 | #include <asm/cacheflush.h> | 27 | #include <asm/cacheflush.h> |
| 27 | #include <asm/tlbflush.h> | 28 | #include <asm/tlbflush.h> |
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c index cdc91d919e93..83e85c2e802a 100644 --- a/arch/sparc/kernel/mdesc.c +++ b/arch/sparc/kernel/mdesc.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | */ | 4 | */ |
| 5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
| 6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
| 7 | #include <linux/lmb.h> | 7 | #include <linux/memblock.h> |
| 8 | #include <linux/log2.h> | 8 | #include <linux/log2.h> |
| 9 | #include <linux/list.h> | 9 | #include <linux/list.h> |
| 10 | #include <linux/slab.h> | 10 | #include <linux/slab.h> |
| @@ -86,7 +86,7 @@ static void mdesc_handle_init(struct mdesc_handle *hp, | |||
| 86 | hp->handle_size = handle_size; | 86 | hp->handle_size = handle_size; |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | static struct mdesc_handle * __init mdesc_lmb_alloc(unsigned int mdesc_size) | 89 | static struct mdesc_handle * __init mdesc_memblock_alloc(unsigned int mdesc_size) |
| 90 | { | 90 | { |
| 91 | unsigned int handle_size, alloc_size; | 91 | unsigned int handle_size, alloc_size; |
| 92 | struct mdesc_handle *hp; | 92 | struct mdesc_handle *hp; |
| @@ -97,7 +97,7 @@ static struct mdesc_handle * __init mdesc_lmb_alloc(unsigned int mdesc_size) | |||
| 97 | mdesc_size); | 97 | mdesc_size); |
| 98 | alloc_size = PAGE_ALIGN(handle_size); | 98 | alloc_size = PAGE_ALIGN(handle_size); |
| 99 | 99 | ||
| 100 | paddr = lmb_alloc(alloc_size, PAGE_SIZE); | 100 | paddr = memblock_alloc(alloc_size, PAGE_SIZE); |
| 101 | 101 | ||
| 102 | hp = NULL; | 102 | hp = NULL; |
| 103 | if (paddr) { | 103 | if (paddr) { |
| @@ -107,7 +107,7 @@ static struct mdesc_handle * __init mdesc_lmb_alloc(unsigned int mdesc_size) | |||
| 107 | return hp; | 107 | return hp; |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | static void mdesc_lmb_free(struct mdesc_handle *hp) | 110 | static void mdesc_memblock_free(struct mdesc_handle *hp) |
| 111 | { | 111 | { |
| 112 | unsigned int alloc_size; | 112 | unsigned int alloc_size; |
| 113 | unsigned long start; | 113 | unsigned long start; |
| @@ -120,9 +120,9 @@ static void mdesc_lmb_free(struct mdesc_handle *hp) | |||
| 120 | free_bootmem_late(start, alloc_size); | 120 | free_bootmem_late(start, alloc_size); |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | static struct mdesc_mem_ops lmb_mdesc_ops = { | 123 | static struct mdesc_mem_ops memblock_mdesc_ops = { |
| 124 | .alloc = mdesc_lmb_alloc, | 124 | .alloc = mdesc_memblock_alloc, |
| 125 | .free = mdesc_lmb_free, | 125 | .free = mdesc_memblock_free, |
| 126 | }; | 126 | }; |
| 127 | 127 | ||
| 128 | static struct mdesc_handle *mdesc_kmalloc(unsigned int mdesc_size) | 128 | static struct mdesc_handle *mdesc_kmalloc(unsigned int mdesc_size) |
| @@ -914,7 +914,7 @@ void __init sun4v_mdesc_init(void) | |||
| 914 | 914 | ||
| 915 | printk("MDESC: Size is %lu bytes.\n", len); | 915 | printk("MDESC: Size is %lu bytes.\n", len); |
| 916 | 916 | ||
| 917 | hp = mdesc_alloc(len, &lmb_mdesc_ops); | 917 | hp = mdesc_alloc(len, &memblock_mdesc_ops); |
| 918 | if (hp == NULL) { | 918 | if (hp == NULL) { |
| 919 | prom_printf("MDESC: alloc of %lu bytes failed.\n", len); | 919 | prom_printf("MDESC: alloc of %lu bytes failed.\n", len); |
| 920 | prom_halt(); | 920 | prom_halt(); |
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c index 0ee642f63234..f848aadf54dc 100644 --- a/arch/sparc/kernel/module.c +++ b/arch/sparc/kernel/module.c | |||
| @@ -9,9 +9,9 @@ | |||
| 9 | #include <linux/elf.h> | 9 | #include <linux/elf.h> |
| 10 | #include <linux/vmalloc.h> | 10 | #include <linux/vmalloc.h> |
| 11 | #include <linux/fs.h> | 11 | #include <linux/fs.h> |
| 12 | #include <linux/gfp.h> | ||
| 12 | #include <linux/string.h> | 13 | #include <linux/string.h> |
| 13 | #include <linux/ctype.h> | 14 | #include <linux/ctype.h> |
| 14 | #include <linux/slab.h> | ||
| 15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
| 16 | 16 | ||
| 17 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
diff --git a/arch/sparc/kernel/nmi.c b/arch/sparc/kernel/nmi.c index b287b62c7ea3..a4bd7ba74c89 100644 --- a/arch/sparc/kernel/nmi.c +++ b/arch/sparc/kernel/nmi.c | |||
| @@ -23,6 +23,8 @@ | |||
| 23 | #include <asm/ptrace.h> | 23 | #include <asm/ptrace.h> |
| 24 | #include <asm/pcr.h> | 24 | #include <asm/pcr.h> |
| 25 | 25 | ||
| 26 | #include "kstack.h" | ||
| 27 | |||
| 26 | /* We don't have a real NMI on sparc64, but we can fake one | 28 | /* We don't have a real NMI on sparc64, but we can fake one |
| 27 | * up using profiling counter overflow interrupts and interrupt | 29 | * up using profiling counter overflow interrupts and interrupt |
| 28 | * levels. | 30 | * levels. |
| @@ -92,7 +94,7 @@ static void die_nmi(const char *str, struct pt_regs *regs, int do_panic) | |||
| 92 | notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs) | 94 | notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs) |
| 93 | { | 95 | { |
| 94 | unsigned int sum, touched = 0; | 96 | unsigned int sum, touched = 0; |
| 95 | int cpu = smp_processor_id(); | 97 | void *orig_sp; |
| 96 | 98 | ||
| 97 | clear_softint(1 << irq); | 99 | clear_softint(1 << irq); |
| 98 | 100 | ||
| @@ -100,13 +102,15 @@ notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs) | |||
| 100 | 102 | ||
| 101 | nmi_enter(); | 103 | nmi_enter(); |
| 102 | 104 | ||
| 105 | orig_sp = set_hardirq_stack(); | ||
| 106 | |||
| 103 | if (notify_die(DIE_NMI, "nmi", regs, 0, | 107 | if (notify_die(DIE_NMI, "nmi", regs, 0, |
| 104 | pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP) | 108 | pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP) |
| 105 | touched = 1; | 109 | touched = 1; |
| 106 | else | 110 | else |
| 107 | pcr_ops->write(PCR_PIC_PRIV); | 111 | pcr_ops->write(PCR_PIC_PRIV); |
| 108 | 112 | ||
| 109 | sum = kstat_irqs_cpu(0, cpu); | 113 | sum = local_cpu_data().irq0_irqs; |
| 110 | if (__get_cpu_var(nmi_touch)) { | 114 | if (__get_cpu_var(nmi_touch)) { |
| 111 | __get_cpu_var(nmi_touch) = 0; | 115 | __get_cpu_var(nmi_touch) = 0; |
| 112 | touched = 1; | 116 | touched = 1; |
| @@ -125,6 +129,8 @@ notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs) | |||
| 125 | pcr_ops->write(pcr_enable); | 129 | pcr_ops->write(pcr_enable); |
| 126 | } | 130 | } |
| 127 | 131 | ||
| 132 | restore_hardirq_stack(orig_sp); | ||
| 133 | |||
| 128 | nmi_exit(); | 134 | nmi_exit(); |
| 129 | } | 135 | } |
| 130 | 136 | ||
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c index da527b33ebc7..47e63f1e719c 100644 --- a/arch/sparc/kernel/of_device_32.c +++ b/arch/sparc/kernel/of_device_32.c | |||
| @@ -254,10 +254,10 @@ static void __init build_device_resources(struct of_device *op, | |||
| 254 | return; | 254 | return; |
| 255 | 255 | ||
| 256 | p_op = to_of_device(parent); | 256 | p_op = to_of_device(parent); |
| 257 | bus = of_match_bus(p_op->node); | 257 | bus = of_match_bus(p_op->dev.of_node); |
| 258 | bus->count_cells(op->node, &na, &ns); | 258 | bus->count_cells(op->dev.of_node, &na, &ns); |
| 259 | 259 | ||
| 260 | preg = of_get_property(op->node, bus->addr_prop_name, &num_reg); | 260 | preg = of_get_property(op->dev.of_node, bus->addr_prop_name, &num_reg); |
| 261 | if (!preg || num_reg == 0) | 261 | if (!preg || num_reg == 0) |
| 262 | return; | 262 | return; |
| 263 | 263 | ||
| @@ -271,8 +271,8 @@ static void __init build_device_resources(struct of_device *op, | |||
| 271 | struct resource *r = &op->resource[index]; | 271 | struct resource *r = &op->resource[index]; |
| 272 | u32 addr[OF_MAX_ADDR_CELLS]; | 272 | u32 addr[OF_MAX_ADDR_CELLS]; |
| 273 | const u32 *reg = (preg + (index * ((na + ns) * 4))); | 273 | const u32 *reg = (preg + (index * ((na + ns) * 4))); |
| 274 | struct device_node *dp = op->node; | 274 | struct device_node *dp = op->dev.of_node; |
| 275 | struct device_node *pp = p_op->node; | 275 | struct device_node *pp = p_op->dev.of_node; |
| 276 | struct of_bus *pbus, *dbus; | 276 | struct of_bus *pbus, *dbus; |
| 277 | u64 size, result = OF_BAD_ADDR; | 277 | u64 size, result = OF_BAD_ADDR; |
| 278 | unsigned long flags; | 278 | unsigned long flags; |
| @@ -321,7 +321,7 @@ static void __init build_device_resources(struct of_device *op, | |||
| 321 | 321 | ||
| 322 | if (of_resource_verbose) | 322 | if (of_resource_verbose) |
| 323 | printk("%s reg[%d] -> %llx\n", | 323 | printk("%s reg[%d] -> %llx\n", |
| 324 | op->node->full_name, index, | 324 | op->dev.of_node->full_name, index, |
| 325 | result); | 325 | result); |
| 326 | 326 | ||
| 327 | if (result != OF_BAD_ADDR) { | 327 | if (result != OF_BAD_ADDR) { |
| @@ -329,7 +329,7 @@ static void __init build_device_resources(struct of_device *op, | |||
| 329 | r->end = result + size - 1; | 329 | r->end = result + size - 1; |
| 330 | r->flags = flags | ((result >> 32ULL) & 0xffUL); | 330 | r->flags = flags | ((result >> 32ULL) & 0xffUL); |
| 331 | } | 331 | } |
| 332 | r->name = op->node->name; | 332 | r->name = op->dev.of_node->name; |
| 333 | } | 333 | } |
| 334 | } | 334 | } |
| 335 | 335 | ||
| @@ -345,10 +345,9 @@ static struct of_device * __init scan_one_device(struct device_node *dp, | |||
| 345 | return NULL; | 345 | return NULL; |
| 346 | 346 | ||
| 347 | sd = &op->dev.archdata; | 347 | sd = &op->dev.archdata; |
| 348 | sd->prom_node = dp; | ||
| 349 | sd->op = op; | 348 | sd->op = op; |
| 350 | 349 | ||
| 351 | op->node = dp; | 350 | op->dev.of_node = dp; |
| 352 | 351 | ||
| 353 | op->clock_freq = of_getintprop_default(dp, "clock-frequency", | 352 | op->clock_freq = of_getintprop_default(dp, "clock-frequency", |
| 354 | (25*1000*1000)); | 353 | (25*1000*1000)); |
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c index b3d4cb5d21b3..1dae8079f728 100644 --- a/arch/sparc/kernel/of_device_64.c +++ b/arch/sparc/kernel/of_device_64.c | |||
| @@ -323,10 +323,10 @@ static void __init build_device_resources(struct of_device *op, | |||
| 323 | return; | 323 | return; |
| 324 | 324 | ||
| 325 | p_op = to_of_device(parent); | 325 | p_op = to_of_device(parent); |
| 326 | bus = of_match_bus(p_op->node); | 326 | bus = of_match_bus(p_op->dev.of_node); |
| 327 | bus->count_cells(op->node, &na, &ns); | 327 | bus->count_cells(op->dev.of_node, &na, &ns); |
| 328 | 328 | ||
| 329 | preg = of_get_property(op->node, bus->addr_prop_name, &num_reg); | 329 | preg = of_get_property(op->dev.of_node, bus->addr_prop_name, &num_reg); |
| 330 | if (!preg || num_reg == 0) | 330 | if (!preg || num_reg == 0) |
| 331 | return; | 331 | return; |
| 332 | 332 | ||
| @@ -340,7 +340,7 @@ static void __init build_device_resources(struct of_device *op, | |||
| 340 | if (num_reg > PROMREG_MAX) { | 340 | if (num_reg > PROMREG_MAX) { |
| 341 | printk(KERN_WARNING "%s: Too many regs (%d), " | 341 | printk(KERN_WARNING "%s: Too many regs (%d), " |
| 342 | "limiting to %d.\n", | 342 | "limiting to %d.\n", |
| 343 | op->node->full_name, num_reg, PROMREG_MAX); | 343 | op->dev.of_node->full_name, num_reg, PROMREG_MAX); |
| 344 | num_reg = PROMREG_MAX; | 344 | num_reg = PROMREG_MAX; |
| 345 | } | 345 | } |
| 346 | 346 | ||
| @@ -348,8 +348,8 @@ static void __init build_device_resources(struct of_device *op, | |||
| 348 | struct resource *r = &op->resource[index]; | 348 | struct resource *r = &op->resource[index]; |
| 349 | u32 addr[OF_MAX_ADDR_CELLS]; | 349 | u32 addr[OF_MAX_ADDR_CELLS]; |
| 350 | const u32 *reg = (preg + (index * ((na + ns) * 4))); | 350 | const u32 *reg = (preg + (index * ((na + ns) * 4))); |
| 351 | struct device_node *dp = op->node; | 351 | struct device_node *dp = op->dev.of_node; |
| 352 | struct device_node *pp = p_op->node; | 352 | struct device_node *pp = p_op->dev.of_node; |
| 353 | struct of_bus *pbus, *dbus; | 353 | struct of_bus *pbus, *dbus; |
| 354 | u64 size, result = OF_BAD_ADDR; | 354 | u64 size, result = OF_BAD_ADDR; |
| 355 | unsigned long flags; | 355 | unsigned long flags; |
| @@ -397,7 +397,7 @@ static void __init build_device_resources(struct of_device *op, | |||
| 397 | 397 | ||
| 398 | if (of_resource_verbose) | 398 | if (of_resource_verbose) |
| 399 | printk("%s reg[%d] -> %llx\n", | 399 | printk("%s reg[%d] -> %llx\n", |
| 400 | op->node->full_name, index, | 400 | op->dev.of_node->full_name, index, |
| 401 | result); | 401 | result); |
| 402 | 402 | ||
| 403 | if (result != OF_BAD_ADDR) { | 403 | if (result != OF_BAD_ADDR) { |
| @@ -408,7 +408,7 @@ static void __init build_device_resources(struct of_device *op, | |||
| 408 | r->end = result + size - 1; | 408 | r->end = result + size - 1; |
| 409 | r->flags = flags; | 409 | r->flags = flags; |
| 410 | } | 410 | } |
| 411 | r->name = op->node->name; | 411 | r->name = op->dev.of_node->name; |
| 412 | } | 412 | } |
| 413 | } | 413 | } |
| 414 | 414 | ||
| @@ -530,7 +530,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op, | |||
| 530 | struct device *parent, | 530 | struct device *parent, |
| 531 | unsigned int irq) | 531 | unsigned int irq) |
| 532 | { | 532 | { |
| 533 | struct device_node *dp = op->node; | 533 | struct device_node *dp = op->dev.of_node; |
| 534 | struct device_node *pp, *ip; | 534 | struct device_node *pp, *ip; |
| 535 | unsigned int orig_irq = irq; | 535 | unsigned int orig_irq = irq; |
| 536 | int nid; | 536 | int nid; |
| @@ -575,7 +575,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op, | |||
| 575 | 575 | ||
| 576 | if (of_irq_verbose) | 576 | if (of_irq_verbose) |
| 577 | printk("%s: Apply [%s:%x] imap --> [%s:%x]\n", | 577 | printk("%s: Apply [%s:%x] imap --> [%s:%x]\n", |
| 578 | op->node->full_name, | 578 | op->dev.of_node->full_name, |
| 579 | pp->full_name, this_orig_irq, | 579 | pp->full_name, this_orig_irq, |
| 580 | (iret ? iret->full_name : "NULL"), irq); | 580 | (iret ? iret->full_name : "NULL"), irq); |
| 581 | 581 | ||
| @@ -594,7 +594,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op, | |||
| 594 | if (of_irq_verbose) | 594 | if (of_irq_verbose) |
| 595 | printk("%s: PCI swizzle [%s] " | 595 | printk("%s: PCI swizzle [%s] " |
| 596 | "%x --> %x\n", | 596 | "%x --> %x\n", |
| 597 | op->node->full_name, | 597 | op->dev.of_node->full_name, |
| 598 | pp->full_name, this_orig_irq, | 598 | pp->full_name, this_orig_irq, |
| 599 | irq); | 599 | irq); |
| 600 | 600 | ||
| @@ -611,11 +611,11 @@ static unsigned int __init build_one_device_irq(struct of_device *op, | |||
| 611 | if (!ip) | 611 | if (!ip) |
| 612 | return orig_irq; | 612 | return orig_irq; |
| 613 | 613 | ||
| 614 | irq = ip->irq_trans->irq_build(op->node, irq, | 614 | irq = ip->irq_trans->irq_build(op->dev.of_node, irq, |
| 615 | ip->irq_trans->data); | 615 | ip->irq_trans->data); |
| 616 | if (of_irq_verbose) | 616 | if (of_irq_verbose) |
| 617 | printk("%s: Apply IRQ trans [%s] %x --> %x\n", | 617 | printk("%s: Apply IRQ trans [%s] %x --> %x\n", |
| 618 | op->node->full_name, ip->full_name, orig_irq, irq); | 618 | op->dev.of_node->full_name, ip->full_name, orig_irq, irq); |
| 619 | 619 | ||
| 620 | out: | 620 | out: |
| 621 | nid = of_node_to_nid(dp); | 621 | nid = of_node_to_nid(dp); |
| @@ -640,10 +640,9 @@ static struct of_device * __init scan_one_device(struct device_node *dp, | |||
| 640 | return NULL; | 640 | return NULL; |
| 641 | 641 | ||
| 642 | sd = &op->dev.archdata; | 642 | sd = &op->dev.archdata; |
| 643 | sd->prom_node = dp; | ||
| 644 | sd->op = op; | 643 | sd->op = op; |
| 645 | 644 | ||
| 646 | op->node = dp; | 645 | op->dev.of_node = dp; |
| 647 | 646 | ||
| 648 | op->clock_freq = of_getintprop_default(dp, "clock-frequency", | 647 | op->clock_freq = of_getintprop_default(dp, "clock-frequency", |
| 649 | (25*1000*1000)); | 648 | (25*1000*1000)); |
diff --git a/arch/sparc/kernel/of_device_common.c b/arch/sparc/kernel/of_device_common.c index cb8eb799bb6c..10c6c36a6e75 100644 --- a/arch/sparc/kernel/of_device_common.c +++ b/arch/sparc/kernel/of_device_common.c | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | #include <linux/init.h> | 4 | #include <linux/init.h> |
| 5 | #include <linux/module.h> | 5 | #include <linux/module.h> |
| 6 | #include <linux/mod_devicetable.h> | 6 | #include <linux/mod_devicetable.h> |
| 7 | #include <linux/slab.h> | ||
| 8 | #include <linux/errno.h> | 7 | #include <linux/errno.h> |
| 9 | #include <linux/irq.h> | 8 | #include <linux/irq.h> |
| 10 | #include <linux/of_device.h> | 9 | #include <linux/of_device.h> |
| @@ -17,7 +16,7 @@ static int node_match(struct device *dev, void *data) | |||
| 17 | struct of_device *op = to_of_device(dev); | 16 | struct of_device *op = to_of_device(dev); |
| 18 | struct device_node *dp = data; | 17 | struct device_node *dp = data; |
| 19 | 18 | ||
| 20 | return (op->node == dp); | 19 | return (op->dev.of_node == dp); |
| 21 | } | 20 | } |
| 22 | 21 | ||
| 23 | struct of_device *of_find_device_by_node(struct device_node *dp) | 22 | struct of_device *of_find_device_by_node(struct device_node *dp) |
| @@ -49,7 +48,7 @@ EXPORT_SYMBOL(irq_of_parse_and_map); | |||
| 49 | void of_propagate_archdata(struct of_device *bus) | 48 | void of_propagate_archdata(struct of_device *bus) |
| 50 | { | 49 | { |
| 51 | struct dev_archdata *bus_sd = &bus->dev.archdata; | 50 | struct dev_archdata *bus_sd = &bus->dev.archdata; |
| 52 | struct device_node *bus_dp = bus->node; | 51 | struct device_node *bus_dp = bus->dev.of_node; |
| 53 | struct device_node *dp; | 52 | struct device_node *dp; |
| 54 | 53 | ||
| 55 | for (dp = bus_dp->child; dp; dp = dp->sibling) { | 54 | for (dp = bus_dp->child; dp; dp = dp->sibling) { |
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 5ac539a5930f..8a8363adb8bd 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
| @@ -261,7 +261,6 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
| 261 | sd->iommu = pbm->iommu; | 261 | sd->iommu = pbm->iommu; |
| 262 | sd->stc = &pbm->stc; | 262 | sd->stc = &pbm->stc; |
| 263 | sd->host_controller = pbm; | 263 | sd->host_controller = pbm; |
| 264 | sd->prom_node = node; | ||
| 265 | sd->op = op = of_find_device_by_node(node); | 264 | sd->op = op = of_find_device_by_node(node); |
| 266 | sd->numa_node = pbm->numa_node; | 265 | sd->numa_node = pbm->numa_node; |
| 267 | 266 | ||
| @@ -285,6 +284,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
| 285 | dev->sysdata = node; | 284 | dev->sysdata = node; |
| 286 | dev->dev.parent = bus->bridge; | 285 | dev->dev.parent = bus->bridge; |
| 287 | dev->dev.bus = &pci_bus_type; | 286 | dev->dev.bus = &pci_bus_type; |
| 287 | dev->dev.of_node = node; | ||
| 288 | dev->devfn = devfn; | 288 | dev->devfn = devfn; |
| 289 | dev->multifunction = 0; /* maybe a lie? */ | 289 | dev->multifunction = 0; /* maybe a lie? */ |
| 290 | set_pcie_port_type(dev); | 290 | set_pcie_port_type(dev); |
| @@ -653,7 +653,7 @@ show_pciobppath_attr(struct device * dev, struct device_attribute * attr, char * | |||
| 653 | struct device_node *dp; | 653 | struct device_node *dp; |
| 654 | 654 | ||
| 655 | pdev = to_pci_dev(dev); | 655 | pdev = to_pci_dev(dev); |
| 656 | dp = pdev->dev.archdata.prom_node; | 656 | dp = pdev->dev.of_node; |
| 657 | 657 | ||
| 658 | return snprintf (buf, PAGE_SIZE, "%s\n", dp->full_name); | 658 | return snprintf (buf, PAGE_SIZE, "%s\n", dp->full_name); |
| 659 | } | 659 | } |
| @@ -683,7 +683,7 @@ static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus) | |||
| 683 | struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm, | 683 | struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm, |
| 684 | struct device *parent) | 684 | struct device *parent) |
| 685 | { | 685 | { |
| 686 | struct device_node *node = pbm->op->node; | 686 | struct device_node *node = pbm->op->dev.of_node; |
| 687 | struct pci_bus *bus; | 687 | struct pci_bus *bus; |
| 688 | 688 | ||
| 689 | printk("PCI: Scanning PBM %s\n", node->full_name); | 689 | printk("PCI: Scanning PBM %s\n", node->full_name); |
| @@ -1022,7 +1022,7 @@ void arch_teardown_msi_irq(unsigned int virt_irq) | |||
| 1022 | 1022 | ||
| 1023 | struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) | 1023 | struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) |
| 1024 | { | 1024 | { |
| 1025 | return pdev->dev.archdata.prom_node; | 1025 | return pdev->dev.of_node; |
| 1026 | } | 1026 | } |
| 1027 | EXPORT_SYMBOL(pci_device_to_OF_node); | 1027 | EXPORT_SYMBOL(pci_device_to_OF_node); |
| 1028 | 1028 | ||
| @@ -1151,15 +1151,13 @@ static int __init of_pci_slot_init(void) | |||
| 1151 | struct device_node *node; | 1151 | struct device_node *node; |
| 1152 | 1152 | ||
| 1153 | if (pbus->self) { | 1153 | if (pbus->self) { |
| 1154 | struct dev_archdata *sd = pbus->self->sysdata; | ||
| 1155 | |||
| 1156 | /* PCI->PCI bridge */ | 1154 | /* PCI->PCI bridge */ |
| 1157 | node = sd->prom_node; | 1155 | node = pbus->self->dev.of_node; |
| 1158 | } else { | 1156 | } else { |
| 1159 | struct pci_pbm_info *pbm = pbus->sysdata; | 1157 | struct pci_pbm_info *pbm = pbus->sysdata; |
| 1160 | 1158 | ||
| 1161 | /* Host PCI controller */ | 1159 | /* Host PCI controller */ |
| 1162 | node = pbm->op->node; | 1160 | node = pbm->op->dev.of_node; |
| 1163 | } | 1161 | } |
| 1164 | 1162 | ||
| 1165 | pci_bus_slot_names(node, pbus); | 1163 | pci_bus_slot_names(node, pbus); |
diff --git a/arch/sparc/kernel/pci_common.c b/arch/sparc/kernel/pci_common.c index b775658a927d..6c7a33af3ba6 100644 --- a/arch/sparc/kernel/pci_common.c +++ b/arch/sparc/kernel/pci_common.c | |||
| @@ -314,12 +314,12 @@ struct pci_ops sun4v_pci_ops = { | |||
| 314 | 314 | ||
| 315 | void pci_get_pbm_props(struct pci_pbm_info *pbm) | 315 | void pci_get_pbm_props(struct pci_pbm_info *pbm) |
| 316 | { | 316 | { |
| 317 | const u32 *val = of_get_property(pbm->op->node, "bus-range", NULL); | 317 | const u32 *val = of_get_property(pbm->op->dev.of_node, "bus-range", NULL); |
| 318 | 318 | ||
| 319 | pbm->pci_first_busno = val[0]; | 319 | pbm->pci_first_busno = val[0]; |
| 320 | pbm->pci_last_busno = val[1]; | 320 | pbm->pci_last_busno = val[1]; |
| 321 | 321 | ||
| 322 | val = of_get_property(pbm->op->node, "ino-bitmap", NULL); | 322 | val = of_get_property(pbm->op->dev.of_node, "ino-bitmap", NULL); |
| 323 | if (val) { | 323 | if (val) { |
| 324 | pbm->ino_bitmap = (((u64)val[1] << 32UL) | | 324 | pbm->ino_bitmap = (((u64)val[1] << 32UL) | |
| 325 | ((u64)val[0] << 0UL)); | 325 | ((u64)val[0] << 0UL)); |
| @@ -365,20 +365,26 @@ static void pci_register_legacy_regions(struct resource *io_res, | |||
| 365 | 365 | ||
| 366 | static void pci_register_iommu_region(struct pci_pbm_info *pbm) | 366 | static void pci_register_iommu_region(struct pci_pbm_info *pbm) |
| 367 | { | 367 | { |
| 368 | const u32 *vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); | 368 | const u32 *vdma = of_get_property(pbm->op->dev.of_node, "virtual-dma", |
| 369 | NULL); | ||
| 369 | 370 | ||
| 370 | if (vdma) { | 371 | if (vdma) { |
| 371 | struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL); | 372 | struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL); |
| 372 | 373 | ||
| 373 | if (!rp) { | 374 | if (!rp) { |
| 374 | prom_printf("Cannot allocate IOMMU resource.\n"); | 375 | pr_info("%s: Cannot allocate IOMMU resource.\n", |
| 375 | prom_halt(); | 376 | pbm->name); |
| 377 | return; | ||
| 376 | } | 378 | } |
| 377 | rp->name = "IOMMU"; | 379 | rp->name = "IOMMU"; |
| 378 | rp->start = pbm->mem_space.start + (unsigned long) vdma[0]; | 380 | rp->start = pbm->mem_space.start + (unsigned long) vdma[0]; |
| 379 | rp->end = rp->start + (unsigned long) vdma[1] - 1UL; | 381 | rp->end = rp->start + (unsigned long) vdma[1] - 1UL; |
| 380 | rp->flags = IORESOURCE_BUSY; | 382 | rp->flags = IORESOURCE_BUSY; |
| 381 | request_resource(&pbm->mem_space, rp); | 383 | if (request_resource(&pbm->mem_space, rp)) { |
| 384 | pr_info("%s: Unable to request IOMMU resource.\n", | ||
| 385 | pbm->name); | ||
| 386 | kfree(rp); | ||
| 387 | } | ||
| 382 | } | 388 | } |
| 383 | } | 389 | } |
| 384 | 390 | ||
| @@ -389,7 +395,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm) | |||
| 389 | int num_pbm_ranges; | 395 | int num_pbm_ranges; |
| 390 | 396 | ||
| 391 | saw_mem = saw_io = 0; | 397 | saw_mem = saw_io = 0; |
| 392 | pbm_ranges = of_get_property(pbm->op->node, "ranges", &i); | 398 | pbm_ranges = of_get_property(pbm->op->dev.of_node, "ranges", &i); |
| 393 | if (!pbm_ranges) { | 399 | if (!pbm_ranges) { |
| 394 | prom_printf("PCI: Fatal error, missing PBM ranges property " | 400 | prom_printf("PCI: Fatal error, missing PBM ranges property " |
| 395 | " for %s\n", | 401 | " for %s\n", |
diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c index d53f45bc7dda..51cfa09e392a 100644 --- a/arch/sparc/kernel/pci_fire.c +++ b/arch/sparc/kernel/pci_fire.c | |||
| @@ -413,7 +413,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm, | |||
| 413 | struct of_device *op, u32 portid) | 413 | struct of_device *op, u32 portid) |
| 414 | { | 414 | { |
| 415 | const struct linux_prom64_registers *regs; | 415 | const struct linux_prom64_registers *regs; |
| 416 | struct device_node *dp = op->node; | 416 | struct device_node *dp = op->dev.of_node; |
| 417 | int err; | 417 | int err; |
| 418 | 418 | ||
| 419 | pbm->numa_node = -1; | 419 | pbm->numa_node = -1; |
| @@ -458,7 +458,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm, | |||
| 458 | static int __devinit fire_probe(struct of_device *op, | 458 | static int __devinit fire_probe(struct of_device *op, |
| 459 | const struct of_device_id *match) | 459 | const struct of_device_id *match) |
| 460 | { | 460 | { |
| 461 | struct device_node *dp = op->node; | 461 | struct device_node *dp = op->dev.of_node; |
| 462 | struct pci_pbm_info *pbm; | 462 | struct pci_pbm_info *pbm; |
| 463 | struct iommu *iommu; | 463 | struct iommu *iommu; |
| 464 | u32 portid; | 464 | u32 portid; |
| @@ -508,8 +508,11 @@ static struct of_device_id __initdata fire_match[] = { | |||
| 508 | }; | 508 | }; |
| 509 | 509 | ||
| 510 | static struct of_platform_driver fire_driver = { | 510 | static struct of_platform_driver fire_driver = { |
| 511 | .name = DRIVER_NAME, | 511 | .driver = { |
| 512 | .match_table = fire_match, | 512 | .name = DRIVER_NAME, |
| 513 | .owner = THIS_MODULE, | ||
| 514 | .of_match_table = fire_match, | ||
| 515 | }, | ||
| 513 | .probe = fire_probe, | 516 | .probe = fire_probe, |
| 514 | }; | 517 | }; |
| 515 | 518 | ||
diff --git a/arch/sparc/kernel/pci_msi.c b/arch/sparc/kernel/pci_msi.c index e1b0541feb19..548b8ca9c210 100644 --- a/arch/sparc/kernel/pci_msi.c +++ b/arch/sparc/kernel/pci_msi.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | */ | 4 | */ |
| 5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
| 6 | #include <linux/interrupt.h> | 6 | #include <linux/interrupt.h> |
| 7 | #include <linux/slab.h> | ||
| 7 | #include <linux/irq.h> | 8 | #include <linux/irq.h> |
| 8 | 9 | ||
| 9 | #include "pci_impl.h" | 10 | #include "pci_impl.h" |
| @@ -323,7 +324,7 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm, | |||
| 323 | const u32 *val; | 324 | const u32 *val; |
| 324 | int len; | 325 | int len; |
| 325 | 326 | ||
| 326 | val = of_get_property(pbm->op->node, "#msi-eqs", &len); | 327 | val = of_get_property(pbm->op->dev.of_node, "#msi-eqs", &len); |
| 327 | if (!val || len != 4) | 328 | if (!val || len != 4) |
| 328 | goto no_msi; | 329 | goto no_msi; |
| 329 | pbm->msiq_num = *val; | 330 | pbm->msiq_num = *val; |
| @@ -346,16 +347,16 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm, | |||
| 346 | u32 msi64_len; | 347 | u32 msi64_len; |
| 347 | } *arng; | 348 | } *arng; |
| 348 | 349 | ||
| 349 | val = of_get_property(pbm->op->node, "msi-eq-size", &len); | 350 | val = of_get_property(pbm->op->dev.of_node, "msi-eq-size", &len); |
| 350 | if (!val || len != 4) | 351 | if (!val || len != 4) |
| 351 | goto no_msi; | 352 | goto no_msi; |
| 352 | 353 | ||
| 353 | pbm->msiq_ent_count = *val; | 354 | pbm->msiq_ent_count = *val; |
| 354 | 355 | ||
| 355 | mqp = of_get_property(pbm->op->node, | 356 | mqp = of_get_property(pbm->op->dev.of_node, |
| 356 | "msi-eq-to-devino", &len); | 357 | "msi-eq-to-devino", &len); |
| 357 | if (!mqp) | 358 | if (!mqp) |
| 358 | mqp = of_get_property(pbm->op->node, | 359 | mqp = of_get_property(pbm->op->dev.of_node, |
| 359 | "msi-eq-devino", &len); | 360 | "msi-eq-devino", &len); |
| 360 | if (!mqp || len != sizeof(struct msiq_prop)) | 361 | if (!mqp || len != sizeof(struct msiq_prop)) |
| 361 | goto no_msi; | 362 | goto no_msi; |
| @@ -363,27 +364,27 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm, | |||
| 363 | pbm->msiq_first = mqp->first_msiq; | 364 | pbm->msiq_first = mqp->first_msiq; |
| 364 | pbm->msiq_first_devino = mqp->first_devino; | 365 | pbm->msiq_first_devino = mqp->first_devino; |
| 365 | 366 | ||
| 366 | val = of_get_property(pbm->op->node, "#msi", &len); | 367 | val = of_get_property(pbm->op->dev.of_node, "#msi", &len); |
| 367 | if (!val || len != 4) | 368 | if (!val || len != 4) |
| 368 | goto no_msi; | 369 | goto no_msi; |
| 369 | pbm->msi_num = *val; | 370 | pbm->msi_num = *val; |
| 370 | 371 | ||
| 371 | mrng = of_get_property(pbm->op->node, "msi-ranges", &len); | 372 | mrng = of_get_property(pbm->op->dev.of_node, "msi-ranges", &len); |
| 372 | if (!mrng || len != sizeof(struct msi_range_prop)) | 373 | if (!mrng || len != sizeof(struct msi_range_prop)) |
| 373 | goto no_msi; | 374 | goto no_msi; |
| 374 | pbm->msi_first = mrng->first_msi; | 375 | pbm->msi_first = mrng->first_msi; |
| 375 | 376 | ||
| 376 | val = of_get_property(pbm->op->node, "msi-data-mask", &len); | 377 | val = of_get_property(pbm->op->dev.of_node, "msi-data-mask", &len); |
| 377 | if (!val || len != 4) | 378 | if (!val || len != 4) |
| 378 | goto no_msi; | 379 | goto no_msi; |
| 379 | pbm->msi_data_mask = *val; | 380 | pbm->msi_data_mask = *val; |
| 380 | 381 | ||
| 381 | val = of_get_property(pbm->op->node, "msix-data-width", &len); | 382 | val = of_get_property(pbm->op->dev.of_node, "msix-data-width", &len); |
| 382 | if (!val || len != 4) | 383 | if (!val || len != 4) |
| 383 | goto no_msi; | 384 | goto no_msi; |
| 384 | pbm->msix_data_width = *val; | 385 | pbm->msix_data_width = *val; |
| 385 | 386 | ||
| 386 | arng = of_get_property(pbm->op->node, "msi-address-ranges", | 387 | arng = of_get_property(pbm->op->dev.of_node, "msi-address-ranges", |
| 387 | &len); | 388 | &len); |
| 388 | if (!arng || len != sizeof(struct addr_range_prop)) | 389 | if (!arng || len != sizeof(struct addr_range_prop)) |
| 389 | goto no_msi; | 390 | goto no_msi; |
diff --git a/arch/sparc/kernel/pci_psycho.c b/arch/sparc/kernel/pci_psycho.c index 142b9d6984a8..558a70512824 100644 --- a/arch/sparc/kernel/pci_psycho.c +++ b/arch/sparc/kernel/pci_psycho.c | |||
| @@ -285,7 +285,7 @@ static irqreturn_t psycho_ce_intr(int irq, void *dev_id) | |||
| 285 | #define PSYCHO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */ | 285 | #define PSYCHO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */ |
| 286 | static void psycho_register_error_handlers(struct pci_pbm_info *pbm) | 286 | static void psycho_register_error_handlers(struct pci_pbm_info *pbm) |
| 287 | { | 287 | { |
| 288 | struct of_device *op = of_find_device_by_node(pbm->op->node); | 288 | struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node); |
| 289 | unsigned long base = pbm->controller_regs; | 289 | unsigned long base = pbm->controller_regs; |
| 290 | u64 tmp; | 290 | u64 tmp; |
| 291 | int err; | 291 | int err; |
| @@ -507,7 +507,7 @@ static int __devinit psycho_probe(struct of_device *op, | |||
| 507 | const struct of_device_id *match) | 507 | const struct of_device_id *match) |
| 508 | { | 508 | { |
| 509 | const struct linux_prom64_registers *pr_regs; | 509 | const struct linux_prom64_registers *pr_regs; |
| 510 | struct device_node *dp = op->node; | 510 | struct device_node *dp = op->dev.of_node; |
| 511 | struct pci_pbm_info *pbm; | 511 | struct pci_pbm_info *pbm; |
| 512 | struct iommu *iommu; | 512 | struct iommu *iommu; |
| 513 | int is_pbm_a, err; | 513 | int is_pbm_a, err; |
| @@ -602,8 +602,11 @@ static struct of_device_id __initdata psycho_match[] = { | |||
| 602 | }; | 602 | }; |
| 603 | 603 | ||
| 604 | static struct of_platform_driver psycho_driver = { | 604 | static struct of_platform_driver psycho_driver = { |
| 605 | .name = DRIVER_NAME, | 605 | .driver = { |
| 606 | .match_table = psycho_match, | 606 | .name = DRIVER_NAME, |
| 607 | .owner = THIS_MODULE, | ||
| 608 | .of_match_table = psycho_match, | ||
| 609 | }, | ||
| 607 | .probe = psycho_probe, | 610 | .probe = psycho_probe, |
| 608 | }; | 611 | }; |
| 609 | 612 | ||
diff --git a/arch/sparc/kernel/pci_sabre.c b/arch/sparc/kernel/pci_sabre.c index ba6fbeba3e2c..6dad8e3b7506 100644 --- a/arch/sparc/kernel/pci_sabre.c +++ b/arch/sparc/kernel/pci_sabre.c | |||
| @@ -310,7 +310,7 @@ static irqreturn_t sabre_ce_intr(int irq, void *dev_id) | |||
| 310 | 310 | ||
| 311 | static void sabre_register_error_handlers(struct pci_pbm_info *pbm) | 311 | static void sabre_register_error_handlers(struct pci_pbm_info *pbm) |
| 312 | { | 312 | { |
| 313 | struct device_node *dp = pbm->op->node; | 313 | struct device_node *dp = pbm->op->dev.of_node; |
| 314 | struct of_device *op; | 314 | struct of_device *op; |
| 315 | unsigned long base = pbm->controller_regs; | 315 | unsigned long base = pbm->controller_regs; |
| 316 | u64 tmp; | 316 | u64 tmp; |
| @@ -456,7 +456,7 @@ static int __devinit sabre_probe(struct of_device *op, | |||
| 456 | const struct of_device_id *match) | 456 | const struct of_device_id *match) |
| 457 | { | 457 | { |
| 458 | const struct linux_prom64_registers *pr_regs; | 458 | const struct linux_prom64_registers *pr_regs; |
| 459 | struct device_node *dp = op->node; | 459 | struct device_node *dp = op->dev.of_node; |
| 460 | struct pci_pbm_info *pbm; | 460 | struct pci_pbm_info *pbm; |
| 461 | u32 upa_portid, dma_mask; | 461 | u32 upa_portid, dma_mask; |
| 462 | struct iommu *iommu; | 462 | struct iommu *iommu; |
| @@ -596,8 +596,11 @@ static struct of_device_id __initdata sabre_match[] = { | |||
| 596 | }; | 596 | }; |
| 597 | 597 | ||
| 598 | static struct of_platform_driver sabre_driver = { | 598 | static struct of_platform_driver sabre_driver = { |
| 599 | .name = DRIVER_NAME, | 599 | .driver = { |
| 600 | .match_table = sabre_match, | 600 | .name = DRIVER_NAME, |
| 601 | .owner = THIS_MODULE, | ||
| 602 | .of_match_table = sabre_match, | ||
| 603 | }, | ||
| 601 | .probe = sabre_probe, | 604 | .probe = sabre_probe, |
| 602 | }; | 605 | }; |
| 603 | 606 | ||
diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c index 2b5cdde77af7..97a1ae2e1c02 100644 --- a/arch/sparc/kernel/pci_schizo.c +++ b/arch/sparc/kernel/pci_schizo.c | |||
| @@ -844,7 +844,7 @@ static int pbm_routes_this_ino(struct pci_pbm_info *pbm, u32 ino) | |||
| 844 | */ | 844 | */ |
| 845 | static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm) | 845 | static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm) |
| 846 | { | 846 | { |
| 847 | struct of_device *op = of_find_device_by_node(pbm->op->node); | 847 | struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node); |
| 848 | u64 tmp, err_mask, err_no_mask; | 848 | u64 tmp, err_mask, err_no_mask; |
| 849 | int err; | 849 | int err; |
| 850 | 850 | ||
| @@ -939,7 +939,7 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm) | |||
| 939 | 939 | ||
| 940 | static void schizo_register_error_handlers(struct pci_pbm_info *pbm) | 940 | static void schizo_register_error_handlers(struct pci_pbm_info *pbm) |
| 941 | { | 941 | { |
| 942 | struct of_device *op = of_find_device_by_node(pbm->op->node); | 942 | struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node); |
| 943 | u64 tmp, err_mask, err_no_mask; | 943 | u64 tmp, err_mask, err_no_mask; |
| 944 | int err; | 944 | int err; |
| 945 | 945 | ||
| @@ -1068,7 +1068,7 @@ static void __devinit schizo_scan_bus(struct pci_pbm_info *pbm, | |||
| 1068 | { | 1068 | { |
| 1069 | pbm_config_busmastering(pbm); | 1069 | pbm_config_busmastering(pbm); |
| 1070 | pbm->is_66mhz_capable = | 1070 | pbm->is_66mhz_capable = |
| 1071 | (of_find_property(pbm->op->node, "66mhz-capable", NULL) | 1071 | (of_find_property(pbm->op->dev.of_node, "66mhz-capable", NULL) |
| 1072 | != NULL); | 1072 | != NULL); |
| 1073 | 1073 | ||
| 1074 | pbm->pci_bus = pci_scan_one_pbm(pbm, parent); | 1074 | pbm->pci_bus = pci_scan_one_pbm(pbm, parent); |
| @@ -1138,7 +1138,7 @@ static int schizo_pbm_iommu_init(struct pci_pbm_info *pbm) | |||
| 1138 | u32 dma_mask; | 1138 | u32 dma_mask; |
| 1139 | u64 control; | 1139 | u64 control; |
| 1140 | 1140 | ||
| 1141 | vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); | 1141 | vdma = of_get_property(pbm->op->dev.of_node, "virtual-dma", NULL); |
| 1142 | if (!vdma) | 1142 | if (!vdma) |
| 1143 | vdma = vdma_default; | 1143 | vdma = vdma_default; |
| 1144 | 1144 | ||
| @@ -1268,7 +1268,7 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm) | |||
| 1268 | pbm->chip_version >= 0x2) | 1268 | pbm->chip_version >= 0x2) |
| 1269 | tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT; | 1269 | tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT; |
| 1270 | 1270 | ||
| 1271 | if (!of_find_property(pbm->op->node, "no-bus-parking", NULL)) | 1271 | if (!of_find_property(pbm->op->dev.of_node, "no-bus-parking", NULL)) |
| 1272 | tmp |= SCHIZO_PCICTRL_PARK; | 1272 | tmp |= SCHIZO_PCICTRL_PARK; |
| 1273 | else | 1273 | else |
| 1274 | tmp &= ~SCHIZO_PCICTRL_PARK; | 1274 | tmp &= ~SCHIZO_PCICTRL_PARK; |
| @@ -1311,7 +1311,7 @@ static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm, | |||
| 1311 | int chip_type) | 1311 | int chip_type) |
| 1312 | { | 1312 | { |
| 1313 | const struct linux_prom64_registers *regs; | 1313 | const struct linux_prom64_registers *regs; |
| 1314 | struct device_node *dp = op->node; | 1314 | struct device_node *dp = op->dev.of_node; |
| 1315 | const char *chipset_name; | 1315 | const char *chipset_name; |
| 1316 | int is_pbm_a, err; | 1316 | int is_pbm_a, err; |
| 1317 | 1317 | ||
| @@ -1415,7 +1415,7 @@ static struct pci_pbm_info * __devinit schizo_find_sibling(u32 portid, | |||
| 1415 | 1415 | ||
| 1416 | static int __devinit __schizo_init(struct of_device *op, unsigned long chip_type) | 1416 | static int __devinit __schizo_init(struct of_device *op, unsigned long chip_type) |
| 1417 | { | 1417 | { |
| 1418 | struct device_node *dp = op->node; | 1418 | struct device_node *dp = op->dev.of_node; |
| 1419 | struct pci_pbm_info *pbm; | 1419 | struct pci_pbm_info *pbm; |
| 1420 | struct iommu *iommu; | 1420 | struct iommu *iommu; |
| 1421 | u32 portid; | 1421 | u32 portid; |
| @@ -1491,8 +1491,11 @@ static struct of_device_id __initdata schizo_match[] = { | |||
| 1491 | }; | 1491 | }; |
| 1492 | 1492 | ||
| 1493 | static struct of_platform_driver schizo_driver = { | 1493 | static struct of_platform_driver schizo_driver = { |
| 1494 | .name = DRIVER_NAME, | 1494 | .driver = { |
| 1495 | .match_table = schizo_match, | 1495 | .name = DRIVER_NAME, |
| 1496 | .owner = THIS_MODULE, | ||
| 1497 | .of_match_table = schizo_match, | ||
| 1498 | }, | ||
| 1496 | .probe = schizo_probe, | 1499 | .probe = schizo_probe, |
| 1497 | }; | 1500 | }; |
| 1498 | 1501 | ||
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c index 23c33ff9c31e..a24af6f7e17f 100644 --- a/arch/sparc/kernel/pci_sun4v.c +++ b/arch/sparc/kernel/pci_sun4v.c | |||
| @@ -540,7 +540,7 @@ static void __devinit pci_sun4v_scan_bus(struct pci_pbm_info *pbm, | |||
| 540 | struct property *prop; | 540 | struct property *prop; |
| 541 | struct device_node *dp; | 541 | struct device_node *dp; |
| 542 | 542 | ||
| 543 | dp = pbm->op->node; | 543 | dp = pbm->op->dev.of_node; |
| 544 | prop = of_find_property(dp, "66mhz-capable", NULL); | 544 | prop = of_find_property(dp, "66mhz-capable", NULL); |
| 545 | pbm->is_66mhz_capable = (prop != NULL); | 545 | pbm->is_66mhz_capable = (prop != NULL); |
| 546 | pbm->pci_bus = pci_scan_one_pbm(pbm, parent); | 546 | pbm->pci_bus = pci_scan_one_pbm(pbm, parent); |
| @@ -584,7 +584,7 @@ static int __devinit pci_sun4v_iommu_init(struct pci_pbm_info *pbm) | |||
| 584 | u32 dma_mask, dma_offset; | 584 | u32 dma_mask, dma_offset; |
| 585 | const u32 *vdma; | 585 | const u32 *vdma; |
| 586 | 586 | ||
| 587 | vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); | 587 | vdma = of_get_property(pbm->op->dev.of_node, "virtual-dma", NULL); |
| 588 | if (!vdma) | 588 | if (!vdma) |
| 589 | vdma = vdma_default; | 589 | vdma = vdma_default; |
| 590 | 590 | ||
| @@ -881,7 +881,7 @@ static void pci_sun4v_msi_init(struct pci_pbm_info *pbm) | |||
| 881 | static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm, | 881 | static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm, |
| 882 | struct of_device *op, u32 devhandle) | 882 | struct of_device *op, u32 devhandle) |
| 883 | { | 883 | { |
| 884 | struct device_node *dp = op->node; | 884 | struct device_node *dp = op->dev.of_node; |
| 885 | int err; | 885 | int err; |
| 886 | 886 | ||
| 887 | pbm->numa_node = of_node_to_nid(dp); | 887 | pbm->numa_node = of_node_to_nid(dp); |
| @@ -929,7 +929,7 @@ static int __devinit pci_sun4v_probe(struct of_device *op, | |||
| 929 | u32 devhandle; | 929 | u32 devhandle; |
| 930 | int i, err; | 930 | int i, err; |
| 931 | 931 | ||
| 932 | dp = op->node; | 932 | dp = op->dev.of_node; |
| 933 | 933 | ||
| 934 | if (!hvapi_negotiated++) { | 934 | if (!hvapi_negotiated++) { |
| 935 | err = sun4v_hvapi_register(HV_GRP_PCI, | 935 | err = sun4v_hvapi_register(HV_GRP_PCI, |
| @@ -1009,8 +1009,11 @@ static struct of_device_id __initdata pci_sun4v_match[] = { | |||
| 1009 | }; | 1009 | }; |
| 1010 | 1010 | ||
| 1011 | static struct of_platform_driver pci_sun4v_driver = { | 1011 | static struct of_platform_driver pci_sun4v_driver = { |
| 1012 | .name = DRIVER_NAME, | 1012 | .driver = { |
| 1013 | .match_table = pci_sun4v_match, | 1013 | .name = DRIVER_NAME, |
| 1014 | .owner = THIS_MODULE, | ||
| 1015 | .of_match_table = pci_sun4v_match, | ||
| 1016 | }, | ||
| 1014 | .probe = pci_sun4v_probe, | 1017 | .probe = pci_sun4v_probe, |
| 1015 | }; | 1018 | }; |
| 1016 | 1019 | ||
diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c index 2d94e7a03af5..c4a6a50b4849 100644 --- a/arch/sparc/kernel/pcr.c +++ b/arch/sparc/kernel/pcr.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/irq.h> | 8 | #include <linux/irq.h> |
| 9 | 9 | ||
| 10 | #include <linux/perf_event.h> | 10 | #include <linux/perf_event.h> |
| 11 | #include <linux/ftrace.h> | ||
| 11 | 12 | ||
| 12 | #include <asm/pil.h> | 13 | #include <asm/pil.h> |
| 13 | #include <asm/pcr.h> | 14 | #include <asm/pcr.h> |
| @@ -34,7 +35,7 @@ unsigned int picl_shift; | |||
| 34 | * Therefore in such situations we defer the work by signalling | 35 | * Therefore in such situations we defer the work by signalling |
| 35 | * a lower level cpu IRQ. | 36 | * a lower level cpu IRQ. |
| 36 | */ | 37 | */ |
| 37 | void deferred_pcr_work_irq(int irq, struct pt_regs *regs) | 38 | void __irq_entry deferred_pcr_work_irq(int irq, struct pt_regs *regs) |
| 38 | { | 39 | { |
| 39 | struct pt_regs *old_regs; | 40 | struct pt_regs *old_regs; |
| 40 | 41 | ||
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 68cb9b42088f..44faabc3c02c 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | #include <linux/perf_event.h> | 15 | #include <linux/perf_event.h> |
| 16 | #include <linux/kprobes.h> | 16 | #include <linux/kprobes.h> |
| 17 | #include <linux/ftrace.h> | ||
| 17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
| 18 | #include <linux/kdebug.h> | 19 | #include <linux/kdebug.h> |
| 19 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
| @@ -91,6 +92,8 @@ struct cpu_hw_events { | |||
| 91 | 92 | ||
| 92 | /* Enabled/disable state. */ | 93 | /* Enabled/disable state. */ |
| 93 | int enabled; | 94 | int enabled; |
| 95 | |||
| 96 | unsigned int group_flag; | ||
| 94 | }; | 97 | }; |
| 95 | DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = { .enabled = 1, }; | 98 | DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = { .enabled = 1, }; |
| 96 | 99 | ||
| @@ -654,6 +657,7 @@ static u64 maybe_change_configuration(struct cpu_hw_events *cpuc, u64 pcr) | |||
| 654 | cpuc->current_idx[i] = idx; | 657 | cpuc->current_idx[i] = idx; |
| 655 | 658 | ||
| 656 | enc = perf_event_get_enc(cpuc->events[i]); | 659 | enc = perf_event_get_enc(cpuc->events[i]); |
| 660 | pcr &= ~mask_for_index(idx); | ||
| 657 | pcr |= event_encoding(enc, idx); | 661 | pcr |= event_encoding(enc, idx); |
| 658 | } | 662 | } |
| 659 | out: | 663 | out: |
| @@ -980,53 +984,6 @@ static int collect_events(struct perf_event *group, int max_count, | |||
| 980 | return n; | 984 | return n; |
| 981 | } | 985 | } |
| 982 | 986 | ||
| 983 | static void event_sched_in(struct perf_event *event) | ||
| 984 | { | ||
| 985 | event->state = PERF_EVENT_STATE_ACTIVE; | ||
| 986 | event->oncpu = smp_processor_id(); | ||
| 987 | event->tstamp_running += event->ctx->time - event->tstamp_stopped; | ||
| 988 | if (is_software_event(event)) | ||
| 989 | event->pmu->enable(event); | ||
| 990 | } | ||
| 991 | |||
| 992 | int hw_perf_group_sched_in(struct perf_event *group_leader, | ||
| 993 | struct perf_cpu_context *cpuctx, | ||
| 994 | struct perf_event_context *ctx) | ||
| 995 | { | ||
| 996 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | ||
| 997 | struct perf_event *sub; | ||
| 998 | int n0, n; | ||
| 999 | |||
| 1000 | if (!sparc_pmu) | ||
| 1001 | return 0; | ||
| 1002 | |||
| 1003 | n0 = cpuc->n_events; | ||
| 1004 | n = collect_events(group_leader, perf_max_events - n0, | ||
| 1005 | &cpuc->event[n0], &cpuc->events[n0], | ||
| 1006 | &cpuc->current_idx[n0]); | ||
| 1007 | if (n < 0) | ||
| 1008 | return -EAGAIN; | ||
| 1009 | if (check_excludes(cpuc->event, n0, n)) | ||
| 1010 | return -EINVAL; | ||
| 1011 | if (sparc_check_constraints(cpuc->event, cpuc->events, n + n0)) | ||
| 1012 | return -EAGAIN; | ||
| 1013 | cpuc->n_events = n0 + n; | ||
| 1014 | cpuc->n_added += n; | ||
| 1015 | |||
| 1016 | cpuctx->active_oncpu += n; | ||
| 1017 | n = 1; | ||
| 1018 | event_sched_in(group_leader); | ||
| 1019 | list_for_each_entry(sub, &group_leader->sibling_list, group_entry) { | ||
| 1020 | if (sub->state != PERF_EVENT_STATE_OFF) { | ||
| 1021 | event_sched_in(sub); | ||
| 1022 | n++; | ||
| 1023 | } | ||
| 1024 | } | ||
| 1025 | ctx->nr_active += n; | ||
| 1026 | |||
| 1027 | return 1; | ||
| 1028 | } | ||
| 1029 | |||
| 1030 | static int sparc_pmu_enable(struct perf_event *event) | 987 | static int sparc_pmu_enable(struct perf_event *event) |
| 1031 | { | 988 | { |
| 1032 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | 989 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); |
| @@ -1044,11 +1001,20 @@ static int sparc_pmu_enable(struct perf_event *event) | |||
| 1044 | cpuc->events[n0] = event->hw.event_base; | 1001 | cpuc->events[n0] = event->hw.event_base; |
| 1045 | cpuc->current_idx[n0] = PIC_NO_INDEX; | 1002 | cpuc->current_idx[n0] = PIC_NO_INDEX; |
| 1046 | 1003 | ||
| 1004 | /* | ||
| 1005 | * If group events scheduling transaction was started, | ||
| 1006 | * skip the schedulability test here, it will be peformed | ||
| 1007 | * at commit time(->commit_txn) as a whole | ||
| 1008 | */ | ||
| 1009 | if (cpuc->group_flag & PERF_EVENT_TXN_STARTED) | ||
| 1010 | goto nocheck; | ||
| 1011 | |||
| 1047 | if (check_excludes(cpuc->event, n0, 1)) | 1012 | if (check_excludes(cpuc->event, n0, 1)) |
| 1048 | goto out; | 1013 | goto out; |
| 1049 | if (sparc_check_constraints(cpuc->event, cpuc->events, n0 + 1)) | 1014 | if (sparc_check_constraints(cpuc->event, cpuc->events, n0 + 1)) |
| 1050 | goto out; | 1015 | goto out; |
| 1051 | 1016 | ||
| 1017 | nocheck: | ||
| 1052 | cpuc->n_events++; | 1018 | cpuc->n_events++; |
| 1053 | cpuc->n_added++; | 1019 | cpuc->n_added++; |
| 1054 | 1020 | ||
| @@ -1128,11 +1094,61 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
| 1128 | return 0; | 1094 | return 0; |
| 1129 | } | 1095 | } |
| 1130 | 1096 | ||
| 1097 | /* | ||
| 1098 | * Start group events scheduling transaction | ||
| 1099 | * Set the flag to make pmu::enable() not perform the | ||
| 1100 | * schedulability test, it will be performed at commit time | ||
| 1101 | */ | ||
| 1102 | static void sparc_pmu_start_txn(const struct pmu *pmu) | ||
| 1103 | { | ||
| 1104 | struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); | ||
| 1105 | |||
| 1106 | cpuhw->group_flag |= PERF_EVENT_TXN_STARTED; | ||
| 1107 | } | ||
| 1108 | |||
| 1109 | /* | ||
| 1110 | * Stop group events scheduling transaction | ||
| 1111 | * Clear the flag and pmu::enable() will perform the | ||
| 1112 | * schedulability test. | ||
| 1113 | */ | ||
| 1114 | static void sparc_pmu_cancel_txn(const struct pmu *pmu) | ||
| 1115 | { | ||
| 1116 | struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); | ||
| 1117 | |||
| 1118 | cpuhw->group_flag &= ~PERF_EVENT_TXN_STARTED; | ||
| 1119 | } | ||
| 1120 | |||
| 1121 | /* | ||
| 1122 | * Commit group events scheduling transaction | ||
| 1123 | * Perform the group schedulability test as a whole | ||
| 1124 | * Return 0 if success | ||
| 1125 | */ | ||
| 1126 | static int sparc_pmu_commit_txn(const struct pmu *pmu) | ||
| 1127 | { | ||
| 1128 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | ||
| 1129 | int n; | ||
| 1130 | |||
| 1131 | if (!sparc_pmu) | ||
| 1132 | return -EINVAL; | ||
| 1133 | |||
| 1134 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
| 1135 | n = cpuc->n_events; | ||
| 1136 | if (check_excludes(cpuc->event, 0, n)) | ||
| 1137 | return -EINVAL; | ||
| 1138 | if (sparc_check_constraints(cpuc->event, cpuc->events, n)) | ||
| 1139 | return -EAGAIN; | ||
| 1140 | |||
| 1141 | return 0; | ||
| 1142 | } | ||
| 1143 | |||
| 1131 | static const struct pmu pmu = { | 1144 | static const struct pmu pmu = { |
| 1132 | .enable = sparc_pmu_enable, | 1145 | .enable = sparc_pmu_enable, |
| 1133 | .disable = sparc_pmu_disable, | 1146 | .disable = sparc_pmu_disable, |
| 1134 | .read = sparc_pmu_read, | 1147 | .read = sparc_pmu_read, |
| 1135 | .unthrottle = sparc_pmu_unthrottle, | 1148 | .unthrottle = sparc_pmu_unthrottle, |
| 1149 | .start_txn = sparc_pmu_start_txn, | ||
| 1150 | .cancel_txn = sparc_pmu_cancel_txn, | ||
| 1151 | .commit_txn = sparc_pmu_commit_txn, | ||
| 1136 | }; | 1152 | }; |
| 1137 | 1153 | ||
| 1138 | const struct pmu *hw_perf_event_init(struct perf_event *event) | 1154 | const struct pmu *hw_perf_event_init(struct perf_event *event) |
| @@ -1276,6 +1292,9 @@ static void perf_callchain_kernel(struct pt_regs *regs, | |||
| 1276 | struct perf_callchain_entry *entry) | 1292 | struct perf_callchain_entry *entry) |
| 1277 | { | 1293 | { |
| 1278 | unsigned long ksp, fp; | 1294 | unsigned long ksp, fp; |
| 1295 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 1296 | int graph = 0; | ||
| 1297 | #endif | ||
| 1279 | 1298 | ||
| 1280 | callchain_store(entry, PERF_CONTEXT_KERNEL); | 1299 | callchain_store(entry, PERF_CONTEXT_KERNEL); |
| 1281 | callchain_store(entry, regs->tpc); | 1300 | callchain_store(entry, regs->tpc); |
| @@ -1303,6 +1322,16 @@ static void perf_callchain_kernel(struct pt_regs *regs, | |||
| 1303 | fp = (unsigned long)sf->fp + STACK_BIAS; | 1322 | fp = (unsigned long)sf->fp + STACK_BIAS; |
| 1304 | } | 1323 | } |
| 1305 | callchain_store(entry, pc); | 1324 | callchain_store(entry, pc); |
| 1325 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 1326 | if ((pc + 8UL) == (unsigned long) &return_to_handler) { | ||
| 1327 | int index = current->curr_ret_stack; | ||
| 1328 | if (current->ret_stack && index >= graph) { | ||
| 1329 | pc = current->ret_stack[index - graph].ret; | ||
| 1330 | callchain_store(entry, pc); | ||
| 1331 | graph++; | ||
| 1332 | } | ||
| 1333 | } | ||
| 1334 | #endif | ||
| 1306 | } while (entry->nr < PERF_MAX_STACK_DEPTH); | 1335 | } while (entry->nr < PERF_MAX_STACK_DEPTH); |
| 1307 | } | 1336 | } |
| 1308 | 1337 | ||
| @@ -1337,7 +1366,7 @@ static void perf_callchain_user_32(struct pt_regs *regs, | |||
| 1337 | callchain_store(entry, PERF_CONTEXT_USER); | 1366 | callchain_store(entry, PERF_CONTEXT_USER); |
| 1338 | callchain_store(entry, regs->tpc); | 1367 | callchain_store(entry, regs->tpc); |
| 1339 | 1368 | ||
| 1340 | ufp = regs->u_regs[UREG_I6]; | 1369 | ufp = regs->u_regs[UREG_I6] & 0xffffffffUL; |
| 1341 | do { | 1370 | do { |
| 1342 | struct sparc_stackf32 *usf, sf; | 1371 | struct sparc_stackf32 *usf, sf; |
| 1343 | unsigned long pc; | 1372 | unsigned long pc; |
diff --git a/arch/sparc/kernel/pmc.c b/arch/sparc/kernel/pmc.c index 5e4563d86f19..9589d8b9b0c1 100644 --- a/arch/sparc/kernel/pmc.c +++ b/arch/sparc/kernel/pmc.c | |||
| @@ -79,8 +79,11 @@ static struct of_device_id __initdata pmc_match[] = { | |||
| 79 | MODULE_DEVICE_TABLE(of, pmc_match); | 79 | MODULE_DEVICE_TABLE(of, pmc_match); |
| 80 | 80 | ||
| 81 | static struct of_platform_driver pmc_driver = { | 81 | static struct of_platform_driver pmc_driver = { |
| 82 | .name = "pmc", | 82 | .driver = { |
| 83 | .match_table = pmc_match, | 83 | .name = "pmc", |
| 84 | .owner = THIS_MODULE, | ||
| 85 | .of_match_table = pmc_match, | ||
| 86 | }, | ||
| 84 | .probe = pmc_probe, | 87 | .probe = pmc_probe, |
| 85 | }; | 88 | }; |
| 86 | 89 | ||
diff --git a/arch/sparc/kernel/power.c b/arch/sparc/kernel/power.c index e2a045c235a1..168d4cb63f5b 100644 --- a/arch/sparc/kernel/power.c +++ b/arch/sparc/kernel/power.c | |||
| @@ -41,9 +41,9 @@ static int __devinit power_probe(struct of_device *op, const struct of_device_id | |||
| 41 | power_reg = of_ioremap(res, 0, 0x4, "power"); | 41 | power_reg = of_ioremap(res, 0, 0x4, "power"); |
| 42 | 42 | ||
| 43 | printk(KERN_INFO "%s: Control reg at %llx\n", | 43 | printk(KERN_INFO "%s: Control reg at %llx\n", |
| 44 | op->node->name, res->start); | 44 | op->dev.of_node->name, res->start); |
| 45 | 45 | ||
| 46 | if (has_button_interrupt(irq, op->node)) { | 46 | if (has_button_interrupt(irq, op->dev.of_node)) { |
| 47 | if (request_irq(irq, | 47 | if (request_irq(irq, |
| 48 | power_handler, 0, "power", NULL) < 0) | 48 | power_handler, 0, "power", NULL) < 0) |
| 49 | printk(KERN_ERR "power: Cannot setup IRQ handler.\n"); | 49 | printk(KERN_ERR "power: Cannot setup IRQ handler.\n"); |
| @@ -60,10 +60,11 @@ static struct of_device_id __initdata power_match[] = { | |||
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | static struct of_platform_driver power_driver = { | 62 | static struct of_platform_driver power_driver = { |
| 63 | .match_table = power_match, | ||
| 64 | .probe = power_probe, | 63 | .probe = power_probe, |
| 65 | .driver = { | 64 | .driver = { |
| 66 | .name = "power", | 65 | .name = "power", |
| 66 | .owner = THIS_MODULE, | ||
| 67 | .of_match_table = power_match, | ||
| 67 | }, | 68 | }, |
| 68 | }; | 69 | }; |
| 69 | 70 | ||
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index c49865b30719..40e29fc8a4d6 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c | |||
| @@ -17,13 +17,13 @@ | |||
| 17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
| 18 | #include <linux/stddef.h> | 18 | #include <linux/stddef.h> |
| 19 | #include <linux/ptrace.h> | 19 | #include <linux/ptrace.h> |
| 20 | #include <linux/slab.h> | ||
| 21 | #include <linux/user.h> | 20 | #include <linux/user.h> |
| 22 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
| 23 | #include <linux/reboot.h> | 22 | #include <linux/reboot.h> |
| 24 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
| 25 | #include <linux/pm.h> | 24 | #include <linux/pm.h> |
| 26 | #include <linux/init.h> | 25 | #include <linux/init.h> |
| 26 | #include <linux/slab.h> | ||
| 27 | 27 | ||
| 28 | #include <asm/auxio.h> | 28 | #include <asm/auxio.h> |
| 29 | #include <asm/oplib.h> | 29 | #include <asm/oplib.h> |
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index a5cf3864b31f..dbe81a368b45 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
| @@ -202,6 +202,7 @@ void show_regs(struct pt_regs *regs) | |||
| 202 | regs->u_regs[15]); | 202 | regs->u_regs[15]); |
| 203 | printk("RPC: <%pS>\n", (void *) regs->u_regs[15]); | 203 | printk("RPC: <%pS>\n", (void *) regs->u_regs[15]); |
| 204 | show_regwindow(regs); | 204 | show_regwindow(regs); |
| 205 | show_stack(current, (unsigned long *) regs->u_regs[UREG_FP]); | ||
| 205 | } | 206 | } |
| 206 | 207 | ||
| 207 | struct global_reg_snapshot global_reg_snapshot[NR_CPUS]; | 208 | struct global_reg_snapshot global_reg_snapshot[NR_CPUS]; |
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c index fb06ac2bd38f..466a32763ea8 100644 --- a/arch/sparc/kernel/prom_64.c +++ b/arch/sparc/kernel/prom_64.c | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | #include <linux/string.h> | 20 | #include <linux/string.h> |
| 21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
| 22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 23 | #include <linux/lmb.h> | 23 | #include <linux/memblock.h> |
| 24 | #include <linux/of_device.h> | 24 | #include <linux/of_device.h> |
| 25 | 25 | ||
| 26 | #include <asm/prom.h> | 26 | #include <asm/prom.h> |
| @@ -34,7 +34,7 @@ | |||
| 34 | 34 | ||
| 35 | void * __init prom_early_alloc(unsigned long size) | 35 | void * __init prom_early_alloc(unsigned long size) |
| 36 | { | 36 | { |
| 37 | unsigned long paddr = lmb_alloc(size, SMP_CACHE_BYTES); | 37 | unsigned long paddr = memblock_alloc(size, SMP_CACHE_BYTES); |
| 38 | void *ret; | 38 | void *ret; |
| 39 | 39 | ||
| 40 | if (!paddr) { | 40 | if (!paddr) { |
diff --git a/arch/sparc/kernel/psycho_common.c b/arch/sparc/kernel/psycho_common.c index 8f1478475421..3f34ac853931 100644 --- a/arch/sparc/kernel/psycho_common.c +++ b/arch/sparc/kernel/psycho_common.c | |||
| @@ -450,7 +450,7 @@ int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize, | |||
| 450 | void psycho_pbm_init_common(struct pci_pbm_info *pbm, struct of_device *op, | 450 | void psycho_pbm_init_common(struct pci_pbm_info *pbm, struct of_device *op, |
| 451 | const char *chip_name, int chip_type) | 451 | const char *chip_name, int chip_type) |
| 452 | { | 452 | { |
| 453 | struct device_node *dp = op->node; | 453 | struct device_node *dp = op->dev.of_node; |
| 454 | 454 | ||
| 455 | pbm->name = dp->full_name; | 455 | pbm->name = dp->full_name; |
| 456 | pbm->numa_node = -1; | 456 | pbm->numa_node = -1; |
diff --git a/arch/sparc/kernel/ptrace_32.c b/arch/sparc/kernel/ptrace_32.c index 7e3dfd9bb97e..e608f397e11f 100644 --- a/arch/sparc/kernel/ptrace_32.c +++ b/arch/sparc/kernel/ptrace_32.c | |||
| @@ -65,6 +65,7 @@ static int genregs32_get(struct task_struct *target, | |||
| 65 | *k++ = regs->u_regs[pos++]; | 65 | *k++ = regs->u_regs[pos++]; |
| 66 | 66 | ||
| 67 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; | 67 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; |
| 68 | reg_window -= 16; | ||
| 68 | for (; count > 0 && pos < 32; count--) { | 69 | for (; count > 0 && pos < 32; count--) { |
| 69 | if (get_user(*k++, ®_window[pos++])) | 70 | if (get_user(*k++, ®_window[pos++])) |
| 70 | return -EFAULT; | 71 | return -EFAULT; |
| @@ -76,6 +77,7 @@ static int genregs32_get(struct task_struct *target, | |||
| 76 | } | 77 | } |
| 77 | 78 | ||
| 78 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; | 79 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; |
| 80 | reg_window -= 16; | ||
| 79 | for (; count > 0 && pos < 32; count--) { | 81 | for (; count > 0 && pos < 32; count--) { |
| 80 | if (get_user(reg, ®_window[pos++]) || | 82 | if (get_user(reg, ®_window[pos++]) || |
| 81 | put_user(reg, u++)) | 83 | put_user(reg, u++)) |
| @@ -141,6 +143,7 @@ static int genregs32_set(struct task_struct *target, | |||
| 141 | regs->u_regs[pos++] = *k++; | 143 | regs->u_regs[pos++] = *k++; |
| 142 | 144 | ||
| 143 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; | 145 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; |
| 146 | reg_window -= 16; | ||
| 144 | for (; count > 0 && pos < 32; count--) { | 147 | for (; count > 0 && pos < 32; count--) { |
| 145 | if (put_user(*k++, ®_window[pos++])) | 148 | if (put_user(*k++, ®_window[pos++])) |
| 146 | return -EFAULT; | 149 | return -EFAULT; |
| @@ -153,6 +156,7 @@ static int genregs32_set(struct task_struct *target, | |||
| 153 | } | 156 | } |
| 154 | 157 | ||
| 155 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; | 158 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; |
| 159 | reg_window -= 16; | ||
| 156 | for (; count > 0 && pos < 32; count--) { | 160 | for (; count > 0 && pos < 32; count--) { |
| 157 | if (get_user(reg, u++) || | 161 | if (get_user(reg, u++) || |
| 158 | put_user(reg, ®_window[pos++])) | 162 | put_user(reg, ®_window[pos++])) |
diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c index 2f6524d1a817..aa90da08bf61 100644 --- a/arch/sparc/kernel/ptrace_64.c +++ b/arch/sparc/kernel/ptrace_64.c | |||
| @@ -492,6 +492,7 @@ static int genregs32_get(struct task_struct *target, | |||
| 492 | *k++ = regs->u_regs[pos++]; | 492 | *k++ = regs->u_regs[pos++]; |
| 493 | 493 | ||
| 494 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; | 494 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; |
| 495 | reg_window -= 16; | ||
| 495 | if (target == current) { | 496 | if (target == current) { |
| 496 | for (; count > 0 && pos < 32; count--) { | 497 | for (; count > 0 && pos < 32; count--) { |
| 497 | if (get_user(*k++, ®_window[pos++])) | 498 | if (get_user(*k++, ®_window[pos++])) |
| @@ -516,6 +517,7 @@ static int genregs32_get(struct task_struct *target, | |||
| 516 | } | 517 | } |
| 517 | 518 | ||
| 518 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; | 519 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; |
| 520 | reg_window -= 16; | ||
| 519 | if (target == current) { | 521 | if (target == current) { |
| 520 | for (; count > 0 && pos < 32; count--) { | 522 | for (; count > 0 && pos < 32; count--) { |
| 521 | if (get_user(reg, ®_window[pos++]) || | 523 | if (get_user(reg, ®_window[pos++]) || |
| @@ -599,6 +601,7 @@ static int genregs32_set(struct task_struct *target, | |||
| 599 | regs->u_regs[pos++] = *k++; | 601 | regs->u_regs[pos++] = *k++; |
| 600 | 602 | ||
| 601 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; | 603 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; |
| 604 | reg_window -= 16; | ||
| 602 | if (target == current) { | 605 | if (target == current) { |
| 603 | for (; count > 0 && pos < 32; count--) { | 606 | for (; count > 0 && pos < 32; count--) { |
| 604 | if (put_user(*k++, ®_window[pos++])) | 607 | if (put_user(*k++, ®_window[pos++])) |
| @@ -625,6 +628,7 @@ static int genregs32_set(struct task_struct *target, | |||
| 625 | } | 628 | } |
| 626 | 629 | ||
| 627 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; | 630 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; |
| 631 | reg_window -= 16; | ||
| 628 | if (target == current) { | 632 | if (target == current) { |
| 629 | for (; count > 0 && pos < 32; count--) { | 633 | for (; count > 0 && pos < 32; count--) { |
| 630 | if (get_user(reg, u++) || | 634 | if (get_user(reg, u++) || |
diff --git a/arch/sparc/kernel/rtrap_64.S b/arch/sparc/kernel/rtrap_64.S index 83f1873c6c13..090b9e9ad5e3 100644 --- a/arch/sparc/kernel/rtrap_64.S +++ b/arch/sparc/kernel/rtrap_64.S | |||
| @@ -130,7 +130,17 @@ rtrap_xcall: | |||
| 130 | nop | 130 | nop |
| 131 | call trace_hardirqs_on | 131 | call trace_hardirqs_on |
| 132 | nop | 132 | nop |
| 133 | wrpr %l4, %pil | 133 | /* Do not actually set the %pil here. We will do that |
| 134 | * below after we clear PSTATE_IE in the %pstate register. | ||
| 135 | * If we re-enable interrupts here, we can recurse down | ||
| 136 | * the hardirq stack potentially endlessly, causing a | ||
| 137 | * stack overflow. | ||
| 138 | * | ||
| 139 | * It is tempting to put this test and trace_hardirqs_on | ||
| 140 | * call at the 'rt_continue' label, but that will not work | ||
| 141 | * as that path hits unconditionally and we do not want to | ||
| 142 | * execute this in NMI return paths, for example. | ||
| 143 | */ | ||
| 134 | #endif | 144 | #endif |
| 135 | rtrap_no_irq_enable: | 145 | rtrap_no_irq_enable: |
| 136 | andcc %l1, TSTATE_PRIV, %l3 | 146 | andcc %l1, TSTATE_PRIV, %l3 |
diff --git a/arch/sparc/kernel/sbus.c b/arch/sparc/kernel/sbus.c index 406e0872504e..cfeaf04b9cdf 100644 --- a/arch/sparc/kernel/sbus.c +++ b/arch/sparc/kernel/sbus.c | |||
| @@ -63,10 +63,10 @@ void sbus_set_sbus64(struct device *dev, int bursts) | |||
| 63 | int slot; | 63 | int slot; |
| 64 | u64 val; | 64 | u64 val; |
| 65 | 65 | ||
| 66 | regs = of_get_property(op->node, "reg", NULL); | 66 | regs = of_get_property(op->dev.of_node, "reg", NULL); |
| 67 | if (!regs) { | 67 | if (!regs) { |
| 68 | printk(KERN_ERR "sbus_set_sbus64: Cannot find regs for %s\n", | 68 | printk(KERN_ERR "sbus_set_sbus64: Cannot find regs for %s\n", |
| 69 | op->node->full_name); | 69 | op->dev.of_node->full_name); |
| 70 | return; | 70 | return; |
| 71 | } | 71 | } |
| 72 | slot = regs->which_io; | 72 | slot = regs->which_io; |
| @@ -287,7 +287,7 @@ static irqreturn_t sysio_ue_handler(int irq, void *dev_id) | |||
| 287 | SYSIO_UEAFSR_SPIO | SYSIO_UEAFSR_SDRD | SYSIO_UEAFSR_SDWR); | 287 | SYSIO_UEAFSR_SPIO | SYSIO_UEAFSR_SDRD | SYSIO_UEAFSR_SDWR); |
| 288 | upa_writeq(error_bits, afsr_reg); | 288 | upa_writeq(error_bits, afsr_reg); |
| 289 | 289 | ||
| 290 | portid = of_getintprop_default(op->node, "portid", -1); | 290 | portid = of_getintprop_default(op->dev.of_node, "portid", -1); |
| 291 | 291 | ||
| 292 | /* Log the error. */ | 292 | /* Log the error. */ |
| 293 | printk("SYSIO[%x]: Uncorrectable ECC Error, primary error type[%s]\n", | 293 | printk("SYSIO[%x]: Uncorrectable ECC Error, primary error type[%s]\n", |
| @@ -361,7 +361,7 @@ static irqreturn_t sysio_ce_handler(int irq, void *dev_id) | |||
| 361 | SYSIO_CEAFSR_SPIO | SYSIO_CEAFSR_SDRD | SYSIO_CEAFSR_SDWR); | 361 | SYSIO_CEAFSR_SPIO | SYSIO_CEAFSR_SDRD | SYSIO_CEAFSR_SDWR); |
| 362 | upa_writeq(error_bits, afsr_reg); | 362 | upa_writeq(error_bits, afsr_reg); |
| 363 | 363 | ||
| 364 | portid = of_getintprop_default(op->node, "portid", -1); | 364 | portid = of_getintprop_default(op->dev.of_node, "portid", -1); |
| 365 | 365 | ||
| 366 | printk("SYSIO[%x]: Correctable ECC Error, primary error type[%s]\n", | 366 | printk("SYSIO[%x]: Correctable ECC Error, primary error type[%s]\n", |
| 367 | portid, | 367 | portid, |
| @@ -439,7 +439,7 @@ static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id) | |||
| 439 | SYSIO_SBAFSR_SLE | SYSIO_SBAFSR_STO | SYSIO_SBAFSR_SBERR); | 439 | SYSIO_SBAFSR_SLE | SYSIO_SBAFSR_STO | SYSIO_SBAFSR_SBERR); |
| 440 | upa_writeq(error_bits, afsr_reg); | 440 | upa_writeq(error_bits, afsr_reg); |
| 441 | 441 | ||
| 442 | portid = of_getintprop_default(op->node, "portid", -1); | 442 | portid = of_getintprop_default(op->dev.of_node, "portid", -1); |
| 443 | 443 | ||
| 444 | /* Log the error. */ | 444 | /* Log the error. */ |
| 445 | printk("SYSIO[%x]: SBUS Error, primary error type[%s] read(%d)\n", | 445 | printk("SYSIO[%x]: SBUS Error, primary error type[%s] read(%d)\n", |
| @@ -496,7 +496,7 @@ static void __init sysio_register_error_handlers(struct of_device *op) | |||
| 496 | u64 control; | 496 | u64 control; |
| 497 | int portid; | 497 | int portid; |
| 498 | 498 | ||
| 499 | portid = of_getintprop_default(op->node, "portid", -1); | 499 | portid = of_getintprop_default(op->dev.of_node, "portid", -1); |
| 500 | 500 | ||
| 501 | irq = sbus_build_irq(op, SYSIO_UE_INO); | 501 | irq = sbus_build_irq(op, SYSIO_UE_INO); |
| 502 | if (request_irq(irq, sysio_ue_handler, 0, | 502 | if (request_irq(irq, sysio_ue_handler, 0, |
| @@ -537,7 +537,7 @@ static void __init sysio_register_error_handlers(struct of_device *op) | |||
| 537 | static void __init sbus_iommu_init(struct of_device *op) | 537 | static void __init sbus_iommu_init(struct of_device *op) |
| 538 | { | 538 | { |
| 539 | const struct linux_prom64_registers *pr; | 539 | const struct linux_prom64_registers *pr; |
| 540 | struct device_node *dp = op->node; | 540 | struct device_node *dp = op->dev.of_node; |
| 541 | struct iommu *iommu; | 541 | struct iommu *iommu; |
| 542 | struct strbuf *strbuf; | 542 | struct strbuf *strbuf; |
| 543 | unsigned long regs, reg_base; | 543 | unsigned long regs, reg_base; |
| @@ -589,7 +589,7 @@ static void __init sbus_iommu_init(struct of_device *op) | |||
| 589 | */ | 589 | */ |
| 590 | iommu->write_complete_reg = regs + 0x2000UL; | 590 | iommu->write_complete_reg = regs + 0x2000UL; |
| 591 | 591 | ||
| 592 | portid = of_getintprop_default(op->node, "portid", -1); | 592 | portid = of_getintprop_default(op->dev.of_node, "portid", -1); |
| 593 | printk(KERN_INFO "SYSIO: UPA portID %x, at %016lx\n", | 593 | printk(KERN_INFO "SYSIO: UPA portID %x, at %016lx\n", |
| 594 | portid, regs); | 594 | portid, regs); |
| 595 | 595 | ||
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index a2a79e76344f..5f72de67588b 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | #include <linux/stddef.h> | 12 | #include <linux/stddef.h> |
| 13 | #include <linux/unistd.h> | 13 | #include <linux/unistd.h> |
| 14 | #include <linux/ptrace.h> | 14 | #include <linux/ptrace.h> |
| 15 | #include <linux/slab.h> | ||
| 16 | #include <asm/smp.h> | 15 | #include <asm/smp.h> |
| 17 | #include <linux/user.h> | 16 | #include <linux/user.h> |
| 18 | #include <linux/screen_info.h> | 17 | #include <linux/screen_info.h> |
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index eb14844a0021..b6a2b8f47040 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c | |||
| @@ -22,7 +22,9 @@ | |||
| 22 | #include <linux/profile.h> | 22 | #include <linux/profile.h> |
| 23 | #include <linux/bootmem.h> | 23 | #include <linux/bootmem.h> |
| 24 | #include <linux/vmalloc.h> | 24 | #include <linux/vmalloc.h> |
| 25 | #include <linux/ftrace.h> | ||
| 25 | #include <linux/cpu.h> | 26 | #include <linux/cpu.h> |
| 27 | #include <linux/slab.h> | ||
| 26 | 28 | ||
| 27 | #include <asm/head.h> | 29 | #include <asm/head.h> |
| 28 | #include <asm/ptrace.h> | 30 | #include <asm/ptrace.h> |
| @@ -822,13 +824,13 @@ void arch_send_call_function_single_ipi(int cpu) | |||
| 822 | &cpumask_of_cpu(cpu)); | 824 | &cpumask_of_cpu(cpu)); |
| 823 | } | 825 | } |
| 824 | 826 | ||
| 825 | void smp_call_function_client(int irq, struct pt_regs *regs) | 827 | void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs) |
| 826 | { | 828 | { |
| 827 | clear_softint(1 << irq); | 829 | clear_softint(1 << irq); |
| 828 | generic_smp_call_function_interrupt(); | 830 | generic_smp_call_function_interrupt(); |
| 829 | } | 831 | } |
| 830 | 832 | ||
| 831 | void smp_call_function_single_client(int irq, struct pt_regs *regs) | 833 | void __irq_entry smp_call_function_single_client(int irq, struct pt_regs *regs) |
| 832 | { | 834 | { |
| 833 | clear_softint(1 << irq); | 835 | clear_softint(1 << irq); |
| 834 | generic_smp_call_function_single_interrupt(); | 836 | generic_smp_call_function_single_interrupt(); |
| @@ -964,7 +966,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page) | |||
| 964 | put_cpu(); | 966 | put_cpu(); |
| 965 | } | 967 | } |
| 966 | 968 | ||
| 967 | void smp_new_mmu_context_version_client(int irq, struct pt_regs *regs) | 969 | void __irq_entry smp_new_mmu_context_version_client(int irq, struct pt_regs *regs) |
| 968 | { | 970 | { |
| 969 | struct mm_struct *mm; | 971 | struct mm_struct *mm; |
| 970 | unsigned long flags; | 972 | unsigned long flags; |
| @@ -1148,7 +1150,7 @@ void smp_release(void) | |||
| 1148 | */ | 1150 | */ |
| 1149 | extern void prom_world(int); | 1151 | extern void prom_world(int); |
| 1150 | 1152 | ||
| 1151 | void smp_penguin_jailcell(int irq, struct pt_regs *regs) | 1153 | void __irq_entry smp_penguin_jailcell(int irq, struct pt_regs *regs) |
| 1152 | { | 1154 | { |
| 1153 | clear_softint(1 << irq); | 1155 | clear_softint(1 << irq); |
| 1154 | 1156 | ||
| @@ -1364,7 +1366,7 @@ void smp_send_reschedule(int cpu) | |||
| 1364 | &cpumask_of_cpu(cpu)); | 1366 | &cpumask_of_cpu(cpu)); |
| 1365 | } | 1367 | } |
| 1366 | 1368 | ||
| 1367 | void smp_receive_signal_client(int irq, struct pt_regs *regs) | 1369 | void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs) |
| 1368 | { | 1370 | { |
| 1369 | clear_softint(1 << irq); | 1371 | clear_softint(1 << irq); |
| 1370 | } | 1372 | } |
diff --git a/arch/sparc/kernel/stacktrace.c b/arch/sparc/kernel/stacktrace.c index acb12f673757..3e0815349630 100644 --- a/arch/sparc/kernel/stacktrace.c +++ b/arch/sparc/kernel/stacktrace.c | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #include <linux/sched.h> | 1 | #include <linux/sched.h> |
| 2 | #include <linux/stacktrace.h> | 2 | #include <linux/stacktrace.h> |
| 3 | #include <linux/thread_info.h> | 3 | #include <linux/thread_info.h> |
| 4 | #include <linux/ftrace.h> | ||
| 4 | #include <linux/module.h> | 5 | #include <linux/module.h> |
| 5 | #include <asm/ptrace.h> | 6 | #include <asm/ptrace.h> |
| 6 | #include <asm/stacktrace.h> | 7 | #include <asm/stacktrace.h> |
| @@ -12,6 +13,10 @@ static void __save_stack_trace(struct thread_info *tp, | |||
| 12 | bool skip_sched) | 13 | bool skip_sched) |
| 13 | { | 14 | { |
| 14 | unsigned long ksp, fp; | 15 | unsigned long ksp, fp; |
| 16 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 17 | struct task_struct *t; | ||
| 18 | int graph = 0; | ||
| 19 | #endif | ||
| 15 | 20 | ||
| 16 | if (tp == current_thread_info()) { | 21 | if (tp == current_thread_info()) { |
| 17 | stack_trace_flush(); | 22 | stack_trace_flush(); |
| @@ -21,6 +26,9 @@ static void __save_stack_trace(struct thread_info *tp, | |||
| 21 | } | 26 | } |
| 22 | 27 | ||
| 23 | fp = ksp + STACK_BIAS; | 28 | fp = ksp + STACK_BIAS; |
| 29 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 30 | t = tp->task; | ||
| 31 | #endif | ||
| 24 | do { | 32 | do { |
| 25 | struct sparc_stackf *sf; | 33 | struct sparc_stackf *sf; |
| 26 | struct pt_regs *regs; | 34 | struct pt_regs *regs; |
| @@ -44,8 +52,21 @@ static void __save_stack_trace(struct thread_info *tp, | |||
| 44 | 52 | ||
| 45 | if (trace->skip > 0) | 53 | if (trace->skip > 0) |
| 46 | trace->skip--; | 54 | trace->skip--; |
| 47 | else if (!skip_sched || !in_sched_functions(pc)) | 55 | else if (!skip_sched || !in_sched_functions(pc)) { |
| 48 | trace->entries[trace->nr_entries++] = pc; | 56 | trace->entries[trace->nr_entries++] = pc; |
| 57 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 58 | if ((pc + 8UL) == (unsigned long) &return_to_handler) { | ||
| 59 | int index = t->curr_ret_stack; | ||
| 60 | if (t->ret_stack && index >= graph) { | ||
| 61 | pc = t->ret_stack[index - graph].ret; | ||
| 62 | if (trace->nr_entries < | ||
| 63 | trace->max_entries) | ||
| 64 | trace->entries[trace->nr_entries++] = pc; | ||
| 65 | graph++; | ||
| 66 | } | ||
| 67 | } | ||
| 68 | #endif | ||
| 69 | } | ||
| 49 | } while (trace->nr_entries < trace->max_entries); | 70 | } while (trace->nr_entries < trace->max_entries); |
| 50 | } | 71 | } |
| 51 | 72 | ||
diff --git a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c index bc3adbf79c6a..892fb884910a 100644 --- a/arch/sparc/kernel/sun4c_irq.c +++ b/arch/sparc/kernel/sun4c_irq.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 17 | #include <linux/ptrace.h> | 17 | #include <linux/ptrace.h> |
| 18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/slab.h> | ||
| 20 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 21 | #include <linux/of.h> | 20 | #include <linux/of.h> |
| 22 | #include <linux/of_device.h> | 21 | #include <linux/of_device.h> |
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index ab036a72de5a..e11b4612dabb 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c | |||
| @@ -183,7 +183,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id) | |||
| 183 | goto out_unlock; | 183 | goto out_unlock; |
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | if (action && tmp) | 186 | if (tmp) |
| 187 | tmp->next = action->next; | 187 | tmp->next = action->next; |
| 188 | else | 188 | else |
| 189 | *actionp = action->next; | 189 | *actionp = action->next; |
diff --git a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c index 301892e2d718..7f3b97ff62c1 100644 --- a/arch/sparc/kernel/sun4m_irq.c +++ b/arch/sparc/kernel/sun4m_irq.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/ptrace.h> | 17 | #include <linux/ptrace.h> |
| 18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
| 19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
| 20 | #include <linux/slab.h> | ||
| 21 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 22 | #include <linux/ioport.h> | 21 | #include <linux/ioport.h> |
| 23 | #include <linux/of.h> | 22 | #include <linux/of.h> |
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c index daded3b96398..c0ca87553e1c 100644 --- a/arch/sparc/kernel/sys_sparc32.c +++ b/arch/sparc/kernel/sys_sparc32.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/sem.h> | 21 | #include <linux/sem.h> |
| 22 | #include <linux/msg.h> | 22 | #include <linux/msg.h> |
| 23 | #include <linux/shm.h> | 23 | #include <linux/shm.h> |
| 24 | #include <linux/slab.h> | ||
| 25 | #include <linux/uio.h> | 24 | #include <linux/uio.h> |
| 26 | #include <linux/nfs_fs.h> | 25 | #include <linux/nfs_fs.h> |
| 27 | #include <linux/quota.h> | 26 | #include <linux/quota.h> |
| @@ -44,6 +43,7 @@ | |||
| 44 | #include <linux/compat.h> | 43 | #include <linux/compat.h> |
| 45 | #include <linux/vfs.h> | 44 | #include <linux/vfs.h> |
| 46 | #include <linux/ptrace.h> | 45 | #include <linux/ptrace.h> |
| 46 | #include <linux/slab.h> | ||
| 47 | 47 | ||
| 48 | #include <asm/types.h> | 48 | #include <asm/types.h> |
| 49 | #include <asm/uaccess.h> | 49 | #include <asm/uaccess.h> |
diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c index ca39c606fe8e..1eb8b00aed75 100644 --- a/arch/sparc/kernel/sysfs.c +++ b/arch/sparc/kernel/sysfs.c | |||
| @@ -107,12 +107,12 @@ static unsigned long run_on_cpu(unsigned long cpu, | |||
| 107 | unsigned long ret; | 107 | unsigned long ret; |
| 108 | 108 | ||
| 109 | /* should return -EINVAL to userspace */ | 109 | /* should return -EINVAL to userspace */ |
| 110 | if (set_cpus_allowed(current, cpumask_of_cpu(cpu))) | 110 | if (set_cpus_allowed_ptr(current, cpumask_of(cpu))) |
| 111 | return 0; | 111 | return 0; |
| 112 | 112 | ||
| 113 | ret = func(arg); | 113 | ret = func(arg); |
| 114 | 114 | ||
| 115 | set_cpus_allowed(current, old_affinity); | 115 | set_cpus_allowed_ptr(current, &old_affinity); |
| 116 | 116 | ||
| 117 | return ret; | 117 | return ret; |
| 118 | } | 118 | } |
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index 0d4c09b15efc..e404b063be2c 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c | |||
| @@ -78,6 +78,11 @@ __volatile__ unsigned int *master_l10_counter; | |||
| 78 | 78 | ||
| 79 | u32 (*do_arch_gettimeoffset)(void); | 79 | u32 (*do_arch_gettimeoffset)(void); |
| 80 | 80 | ||
| 81 | int update_persistent_clock(struct timespec now) | ||
| 82 | { | ||
| 83 | return set_rtc_mmss(now.tv_sec); | ||
| 84 | } | ||
| 85 | |||
| 81 | /* | 86 | /* |
| 82 | * timer_interrupt() needs to keep up the real-time clock, | 87 | * timer_interrupt() needs to keep up the real-time clock, |
| 83 | * as well as call the "do_timer()" routine every clocktick | 88 | * as well as call the "do_timer()" routine every clocktick |
| @@ -87,9 +92,6 @@ u32 (*do_arch_gettimeoffset)(void); | |||
| 87 | 92 | ||
| 88 | static irqreturn_t timer_interrupt(int dummy, void *dev_id) | 93 | static irqreturn_t timer_interrupt(int dummy, void *dev_id) |
| 89 | { | 94 | { |
| 90 | /* last time the cmos clock got updated */ | ||
| 91 | static long last_rtc_update; | ||
| 92 | |||
| 93 | #ifndef CONFIG_SMP | 95 | #ifndef CONFIG_SMP |
| 94 | profile_tick(CPU_PROFILING); | 96 | profile_tick(CPU_PROFILING); |
| 95 | #endif | 97 | #endif |
| @@ -101,16 +103,6 @@ static irqreturn_t timer_interrupt(int dummy, void *dev_id) | |||
| 101 | 103 | ||
| 102 | do_timer(1); | 104 | do_timer(1); |
| 103 | 105 | ||
| 104 | /* Determine when to update the Mostek clock. */ | ||
| 105 | if (ntp_synced() && | ||
| 106 | xtime.tv_sec > last_rtc_update + 660 && | ||
| 107 | (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 && | ||
| 108 | (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) { | ||
| 109 | if (set_rtc_mmss(xtime.tv_sec) == 0) | ||
| 110 | last_rtc_update = xtime.tv_sec; | ||
| 111 | else | ||
| 112 | last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ | ||
| 113 | } | ||
| 114 | write_sequnlock(&xtime_lock); | 106 | write_sequnlock(&xtime_lock); |
| 115 | 107 | ||
| 116 | #ifndef CONFIG_SMP | 108 | #ifndef CONFIG_SMP |
| @@ -152,7 +144,7 @@ static struct platform_device m48t59_rtc = { | |||
| 152 | 144 | ||
| 153 | static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match) | 145 | static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match) |
| 154 | { | 146 | { |
| 155 | struct device_node *dp = op->node; | 147 | struct device_node *dp = op->dev.of_node; |
| 156 | const char *model = of_get_property(dp, "model", NULL); | 148 | const char *model = of_get_property(dp, "model", NULL); |
| 157 | 149 | ||
| 158 | if (!model) | 150 | if (!model) |
| @@ -185,10 +177,11 @@ static struct of_device_id __initdata clock_match[] = { | |||
| 185 | }; | 177 | }; |
| 186 | 178 | ||
| 187 | static struct of_platform_driver clock_driver = { | 179 | static struct of_platform_driver clock_driver = { |
| 188 | .match_table = clock_match, | ||
| 189 | .probe = clock_probe, | 180 | .probe = clock_probe, |
| 190 | .driver = { | 181 | .driver = { |
| 191 | .name = "rtc", | 182 | .name = "rtc", |
| 183 | .owner = THIS_MODULE, | ||
| 184 | .of_match_table = clock_match, | ||
| 192 | }, | 185 | }, |
| 193 | }; | 186 | }; |
| 194 | 187 | ||
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c index 67e165102885..21e9fcae0668 100644 --- a/arch/sparc/kernel/time_64.c +++ b/arch/sparc/kernel/time_64.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <linux/clocksource.h> | 35 | #include <linux/clocksource.h> |
| 36 | #include <linux/of_device.h> | 36 | #include <linux/of_device.h> |
| 37 | #include <linux/platform_device.h> | 37 | #include <linux/platform_device.h> |
| 38 | #include <linux/ftrace.h> | ||
| 38 | 39 | ||
| 39 | #include <asm/oplib.h> | 40 | #include <asm/oplib.h> |
| 40 | #include <asm/timer.h> | 41 | #include <asm/timer.h> |
| @@ -423,7 +424,7 @@ static int __devinit rtc_probe(struct of_device *op, const struct of_device_id * | |||
| 423 | struct resource *r; | 424 | struct resource *r; |
| 424 | 425 | ||
| 425 | printk(KERN_INFO "%s: RTC regs at 0x%llx\n", | 426 | printk(KERN_INFO "%s: RTC regs at 0x%llx\n", |
| 426 | op->node->full_name, op->resource[0].start); | 427 | op->dev.of_node->full_name, op->resource[0].start); |
| 427 | 428 | ||
| 428 | /* The CMOS RTC driver only accepts IORESOURCE_IO, so cons | 429 | /* The CMOS RTC driver only accepts IORESOURCE_IO, so cons |
| 429 | * up a fake resource so that the probe works for all cases. | 430 | * up a fake resource so that the probe works for all cases. |
| @@ -462,10 +463,11 @@ static struct of_device_id __initdata rtc_match[] = { | |||
| 462 | }; | 463 | }; |
| 463 | 464 | ||
| 464 | static struct of_platform_driver rtc_driver = { | 465 | static struct of_platform_driver rtc_driver = { |
| 465 | .match_table = rtc_match, | ||
| 466 | .probe = rtc_probe, | 466 | .probe = rtc_probe, |
| 467 | .driver = { | 467 | .driver = { |
| 468 | .name = "rtc", | 468 | .name = "rtc", |
| 469 | .owner = THIS_MODULE, | ||
| 470 | .of_match_table = rtc_match, | ||
| 469 | }, | 471 | }, |
| 470 | }; | 472 | }; |
| 471 | 473 | ||
| @@ -479,7 +481,7 @@ static int __devinit bq4802_probe(struct of_device *op, const struct of_device_i | |||
| 479 | { | 481 | { |
| 480 | 482 | ||
| 481 | printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n", | 483 | printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n", |
| 482 | op->node->full_name, op->resource[0].start); | 484 | op->dev.of_node->full_name, op->resource[0].start); |
| 483 | 485 | ||
| 484 | rtc_bq4802_device.resource = &op->resource[0]; | 486 | rtc_bq4802_device.resource = &op->resource[0]; |
| 485 | return platform_device_register(&rtc_bq4802_device); | 487 | return platform_device_register(&rtc_bq4802_device); |
| @@ -494,10 +496,11 @@ static struct of_device_id __initdata bq4802_match[] = { | |||
| 494 | }; | 496 | }; |
| 495 | 497 | ||
| 496 | static struct of_platform_driver bq4802_driver = { | 498 | static struct of_platform_driver bq4802_driver = { |
| 497 | .match_table = bq4802_match, | ||
| 498 | .probe = bq4802_probe, | 499 | .probe = bq4802_probe, |
| 499 | .driver = { | 500 | .driver = { |
| 500 | .name = "bq4802", | 501 | .name = "bq4802", |
| 502 | .owner = THIS_MODULE, | ||
| 503 | .of_match_table = bq4802_match, | ||
| 501 | }, | 504 | }, |
| 502 | }; | 505 | }; |
| 503 | 506 | ||
| @@ -533,7 +536,7 @@ static struct platform_device m48t59_rtc = { | |||
| 533 | 536 | ||
| 534 | static int __devinit mostek_probe(struct of_device *op, const struct of_device_id *match) | 537 | static int __devinit mostek_probe(struct of_device *op, const struct of_device_id *match) |
| 535 | { | 538 | { |
| 536 | struct device_node *dp = op->node; | 539 | struct device_node *dp = op->dev.of_node; |
| 537 | 540 | ||
| 538 | /* On an Enterprise system there can be multiple mostek clocks. | 541 | /* On an Enterprise system there can be multiple mostek clocks. |
| 539 | * We should only match the one that is on the central FHC bus. | 542 | * We should only match the one that is on the central FHC bus. |
| @@ -557,10 +560,11 @@ static struct of_device_id __initdata mostek_match[] = { | |||
| 557 | }; | 560 | }; |
| 558 | 561 | ||
| 559 | static struct of_platform_driver mostek_driver = { | 562 | static struct of_platform_driver mostek_driver = { |
| 560 | .match_table = mostek_match, | ||
| 561 | .probe = mostek_probe, | 563 | .probe = mostek_probe, |
| 562 | .driver = { | 564 | .driver = { |
| 563 | .name = "mostek", | 565 | .name = "mostek", |
| 566 | .owner = THIS_MODULE, | ||
| 567 | .of_match_table = mostek_match, | ||
| 564 | }, | 568 | }, |
| 565 | }; | 569 | }; |
| 566 | 570 | ||
| @@ -717,7 +721,7 @@ static struct clock_event_device sparc64_clockevent = { | |||
| 717 | }; | 721 | }; |
| 718 | static DEFINE_PER_CPU(struct clock_event_device, sparc64_events); | 722 | static DEFINE_PER_CPU(struct clock_event_device, sparc64_events); |
| 719 | 723 | ||
| 720 | void timer_interrupt(int irq, struct pt_regs *regs) | 724 | void __irq_entry timer_interrupt(int irq, struct pt_regs *regs) |
| 721 | { | 725 | { |
| 722 | struct pt_regs *old_regs = set_irq_regs(regs); | 726 | struct pt_regs *old_regs = set_irq_regs(regs); |
| 723 | unsigned long tick_mask = tick_ops->softint_mask; | 727 | unsigned long tick_mask = tick_ops->softint_mask; |
| @@ -728,6 +732,7 @@ void timer_interrupt(int irq, struct pt_regs *regs) | |||
| 728 | 732 | ||
| 729 | irq_enter(); | 733 | irq_enter(); |
| 730 | 734 | ||
| 735 | local_cpu_data().irq0_irqs++; | ||
| 731 | kstat_incr_irqs_this_cpu(0, irq_to_desc(0)); | 736 | kstat_incr_irqs_this_cpu(0, irq_to_desc(0)); |
| 732 | 737 | ||
| 733 | if (unlikely(!evt->event_handler)) { | 738 | if (unlikely(!evt->event_handler)) { |
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index bdc05a21908b..42ad2ba85010 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c | |||
| @@ -17,6 +17,8 @@ | |||
| 17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
| 18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
| 19 | #include <linux/kdebug.h> | 19 | #include <linux/kdebug.h> |
| 20 | #include <linux/ftrace.h> | ||
| 21 | #include <linux/gfp.h> | ||
| 20 | 22 | ||
| 21 | #include <asm/smp.h> | 23 | #include <asm/smp.h> |
| 22 | #include <asm/delay.h> | 24 | #include <asm/delay.h> |
| @@ -2153,6 +2155,9 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
| 2153 | unsigned long fp, thread_base, ksp; | 2155 | unsigned long fp, thread_base, ksp; |
| 2154 | struct thread_info *tp; | 2156 | struct thread_info *tp; |
| 2155 | int count = 0; | 2157 | int count = 0; |
| 2158 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 2159 | int graph = 0; | ||
| 2160 | #endif | ||
| 2156 | 2161 | ||
| 2157 | ksp = (unsigned long) _ksp; | 2162 | ksp = (unsigned long) _ksp; |
| 2158 | if (!tsk) | 2163 | if (!tsk) |
| @@ -2192,6 +2197,16 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
| 2192 | } | 2197 | } |
| 2193 | 2198 | ||
| 2194 | printk(" [%016lx] %pS\n", pc, (void *) pc); | 2199 | printk(" [%016lx] %pS\n", pc, (void *) pc); |
| 2200 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 2201 | if ((pc + 8UL) == (unsigned long) &return_to_handler) { | ||
| 2202 | int index = tsk->curr_ret_stack; | ||
| 2203 | if (tsk->ret_stack && index >= graph) { | ||
| 2204 | pc = tsk->ret_stack[index - graph].ret; | ||
| 2205 | printk(" [%016lx] %pS\n", pc, (void *) pc); | ||
| 2206 | graph++; | ||
| 2207 | } | ||
| 2208 | } | ||
| 2209 | #endif | ||
| 2195 | } while (++count < 16); | 2210 | } while (++count < 16); |
| 2196 | } | 2211 | } |
| 2197 | 2212 | ||
| @@ -2202,27 +2217,6 @@ void dump_stack(void) | |||
| 2202 | 2217 | ||
| 2203 | EXPORT_SYMBOL(dump_stack); | 2218 | EXPORT_SYMBOL(dump_stack); |
| 2204 | 2219 | ||
| 2205 | static inline int is_kernel_stack(struct task_struct *task, | ||
| 2206 | struct reg_window *rw) | ||
| 2207 | { | ||
| 2208 | unsigned long rw_addr = (unsigned long) rw; | ||
| 2209 | unsigned long thread_base, thread_end; | ||
| 2210 | |||
| 2211 | if (rw_addr < PAGE_OFFSET) { | ||
| 2212 | if (task != &init_task) | ||
| 2213 | return 0; | ||
| 2214 | } | ||
| 2215 | |||
| 2216 | thread_base = (unsigned long) task_stack_page(task); | ||
| 2217 | thread_end = thread_base + sizeof(union thread_union); | ||
| 2218 | if (rw_addr >= thread_base && | ||
| 2219 | rw_addr < thread_end && | ||
| 2220 | !(rw_addr & 0x7UL)) | ||
| 2221 | return 1; | ||
| 2222 | |||
| 2223 | return 0; | ||
| 2224 | } | ||
| 2225 | |||
| 2226 | static inline struct reg_window *kernel_stack_up(struct reg_window *rw) | 2220 | static inline struct reg_window *kernel_stack_up(struct reg_window *rw) |
| 2227 | { | 2221 | { |
| 2228 | unsigned long fp = rw->ins[6]; | 2222 | unsigned long fp = rw->ins[6]; |
| @@ -2251,6 +2245,7 @@ void die_if_kernel(char *str, struct pt_regs *regs) | |||
| 2251 | show_regs(regs); | 2245 | show_regs(regs); |
| 2252 | add_taint(TAINT_DIE); | 2246 | add_taint(TAINT_DIE); |
| 2253 | if (regs->tstate & TSTATE_PRIV) { | 2247 | if (regs->tstate & TSTATE_PRIV) { |
| 2248 | struct thread_info *tp = current_thread_info(); | ||
| 2254 | struct reg_window *rw = (struct reg_window *) | 2249 | struct reg_window *rw = (struct reg_window *) |
| 2255 | (regs->u_regs[UREG_FP] + STACK_BIAS); | 2250 | (regs->u_regs[UREG_FP] + STACK_BIAS); |
| 2256 | 2251 | ||
| @@ -2258,8 +2253,8 @@ void die_if_kernel(char *str, struct pt_regs *regs) | |||
| 2258 | * find some badly aligned kernel stack. | 2253 | * find some badly aligned kernel stack. |
| 2259 | */ | 2254 | */ |
| 2260 | while (rw && | 2255 | while (rw && |
| 2261 | count++ < 30&& | 2256 | count++ < 30 && |
| 2262 | is_kernel_stack(current, rw)) { | 2257 | kstack_valid(tp, (unsigned long) rw)) { |
| 2263 | printk("Caller[%016lx]: %pS\n", rw->ins[7], | 2258 | printk("Caller[%016lx]: %pS\n", rw->ins[7], |
| 2264 | (void *) rw->ins[7]); | 2259 | (void *) rw->ins[7]); |
| 2265 | 2260 | ||
diff --git a/arch/sparc/kernel/ttable.S b/arch/sparc/kernel/ttable.S index 76d837fc47d3..c6dfdaa29e20 100644 --- a/arch/sparc/kernel/ttable.S +++ b/arch/sparc/kernel/ttable.S | |||
| @@ -64,7 +64,7 @@ tl0_irq6: TRAP_IRQ(smp_call_function_single_client, 6) | |||
| 64 | tl0_irq6: BTRAP(0x46) | 64 | tl0_irq6: BTRAP(0x46) |
| 65 | #endif | 65 | #endif |
| 66 | tl0_irq7: TRAP_IRQ(deferred_pcr_work_irq, 7) | 66 | tl0_irq7: TRAP_IRQ(deferred_pcr_work_irq, 7) |
| 67 | #ifdef CONFIG_KGDB | 67 | #if defined(CONFIG_KGDB) && defined(CONFIG_SMP) |
| 68 | tl0_irq8: TRAP_IRQ(smp_kgdb_capture_client, 8) | 68 | tl0_irq8: TRAP_IRQ(smp_kgdb_capture_client, 8) |
| 69 | #else | 69 | #else |
| 70 | tl0_irq8: BTRAP(0x48) | 70 | tl0_irq8: BTRAP(0x48) |
diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c index ebce43018c49..c752c4c479bd 100644 --- a/arch/sparc/kernel/unaligned_64.c +++ b/arch/sparc/kernel/unaligned_64.c | |||
| @@ -50,7 +50,7 @@ static inline enum direction decode_direction(unsigned int insn) | |||
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | /* 16 = double-word, 8 = extra-word, 4 = word, 2 = half-word */ | 52 | /* 16 = double-word, 8 = extra-word, 4 = word, 2 = half-word */ |
| 53 | static inline int decode_access_size(unsigned int insn) | 53 | static inline int decode_access_size(struct pt_regs *regs, unsigned int insn) |
| 54 | { | 54 | { |
| 55 | unsigned int tmp; | 55 | unsigned int tmp; |
| 56 | 56 | ||
| @@ -66,7 +66,7 @@ static inline int decode_access_size(unsigned int insn) | |||
| 66 | return 2; | 66 | return 2; |
| 67 | else { | 67 | else { |
| 68 | printk("Impossible unaligned trap. insn=%08x\n", insn); | 68 | printk("Impossible unaligned trap. insn=%08x\n", insn); |
| 69 | die_if_kernel("Byte sized unaligned access?!?!", current_thread_info()->kregs); | 69 | die_if_kernel("Byte sized unaligned access?!?!", regs); |
| 70 | 70 | ||
| 71 | /* GCC should never warn that control reaches the end | 71 | /* GCC should never warn that control reaches the end |
| 72 | * of this function without returning a value because | 72 | * of this function without returning a value because |
| @@ -286,7 +286,7 @@ static void log_unaligned(struct pt_regs *regs) | |||
| 286 | asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn) | 286 | asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn) |
| 287 | { | 287 | { |
| 288 | enum direction dir = decode_direction(insn); | 288 | enum direction dir = decode_direction(insn); |
| 289 | int size = decode_access_size(insn); | 289 | int size = decode_access_size(regs, insn); |
| 290 | int orig_asi, asi; | 290 | int orig_asi, asi; |
| 291 | 291 | ||
| 292 | current_thread_info()->kern_una_regs = regs; | 292 | current_thread_info()->kern_una_regs = regs; |
diff --git a/arch/sparc/kernel/us2e_cpufreq.c b/arch/sparc/kernel/us2e_cpufreq.c index 791c15138f3a..8f982b76c712 100644 --- a/arch/sparc/kernel/us2e_cpufreq.c +++ b/arch/sparc/kernel/us2e_cpufreq.c | |||
| @@ -238,12 +238,12 @@ static unsigned int us2e_freq_get(unsigned int cpu) | |||
| 238 | return 0; | 238 | return 0; |
| 239 | 239 | ||
| 240 | cpus_allowed = current->cpus_allowed; | 240 | cpus_allowed = current->cpus_allowed; |
| 241 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | 241 | set_cpus_allowed_ptr(current, cpumask_of(cpu)); |
| 242 | 242 | ||
| 243 | clock_tick = sparc64_get_clock_tick(cpu) / 1000; | 243 | clock_tick = sparc64_get_clock_tick(cpu) / 1000; |
| 244 | estar = read_hbreg(HBIRD_ESTAR_MODE_ADDR); | 244 | estar = read_hbreg(HBIRD_ESTAR_MODE_ADDR); |
| 245 | 245 | ||
| 246 | set_cpus_allowed(current, cpus_allowed); | 246 | set_cpus_allowed_ptr(current, &cpus_allowed); |
| 247 | 247 | ||
| 248 | return clock_tick / estar_to_divisor(estar); | 248 | return clock_tick / estar_to_divisor(estar); |
| 249 | } | 249 | } |
| @@ -259,7 +259,7 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) | |||
| 259 | return; | 259 | return; |
| 260 | 260 | ||
| 261 | cpus_allowed = current->cpus_allowed; | 261 | cpus_allowed = current->cpus_allowed; |
| 262 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | 262 | set_cpus_allowed_ptr(current, cpumask_of(cpu)); |
| 263 | 263 | ||
| 264 | new_freq = clock_tick = sparc64_get_clock_tick(cpu) / 1000; | 264 | new_freq = clock_tick = sparc64_get_clock_tick(cpu) / 1000; |
| 265 | new_bits = index_to_estar_mode(index); | 265 | new_bits = index_to_estar_mode(index); |
| @@ -281,7 +281,7 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) | |||
| 281 | 281 | ||
| 282 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | 282 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); |
| 283 | 283 | ||
| 284 | set_cpus_allowed(current, cpus_allowed); | 284 | set_cpus_allowed_ptr(current, &cpus_allowed); |
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | static int us2e_freq_target(struct cpufreq_policy *policy, | 287 | static int us2e_freq_target(struct cpufreq_policy *policy, |
diff --git a/arch/sparc/kernel/us3_cpufreq.c b/arch/sparc/kernel/us3_cpufreq.c index 365b6464e2ce..f35d1e794548 100644 --- a/arch/sparc/kernel/us3_cpufreq.c +++ b/arch/sparc/kernel/us3_cpufreq.c | |||
| @@ -86,12 +86,12 @@ static unsigned int us3_freq_get(unsigned int cpu) | |||
| 86 | return 0; | 86 | return 0; |
| 87 | 87 | ||
| 88 | cpus_allowed = current->cpus_allowed; | 88 | cpus_allowed = current->cpus_allowed; |
| 89 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | 89 | set_cpus_allowed_ptr(current, cpumask_of(cpu)); |
| 90 | 90 | ||
| 91 | reg = read_safari_cfg(); | 91 | reg = read_safari_cfg(); |
| 92 | ret = get_current_freq(cpu, reg); | 92 | ret = get_current_freq(cpu, reg); |
| 93 | 93 | ||
| 94 | set_cpus_allowed(current, cpus_allowed); | 94 | set_cpus_allowed_ptr(current, &cpus_allowed); |
| 95 | 95 | ||
| 96 | return ret; | 96 | return ret; |
| 97 | } | 97 | } |
| @@ -106,7 +106,7 @@ static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) | |||
| 106 | return; | 106 | return; |
| 107 | 107 | ||
| 108 | cpus_allowed = current->cpus_allowed; | 108 | cpus_allowed = current->cpus_allowed; |
| 109 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | 109 | set_cpus_allowed_ptr(current, cpumask_of(cpu)); |
| 110 | 110 | ||
| 111 | new_freq = sparc64_get_clock_tick(cpu) / 1000; | 111 | new_freq = sparc64_get_clock_tick(cpu) / 1000; |
| 112 | switch (index) { | 112 | switch (index) { |
| @@ -140,7 +140,7 @@ static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) | |||
| 140 | 140 | ||
| 141 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | 141 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); |
| 142 | 142 | ||
| 143 | set_cpus_allowed(current, cpus_allowed); | 143 | set_cpus_allowed_ptr(current, &cpus_allowed); |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | static int us3_freq_target(struct cpufreq_policy *policy, | 146 | static int us3_freq_target(struct cpufreq_policy *policy, |
diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c index c28c71449a6c..3cb1def9806c 100644 --- a/arch/sparc/kernel/vio.c +++ b/arch/sparc/kernel/vio.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
| 14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 15 | 16 | ||
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S index 4e5992593967..0c1e6783657f 100644 --- a/arch/sparc/kernel/vmlinux.lds.S +++ b/arch/sparc/kernel/vmlinux.lds.S | |||
| @@ -46,11 +46,16 @@ SECTIONS | |||
| 46 | SCHED_TEXT | 46 | SCHED_TEXT |
| 47 | LOCK_TEXT | 47 | LOCK_TEXT |
| 48 | KPROBES_TEXT | 48 | KPROBES_TEXT |
| 49 | IRQENTRY_TEXT | ||
| 49 | *(.gnu.warning) | 50 | *(.gnu.warning) |
| 50 | } = 0 | 51 | } = 0 |
| 51 | _etext = .; | 52 | _etext = .; |
| 52 | 53 | ||
| 53 | RO_DATA(PAGE_SIZE) | 54 | RO_DATA(PAGE_SIZE) |
| 55 | |||
| 56 | /* Start of data section */ | ||
| 57 | _sdata = .; | ||
| 58 | |||
| 54 | .data1 : { | 59 | .data1 : { |
| 55 | *(.data1) | 60 | *(.data1) |
| 56 | } | 61 | } |
