aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/parisc/kernel/drivers.c6
-rw-r--r--arch/parisc/kernel/firmware.c250
-rw-r--r--arch/parisc/kernel/irq.c3
-rw-r--r--arch/parisc/kernel/smp.c15
-rw-r--r--arch/parisc/kernel/time.c32
5 files changed, 177 insertions, 129 deletions
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index 2b257e4f17df..d6c486e9501c 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -424,7 +424,7 @@ struct parisc_device * create_tree_node(char id, struct device *parent)
424 /* make the generic dma mask a pointer to the parisc one */ 424 /* make the generic dma mask a pointer to the parisc one */
425 dev->dev.dma_mask = &dev->dma_mask; 425 dev->dev.dma_mask = &dev->dma_mask;
426 dev->dev.coherent_dma_mask = dev->dma_mask; 426 dev->dev.coherent_dma_mask = dev->dma_mask;
427 if (!device_register(&dev->dev)) { 427 if (device_register(&dev->dev)) {
428 kfree(dev); 428 kfree(dev);
429 return NULL; 429 return NULL;
430 } 430 }
@@ -853,9 +853,9 @@ static void print_parisc_device(struct parisc_device *dev)
853 */ 853 */
854void init_parisc_bus(void) 854void init_parisc_bus(void)
855{ 855{
856 if (!bus_register(&parisc_bus_type)) 856 if (bus_register(&parisc_bus_type))
857 panic("Could not register PA-RISC bus type\n"); 857 panic("Could not register PA-RISC bus type\n");
858 if (!device_register(&root)) 858 if (device_register(&root))
859 panic("Could not register PA-RISC root device\n"); 859 panic("Could not register PA-RISC root device\n");
860 get_device(&root); 860 get_device(&root);
861} 861}
diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
index c2531ae032cf..9158b707c0dd 100644
--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -160,13 +160,14 @@ void __init set_firmware_width(void)
160{ 160{
161#ifdef __LP64__ 161#ifdef __LP64__
162 int retval; 162 int retval;
163 unsigned long flags;
163 164
164 spin_lock_irq(&pdc_lock); 165 spin_lock_irqsave(&pdc_lock, flags);
165 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0); 166 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0);
166 convert_to_wide(pdc_result); 167 convert_to_wide(pdc_result);
167 if(pdc_result[0] != NARROW_FIRMWARE) 168 if(pdc_result[0] != NARROW_FIRMWARE)
168 parisc_narrow_firmware = 0; 169 parisc_narrow_firmware = 0;
169 spin_unlock_irq(&pdc_lock); 170 spin_unlock_irqrestore(&pdc_lock, flags);
170#endif 171#endif
171} 172}
172 173
@@ -196,10 +197,11 @@ void pdc_emergency_unlock(void)
196int pdc_add_valid(unsigned long address) 197int pdc_add_valid(unsigned long address)
197{ 198{
198 int retval; 199 int retval;
200 unsigned long flags;
199 201
200 spin_lock_irq(&pdc_lock); 202 spin_lock_irqsave(&pdc_lock, flags);
201 retval = mem_pdc_call(PDC_ADD_VALID, PDC_ADD_VALID_VERIFY, address); 203 retval = mem_pdc_call(PDC_ADD_VALID, PDC_ADD_VALID_VERIFY, address);
202 spin_unlock_irq(&pdc_lock); 204 spin_unlock_irqrestore(&pdc_lock, flags);
203 205
204 return retval; 206 return retval;
205} 207}
@@ -216,15 +218,16 @@ EXPORT_SYMBOL(pdc_add_valid);
216int __init pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len) 218int __init pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len)
217{ 219{
218 int retval; 220 int retval;
221 unsigned long flags;
219 222
220 spin_lock_irq(&pdc_lock); 223 spin_lock_irqsave(&pdc_lock, flags);
221 memcpy(&pdc_result, chassis_info, sizeof(*chassis_info)); 224 memcpy(&pdc_result, chassis_info, sizeof(*chassis_info));
222 memcpy(&pdc_result2, led_info, len); 225 memcpy(&pdc_result2, led_info, len);
223 retval = mem_pdc_call(PDC_CHASSIS, PDC_RETURN_CHASSIS_INFO, 226 retval = mem_pdc_call(PDC_CHASSIS, PDC_RETURN_CHASSIS_INFO,
224 __pa(pdc_result), __pa(pdc_result2), len); 227 __pa(pdc_result), __pa(pdc_result2), len);
225 memcpy(chassis_info, pdc_result, sizeof(*chassis_info)); 228 memcpy(chassis_info, pdc_result, sizeof(*chassis_info));
226 memcpy(led_info, pdc_result2, len); 229 memcpy(led_info, pdc_result2, len);
227 spin_unlock_irq(&pdc_lock); 230 spin_unlock_irqrestore(&pdc_lock, flags);
228 231
229 return retval; 232 return retval;
230} 233}
@@ -239,13 +242,14 @@ int __init pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_inf
239int pdc_pat_chassis_send_log(unsigned long state, unsigned long data) 242int pdc_pat_chassis_send_log(unsigned long state, unsigned long data)
240{ 243{
241 int retval = 0; 244 int retval = 0;
245 unsigned long flags;
242 246
243 if (!is_pdc_pat()) 247 if (!is_pdc_pat())
244 return -1; 248 return -1;
245 249
246 spin_lock_irq(&pdc_lock); 250 spin_lock_irqsave(&pdc_lock, flags);
247 retval = mem_pdc_call(PDC_PAT_CHASSIS_LOG, PDC_PAT_CHASSIS_WRITE_LOG, __pa(&state), __pa(&data)); 251 retval = mem_pdc_call(PDC_PAT_CHASSIS_LOG, PDC_PAT_CHASSIS_WRITE_LOG, __pa(&state), __pa(&data));
248 spin_unlock_irq(&pdc_lock); 252 spin_unlock_irqrestore(&pdc_lock, flags);
249 253
250 return retval; 254 return retval;
251} 255}
@@ -258,10 +262,11 @@ int pdc_pat_chassis_send_log(unsigned long state, unsigned long data)
258int pdc_chassis_disp(unsigned long disp) 262int pdc_chassis_disp(unsigned long disp)
259{ 263{
260 int retval = 0; 264 int retval = 0;
265 unsigned long flags;
261 266
262 spin_lock_irq(&pdc_lock); 267 spin_lock_irqsave(&pdc_lock, flags);
263 retval = mem_pdc_call(PDC_CHASSIS, PDC_CHASSIS_DISP, disp); 268 retval = mem_pdc_call(PDC_CHASSIS, PDC_CHASSIS_DISP, disp);
264 spin_unlock_irq(&pdc_lock); 269 spin_unlock_irqrestore(&pdc_lock, flags);
265 270
266 return retval; 271 return retval;
267} 272}
@@ -273,11 +278,12 @@ int pdc_chassis_disp(unsigned long disp)
273int pdc_chassis_warn(unsigned long *warn) 278int pdc_chassis_warn(unsigned long *warn)
274{ 279{
275 int retval = 0; 280 int retval = 0;
281 unsigned long flags;
276 282
277 spin_lock_irq(&pdc_lock); 283 spin_lock_irqsave(&pdc_lock, flags);
278 retval = mem_pdc_call(PDC_CHASSIS, PDC_CHASSIS_WARN, __pa(pdc_result)); 284 retval = mem_pdc_call(PDC_CHASSIS, PDC_CHASSIS_WARN, __pa(pdc_result));
279 *warn = pdc_result[0]; 285 *warn = pdc_result[0];
280 spin_unlock_irq(&pdc_lock); 286 spin_unlock_irqrestore(&pdc_lock, flags);
281 287
282 return retval; 288 return retval;
283} 289}
@@ -292,15 +298,16 @@ int pdc_chassis_warn(unsigned long *warn)
292int __init pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info) 298int __init pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info)
293{ 299{
294 int retval; 300 int retval;
301 unsigned long flags;
295 302
296 spin_lock_irq(&pdc_lock); 303 spin_lock_irqsave(&pdc_lock, flags);
297 retval = mem_pdc_call(PDC_COPROC, PDC_COPROC_CFG, __pa(pdc_result)); 304 retval = mem_pdc_call(PDC_COPROC, PDC_COPROC_CFG, __pa(pdc_result));
298 convert_to_wide(pdc_result); 305 convert_to_wide(pdc_result);
299 pdc_coproc_info->ccr_functional = pdc_result[0]; 306 pdc_coproc_info->ccr_functional = pdc_result[0];
300 pdc_coproc_info->ccr_present = pdc_result[1]; 307 pdc_coproc_info->ccr_present = pdc_result[1];
301 pdc_coproc_info->revision = pdc_result[17]; 308 pdc_coproc_info->revision = pdc_result[17];
302 pdc_coproc_info->model = pdc_result[18]; 309 pdc_coproc_info->model = pdc_result[18];
303 spin_unlock_irq(&pdc_lock); 310 spin_unlock_irqrestore(&pdc_lock, flags);
304 311
305 return retval; 312 return retval;
306} 313}
@@ -320,14 +327,15 @@ int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index,
320 void *iodc_data, unsigned int iodc_data_size) 327 void *iodc_data, unsigned int iodc_data_size)
321{ 328{
322 int retval; 329 int retval;
330 unsigned long flags;
323 331
324 spin_lock_irq(&pdc_lock); 332 spin_lock_irqsave(&pdc_lock, flags);
325 retval = mem_pdc_call(PDC_IODC, PDC_IODC_READ, __pa(pdc_result), hpa, 333 retval = mem_pdc_call(PDC_IODC, PDC_IODC_READ, __pa(pdc_result), hpa,
326 index, __pa(pdc_result2), iodc_data_size); 334 index, __pa(pdc_result2), iodc_data_size);
327 convert_to_wide(pdc_result); 335 convert_to_wide(pdc_result);
328 *actcnt = pdc_result[0]; 336 *actcnt = pdc_result[0];
329 memcpy(iodc_data, pdc_result2, iodc_data_size); 337 memcpy(iodc_data, pdc_result2, iodc_data_size);
330 spin_unlock_irq(&pdc_lock); 338 spin_unlock_irqrestore(&pdc_lock, flags);
331 339
332 return retval; 340 return retval;
333} 341}
@@ -346,14 +354,15 @@ int pdc_system_map_find_mods(struct pdc_system_map_mod_info *pdc_mod_info,
346 struct pdc_module_path *mod_path, long mod_index) 354 struct pdc_module_path *mod_path, long mod_index)
347{ 355{
348 int retval; 356 int retval;
357 unsigned long flags;
349 358
350 spin_lock_irq(&pdc_lock); 359 spin_lock_irqsave(&pdc_lock, flags);
351 retval = mem_pdc_call(PDC_SYSTEM_MAP, PDC_FIND_MODULE, __pa(pdc_result), 360 retval = mem_pdc_call(PDC_SYSTEM_MAP, PDC_FIND_MODULE, __pa(pdc_result),
352 __pa(pdc_result2), mod_index); 361 __pa(pdc_result2), mod_index);
353 convert_to_wide(pdc_result); 362 convert_to_wide(pdc_result);
354 memcpy(pdc_mod_info, pdc_result, sizeof(*pdc_mod_info)); 363 memcpy(pdc_mod_info, pdc_result, sizeof(*pdc_mod_info));
355 memcpy(mod_path, pdc_result2, sizeof(*mod_path)); 364 memcpy(mod_path, pdc_result2, sizeof(*mod_path));
356 spin_unlock_irq(&pdc_lock); 365 spin_unlock_irqrestore(&pdc_lock, flags);
357 366
358 pdc_mod_info->mod_addr = f_extend(pdc_mod_info->mod_addr); 367 pdc_mod_info->mod_addr = f_extend(pdc_mod_info->mod_addr);
359 return retval; 368 return retval;
@@ -372,13 +381,14 @@ int pdc_system_map_find_addrs(struct pdc_system_map_addr_info *pdc_addr_info,
372 long mod_index, long addr_index) 381 long mod_index, long addr_index)
373{ 382{
374 int retval; 383 int retval;
384 unsigned long flags;
375 385
376 spin_lock_irq(&pdc_lock); 386 spin_lock_irqsave(&pdc_lock, flags);
377 retval = mem_pdc_call(PDC_SYSTEM_MAP, PDC_FIND_ADDRESS, __pa(pdc_result), 387 retval = mem_pdc_call(PDC_SYSTEM_MAP, PDC_FIND_ADDRESS, __pa(pdc_result),
378 mod_index, addr_index); 388 mod_index, addr_index);
379 convert_to_wide(pdc_result); 389 convert_to_wide(pdc_result);
380 memcpy(pdc_addr_info, pdc_result, sizeof(*pdc_addr_info)); 390 memcpy(pdc_addr_info, pdc_result, sizeof(*pdc_addr_info));
381 spin_unlock_irq(&pdc_lock); 391 spin_unlock_irqrestore(&pdc_lock, flags);
382 392
383 pdc_addr_info->mod_addr = f_extend(pdc_addr_info->mod_addr); 393 pdc_addr_info->mod_addr = f_extend(pdc_addr_info->mod_addr);
384 return retval; 394 return retval;
@@ -393,12 +403,13 @@ int pdc_system_map_find_addrs(struct pdc_system_map_addr_info *pdc_addr_info,
393int pdc_model_info(struct pdc_model *model) 403int pdc_model_info(struct pdc_model *model)
394{ 404{
395 int retval; 405 int retval;
406 unsigned long flags;
396 407
397 spin_lock_irq(&pdc_lock); 408 spin_lock_irqsave(&pdc_lock, flags);
398 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_INFO, __pa(pdc_result), 0); 409 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_INFO, __pa(pdc_result), 0);
399 convert_to_wide(pdc_result); 410 convert_to_wide(pdc_result);
400 memcpy(model, pdc_result, sizeof(*model)); 411 memcpy(model, pdc_result, sizeof(*model));
401 spin_unlock_irq(&pdc_lock); 412 spin_unlock_irqrestore(&pdc_lock, flags);
402 413
403 return retval; 414 return retval;
404} 415}
@@ -414,8 +425,9 @@ int pdc_model_info(struct pdc_model *model)
414int pdc_model_sysmodel(char *name) 425int pdc_model_sysmodel(char *name)
415{ 426{
416 int retval; 427 int retval;
428 unsigned long flags;
417 429
418 spin_lock_irq(&pdc_lock); 430 spin_lock_irqsave(&pdc_lock, flags);
419 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_SYSMODEL, __pa(pdc_result), 431 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_SYSMODEL, __pa(pdc_result),
420 OS_ID_HPUX, __pa(name)); 432 OS_ID_HPUX, __pa(name));
421 convert_to_wide(pdc_result); 433 convert_to_wide(pdc_result);
@@ -425,7 +437,7 @@ int pdc_model_sysmodel(char *name)
425 } else { 437 } else {
426 name[0] = 0; 438 name[0] = 0;
427 } 439 }
428 spin_unlock_irq(&pdc_lock); 440 spin_unlock_irqrestore(&pdc_lock, flags);
429 441
430 return retval; 442 return retval;
431} 443}
@@ -443,12 +455,13 @@ int pdc_model_sysmodel(char *name)
443int pdc_model_versions(unsigned long *versions, int id) 455int pdc_model_versions(unsigned long *versions, int id)
444{ 456{
445 int retval; 457 int retval;
458 unsigned long flags;
446 459
447 spin_lock_irq(&pdc_lock); 460 spin_lock_irqsave(&pdc_lock, flags);
448 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_VERSIONS, __pa(pdc_result), id); 461 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_VERSIONS, __pa(pdc_result), id);
449 convert_to_wide(pdc_result); 462 convert_to_wide(pdc_result);
450 *versions = pdc_result[0]; 463 *versions = pdc_result[0];
451 spin_unlock_irq(&pdc_lock); 464 spin_unlock_irqrestore(&pdc_lock, flags);
452 465
453 return retval; 466 return retval;
454} 467}
@@ -463,13 +476,14 @@ int pdc_model_versions(unsigned long *versions, int id)
463int pdc_model_cpuid(unsigned long *cpu_id) 476int pdc_model_cpuid(unsigned long *cpu_id)
464{ 477{
465 int retval; 478 int retval;
479 unsigned long flags;
466 480
467 spin_lock_irq(&pdc_lock); 481 spin_lock_irqsave(&pdc_lock, flags);
468 pdc_result[0] = 0; /* preset zero (call may not be implemented!) */ 482 pdc_result[0] = 0; /* preset zero (call may not be implemented!) */
469 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CPU_ID, __pa(pdc_result), 0); 483 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CPU_ID, __pa(pdc_result), 0);
470 convert_to_wide(pdc_result); 484 convert_to_wide(pdc_result);
471 *cpu_id = pdc_result[0]; 485 *cpu_id = pdc_result[0];
472 spin_unlock_irq(&pdc_lock); 486 spin_unlock_irqrestore(&pdc_lock, flags);
473 487
474 return retval; 488 return retval;
475} 489}
@@ -484,13 +498,14 @@ int pdc_model_cpuid(unsigned long *cpu_id)
484int pdc_model_capabilities(unsigned long *capabilities) 498int pdc_model_capabilities(unsigned long *capabilities)
485{ 499{
486 int retval; 500 int retval;
501 unsigned long flags;
487 502
488 spin_lock_irq(&pdc_lock); 503 spin_lock_irqsave(&pdc_lock, flags);
489 pdc_result[0] = 0; /* preset zero (call may not be implemented!) */ 504 pdc_result[0] = 0; /* preset zero (call may not be implemented!) */
490 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0); 505 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0);
491 convert_to_wide(pdc_result); 506 convert_to_wide(pdc_result);
492 *capabilities = pdc_result[0]; 507 *capabilities = pdc_result[0];
493 spin_unlock_irq(&pdc_lock); 508 spin_unlock_irqrestore(&pdc_lock, flags);
494 509
495 return retval; 510 return retval;
496} 511}
@@ -504,12 +519,13 @@ int pdc_model_capabilities(unsigned long *capabilities)
504int pdc_cache_info(struct pdc_cache_info *cache_info) 519int pdc_cache_info(struct pdc_cache_info *cache_info)
505{ 520{
506 int retval; 521 int retval;
522 unsigned long flags;
507 523
508 spin_lock_irq(&pdc_lock); 524 spin_lock_irqsave(&pdc_lock, flags);
509 retval = mem_pdc_call(PDC_CACHE, PDC_CACHE_INFO, __pa(pdc_result), 0); 525 retval = mem_pdc_call(PDC_CACHE, PDC_CACHE_INFO, __pa(pdc_result), 0);
510 convert_to_wide(pdc_result); 526 convert_to_wide(pdc_result);
511 memcpy(cache_info, pdc_result, sizeof(*cache_info)); 527 memcpy(cache_info, pdc_result, sizeof(*cache_info));
512 spin_unlock_irq(&pdc_lock); 528 spin_unlock_irqrestore(&pdc_lock, flags);
513 529
514 return retval; 530 return retval;
515} 531}
@@ -523,13 +539,14 @@ int pdc_cache_info(struct pdc_cache_info *cache_info)
523int pdc_spaceid_bits(unsigned long *space_bits) 539int pdc_spaceid_bits(unsigned long *space_bits)
524{ 540{
525 int retval; 541 int retval;
542 unsigned long flags;
526 543
527 spin_lock_irq(&pdc_lock); 544 spin_lock_irqsave(&pdc_lock, flags);
528 pdc_result[0] = 0; 545 pdc_result[0] = 0;
529 retval = mem_pdc_call(PDC_CACHE, PDC_CACHE_RET_SPID, __pa(pdc_result), 0); 546 retval = mem_pdc_call(PDC_CACHE, PDC_CACHE_RET_SPID, __pa(pdc_result), 0);
530 convert_to_wide(pdc_result); 547 convert_to_wide(pdc_result);
531 *space_bits = pdc_result[0]; 548 *space_bits = pdc_result[0];
532 spin_unlock_irq(&pdc_lock); 549 spin_unlock_irqrestore(&pdc_lock, flags);
533 550
534 return retval; 551 return retval;
535} 552}
@@ -544,11 +561,12 @@ int pdc_spaceid_bits(unsigned long *space_bits)
544int pdc_btlb_info(struct pdc_btlb_info *btlb) 561int pdc_btlb_info(struct pdc_btlb_info *btlb)
545{ 562{
546 int retval; 563 int retval;
564 unsigned long flags;
547 565
548 spin_lock_irq(&pdc_lock); 566 spin_lock_irqsave(&pdc_lock, flags);
549 retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0); 567 retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0);
550 memcpy(btlb, pdc_result, sizeof(*btlb)); 568 memcpy(btlb, pdc_result, sizeof(*btlb));
551 spin_unlock_irq(&pdc_lock); 569 spin_unlock_irqrestore(&pdc_lock, flags);
552 570
553 if(retval < 0) { 571 if(retval < 0) {
554 btlb->max_size = 0; 572 btlb->max_size = 0;
@@ -572,13 +590,14 @@ int pdc_mem_map_hpa(struct pdc_memory_map *address,
572 struct pdc_module_path *mod_path) 590 struct pdc_module_path *mod_path)
573{ 591{
574 int retval; 592 int retval;
593 unsigned long flags;
575 594
576 spin_lock_irq(&pdc_lock); 595 spin_lock_irqsave(&pdc_lock, flags);
577 memcpy(pdc_result2, mod_path, sizeof(*mod_path)); 596 memcpy(pdc_result2, mod_path, sizeof(*mod_path));
578 retval = mem_pdc_call(PDC_MEM_MAP, PDC_MEM_MAP_HPA, __pa(pdc_result), 597 retval = mem_pdc_call(PDC_MEM_MAP, PDC_MEM_MAP_HPA, __pa(pdc_result),
579 __pa(pdc_result2)); 598 __pa(pdc_result2));
580 memcpy(address, pdc_result, sizeof(*address)); 599 memcpy(address, pdc_result, sizeof(*address));
581 spin_unlock_irq(&pdc_lock); 600 spin_unlock_irqrestore(&pdc_lock, flags);
582 601
583 return retval; 602 return retval;
584} 603}
@@ -594,8 +613,9 @@ int pdc_mem_map_hpa(struct pdc_memory_map *address,
594int pdc_lan_station_id(char *lan_addr, unsigned long hpa) 613int pdc_lan_station_id(char *lan_addr, unsigned long hpa)
595{ 614{
596 int retval; 615 int retval;
616 unsigned long flags;
597 617
598 spin_lock_irq(&pdc_lock); 618 spin_lock_irqsave(&pdc_lock, flags);
599 retval = mem_pdc_call(PDC_LAN_STATION_ID, PDC_LAN_STATION_ID_READ, 619 retval = mem_pdc_call(PDC_LAN_STATION_ID, PDC_LAN_STATION_ID_READ,
600 __pa(pdc_result), hpa); 620 __pa(pdc_result), hpa);
601 if (retval < 0) { 621 if (retval < 0) {
@@ -604,7 +624,7 @@ int pdc_lan_station_id(char *lan_addr, unsigned long hpa)
604 } else { 624 } else {
605 memcpy(lan_addr, pdc_result, PDC_LAN_STATION_ID_SIZE); 625 memcpy(lan_addr, pdc_result, PDC_LAN_STATION_ID_SIZE);
606 } 626 }
607 spin_unlock_irq(&pdc_lock); 627 spin_unlock_irqrestore(&pdc_lock, flags);
608 628
609 return retval; 629 return retval;
610} 630}
@@ -623,13 +643,14 @@ EXPORT_SYMBOL(pdc_lan_station_id);
623int pdc_stable_read(unsigned long staddr, void *memaddr, unsigned long count) 643int pdc_stable_read(unsigned long staddr, void *memaddr, unsigned long count)
624{ 644{
625 int retval; 645 int retval;
646 unsigned long flags;
626 647
627 spin_lock_irq(&pdc_lock); 648 spin_lock_irqsave(&pdc_lock, flags);
628 retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_READ, staddr, 649 retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_READ, staddr,
629 __pa(pdc_result), count); 650 __pa(pdc_result), count);
630 convert_to_wide(pdc_result); 651 convert_to_wide(pdc_result);
631 memcpy(memaddr, pdc_result, count); 652 memcpy(memaddr, pdc_result, count);
632 spin_unlock_irq(&pdc_lock); 653 spin_unlock_irqrestore(&pdc_lock, flags);
633 654
634 return retval; 655 return retval;
635} 656}
@@ -648,13 +669,14 @@ EXPORT_SYMBOL(pdc_stable_read);
648int pdc_stable_write(unsigned long staddr, void *memaddr, unsigned long count) 669int pdc_stable_write(unsigned long staddr, void *memaddr, unsigned long count)
649{ 670{
650 int retval; 671 int retval;
672 unsigned long flags;
651 673
652 spin_lock_irq(&pdc_lock); 674 spin_lock_irqsave(&pdc_lock, flags);
653 memcpy(pdc_result, memaddr, count); 675 memcpy(pdc_result, memaddr, count);
654 convert_to_wide(pdc_result); 676 convert_to_wide(pdc_result);
655 retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_WRITE, staddr, 677 retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_WRITE, staddr,
656 __pa(pdc_result), count); 678 __pa(pdc_result), count);
657 spin_unlock_irq(&pdc_lock); 679 spin_unlock_irqrestore(&pdc_lock, flags);
658 680
659 return retval; 681 return retval;
660} 682}
@@ -672,11 +694,12 @@ EXPORT_SYMBOL(pdc_stable_write);
672int pdc_stable_get_size(unsigned long *size) 694int pdc_stable_get_size(unsigned long *size)
673{ 695{
674 int retval; 696 int retval;
697 unsigned long flags;
675 698
676 spin_lock_irq(&pdc_lock); 699 spin_lock_irqsave(&pdc_lock, flags);
677 retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_RETURN_SIZE, __pa(pdc_result)); 700 retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_RETURN_SIZE, __pa(pdc_result));
678 *size = pdc_result[0]; 701 *size = pdc_result[0];
679 spin_unlock_irq(&pdc_lock); 702 spin_unlock_irqrestore(&pdc_lock, flags);
680 703
681 return retval; 704 return retval;
682} 705}
@@ -691,10 +714,11 @@ EXPORT_SYMBOL(pdc_stable_get_size);
691int pdc_stable_verify_contents(void) 714int pdc_stable_verify_contents(void)
692{ 715{
693 int retval; 716 int retval;
717 unsigned long flags;
694 718
695 spin_lock_irq(&pdc_lock); 719 spin_lock_irqsave(&pdc_lock, flags);
696 retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_VERIFY_CONTENTS); 720 retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_VERIFY_CONTENTS);
697 spin_unlock_irq(&pdc_lock); 721 spin_unlock_irqrestore(&pdc_lock, flags);
698 722
699 return retval; 723 return retval;
700} 724}
@@ -709,10 +733,11 @@ EXPORT_SYMBOL(pdc_stable_verify_contents);
709int pdc_stable_initialize(void) 733int pdc_stable_initialize(void)
710{ 734{
711 int retval; 735 int retval;
736 unsigned long flags;
712 737
713 spin_lock_irq(&pdc_lock); 738 spin_lock_irqsave(&pdc_lock, flags);
714 retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_INITIALIZE); 739 retval = mem_pdc_call(PDC_STABLE, PDC_STABLE_INITIALIZE);
715 spin_unlock_irq(&pdc_lock); 740 spin_unlock_irqrestore(&pdc_lock, flags);
716 741
717 return retval; 742 return retval;
718} 743}
@@ -735,8 +760,9 @@ EXPORT_SYMBOL(pdc_stable_initialize);
735int pdc_get_initiator(struct hardware_path *hwpath, struct pdc_initiator *initiator) 760int pdc_get_initiator(struct hardware_path *hwpath, struct pdc_initiator *initiator)
736{ 761{
737 int retval; 762 int retval;
763 unsigned long flags;
738 764
739 spin_lock_irq(&pdc_lock); 765 spin_lock_irqsave(&pdc_lock, flags);
740 766
741/* BCJ-XXXX series boxes. E.G. "9000/785/C3000" */ 767/* BCJ-XXXX series boxes. E.G. "9000/785/C3000" */
742#define IS_SPROCKETS() (strlen(boot_cpu_data.pdc.sys_model_name) == 14 && \ 768#define IS_SPROCKETS() (strlen(boot_cpu_data.pdc.sys_model_name) == 14 && \
@@ -776,7 +802,8 @@ int pdc_get_initiator(struct hardware_path *hwpath, struct pdc_initiator *initia
776 } 802 }
777 803
778 out: 804 out:
779 spin_unlock_irq(&pdc_lock); 805 spin_unlock_irqrestore(&pdc_lock, flags);
806
780 return (retval >= PDC_OK); 807 return (retval >= PDC_OK);
781} 808}
782EXPORT_SYMBOL(pdc_get_initiator); 809EXPORT_SYMBOL(pdc_get_initiator);
@@ -794,13 +821,14 @@ EXPORT_SYMBOL(pdc_get_initiator);
794int pdc_pci_irt_size(unsigned long *num_entries, unsigned long hpa) 821int pdc_pci_irt_size(unsigned long *num_entries, unsigned long hpa)
795{ 822{
796 int retval; 823 int retval;
824 unsigned long flags;
797 825
798 spin_lock_irq(&pdc_lock); 826 spin_lock_irqsave(&pdc_lock, flags);
799 retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_GET_INT_TBL_SIZE, 827 retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_GET_INT_TBL_SIZE,
800 __pa(pdc_result), hpa); 828 __pa(pdc_result), hpa);
801 convert_to_wide(pdc_result); 829 convert_to_wide(pdc_result);
802 *num_entries = pdc_result[0]; 830 *num_entries = pdc_result[0];
803 spin_unlock_irq(&pdc_lock); 831 spin_unlock_irqrestore(&pdc_lock, flags);
804 832
805 return retval; 833 return retval;
806} 834}
@@ -817,14 +845,15 @@ int pdc_pci_irt_size(unsigned long *num_entries, unsigned long hpa)
817int pdc_pci_irt(unsigned long num_entries, unsigned long hpa, void *tbl) 845int pdc_pci_irt(unsigned long num_entries, unsigned long hpa, void *tbl)
818{ 846{
819 int retval; 847 int retval;
848 unsigned long flags;
820 849
821 BUG_ON((unsigned long)tbl & 0x7); 850 BUG_ON((unsigned long)tbl & 0x7);
822 851
823 spin_lock_irq(&pdc_lock); 852 spin_lock_irqsave(&pdc_lock, flags);
824 pdc_result[0] = num_entries; 853 pdc_result[0] = num_entries;
825 retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_GET_INT_TBL, 854 retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_GET_INT_TBL,
826 __pa(pdc_result), hpa, __pa(tbl)); 855 __pa(pdc_result), hpa, __pa(tbl));
827 spin_unlock_irq(&pdc_lock); 856 spin_unlock_irqrestore(&pdc_lock, flags);
828 857
829 return retval; 858 return retval;
830} 859}
@@ -842,12 +871,15 @@ int pdc_pci_irt(unsigned long num_entries, unsigned long hpa, void *tbl)
842unsigned int pdc_pci_config_read(void *hpa, unsigned long cfg_addr) 871unsigned int pdc_pci_config_read(void *hpa, unsigned long cfg_addr)
843{ 872{
844 int retval; 873 int retval;
845 spin_lock_irq(&pdc_lock); 874 unsigned long flags;
875
876 spin_lock_irqsave(&pdc_lock, flags);
846 pdc_result[0] = 0; 877 pdc_result[0] = 0;
847 pdc_result[1] = 0; 878 pdc_result[1] = 0;
848 retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_READ_CONFIG, 879 retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_READ_CONFIG,
849 __pa(pdc_result), hpa, cfg_addr&~3UL, 4UL); 880 __pa(pdc_result), hpa, cfg_addr&~3UL, 4UL);
850 spin_unlock_irq(&pdc_lock); 881 spin_unlock_irqrestore(&pdc_lock, flags);
882
851 return retval ? ~0 : (unsigned int) pdc_result[0]; 883 return retval ? ~0 : (unsigned int) pdc_result[0];
852} 884}
853 885
@@ -863,12 +895,15 @@ unsigned int pdc_pci_config_read(void *hpa, unsigned long cfg_addr)
863void pdc_pci_config_write(void *hpa, unsigned long cfg_addr, unsigned int val) 895void pdc_pci_config_write(void *hpa, unsigned long cfg_addr, unsigned int val)
864{ 896{
865 int retval; 897 int retval;
866 spin_lock_irq(&pdc_lock); 898 unsigned long flags;
899
900 spin_lock_irqsave(&pdc_lock, flags);
867 pdc_result[0] = 0; 901 pdc_result[0] = 0;
868 retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_WRITE_CONFIG, 902 retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_WRITE_CONFIG,
869 __pa(pdc_result), hpa, 903 __pa(pdc_result), hpa,
870 cfg_addr&~3UL, 4UL, (unsigned long) val); 904 cfg_addr&~3UL, 4UL, (unsigned long) val);
871 spin_unlock_irq(&pdc_lock); 905 spin_unlock_irqrestore(&pdc_lock, flags);
906
872 return retval; 907 return retval;
873} 908}
874#endif /* UNTESTED CODE */ 909#endif /* UNTESTED CODE */
@@ -882,12 +917,13 @@ void pdc_pci_config_write(void *hpa, unsigned long cfg_addr, unsigned int val)
882int pdc_tod_read(struct pdc_tod *tod) 917int pdc_tod_read(struct pdc_tod *tod)
883{ 918{
884 int retval; 919 int retval;
920 unsigned long flags;
885 921
886 spin_lock_irq(&pdc_lock); 922 spin_lock_irqsave(&pdc_lock, flags);
887 retval = mem_pdc_call(PDC_TOD, PDC_TOD_READ, __pa(pdc_result), 0); 923 retval = mem_pdc_call(PDC_TOD, PDC_TOD_READ, __pa(pdc_result), 0);
888 convert_to_wide(pdc_result); 924 convert_to_wide(pdc_result);
889 memcpy(tod, pdc_result, sizeof(*tod)); 925 memcpy(tod, pdc_result, sizeof(*tod));
890 spin_unlock_irq(&pdc_lock); 926 spin_unlock_irqrestore(&pdc_lock, flags);
891 927
892 return retval; 928 return retval;
893} 929}
@@ -903,10 +939,11 @@ EXPORT_SYMBOL(pdc_tod_read);
903int pdc_tod_set(unsigned long sec, unsigned long usec) 939int pdc_tod_set(unsigned long sec, unsigned long usec)
904{ 940{
905 int retval; 941 int retval;
942 unsigned long flags;
906 943
907 spin_lock_irq(&pdc_lock); 944 spin_lock_irqsave(&pdc_lock, flags);
908 retval = mem_pdc_call(PDC_TOD, PDC_TOD_WRITE, sec, usec); 945 retval = mem_pdc_call(PDC_TOD, PDC_TOD_WRITE, sec, usec);
909 spin_unlock_irq(&pdc_lock); 946 spin_unlock_irqrestore(&pdc_lock, flags);
910 947
911 return retval; 948 return retval;
912} 949}
@@ -917,13 +954,14 @@ int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr,
917 struct pdc_memory_table *tbl, unsigned long entries) 954 struct pdc_memory_table *tbl, unsigned long entries)
918{ 955{
919 int retval; 956 int retval;
957 unsigned long flags;
920 958
921 spin_lock_irq(&pdc_lock); 959 spin_lock_irqsave(&pdc_lock, flags);
922 retval = mem_pdc_call(PDC_MEM, PDC_MEM_TABLE, __pa(pdc_result), __pa(pdc_result2), entries); 960 retval = mem_pdc_call(PDC_MEM, PDC_MEM_TABLE, __pa(pdc_result), __pa(pdc_result2), entries);
923 convert_to_wide(pdc_result); 961 convert_to_wide(pdc_result);
924 memcpy(r_addr, pdc_result, sizeof(*r_addr)); 962 memcpy(r_addr, pdc_result, sizeof(*r_addr));
925 memcpy(tbl, pdc_result2, entries * sizeof(*tbl)); 963 memcpy(tbl, pdc_result2, entries * sizeof(*tbl));
926 spin_unlock_irq(&pdc_lock); 964 spin_unlock_irqrestore(&pdc_lock, flags);
927 965
928 return retval; 966 return retval;
929} 967}
@@ -936,11 +974,12 @@ int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr,
936int pdc_do_firm_test_reset(unsigned long ftc_bitmap) 974int pdc_do_firm_test_reset(unsigned long ftc_bitmap)
937{ 975{
938 int retval; 976 int retval;
977 unsigned long flags;
939 978
940 spin_lock_irq(&pdc_lock); 979 spin_lock_irqsave(&pdc_lock, flags);
941 retval = mem_pdc_call(PDC_BROADCAST_RESET, PDC_DO_FIRM_TEST_RESET, 980 retval = mem_pdc_call(PDC_BROADCAST_RESET, PDC_DO_FIRM_TEST_RESET,
942 PDC_FIRM_TEST_MAGIC, ftc_bitmap); 981 PDC_FIRM_TEST_MAGIC, ftc_bitmap);
943 spin_unlock_irq(&pdc_lock); 982 spin_unlock_irqrestore(&pdc_lock, flags);
944 983
945 return retval; 984 return retval;
946} 985}
@@ -953,10 +992,11 @@ int pdc_do_firm_test_reset(unsigned long ftc_bitmap)
953int pdc_do_reset(void) 992int pdc_do_reset(void)
954{ 993{
955 int retval; 994 int retval;
995 unsigned long flags;
956 996
957 spin_lock_irq(&pdc_lock); 997 spin_lock_irqsave(&pdc_lock, flags);
958 retval = mem_pdc_call(PDC_BROADCAST_RESET, PDC_DO_RESET); 998 retval = mem_pdc_call(PDC_BROADCAST_RESET, PDC_DO_RESET);
959 spin_unlock_irq(&pdc_lock); 999 spin_unlock_irqrestore(&pdc_lock, flags);
960 1000
961 return retval; 1001 return retval;
962} 1002}
@@ -970,16 +1010,17 @@ int pdc_do_reset(void)
970int __init pdc_soft_power_info(unsigned long *power_reg) 1010int __init pdc_soft_power_info(unsigned long *power_reg)
971{ 1011{
972 int retval; 1012 int retval;
1013 unsigned long flags;
973 1014
974 *power_reg = (unsigned long) (-1); 1015 *power_reg = (unsigned long) (-1);
975 1016
976 spin_lock_irq(&pdc_lock); 1017 spin_lock_irqsave(&pdc_lock, flags);
977 retval = mem_pdc_call(PDC_SOFT_POWER, PDC_SOFT_POWER_INFO, __pa(pdc_result), 0); 1018 retval = mem_pdc_call(PDC_SOFT_POWER, PDC_SOFT_POWER_INFO, __pa(pdc_result), 0);
978 if (retval == PDC_OK) { 1019 if (retval == PDC_OK) {
979 convert_to_wide(pdc_result); 1020 convert_to_wide(pdc_result);
980 *power_reg = f_extend(pdc_result[0]); 1021 *power_reg = f_extend(pdc_result[0]);
981 } 1022 }
982 spin_unlock_irq(&pdc_lock); 1023 spin_unlock_irqrestore(&pdc_lock, flags);
983 1024
984 return retval; 1025 return retval;
985} 1026}
@@ -998,9 +1039,12 @@ int __init pdc_soft_power_info(unsigned long *power_reg)
998int pdc_soft_power_button(int sw_control) 1039int pdc_soft_power_button(int sw_control)
999{ 1040{
1000 int retval; 1041 int retval;
1001 spin_lock_irq(&pdc_lock); 1042 unsigned long flags;
1043
1044 spin_lock_irqsave(&pdc_lock, flags);
1002 retval = mem_pdc_call(PDC_SOFT_POWER, PDC_SOFT_POWER_ENABLE, __pa(pdc_result), sw_control); 1045 retval = mem_pdc_call(PDC_SOFT_POWER, PDC_SOFT_POWER_ENABLE, __pa(pdc_result), sw_control);
1003 spin_unlock_irq(&pdc_lock); 1046 spin_unlock_irqrestore(&pdc_lock, flags);
1047
1004 return retval; 1048 return retval;
1005} 1049}
1006 1050
@@ -1011,9 +1055,11 @@ int pdc_soft_power_button(int sw_control)
1011 */ 1055 */
1012void pdc_io_reset(void) 1056void pdc_io_reset(void)
1013{ 1057{
1014 spin_lock_irq(&pdc_lock); 1058 unsigned long flags;
1059
1060 spin_lock_irqsave(&pdc_lock, flags);
1015 mem_pdc_call(PDC_IO, PDC_IO_RESET, 0); 1061 mem_pdc_call(PDC_IO, PDC_IO_RESET, 0);
1016 spin_unlock_irq(&pdc_lock); 1062 spin_unlock_irqrestore(&pdc_lock, flags);
1017} 1063}
1018 1064
1019/* 1065/*
@@ -1027,9 +1073,11 @@ void pdc_io_reset(void)
1027 */ 1073 */
1028void pdc_io_reset_devices(void) 1074void pdc_io_reset_devices(void)
1029{ 1075{
1030 spin_lock_irq(&pdc_lock); 1076 unsigned long flags;
1077
1078 spin_lock_irqsave(&pdc_lock, flags);
1031 mem_pdc_call(PDC_IO, PDC_IO_RESET_DEVICES, 0); 1079 mem_pdc_call(PDC_IO, PDC_IO_RESET_DEVICES, 0);
1032 spin_unlock_irq(&pdc_lock); 1080 spin_unlock_irqrestore(&pdc_lock, flags);
1033} 1081}
1034 1082
1035 1083
@@ -1146,10 +1194,11 @@ int pdc_sti_call(unsigned long func, unsigned long flags,
1146 unsigned long glob_cfg) 1194 unsigned long glob_cfg)
1147{ 1195{
1148 int retval; 1196 int retval;
1197 unsigned long irqflags;
1149 1198
1150 spin_lock_irq(&pdc_lock); 1199 spin_lock_irqsave(&pdc_lock, irqflags);
1151 retval = real32_call(func, flags, inptr, outputr, glob_cfg); 1200 retval = real32_call(func, flags, inptr, outputr, glob_cfg);
1152 spin_unlock_irq(&pdc_lock); 1201 spin_unlock_irqrestore(&pdc_lock, irqflags);
1153 1202
1154 return retval; 1203 return retval;
1155} 1204}
@@ -1166,11 +1215,12 @@ EXPORT_SYMBOL(pdc_sti_call);
1166int pdc_pat_cell_get_number(struct pdc_pat_cell_num *cell_info) 1215int pdc_pat_cell_get_number(struct pdc_pat_cell_num *cell_info)
1167{ 1216{
1168 int retval; 1217 int retval;
1218 unsigned long flags;
1169 1219
1170 spin_lock_irq(&pdc_lock); 1220 spin_lock_irqsave(&pdc_lock, flags);
1171 retval = mem_pdc_call(PDC_PAT_CELL, PDC_PAT_CELL_GET_NUMBER, __pa(pdc_result)); 1221 retval = mem_pdc_call(PDC_PAT_CELL, PDC_PAT_CELL_GET_NUMBER, __pa(pdc_result));
1172 memcpy(cell_info, pdc_result, sizeof(*cell_info)); 1222 memcpy(cell_info, pdc_result, sizeof(*cell_info));
1173 spin_unlock_irq(&pdc_lock); 1223 spin_unlock_irqrestore(&pdc_lock, flags);
1174 1224
1175 return retval; 1225 return retval;
1176} 1226}
@@ -1190,16 +1240,17 @@ int pdc_pat_cell_module(unsigned long *actcnt, unsigned long ploc, unsigned long
1190 unsigned long view_type, void *mem_addr) 1240 unsigned long view_type, void *mem_addr)
1191{ 1241{
1192 int retval; 1242 int retval;
1243 unsigned long flags;
1193 static struct pdc_pat_cell_mod_maddr_block result __attribute__ ((aligned (8))); 1244 static struct pdc_pat_cell_mod_maddr_block result __attribute__ ((aligned (8)));
1194 1245
1195 spin_lock_irq(&pdc_lock); 1246 spin_lock_irqsave(&pdc_lock, flags);
1196 retval = mem_pdc_call(PDC_PAT_CELL, PDC_PAT_CELL_MODULE, __pa(pdc_result), 1247 retval = mem_pdc_call(PDC_PAT_CELL, PDC_PAT_CELL_MODULE, __pa(pdc_result),
1197 ploc, mod, view_type, __pa(&result)); 1248 ploc, mod, view_type, __pa(&result));
1198 if(!retval) { 1249 if(!retval) {
1199 *actcnt = pdc_result[0]; 1250 *actcnt = pdc_result[0];
1200 memcpy(mem_addr, &result, *actcnt); 1251 memcpy(mem_addr, &result, *actcnt);
1201 } 1252 }
1202 spin_unlock_irq(&pdc_lock); 1253 spin_unlock_irqrestore(&pdc_lock, flags);
1203 1254
1204 return retval; 1255 return retval;
1205} 1256}
@@ -1214,12 +1265,13 @@ int pdc_pat_cell_module(unsigned long *actcnt, unsigned long ploc, unsigned long
1214int pdc_pat_cpu_get_number(struct pdc_pat_cpu_num *cpu_info, void *hpa) 1265int pdc_pat_cpu_get_number(struct pdc_pat_cpu_num *cpu_info, void *hpa)
1215{ 1266{
1216 int retval; 1267 int retval;
1268 unsigned long flags;
1217 1269
1218 spin_lock_irq(&pdc_lock); 1270 spin_lock_irqsave(&pdc_lock, flags);
1219 retval = mem_pdc_call(PDC_PAT_CPU, PDC_PAT_CPU_GET_NUMBER, 1271 retval = mem_pdc_call(PDC_PAT_CPU, PDC_PAT_CPU_GET_NUMBER,
1220 __pa(&pdc_result), hpa); 1272 __pa(&pdc_result), hpa);
1221 memcpy(cpu_info, pdc_result, sizeof(*cpu_info)); 1273 memcpy(cpu_info, pdc_result, sizeof(*cpu_info));
1222 spin_unlock_irq(&pdc_lock); 1274 spin_unlock_irqrestore(&pdc_lock, flags);
1223 1275
1224 return retval; 1276 return retval;
1225} 1277}
@@ -1235,12 +1287,13 @@ int pdc_pat_cpu_get_number(struct pdc_pat_cpu_num *cpu_info, void *hpa)
1235int pdc_pat_get_irt_size(unsigned long *num_entries, unsigned long cell_num) 1287int pdc_pat_get_irt_size(unsigned long *num_entries, unsigned long cell_num)
1236{ 1288{
1237 int retval; 1289 int retval;
1290 unsigned long flags;
1238 1291
1239 spin_lock_irq(&pdc_lock); 1292 spin_lock_irqsave(&pdc_lock, flags);
1240 retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_GET_PCI_ROUTING_TABLE_SIZE, 1293 retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_GET_PCI_ROUTING_TABLE_SIZE,
1241 __pa(pdc_result), cell_num); 1294 __pa(pdc_result), cell_num);
1242 *num_entries = pdc_result[0]; 1295 *num_entries = pdc_result[0];
1243 spin_unlock_irq(&pdc_lock); 1296 spin_unlock_irqrestore(&pdc_lock, flags);
1244 1297
1245 return retval; 1298 return retval;
1246} 1299}
@@ -1255,11 +1308,12 @@ int pdc_pat_get_irt_size(unsigned long *num_entries, unsigned long cell_num)
1255int pdc_pat_get_irt(void *r_addr, unsigned long cell_num) 1308int pdc_pat_get_irt(void *r_addr, unsigned long cell_num)
1256{ 1309{
1257 int retval; 1310 int retval;
1311 unsigned long flags;
1258 1312
1259 spin_lock_irq(&pdc_lock); 1313 spin_lock_irqsave(&pdc_lock, flags);
1260 retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_GET_PCI_ROUTING_TABLE, 1314 retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_GET_PCI_ROUTING_TABLE,
1261 __pa(r_addr), cell_num); 1315 __pa(r_addr), cell_num);
1262 spin_unlock_irq(&pdc_lock); 1316 spin_unlock_irqrestore(&pdc_lock, flags);
1263 1317
1264 return retval; 1318 return retval;
1265} 1319}
@@ -1276,13 +1330,14 @@ int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr,
1276 unsigned long count, unsigned long offset) 1330 unsigned long count, unsigned long offset)
1277{ 1331{
1278 int retval; 1332 int retval;
1333 unsigned long flags;
1279 1334
1280 spin_lock_irq(&pdc_lock); 1335 spin_lock_irqsave(&pdc_lock, flags);
1281 retval = mem_pdc_call(PDC_PAT_PD, PDC_PAT_PD_GET_ADDR_MAP, __pa(pdc_result), 1336 retval = mem_pdc_call(PDC_PAT_PD, PDC_PAT_PD_GET_ADDR_MAP, __pa(pdc_result),
1282 __pa(pdc_result2), count, offset); 1337 __pa(pdc_result2), count, offset);
1283 *actual_len = pdc_result[0]; 1338 *actual_len = pdc_result[0];
1284 memcpy(mem_addr, pdc_result2, *actual_len); 1339 memcpy(mem_addr, pdc_result2, *actual_len);
1285 spin_unlock_irq(&pdc_lock); 1340 spin_unlock_irqrestore(&pdc_lock, flags);
1286 1341
1287 return retval; 1342 return retval;
1288} 1343}
@@ -1297,7 +1352,9 @@ int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr,
1297int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *mem_addr) 1352int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *mem_addr)
1298{ 1353{
1299 int retval; 1354 int retval;
1300 spin_lock_irq(&pdc_lock); 1355 unsigned long flags;
1356
1357 spin_lock_irqsave(&pdc_lock, flags);
1301 retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_READ, 1358 retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_READ,
1302 __pa(pdc_result), pci_addr, pci_size); 1359 __pa(pdc_result), pci_addr, pci_size);
1303 switch(pci_size) { 1360 switch(pci_size) {
@@ -1305,7 +1362,7 @@ int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *mem_addr)
1305 case 2: *(u16 *)mem_addr = (u16) pdc_result[0]; 1362 case 2: *(u16 *)mem_addr = (u16) pdc_result[0];
1306 case 4: *(u32 *)mem_addr = (u32) pdc_result[0]; 1363 case 4: *(u32 *)mem_addr = (u32) pdc_result[0];
1307 } 1364 }
1308 spin_unlock_irq(&pdc_lock); 1365 spin_unlock_irqrestore(&pdc_lock, flags);
1309 1366
1310 return retval; 1367 return retval;
1311} 1368}
@@ -1321,11 +1378,12 @@ int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *mem_addr)
1321int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val) 1378int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val)
1322{ 1379{
1323 int retval; 1380 int retval;
1381 unsigned long flags;
1324 1382
1325 spin_lock_irq(&pdc_lock); 1383 spin_lock_irqsave(&pdc_lock, flags);
1326 retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_WRITE, 1384 retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_WRITE,
1327 pci_addr, pci_size, val); 1385 pci_addr, pci_size, val);
1328 spin_unlock_irq(&pdc_lock); 1386 spin_unlock_irqrestore(&pdc_lock, flags);
1329 1387
1330 return retval; 1388 return retval;
1331} 1389}
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index 2ece7c7939fe..b39c5b9aff46 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -347,12 +347,14 @@ static inline int eirr_to_irq(unsigned long eirr)
347/* ONLY called from entry.S:intr_extint() */ 347/* ONLY called from entry.S:intr_extint() */
348void do_cpu_irq_mask(struct pt_regs *regs) 348void do_cpu_irq_mask(struct pt_regs *regs)
349{ 349{
350 struct pt_regs *old_regs;
350 unsigned long eirr_val; 351 unsigned long eirr_val;
351 int irq, cpu = smp_processor_id(); 352 int irq, cpu = smp_processor_id();
352#ifdef CONFIG_SMP 353#ifdef CONFIG_SMP
353 cpumask_t dest; 354 cpumask_t dest;
354#endif 355#endif
355 356
357 old_regs = set_irq_regs(regs);
356 local_irq_disable(); 358 local_irq_disable();
357 irq_enter(); 359 irq_enter();
358 360
@@ -379,6 +381,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
379 381
380 out: 382 out:
381 irq_exit(); 383 irq_exit();
384 set_irq_regs(old_regs);
382 return; 385 return;
383 386
384 set_out: 387 set_out:
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index faad338f310e..4a23a97b06cd 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -154,7 +154,7 @@ halt_processor(void)
154 154
155 155
156irqreturn_t 156irqreturn_t
157ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs) 157ipi_interrupt(int irq, void *dev_id)
158{ 158{
159 int this_cpu = smp_processor_id(); 159 int this_cpu = smp_processor_id();
160 struct cpuinfo_parisc *p = &cpu_data[this_cpu]; 160 struct cpuinfo_parisc *p = &cpu_data[this_cpu];
@@ -414,19 +414,6 @@ smp_flush_tlb_all(void)
414 on_each_cpu(flush_tlb_all_local, NULL, 1, 1); 414 on_each_cpu(flush_tlb_all_local, NULL, 1, 1);
415} 415}
416 416
417
418void
419smp_do_timer(struct pt_regs *regs)
420{
421 int cpu = smp_processor_id();
422 struct cpuinfo_parisc *data = &cpu_data[cpu];
423
424 if (!--data->prof_counter) {
425 data->prof_counter = data->prof_multiplier;
426 update_process_times(user_mode(regs));
427 }
428}
429
430/* 417/*
431 * Called by secondaries to update state and initialize CPU registers. 418 * Called by secondaries to update state and initialize CPU registers.
432 */ 419 */
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index b44839203e69..bad7d1eb62b9 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -34,10 +34,6 @@
34 34
35static unsigned long clocktick __read_mostly; /* timer cycles per tick */ 35static unsigned long clocktick __read_mostly; /* timer cycles per tick */
36 36
37#ifdef CONFIG_SMP
38extern void smp_do_timer(struct pt_regs *regs);
39#endif
40
41/* 37/*
42 * We keep time on PA-RISC Linux by using the Interval Timer which is 38 * We keep time on PA-RISC Linux by using the Interval Timer which is
43 * a pair of registers; one is read-only and one is write-only; both 39 * a pair of registers; one is read-only and one is write-only; both
@@ -55,13 +51,14 @@ extern void smp_do_timer(struct pt_regs *regs);
55 * held off for an arbitrarily long period of time by interrupts being 51 * held off for an arbitrarily long period of time by interrupts being
56 * disabled, so we may miss one or more ticks. 52 * disabled, so we may miss one or more ticks.
57 */ 53 */
58irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 54irqreturn_t timer_interrupt(int irq, void *dev_id)
59{ 55{
60 unsigned long now; 56 unsigned long now;
61 unsigned long next_tick; 57 unsigned long next_tick;
62 unsigned long cycles_elapsed, ticks_elapsed; 58 unsigned long cycles_elapsed, ticks_elapsed;
63 unsigned long cycles_remainder; 59 unsigned long cycles_remainder;
64 unsigned int cpu = smp_processor_id(); 60 unsigned int cpu = smp_processor_id();
61 struct cpuinfo_parisc *cpuinfo = &cpu_data[cpu];
65 62
66 /* gcc can optimize for "read-only" case with a local clocktick */ 63 /* gcc can optimize for "read-only" case with a local clocktick */
67 unsigned long cpt = clocktick; 64 unsigned long cpt = clocktick;
@@ -69,7 +66,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
69 profile_tick(CPU_PROFILING); 66 profile_tick(CPU_PROFILING);
70 67
71 /* Initialize next_tick to the expected tick time. */ 68 /* Initialize next_tick to the expected tick time. */
72 next_tick = cpu_data[cpu].it_value; 69 next_tick = cpuinfo->it_value;
73 70
74 /* Get current interval timer. 71 /* Get current interval timer.
75 * CR16 reads as 64 bits in CPU wide mode. 72 * CR16 reads as 64 bits in CPU wide mode.
@@ -120,7 +117,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
120 */ 117 */
121 next_tick = now + cycles_remainder; 118 next_tick = now + cycles_remainder;
122 119
123 cpu_data[cpu].it_value = next_tick; 120 cpuinfo->it_value = next_tick;
124 121
125 /* Skip one clocktick on purpose if we are likely to miss next_tick. 122 /* Skip one clocktick on purpose if we are likely to miss next_tick.
126 * We want to avoid the new next_tick being less than CR16. 123 * We want to avoid the new next_tick being less than CR16.
@@ -131,18 +128,19 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
131 next_tick += cpt; 128 next_tick += cpt;
132 129
133 /* Program the IT when to deliver the next interrupt. */ 130 /* Program the IT when to deliver the next interrupt. */
134 /* Only bottom 32-bits of next_tick are written to cr16. */ 131 /* Only bottom 32-bits of next_tick are written to cr16. */
135 mtctl(next_tick, 16); 132 mtctl(next_tick, 16);
136 133
137 134
138 /* Done mucking with unreliable delivery of interrupts. 135 /* Done mucking with unreliable delivery of interrupts.
139 * Go do system house keeping. 136 * Go do system house keeping.
140 */ 137 */
141#ifdef CONFIG_SMP 138
142 smp_do_timer(regs); 139 if (!--cpuinfo->prof_counter) {
143#else 140 cpuinfo->prof_counter = cpuinfo->prof_multiplier;
144 update_process_times(user_mode(regs)); 141 update_process_times(user_mode(get_irq_regs()));
145#endif 142 }
143
146 if (cpu == 0) { 144 if (cpu == 0) {
147 write_seqlock(&xtime_lock); 145 write_seqlock(&xtime_lock);
148 do_timer(ticks_elapsed); 146 do_timer(ticks_elapsed);
@@ -319,13 +317,15 @@ void __init time_init(void)
319 317
320 start_cpu_itimer(); /* get CPU 0 started */ 318 start_cpu_itimer(); /* get CPU 0 started */
321 319
322 if(pdc_tod_read(&tod_data) == 0) { 320 if (pdc_tod_read(&tod_data) == 0) {
323 write_seqlock_irq(&xtime_lock); 321 unsigned long flags;
322
323 write_seqlock_irqsave(&xtime_lock, flags);
324 xtime.tv_sec = tod_data.tod_sec; 324 xtime.tv_sec = tod_data.tod_sec;
325 xtime.tv_nsec = tod_data.tod_usec * 1000; 325 xtime.tv_nsec = tod_data.tod_usec * 1000;
326 set_normalized_timespec(&wall_to_monotonic, 326 set_normalized_timespec(&wall_to_monotonic,
327 -xtime.tv_sec, -xtime.tv_nsec); 327 -xtime.tv_sec, -xtime.tv_nsec);
328 write_sequnlock_irq(&xtime_lock); 328 write_sequnlock_irqrestore(&xtime_lock, flags);
329 } else { 329 } else {
330 printk(KERN_ERR "Error reading tod clock\n"); 330 printk(KERN_ERR "Error reading tod clock\n");
331 xtime.tv_sec = 0; 331 xtime.tv_sec = 0;