aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel')
-rw-r--r--arch/sparc64/kernel/chmc.c16
-rw-r--r--arch/sparc64/kernel/isa.c2
-rw-r--r--arch/sparc64/kernel/ldc.c15
-rw-r--r--arch/sparc64/kernel/pci_sun4v.c4
-rw-r--r--arch/sparc64/kernel/smp.c5
5 files changed, 29 insertions, 13 deletions
diff --git a/arch/sparc64/kernel/chmc.c b/arch/sparc64/kernel/chmc.c
index 777d34577045..6d4f02e8a4cf 100644
--- a/arch/sparc64/kernel/chmc.c
+++ b/arch/sparc64/kernel/chmc.c
@@ -1,7 +1,6 @@
1/* $Id: chmc.c,v 1.4 2002/01/08 16:00:14 davem Exp $ 1/* memctrlr.c: Driver for UltraSPARC-III memory controller.
2 * memctrlr.c: Driver for UltraSPARC-III memory controller.
3 * 2 *
4 * Copyright (C) 2001 David S. Miller (davem@redhat.com) 3 * Copyright (C) 2001, 2007 David S. Miller (davem@davemloft.net)
5 */ 4 */
6 5
7#include <linux/module.h> 6#include <linux/module.h>
@@ -16,6 +15,7 @@
16#include <linux/init.h> 15#include <linux/init.h>
17#include <asm/spitfire.h> 16#include <asm/spitfire.h>
18#include <asm/chmctrl.h> 17#include <asm/chmctrl.h>
18#include <asm/cpudata.h>
19#include <asm/oplib.h> 19#include <asm/oplib.h>
20#include <asm/prom.h> 20#include <asm/prom.h>
21#include <asm/io.h> 21#include <asm/io.h>
@@ -242,8 +242,11 @@ int chmc_getunumber(int syndrome_code,
242 */ 242 */
243static u64 read_mcreg(struct mctrl_info *mp, unsigned long offset) 243static u64 read_mcreg(struct mctrl_info *mp, unsigned long offset)
244{ 244{
245 unsigned long ret; 245 unsigned long ret, this_cpu;
246 int this_cpu = get_cpu(); 246
247 preempt_disable();
248
249 this_cpu = real_hard_smp_processor_id();
247 250
248 if (mp->portid == this_cpu) { 251 if (mp->portid == this_cpu) {
249 __asm__ __volatile__("ldxa [%1] %2, %0" 252 __asm__ __volatile__("ldxa [%1] %2, %0"
@@ -255,7 +258,8 @@ static u64 read_mcreg(struct mctrl_info *mp, unsigned long offset)
255 : "r" (mp->regs + offset), 258 : "r" (mp->regs + offset),
256 "i" (ASI_PHYS_BYPASS_EC_E)); 259 "i" (ASI_PHYS_BYPASS_EC_E));
257 } 260 }
258 put_cpu(); 261
262 preempt_enable();
259 263
260 return ret; 264 return ret;
261} 265}
diff --git a/arch/sparc64/kernel/isa.c b/arch/sparc64/kernel/isa.c
index 0f19dce1c905..b5f7b354084f 100644
--- a/arch/sparc64/kernel/isa.c
+++ b/arch/sparc64/kernel/isa.c
@@ -155,6 +155,7 @@ void __init isa_init(void)
155 isa_br = kzalloc(sizeof(*isa_br), GFP_KERNEL); 155 isa_br = kzalloc(sizeof(*isa_br), GFP_KERNEL);
156 if (!isa_br) { 156 if (!isa_br) {
157 printk(KERN_DEBUG "isa: cannot allocate sparc_isa_bridge"); 157 printk(KERN_DEBUG "isa: cannot allocate sparc_isa_bridge");
158 pci_dev_put(pdev);
158 return; 159 return;
159 } 160 }
160 161
@@ -168,6 +169,7 @@ void __init isa_init(void)
168 printk(KERN_DEBUG "isa: device registration error for %s!\n", 169 printk(KERN_DEBUG "isa: device registration error for %s!\n",
169 dp->path_component_name); 170 dp->path_component_name);
170 kfree(isa_br); 171 kfree(isa_br);
172 pci_dev_put(pdev);
171 return; 173 return;
172 } 174 }
173 175
diff --git a/arch/sparc64/kernel/ldc.c b/arch/sparc64/kernel/ldc.c
index 217478a94128..63969f610284 100644
--- a/arch/sparc64/kernel/ldc.c
+++ b/arch/sparc64/kernel/ldc.c
@@ -2338,6 +2338,7 @@ static int __init ldc_init(void)
2338 unsigned long major, minor; 2338 unsigned long major, minor;
2339 struct mdesc_handle *hp; 2339 struct mdesc_handle *hp;
2340 const u64 *v; 2340 const u64 *v;
2341 int err;
2341 u64 mp; 2342 u64 mp;
2342 2343
2343 hp = mdesc_grab(); 2344 hp = mdesc_grab();
@@ -2345,29 +2346,33 @@ static int __init ldc_init(void)
2345 return -ENODEV; 2346 return -ENODEV;
2346 2347
2347 mp = mdesc_node_by_name(hp, MDESC_NODE_NULL, "platform"); 2348 mp = mdesc_node_by_name(hp, MDESC_NODE_NULL, "platform");
2349 err = -ENODEV;
2348 if (mp == MDESC_NODE_NULL) 2350 if (mp == MDESC_NODE_NULL)
2349 return -ENODEV; 2351 goto out;
2350 2352
2351 v = mdesc_get_property(hp, mp, "domaining-enabled", NULL); 2353 v = mdesc_get_property(hp, mp, "domaining-enabled", NULL);
2352 if (!v) 2354 if (!v)
2353 return -ENODEV; 2355 goto out;
2354 2356
2355 major = 1; 2357 major = 1;
2356 minor = 0; 2358 minor = 0;
2357 if (sun4v_hvapi_register(HV_GRP_LDOM, major, &minor)) { 2359 if (sun4v_hvapi_register(HV_GRP_LDOM, major, &minor)) {
2358 printk(KERN_INFO PFX "Could not register LDOM hvapi.\n"); 2360 printk(KERN_INFO PFX "Could not register LDOM hvapi.\n");
2359 return -ENODEV; 2361 goto out;
2360 } 2362 }
2361 2363
2362 printk(KERN_INFO "%s", version); 2364 printk(KERN_INFO "%s", version);
2363 2365
2364 if (!*v) { 2366 if (!*v) {
2365 printk(KERN_INFO PFX "Domaining disabled.\n"); 2367 printk(KERN_INFO PFX "Domaining disabled.\n");
2366 return -ENODEV; 2368 goto out;
2367 } 2369 }
2368 ldom_domaining_enabled = 1; 2370 ldom_domaining_enabled = 1;
2371 err = 0;
2369 2372
2370 return 0; 2373out:
2374 mdesc_release(hp);
2375 return err;
2371} 2376}
2372 2377
2373core_initcall(ldc_init); 2378core_initcall(ldc_init);
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c
index 8c4875bdb4a8..e587a372f3fe 100644
--- a/arch/sparc64/kernel/pci_sun4v.c
+++ b/arch/sparc64/kernel/pci_sun4v.c
@@ -1022,6 +1022,10 @@ void __init sun4v_pci_init(struct device_node *dp, char *model_name)
1022 } 1022 }
1023 1023
1024 prop = of_find_property(dp, "reg", NULL); 1024 prop = of_find_property(dp, "reg", NULL);
1025 if (!prop) {
1026 prom_printf("SUN4V_PCI: Could not find config registers\n");
1027 prom_halt();
1028 }
1025 regs = prop->value; 1029 regs = prop->value;
1026 1030
1027 devhandle = (regs->phys_addr >> 32UL) & 0x0fffffff; 1031 devhandle = (regs->phys_addr >> 32UL) & 0x0fffffff;
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 7cd8d94df0dc..894b506f9636 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -236,8 +236,9 @@ void smp_synchronize_tick_client(void)
236 t[i].rt, t[i].master, t[i].diff, t[i].lat); 236 t[i].rt, t[i].master, t[i].diff, t[i].lat);
237#endif 237#endif
238 238
239 printk(KERN_INFO "CPU %d: synchronized TICK with master CPU (last diff %ld cycles," 239 printk(KERN_INFO "CPU %d: synchronized TICK with master CPU "
240 "maxerr %lu cycles)\n", smp_processor_id(), delta, rt); 240 "(last diff %ld cycles, maxerr %lu cycles)\n",
241 smp_processor_id(), delta, rt);
241} 242}
242 243
243static void smp_start_sync_tick_client(int cpu); 244static void smp_start_sync_tick_client(int cpu);