diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2011-01-05 06:47:39 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2011-01-05 06:47:26 -0500 |
commit | fb0a9d7e865afdae70829a64bb004a74ff67d29f (patch) | |
tree | 91747a95a38e165cc9bb7a725fda73d22a8f20a7 | |
parent | 62d146ffe3adfed2747fc36138476c8417ce73a7 (diff) |
[S390] pfault: delay register of pfault interrupt
Use an early init call to initialize pfault. That way it is possible to
use the register_external_interrupt() instead of the early variant.
No need to enable pfault any earlier since it has only effect if user
space processes are running.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/system.h | 2 | ||||
-rw-r--r-- | arch/s390/kernel/traps.c | 1 | ||||
-rw-r--r-- | arch/s390/mm/fault.c | 27 |
3 files changed, 15 insertions, 15 deletions
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h index 3ad16dbf622e..4ab2779fdb02 100644 --- a/arch/s390/include/asm/system.h +++ b/arch/s390/include/asm/system.h | |||
@@ -101,11 +101,9 @@ extern void account_vtime(struct task_struct *, struct task_struct *); | |||
101 | extern void account_tick_vtime(struct task_struct *); | 101 | extern void account_tick_vtime(struct task_struct *); |
102 | 102 | ||
103 | #ifdef CONFIG_PFAULT | 103 | #ifdef CONFIG_PFAULT |
104 | extern void pfault_irq_init(void); | ||
105 | extern int pfault_init(void); | 104 | extern int pfault_init(void); |
106 | extern void pfault_fini(void); | 105 | extern void pfault_fini(void); |
107 | #else /* CONFIG_PFAULT */ | 106 | #else /* CONFIG_PFAULT */ |
108 | #define pfault_irq_init() do { } while (0) | ||
109 | #define pfault_init() ({-1;}) | 107 | #define pfault_init() ({-1;}) |
110 | #define pfault_fini() do { } while (0) | 108 | #define pfault_fini() do { } while (0) |
111 | #endif /* CONFIG_PFAULT */ | 109 | #endif /* CONFIG_PFAULT */ |
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index bc4f32fcfa57..f6342ec084a4 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c | |||
@@ -733,5 +733,4 @@ void __init trap_init(void) | |||
733 | pgm_check_table[0x15] = &operand_exception; | 733 | pgm_check_table[0x15] = &operand_exception; |
734 | pgm_check_table[0x1C] = &space_switch_exception; | 734 | pgm_check_table[0x1C] = &space_switch_exception; |
735 | pgm_check_table[0x1D] = &hfp_sqrt_exception; | 735 | pgm_check_table[0x1D] = &hfp_sqrt_exception; |
736 | pfault_irq_init(); | ||
737 | } | 736 | } |
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 839b16df72b3..dccb85d91538 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c | |||
@@ -481,8 +481,7 @@ int __handle_fault(unsigned long uaddr, unsigned long pgm_int_code, int write) | |||
481 | /* | 481 | /* |
482 | * 'pfault' pseudo page faults routines. | 482 | * 'pfault' pseudo page faults routines. |
483 | */ | 483 | */ |
484 | static ext_int_info_t ext_int_pfault; | 484 | static int pfault_disable; |
485 | static int pfault_disable = 0; | ||
486 | 485 | ||
487 | static int __init nopfault(char *str) | 486 | static int __init nopfault(char *str) |
488 | { | 487 | { |
@@ -594,24 +593,28 @@ static void pfault_interrupt(unsigned int ext_int_code, | |||
594 | } | 593 | } |
595 | } | 594 | } |
596 | 595 | ||
597 | void __init pfault_irq_init(void) | 596 | static int __init pfault_irq_init(void) |
598 | { | 597 | { |
599 | if (!MACHINE_IS_VM) | 598 | int rc; |
600 | return; | ||
601 | 599 | ||
600 | if (!MACHINE_IS_VM) | ||
601 | return 0; | ||
602 | /* | 602 | /* |
603 | * Try to get pfault pseudo page faults going. | 603 | * Try to get pfault pseudo page faults going. |
604 | */ | 604 | */ |
605 | if (register_early_external_interrupt(0x2603, pfault_interrupt, | 605 | rc = register_external_interrupt(0x2603, pfault_interrupt); |
606 | &ext_int_pfault) != 0) | 606 | if (rc) { |
607 | panic("Couldn't request external interrupt 0x2603"); | 607 | pfault_disable = 1; |
608 | 608 | return rc; | |
609 | } | ||
609 | if (pfault_init() == 0) | 610 | if (pfault_init() == 0) |
610 | return; | 611 | return 0; |
611 | 612 | ||
612 | /* Tough luck, no pfault. */ | 613 | /* Tough luck, no pfault. */ |
613 | pfault_disable = 1; | 614 | pfault_disable = 1; |
614 | unregister_early_external_interrupt(0x2603, pfault_interrupt, | 615 | unregister_external_interrupt(0x2603, pfault_interrupt); |
615 | &ext_int_pfault); | 616 | return 0; |
616 | } | 617 | } |
618 | early_initcall(pfault_irq_init); | ||
619 | |||
617 | #endif | 620 | #endif |