diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/hpet.c | 68 | ||||
-rw-r--r-- | arch/ia64/kernel/msi_ia64.c | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/smpboot.c | 17 | ||||
-rw-r--r-- | arch/ia64/mm/init.c | 2 | ||||
-rw-r--r-- | arch/ia64/pci/pci.c | 1 | ||||
-rw-r--r-- | arch/mips/Kconfig | 2 | ||||
-rw-r--r-- | arch/mips/gt64120/momenco_ocelot/prom.c | 1 | ||||
-rw-r--r-- | arch/mips/gt64120/momenco_ocelot/setup.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/entry.S | 6 | ||||
-rw-r--r-- | arch/mips/kernel/genex.S | 31 | ||||
-rw-r--r-- | arch/mips/kernel/smtc.c | 65 | ||||
-rw-r--r-- | arch/mips/mm/fault.c | 6 | ||||
-rw-r--r-- | arch/mips/pci/pci-ev64120.c | 1 | ||||
-rw-r--r-- | arch/mips/sibyte/bcm1480/irq.c | 4 | ||||
-rw-r--r-- | arch/powerpc/sysdev/qe_lib/qe.c | 6 | ||||
-rw-r--r-- | arch/um/drivers/chan_kern.c | 12 | ||||
-rw-r--r-- | arch/um/drivers/mconsole_kern.c | 3 | ||||
-rw-r--r-- | arch/um/drivers/ubd_kern.c | 13 | ||||
-rw-r--r-- | arch/um/include/mconsole.h | 2 | ||||
-rw-r--r-- | arch/um/kernel/mem.c | 3 | ||||
-rw-r--r-- | arch/um/sys-i386/ldt.c | 3 | ||||
-rw-r--r-- | arch/x86_64/kernel/i8259.c | 6 |
22 files changed, 210 insertions, 46 deletions
diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c index 76afea67f691..17d73459fc5f 100644 --- a/arch/i386/kernel/hpet.c +++ b/arch/i386/kernel/hpet.c | |||
@@ -3,6 +3,8 @@ | |||
3 | #include <linux/errno.h> | 3 | #include <linux/errno.h> |
4 | #include <linux/hpet.h> | 4 | #include <linux/hpet.h> |
5 | #include <linux/init.h> | 5 | #include <linux/init.h> |
6 | #include <linux/sysdev.h> | ||
7 | #include <linux/pm.h> | ||
6 | 8 | ||
7 | #include <asm/hpet.h> | 9 | #include <asm/hpet.h> |
8 | #include <asm/io.h> | 10 | #include <asm/io.h> |
@@ -307,6 +309,7 @@ int __init hpet_enable(void) | |||
307 | out_nohpet: | 309 | out_nohpet: |
308 | iounmap(hpet_virt_address); | 310 | iounmap(hpet_virt_address); |
309 | hpet_virt_address = NULL; | 311 | hpet_virt_address = NULL; |
312 | boot_hpet_disable = 1; | ||
310 | return 0; | 313 | return 0; |
311 | } | 314 | } |
312 | 315 | ||
@@ -521,3 +524,68 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id) | |||
521 | return IRQ_HANDLED; | 524 | return IRQ_HANDLED; |
522 | } | 525 | } |
523 | #endif | 526 | #endif |
527 | |||
528 | |||
529 | /* | ||
530 | * Suspend/resume part | ||
531 | */ | ||
532 | |||
533 | #ifdef CONFIG_PM | ||
534 | |||
535 | static int hpet_suspend(struct sys_device *sys_device, pm_message_t state) | ||
536 | { | ||
537 | unsigned long cfg = hpet_readl(HPET_CFG); | ||
538 | |||
539 | cfg &= ~(HPET_CFG_ENABLE|HPET_CFG_LEGACY); | ||
540 | hpet_writel(cfg, HPET_CFG); | ||
541 | |||
542 | return 0; | ||
543 | } | ||
544 | |||
545 | static int hpet_resume(struct sys_device *sys_device) | ||
546 | { | ||
547 | unsigned int id; | ||
548 | |||
549 | hpet_start_counter(); | ||
550 | |||
551 | id = hpet_readl(HPET_ID); | ||
552 | |||
553 | if (id & HPET_ID_LEGSUP) | ||
554 | hpet_enable_int(); | ||
555 | |||
556 | return 0; | ||
557 | } | ||
558 | |||
559 | static struct sysdev_class hpet_class = { | ||
560 | set_kset_name("hpet"), | ||
561 | .suspend = hpet_suspend, | ||
562 | .resume = hpet_resume, | ||
563 | }; | ||
564 | |||
565 | static struct sys_device hpet_device = { | ||
566 | .id = 0, | ||
567 | .cls = &hpet_class, | ||
568 | }; | ||
569 | |||
570 | |||
571 | static __init int hpet_register_sysfs(void) | ||
572 | { | ||
573 | int err; | ||
574 | |||
575 | if (!is_hpet_capable()) | ||
576 | return 0; | ||
577 | |||
578 | err = sysdev_class_register(&hpet_class); | ||
579 | |||
580 | if (!err) { | ||
581 | err = sysdev_register(&hpet_device); | ||
582 | if (err) | ||
583 | sysdev_class_unregister(&hpet_class); | ||
584 | } | ||
585 | |||
586 | return err; | ||
587 | } | ||
588 | |||
589 | device_initcall(hpet_register_sysfs); | ||
590 | |||
591 | #endif | ||
diff --git a/arch/ia64/kernel/msi_ia64.c b/arch/ia64/kernel/msi_ia64.c index e7220900ea14..ebbeadfee42d 100644 --- a/arch/ia64/kernel/msi_ia64.c +++ b/arch/ia64/kernel/msi_ia64.c | |||
@@ -68,7 +68,7 @@ int ia64_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) | |||
68 | { | 68 | { |
69 | struct msi_msg msg; | 69 | struct msi_msg msg; |
70 | unsigned long dest_phys_id; | 70 | unsigned long dest_phys_id; |
71 | unsigned int irq, vector; | 71 | int irq, vector; |
72 | 72 | ||
73 | irq = create_irq(); | 73 | irq = create_irq(); |
74 | if (irq < 0) | 74 | if (irq < 0) |
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index b21ddecea943..ff7df439da6d 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c | |||
@@ -375,6 +375,7 @@ static void __devinit | |||
375 | smp_callin (void) | 375 | smp_callin (void) |
376 | { | 376 | { |
377 | int cpuid, phys_id, itc_master; | 377 | int cpuid, phys_id, itc_master; |
378 | struct cpuinfo_ia64 *last_cpuinfo, *this_cpuinfo; | ||
378 | extern void ia64_init_itm(void); | 379 | extern void ia64_init_itm(void); |
379 | extern volatile int time_keeper_id; | 380 | extern volatile int time_keeper_id; |
380 | 381 | ||
@@ -424,7 +425,21 @@ smp_callin (void) | |||
424 | * Get our bogomips. | 425 | * Get our bogomips. |
425 | */ | 426 | */ |
426 | ia64_init_itm(); | 427 | ia64_init_itm(); |
427 | calibrate_delay(); | 428 | |
429 | /* | ||
430 | * Delay calibration can be skipped if new processor is identical to the | ||
431 | * previous processor. | ||
432 | */ | ||
433 | last_cpuinfo = cpu_data(cpuid - 1); | ||
434 | this_cpuinfo = local_cpu_data; | ||
435 | if (last_cpuinfo->itc_freq != this_cpuinfo->itc_freq || | ||
436 | last_cpuinfo->proc_freq != this_cpuinfo->proc_freq || | ||
437 | last_cpuinfo->features != this_cpuinfo->features || | ||
438 | last_cpuinfo->revision != this_cpuinfo->revision || | ||
439 | last_cpuinfo->family != this_cpuinfo->family || | ||
440 | last_cpuinfo->archrev != this_cpuinfo->archrev || | ||
441 | last_cpuinfo->model != this_cpuinfo->model) | ||
442 | calibrate_delay(); | ||
428 | local_cpu_data->loops_per_jiffy = loops_per_jiffy; | 443 | local_cpu_data->loops_per_jiffy = loops_per_jiffy; |
429 | 444 | ||
430 | #ifdef CONFIG_IA32_SUPPORT | 445 | #ifdef CONFIG_IA32_SUPPORT |
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index c8da621aab17..4f36987eea72 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c | |||
@@ -155,7 +155,7 @@ ia64_set_rbs_bot (void) | |||
155 | 155 | ||
156 | if (stack_size > MAX_USER_STACK_SIZE) | 156 | if (stack_size > MAX_USER_STACK_SIZE) |
157 | stack_size = MAX_USER_STACK_SIZE; | 157 | stack_size = MAX_USER_STACK_SIZE; |
158 | current->thread.rbs_bot = STACK_TOP - stack_size; | 158 | current->thread.rbs_bot = PAGE_ALIGN(current->mm->start_stack - stack_size); |
159 | } | 159 | } |
160 | 160 | ||
161 | /* | 161 | /* |
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index f8bcccd6d417..0e83f3b419b5 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -568,7 +568,6 @@ pcibios_disable_device (struct pci_dev *dev) | |||
568 | BUG_ON(atomic_read(&dev->enable_cnt)); | 568 | BUG_ON(atomic_read(&dev->enable_cnt)); |
569 | if (!dev->msi_enabled) | 569 | if (!dev->msi_enabled) |
570 | acpi_pci_irq_disable(dev); | 570 | acpi_pci_irq_disable(dev); |
571 | return 0; | ||
572 | } | 571 | } |
573 | 572 | ||
574 | void | 573 | void |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 656f0ca52782..c78b14380b3e 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -1606,7 +1606,7 @@ config MIPS_MT_FPAFF | |||
1606 | 1606 | ||
1607 | config MIPS_MT_SMTC_INSTANT_REPLAY | 1607 | config MIPS_MT_SMTC_INSTANT_REPLAY |
1608 | bool "Low-latency Dispatch of Deferred SMTC IPIs" | 1608 | bool "Low-latency Dispatch of Deferred SMTC IPIs" |
1609 | depends on MIPS_MT_SMTC | 1609 | depends on MIPS_MT_SMTC && !PREEMPT |
1610 | default y | 1610 | default y |
1611 | help | 1611 | help |
1612 | SMTC pseudo-interrupts between TCs are deferred and queued | 1612 | SMTC pseudo-interrupts between TCs are deferred and queued |
diff --git a/arch/mips/gt64120/momenco_ocelot/prom.c b/arch/mips/gt64120/momenco_ocelot/prom.c index 78f393b2afd9..c71c85276c74 100644 --- a/arch/mips/gt64120/momenco_ocelot/prom.c +++ b/arch/mips/gt64120/momenco_ocelot/prom.c | |||
@@ -32,7 +32,6 @@ void __init prom_init(void) | |||
32 | char **arg = (char **) fw_arg1; | 32 | char **arg = (char **) fw_arg1; |
33 | char **env = (char **) fw_arg2; | 33 | char **env = (char **) fw_arg2; |
34 | struct callvectors *cv = (struct callvectors *) fw_arg3; | 34 | struct callvectors *cv = (struct callvectors *) fw_arg3; |
35 | uint32_t tmp; | ||
36 | int i; | 35 | int i; |
37 | 36 | ||
38 | /* save the PROM vectors for debugging use */ | 37 | /* save the PROM vectors for debugging use */ |
diff --git a/arch/mips/gt64120/momenco_ocelot/setup.c b/arch/mips/gt64120/momenco_ocelot/setup.c index 94f94ebbda6c..98b6fb38096d 100644 --- a/arch/mips/gt64120/momenco_ocelot/setup.c +++ b/arch/mips/gt64120/momenco_ocelot/setup.c | |||
@@ -79,7 +79,7 @@ static char reset_reason; | |||
79 | static void __init setup_l3cache(unsigned long size); | 79 | static void __init setup_l3cache(unsigned long size); |
80 | 80 | ||
81 | /* setup code for a handoff from a version 1 PMON 2000 PROM */ | 81 | /* setup code for a handoff from a version 1 PMON 2000 PROM */ |
82 | void PMON_v1_setup() | 82 | static void PMON_v1_setup(void) |
83 | { | 83 | { |
84 | /* A wired TLB entry for the GT64120A and the serial port. The | 84 | /* A wired TLB entry for the GT64120A and the serial port. The |
85 | GT64120A is going to be hit on every IRQ anyway - there's | 85 | GT64120A is going to be hit on every IRQ anyway - there's |
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S index 0b78fcbf044a..686249c5c328 100644 --- a/arch/mips/kernel/entry.S +++ b/arch/mips/kernel/entry.S | |||
@@ -121,7 +121,11 @@ FEXPORT(restore_partial) # restore partial frame | |||
121 | SAVE_AT | 121 | SAVE_AT |
122 | SAVE_TEMP | 122 | SAVE_TEMP |
123 | LONG_L v0, PT_STATUS(sp) | 123 | LONG_L v0, PT_STATUS(sp) |
124 | and v0, 1 | 124 | #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) |
125 | and v0, ST0_IEP | ||
126 | #else | ||
127 | and v0, ST0_IE | ||
128 | #endif | ||
125 | beqz v0, 1f | 129 | beqz v0, 1f |
126 | jal trace_hardirqs_on | 130 | jal trace_hardirqs_on |
127 | b 2f | 131 | b 2f |
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index 83843a229be7..297bd56c2347 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S | |||
@@ -128,6 +128,37 @@ handle_vcei: | |||
128 | 128 | ||
129 | .align 5 | 129 | .align 5 |
130 | NESTED(handle_int, PT_SIZE, sp) | 130 | NESTED(handle_int, PT_SIZE, sp) |
131 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
132 | /* | ||
133 | * Check to see if the interrupted code has just disabled | ||
134 | * interrupts and ignore this interrupt for now if so. | ||
135 | * | ||
136 | * local_irq_disable() disables interrupts and then calls | ||
137 | * trace_hardirqs_off() to track the state. If an interrupt is taken | ||
138 | * after interrupts are disabled but before the state is updated | ||
139 | * it will appear to restore_all that it is incorrectly returning with | ||
140 | * interrupts disabled | ||
141 | */ | ||
142 | .set push | ||
143 | .set noat | ||
144 | mfc0 k0, CP0_STATUS | ||
145 | #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) | ||
146 | and k0, ST0_IEP | ||
147 | bnez k0, 1f | ||
148 | |||
149 | mfc0 k0, EP0_EPC | ||
150 | .set noreorder | ||
151 | j k0 | ||
152 | rfe | ||
153 | #else | ||
154 | and k0, ST0_IE | ||
155 | bnez k0, 1f | ||
156 | |||
157 | eret | ||
158 | #endif | ||
159 | 1: | ||
160 | .set pop | ||
161 | #endif | ||
131 | SAVE_ALL | 162 | SAVE_ALL |
132 | CLI | 163 | CLI |
133 | TRACE_IRQS_OFF | 164 | TRACE_IRQS_OFF |
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c index f253eda27fa3..5dcfab6b288e 100644 --- a/arch/mips/kernel/smtc.c +++ b/arch/mips/kernel/smtc.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/sched.h> | 4 | #include <linux/sched.h> |
5 | #include <linux/cpumask.h> | 5 | #include <linux/cpumask.h> |
6 | #include <linux/interrupt.h> | 6 | #include <linux/interrupt.h> |
7 | #include <linux/kernel_stat.h> | ||
7 | #include <linux/module.h> | 8 | #include <linux/module.h> |
8 | 9 | ||
9 | #include <asm/cpu.h> | 10 | #include <asm/cpu.h> |
@@ -14,6 +15,7 @@ | |||
14 | #include <asm/hazards.h> | 15 | #include <asm/hazards.h> |
15 | #include <asm/mmu_context.h> | 16 | #include <asm/mmu_context.h> |
16 | #include <asm/smp.h> | 17 | #include <asm/smp.h> |
18 | #include <asm/mips-boards/maltaint.h> | ||
17 | #include <asm/mipsregs.h> | 19 | #include <asm/mipsregs.h> |
18 | #include <asm/cacheflush.h> | 20 | #include <asm/cacheflush.h> |
19 | #include <asm/time.h> | 21 | #include <asm/time.h> |
@@ -75,7 +77,7 @@ static struct smtc_ipi_q freeIPIq; | |||
75 | 77 | ||
76 | void ipi_decode(struct smtc_ipi *); | 78 | void ipi_decode(struct smtc_ipi *); |
77 | static void post_direct_ipi(int cpu, struct smtc_ipi *pipi); | 79 | static void post_direct_ipi(int cpu, struct smtc_ipi *pipi); |
78 | static void setup_cross_vpe_interrupts(void); | 80 | static void setup_cross_vpe_interrupts(unsigned int nvpe); |
79 | void init_smtc_stats(void); | 81 | void init_smtc_stats(void); |
80 | 82 | ||
81 | /* Global SMTC Status */ | 83 | /* Global SMTC Status */ |
@@ -168,7 +170,10 @@ __setup("tintq=", tintq); | |||
168 | 170 | ||
169 | int imstuckcount[2][8]; | 171 | int imstuckcount[2][8]; |
170 | /* vpemask represents IM/IE bits of per-VPE Status registers, low-to-high */ | 172 | /* vpemask represents IM/IE bits of per-VPE Status registers, low-to-high */ |
171 | int vpemask[2][8] = {{0,1,1,0,0,0,0,1},{0,1,0,0,0,0,0,1}}; | 173 | int vpemask[2][8] = { |
174 | {0, 0, 1, 0, 0, 0, 0, 1}, | ||
175 | {0, 0, 0, 0, 0, 0, 0, 1} | ||
176 | }; | ||
172 | int tcnoprog[NR_CPUS]; | 177 | int tcnoprog[NR_CPUS]; |
173 | static atomic_t idle_hook_initialized = {0}; | 178 | static atomic_t idle_hook_initialized = {0}; |
174 | static int clock_hang_reported[NR_CPUS]; | 179 | static int clock_hang_reported[NR_CPUS]; |
@@ -501,8 +506,7 @@ void mipsmt_prepare_cpus(void) | |||
501 | 506 | ||
502 | /* If we have multiple VPEs running, set up the cross-VPE interrupt */ | 507 | /* If we have multiple VPEs running, set up the cross-VPE interrupt */ |
503 | 508 | ||
504 | if (nvpe > 1) | 509 | setup_cross_vpe_interrupts(nvpe); |
505 | setup_cross_vpe_interrupts(); | ||
506 | 510 | ||
507 | /* Set up queue of free IPI "messages". */ | 511 | /* Set up queue of free IPI "messages". */ |
508 | nipi = NR_CPUS * IPIBUF_PER_CPU; | 512 | nipi = NR_CPUS * IPIBUF_PER_CPU; |
@@ -607,7 +611,12 @@ void smtc_cpus_done(void) | |||
607 | int setup_irq_smtc(unsigned int irq, struct irqaction * new, | 611 | int setup_irq_smtc(unsigned int irq, struct irqaction * new, |
608 | unsigned long hwmask) | 612 | unsigned long hwmask) |
609 | { | 613 | { |
614 | unsigned int vpe = current_cpu_data.vpe_id; | ||
615 | |||
610 | irq_hwmask[irq] = hwmask; | 616 | irq_hwmask[irq] = hwmask; |
617 | #ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG | ||
618 | vpemask[vpe][irq - MIPSCPU_INT_BASE] = 1; | ||
619 | #endif | ||
611 | 620 | ||
612 | return setup_irq(irq, new); | 621 | return setup_irq(irq, new); |
613 | } | 622 | } |
@@ -812,12 +821,15 @@ void ipi_decode(struct smtc_ipi *pipi) | |||
812 | smtc_ipi_nq(&freeIPIq, pipi); | 821 | smtc_ipi_nq(&freeIPIq, pipi); |
813 | switch (type_copy) { | 822 | switch (type_copy) { |
814 | case SMTC_CLOCK_TICK: | 823 | case SMTC_CLOCK_TICK: |
824 | irq_enter(); | ||
825 | kstat_this_cpu.irqs[MIPSCPU_INT_BASE + MIPSCPU_INT_CPUCTR]++; | ||
815 | /* Invoke Clock "Interrupt" */ | 826 | /* Invoke Clock "Interrupt" */ |
816 | ipi_timer_latch[dest_copy] = 0; | 827 | ipi_timer_latch[dest_copy] = 0; |
817 | #ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG | 828 | #ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG |
818 | clock_hang_reported[dest_copy] = 0; | 829 | clock_hang_reported[dest_copy] = 0; |
819 | #endif /* CONFIG_SMTC_IDLE_HOOK_DEBUG */ | 830 | #endif /* CONFIG_SMTC_IDLE_HOOK_DEBUG */ |
820 | local_timer_interrupt(0, NULL); | 831 | local_timer_interrupt(0, NULL); |
832 | irq_exit(); | ||
821 | break; | 833 | break; |
822 | case LINUX_SMP_IPI: | 834 | case LINUX_SMP_IPI: |
823 | switch ((int)arg_copy) { | 835 | switch ((int)arg_copy) { |
@@ -965,8 +977,11 @@ static void ipi_irq_dispatch(void) | |||
965 | 977 | ||
966 | static struct irqaction irq_ipi; | 978 | static struct irqaction irq_ipi; |
967 | 979 | ||
968 | static void setup_cross_vpe_interrupts(void) | 980 | static void setup_cross_vpe_interrupts(unsigned int nvpe) |
969 | { | 981 | { |
982 | if (nvpe < 1) | ||
983 | return; | ||
984 | |||
970 | if (!cpu_has_vint) | 985 | if (!cpu_has_vint) |
971 | panic("SMTC Kernel requires Vectored Interupt support"); | 986 | panic("SMTC Kernel requires Vectored Interupt support"); |
972 | 987 | ||
@@ -984,10 +999,17 @@ static void setup_cross_vpe_interrupts(void) | |||
984 | 999 | ||
985 | /* | 1000 | /* |
986 | * SMTC-specific hacks invoked from elsewhere in the kernel. | 1001 | * SMTC-specific hacks invoked from elsewhere in the kernel. |
1002 | * | ||
1003 | * smtc_ipi_replay is called from raw_local_irq_restore which is only ever | ||
1004 | * called with interrupts disabled. We do rely on interrupts being disabled | ||
1005 | * here because using spin_lock_irqsave()/spin_unlock_irqrestore() would | ||
1006 | * result in a recursive call to raw_local_irq_restore(). | ||
987 | */ | 1007 | */ |
988 | 1008 | ||
989 | void smtc_ipi_replay(void) | 1009 | static void __smtc_ipi_replay(void) |
990 | { | 1010 | { |
1011 | unsigned int cpu = smp_processor_id(); | ||
1012 | |||
991 | /* | 1013 | /* |
992 | * To the extent that we've ever turned interrupts off, | 1014 | * To the extent that we've ever turned interrupts off, |
993 | * we may have accumulated deferred IPIs. This is subtle. | 1015 | * we may have accumulated deferred IPIs. This is subtle. |
@@ -1002,17 +1024,30 @@ void smtc_ipi_replay(void) | |||
1002 | * is clear, and we'll handle it as a real pseudo-interrupt | 1024 | * is clear, and we'll handle it as a real pseudo-interrupt |
1003 | * and not a pseudo-pseudo interrupt. | 1025 | * and not a pseudo-pseudo interrupt. |
1004 | */ | 1026 | */ |
1005 | if (IPIQ[smp_processor_id()].depth > 0) { | 1027 | if (IPIQ[cpu].depth > 0) { |
1006 | struct smtc_ipi *pipi; | 1028 | while (1) { |
1007 | extern void self_ipi(struct smtc_ipi *); | 1029 | struct smtc_ipi_q *q = &IPIQ[cpu]; |
1030 | struct smtc_ipi *pipi; | ||
1031 | extern void self_ipi(struct smtc_ipi *); | ||
1032 | |||
1033 | spin_lock(&q->lock); | ||
1034 | pipi = __smtc_ipi_dq(q); | ||
1035 | spin_unlock(&q->lock); | ||
1036 | if (!pipi) | ||
1037 | break; | ||
1008 | 1038 | ||
1009 | while ((pipi = smtc_ipi_dq(&IPIQ[smp_processor_id()]))) { | ||
1010 | self_ipi(pipi); | 1039 | self_ipi(pipi); |
1011 | smtc_cpu_stats[smp_processor_id()].selfipis++; | 1040 | smtc_cpu_stats[cpu].selfipis++; |
1012 | } | 1041 | } |
1013 | } | 1042 | } |
1014 | } | 1043 | } |
1015 | 1044 | ||
1045 | void smtc_ipi_replay(void) | ||
1046 | { | ||
1047 | raw_local_irq_disable(); | ||
1048 | __smtc_ipi_replay(); | ||
1049 | } | ||
1050 | |||
1016 | EXPORT_SYMBOL(smtc_ipi_replay); | 1051 | EXPORT_SYMBOL(smtc_ipi_replay); |
1017 | 1052 | ||
1018 | void smtc_idle_loop_hook(void) | 1053 | void smtc_idle_loop_hook(void) |
@@ -1117,7 +1152,13 @@ void smtc_idle_loop_hook(void) | |||
1117 | * is in use, there should never be any. | 1152 | * is in use, there should never be any. |
1118 | */ | 1153 | */ |
1119 | #ifndef CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY | 1154 | #ifndef CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY |
1120 | smtc_ipi_replay(); | 1155 | { |
1156 | unsigned long flags; | ||
1157 | |||
1158 | local_irq_save(flags); | ||
1159 | __smtc_ipi_replay(); | ||
1160 | local_irq_restore(flags); | ||
1161 | } | ||
1121 | #endif /* CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY */ | 1162 | #endif /* CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY */ |
1122 | } | 1163 | } |
1123 | 1164 | ||
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index 6f90e7ef66ac..f9c595dceba9 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c | |||
@@ -42,7 +42,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write, | |||
42 | siginfo_t info; | 42 | siginfo_t info; |
43 | 43 | ||
44 | #if 0 | 44 | #if 0 |
45 | printk("Cpu%d[%s:%d:%0*lx:%ld:%0*lx]\n", smp_processor_id(), | 45 | printk("Cpu%d[%s:%d:%0*lx:%ld:%0*lx]\n", raw_smp_processor_id(), |
46 | current->comm, current->pid, field, address, write, | 46 | current->comm, current->pid, field, address, write, |
47 | field, regs->cp0_epc); | 47 | field, regs->cp0_epc); |
48 | #endif | 48 | #endif |
@@ -165,7 +165,7 @@ no_context: | |||
165 | 165 | ||
166 | printk(KERN_ALERT "CPU %d Unable to handle kernel paging request at " | 166 | printk(KERN_ALERT "CPU %d Unable to handle kernel paging request at " |
167 | "virtual address %0*lx, epc == %0*lx, ra == %0*lx\n", | 167 | "virtual address %0*lx, epc == %0*lx, ra == %0*lx\n", |
168 | smp_processor_id(), field, address, field, regs->cp0_epc, | 168 | raw_smp_processor_id(), field, address, field, regs->cp0_epc, |
169 | field, regs->regs[31]); | 169 | field, regs->regs[31]); |
170 | die("Oops", regs); | 170 | die("Oops", regs); |
171 | 171 | ||
@@ -228,7 +228,7 @@ vmalloc_fault: | |||
228 | pmd_t *pmd, *pmd_k; | 228 | pmd_t *pmd, *pmd_k; |
229 | pte_t *pte_k; | 229 | pte_t *pte_k; |
230 | 230 | ||
231 | pgd = (pgd_t *) pgd_current[smp_processor_id()] + offset; | 231 | pgd = (pgd_t *) pgd_current[raw_smp_processor_id()] + offset; |
232 | pgd_k = init_mm.pgd + offset; | 232 | pgd_k = init_mm.pgd + offset; |
233 | 233 | ||
234 | if (!pgd_present(*pgd_k)) | 234 | if (!pgd_present(*pgd_k)) |
diff --git a/arch/mips/pci/pci-ev64120.c b/arch/mips/pci/pci-ev64120.c index 9cd859ef1842..a84f594b5a18 100644 --- a/arch/mips/pci/pci-ev64120.c +++ b/arch/mips/pci/pci-ev64120.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <linux/pci.h> | 1 | #include <linux/pci.h> |
2 | #include <asm/irq.h> | ||
2 | 3 | ||
3 | int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | 4 | int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) |
4 | { | 5 | { |
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c index 20af0f1bb7bf..ba0c4b776c85 100644 --- a/arch/mips/sibyte/bcm1480/irq.c +++ b/arch/mips/sibyte/bcm1480/irq.c | |||
@@ -141,11 +141,11 @@ static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask) | |||
141 | unsigned long flags; | 141 | unsigned long flags; |
142 | unsigned int irq_dirty; | 142 | unsigned int irq_dirty; |
143 | 143 | ||
144 | i = first_cpu(mask); | 144 | if (cpus_weight(mask) != 1) { |
145 | if (next_cpu(i, mask) <= NR_CPUS) { | ||
146 | printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq); | 145 | printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq); |
147 | return; | 146 | return; |
148 | } | 147 | } |
148 | i = first_cpu(mask); | ||
149 | 149 | ||
150 | /* Convert logical CPU to physical CPU */ | 150 | /* Convert logical CPU to physical CPU */ |
151 | cpu = cpu_logical_map(i); | 151 | cpu = cpu_logical_map(i); |
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c index e3d71e083f35..43f6cc9d7ea0 100644 --- a/arch/powerpc/sysdev/qe_lib/qe.c +++ b/arch/powerpc/sysdev/qe_lib/qe.c | |||
@@ -251,13 +251,13 @@ static int qe_sdma_init(void) | |||
251 | 251 | ||
252 | /* allocate 2 internal temporary buffers (512 bytes size each) for | 252 | /* allocate 2 internal temporary buffers (512 bytes size each) for |
253 | * the SDMA */ | 253 | * the SDMA */ |
254 | sdma_buf_offset = qe_muram_alloc(512 * 2, 64); | 254 | sdma_buf_offset = qe_muram_alloc(512 * 2, 4096); |
255 | if (IS_MURAM_ERR(sdma_buf_offset)) | 255 | if (IS_MURAM_ERR(sdma_buf_offset)) |
256 | return -ENOMEM; | 256 | return -ENOMEM; |
257 | 257 | ||
258 | out_be32(&sdma->sdebcr, sdma_buf_offset & QE_SDEBCR_BA_MASK); | 258 | out_be32(&sdma->sdebcr, sdma_buf_offset & QE_SDEBCR_BA_MASK); |
259 | out_be32(&sdma->sdmr, (QE_SDMR_GLB_1_MSK | (0x1 >> | 259 | out_be32(&sdma->sdmr, (QE_SDMR_GLB_1_MSK | |
260 | QE_SDMR_CEN_SHIFT))); | 260 | (0x1 << QE_SDMR_CEN_SHIFT))); |
261 | 261 | ||
262 | return 0; | 262 | return 0; |
263 | } | 263 | } |
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index 7b8baf146acc..9fdfad649536 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c | |||
@@ -236,11 +236,11 @@ void free_irqs(void) | |||
236 | struct chan *chan; | 236 | struct chan *chan; |
237 | LIST_HEAD(list); | 237 | LIST_HEAD(list); |
238 | struct list_head *ele; | 238 | struct list_head *ele; |
239 | unsigned long flags; | ||
239 | 240 | ||
240 | spin_lock_irq(&irqs_to_free_lock); | 241 | spin_lock_irqsave(&irqs_to_free_lock, flags); |
241 | list_splice_init(&irqs_to_free, &list); | 242 | list_splice_init(&irqs_to_free, &list); |
242 | INIT_LIST_HEAD(&irqs_to_free); | 243 | spin_unlock_irqrestore(&irqs_to_free_lock, flags); |
243 | spin_unlock_irq(&irqs_to_free_lock); | ||
244 | 244 | ||
245 | list_for_each(ele, &list){ | 245 | list_for_each(ele, &list){ |
246 | chan = list_entry(ele, struct chan, free_list); | 246 | chan = list_entry(ele, struct chan, free_list); |
@@ -255,13 +255,15 @@ void free_irqs(void) | |||
255 | 255 | ||
256 | static void close_one_chan(struct chan *chan, int delay_free_irq) | 256 | static void close_one_chan(struct chan *chan, int delay_free_irq) |
257 | { | 257 | { |
258 | unsigned long flags; | ||
259 | |||
258 | if(!chan->opened) | 260 | if(!chan->opened) |
259 | return; | 261 | return; |
260 | 262 | ||
261 | if(delay_free_irq){ | 263 | if(delay_free_irq){ |
262 | spin_lock_irq(&irqs_to_free_lock); | 264 | spin_lock_irqsave(&irqs_to_free_lock, flags); |
263 | list_add(&chan->free_list, &irqs_to_free); | 265 | list_add(&chan->free_list, &irqs_to_free); |
264 | spin_unlock_irq(&irqs_to_free_lock); | 266 | spin_unlock_irqrestore(&irqs_to_free_lock, flags); |
265 | } | 267 | } |
266 | else { | 268 | else { |
267 | if(chan->input) | 269 | if(chan->input) |
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index 178b2eff4a8c..65ad2932672c 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c | |||
@@ -615,6 +615,9 @@ void mconsole_remove(struct mc_request *req) | |||
615 | err_msg = NULL; | 615 | err_msg = NULL; |
616 | err = (*dev->remove)(n, &err_msg); | 616 | err = (*dev->remove)(n, &err_msg); |
617 | switch(err){ | 617 | switch(err){ |
618 | case 0: | ||
619 | err_msg = ""; | ||
620 | break; | ||
618 | case -ENODEV: | 621 | case -ENODEV: |
619 | if(err_msg == NULL) | 622 | if(err_msg == NULL) |
620 | err_msg = "Device doesn't exist"; | 623 | err_msg = "Device doesn't exist"; |
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index f98d26e51381..8bd9204ac1ab 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
@@ -109,10 +109,6 @@ static inline void ubd_set_bit(__u64 bit, unsigned char *data) | |||
109 | 109 | ||
110 | static DEFINE_MUTEX(ubd_lock); | 110 | static DEFINE_MUTEX(ubd_lock); |
111 | 111 | ||
112 | /* XXX - this made sense in 2.4 days, now it's only used as a boolean, and | ||
113 | * probably it doesn't make sense even for that. */ | ||
114 | static int do_ubd; | ||
115 | |||
116 | static int ubd_open(struct inode * inode, struct file * filp); | 112 | static int ubd_open(struct inode * inode, struct file * filp); |
117 | static int ubd_release(struct inode * inode, struct file * file); | 113 | static int ubd_release(struct inode * inode, struct file * file); |
118 | static int ubd_ioctl(struct inode * inode, struct file * file, | 114 | static int ubd_ioctl(struct inode * inode, struct file * file, |
@@ -169,6 +165,7 @@ struct ubd { | |||
169 | struct platform_device pdev; | 165 | struct platform_device pdev; |
170 | struct request_queue *queue; | 166 | struct request_queue *queue; |
171 | spinlock_t lock; | 167 | spinlock_t lock; |
168 | int active; | ||
172 | }; | 169 | }; |
173 | 170 | ||
174 | #define DEFAULT_COW { \ | 171 | #define DEFAULT_COW { \ |
@@ -190,6 +187,7 @@ struct ubd { | |||
190 | .shared = 0, \ | 187 | .shared = 0, \ |
191 | .cow = DEFAULT_COW, \ | 188 | .cow = DEFAULT_COW, \ |
192 | .lock = SPIN_LOCK_UNLOCKED, \ | 189 | .lock = SPIN_LOCK_UNLOCKED, \ |
190 | .active = 0, \ | ||
193 | } | 191 | } |
194 | 192 | ||
195 | /* Protected by ubd_lock */ | 193 | /* Protected by ubd_lock */ |
@@ -507,7 +505,6 @@ static void ubd_handler(void) | |||
507 | struct ubd *dev; | 505 | struct ubd *dev; |
508 | int n; | 506 | int n; |
509 | 507 | ||
510 | do_ubd = 0; | ||
511 | n = os_read_file(thread_fd, &req, sizeof(req)); | 508 | n = os_read_file(thread_fd, &req, sizeof(req)); |
512 | if(n != sizeof(req)){ | 509 | if(n != sizeof(req)){ |
513 | printk(KERN_ERR "Pid %d - spurious interrupt in ubd_handler, " | 510 | printk(KERN_ERR "Pid %d - spurious interrupt in ubd_handler, " |
@@ -517,6 +514,7 @@ static void ubd_handler(void) | |||
517 | 514 | ||
518 | rq = req.req; | 515 | rq = req.req; |
519 | dev = rq->rq_disk->private_data; | 516 | dev = rq->rq_disk->private_data; |
517 | dev->active = 0; | ||
520 | 518 | ||
521 | ubd_finish(rq, req.error); | 519 | ubd_finish(rq, req.error); |
522 | reactivate_fd(thread_fd, UBD_IRQ); | 520 | reactivate_fd(thread_fd, UBD_IRQ); |
@@ -1081,11 +1079,12 @@ static void do_ubd_request(request_queue_t *q) | |||
1081 | } | 1079 | } |
1082 | } | 1080 | } |
1083 | else { | 1081 | else { |
1084 | if(do_ubd || (req = elv_next_request(q)) == NULL) | 1082 | struct ubd *dev = q->queuedata; |
1083 | if(dev->active || (req = elv_next_request(q)) == NULL) | ||
1085 | return; | 1084 | return; |
1086 | err = prepare_request(req, &io_req); | 1085 | err = prepare_request(req, &io_req); |
1087 | if(!err){ | 1086 | if(!err){ |
1088 | do_ubd = 1; | 1087 | dev->active = 1; |
1089 | n = os_write_file(thread_fd, (char *) &io_req, | 1088 | n = os_write_file(thread_fd, (char *) &io_req, |
1090 | sizeof(io_req)); | 1089 | sizeof(io_req)); |
1091 | if(n != sizeof(io_req)) | 1090 | if(n != sizeof(io_req)) |
diff --git a/arch/um/include/mconsole.h b/arch/um/include/mconsole.h index 2666815b6af5..b282839c1625 100644 --- a/arch/um/include/mconsole.h +++ b/arch/um/include/mconsole.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #define u32 uint32_t | 12 | #define u32 uint32_t |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #include "sysdep/ptrace.h" | ||
16 | |||
15 | #define MCONSOLE_MAGIC (0xcafebabe) | 17 | #define MCONSOLE_MAGIC (0xcafebabe) |
16 | #define MCONSOLE_MAX_DATA (512) | 18 | #define MCONSOLE_MAX_DATA (512) |
17 | #define MCONSOLE_VERSION 2 | 19 | #define MCONSOLE_VERSION 2 |
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index e85d65deea0d..df7d662b98ce 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c | |||
@@ -64,8 +64,6 @@ static void setup_highmem(unsigned long highmem_start, | |||
64 | 64 | ||
65 | void mem_init(void) | 65 | void mem_init(void) |
66 | { | 66 | { |
67 | max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT; | ||
68 | |||
69 | /* clear the zero-page */ | 67 | /* clear the zero-page */ |
70 | memset((void *) empty_zero_page, 0, PAGE_SIZE); | 68 | memset((void *) empty_zero_page, 0, PAGE_SIZE); |
71 | 69 | ||
@@ -80,6 +78,7 @@ void mem_init(void) | |||
80 | 78 | ||
81 | /* this will put all low memory onto the freelists */ | 79 | /* this will put all low memory onto the freelists */ |
82 | totalram_pages = free_all_bootmem(); | 80 | totalram_pages = free_all_bootmem(); |
81 | max_low_pfn = totalram_pages; | ||
83 | #ifdef CONFIG_HIGHMEM | 82 | #ifdef CONFIG_HIGHMEM |
84 | totalhigh_pages = highmem >> PAGE_SHIFT; | 83 | totalhigh_pages = highmem >> PAGE_SHIFT; |
85 | totalram_pages += totalhigh_pages; | 84 | totalram_pages += totalhigh_pages; |
diff --git a/arch/um/sys-i386/ldt.c b/arch/um/sys-i386/ldt.c index 4a8b4202ef9e..a939a7ef0227 100644 --- a/arch/um/sys-i386/ldt.c +++ b/arch/um/sys-i386/ldt.c | |||
@@ -394,7 +394,8 @@ static short * host_ldt_entries = NULL; | |||
394 | static void ldt_get_host_info(void) | 394 | static void ldt_get_host_info(void) |
395 | { | 395 | { |
396 | long ret; | 396 | long ret; |
397 | struct ldt_entry * ldt, *tmp; | 397 | struct ldt_entry * ldt; |
398 | short *tmp; | ||
398 | int i, size, k, order; | 399 | int i, size, k, order; |
399 | 400 | ||
400 | spin_lock(&host_ldt_lock); | 401 | spin_lock(&host_ldt_lock); |
diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c index 21d95b747437..489426682772 100644 --- a/arch/x86_64/kernel/i8259.c +++ b/arch/x86_64/kernel/i8259.c | |||
@@ -45,7 +45,7 @@ | |||
45 | 45 | ||
46 | /* | 46 | /* |
47 | * ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts: | 47 | * ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts: |
48 | * (these are usually mapped to vectors 0x20-0x2f) | 48 | * (these are usually mapped to vectors 0x30-0x3f) |
49 | */ | 49 | */ |
50 | 50 | ||
51 | /* | 51 | /* |
@@ -299,7 +299,7 @@ void init_8259A(int auto_eoi) | |||
299 | * outb_p - this has to work on a wide range of PC hardware. | 299 | * outb_p - this has to work on a wide range of PC hardware. |
300 | */ | 300 | */ |
301 | outb_p(0x11, 0x20); /* ICW1: select 8259A-1 init */ | 301 | outb_p(0x11, 0x20); /* ICW1: select 8259A-1 init */ |
302 | outb_p(IRQ0_VECTOR, 0x21); /* ICW2: 8259A-1 IR0-7 mapped to 0x20-0x27 */ | 302 | outb_p(IRQ0_VECTOR, 0x21); /* ICW2: 8259A-1 IR0-7 mapped to 0x30-0x37 */ |
303 | outb_p(0x04, 0x21); /* 8259A-1 (the master) has a slave on IR2 */ | 303 | outb_p(0x04, 0x21); /* 8259A-1 (the master) has a slave on IR2 */ |
304 | if (auto_eoi) | 304 | if (auto_eoi) |
305 | outb_p(0x03, 0x21); /* master does Auto EOI */ | 305 | outb_p(0x03, 0x21); /* master does Auto EOI */ |
@@ -307,7 +307,7 @@ void init_8259A(int auto_eoi) | |||
307 | outb_p(0x01, 0x21); /* master expects normal EOI */ | 307 | outb_p(0x01, 0x21); /* master expects normal EOI */ |
308 | 308 | ||
309 | outb_p(0x11, 0xA0); /* ICW1: select 8259A-2 init */ | 309 | outb_p(0x11, 0xA0); /* ICW1: select 8259A-2 init */ |
310 | outb_p(IRQ8_VECTOR, 0xA1); /* ICW2: 8259A-2 IR0-7 mapped to 0x28-0x2f */ | 310 | outb_p(IRQ8_VECTOR, 0xA1); /* ICW2: 8259A-2 IR0-7 mapped to 0x38-0x3f */ |
311 | outb_p(0x02, 0xA1); /* 8259A-2 is a slave on master's IR2 */ | 311 | outb_p(0x02, 0xA1); /* 8259A-2 is a slave on master's IR2 */ |
312 | outb_p(0x01, 0xA1); /* (slave's support for AEOI in flat mode | 312 | outb_p(0x01, 0xA1); /* (slave's support for AEOI in flat mode |
313 | is to be investigated) */ | 313 | is to be investigated) */ |