diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-09-14 17:00:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-09-14 17:00:35 -0400 |
commit | 7eeac505d912cfe5805290f8f9e293b134e00237 (patch) | |
tree | 32b1e61bd01e390d4db24fba5ca941580c6db8ba | |
parent | 22d95b1282810f5af599ee292b3fc443aefbdad0 (diff) | |
parent | 50da469a79fa2152d824f25f5ad5962f4af4343d (diff) |
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
[MIPS] 20Kc: Disable use of WAIT instruction.
[MIPS] Workaround for 4Kc machine check exception
[MIPS] Malta: Fix off by one bug in interrupt handler.
[MIPS] No ide_default_io_base() if PCI IDE was not found
[MIPS] Add #include <linux/profile.h> to arch/mips/kernel/time.c
[MIPS] N32 needs to use compat_sys_futimesat
[MIPS] rtlx: Fix build error.
[MIPS] rtlx: fix int vs. long bug.
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 9 | ||||
-rw-r--r-- | arch/mips/kernel/rtlx.c | 4 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-n32.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/time.c | 1 | ||||
-rw-r--r-- | arch/mips/mips-boards/malta/malta_int.c | 2 | ||||
-rw-r--r-- | arch/mips/mm/tlbex.c | 26 | ||||
-rw-r--r-- | include/asm-mips/mach-generic/ide.h | 31 |
7 files changed, 68 insertions, 7 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 06448a9656dc..3e004161ebd5 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -199,7 +199,14 @@ static inline void check_wait(void) | |||
199 | if ((c->processor_id & 0xff) <= 0x64) | 199 | if ((c->processor_id & 0xff) <= 0x64) |
200 | break; | 200 | break; |
201 | 201 | ||
202 | cpu_wait = r4k_wait; | 202 | /* |
203 | * Another rev is incremeting c0_count at a reduced clock | ||
204 | * rate while in WAIT mode. So we basically have the choice | ||
205 | * between using the cp0 timer as clocksource or avoiding | ||
206 | * the WAIT instruction. Until more details are known, | ||
207 | * disable the use of WAIT for 20Kc entirely. | ||
208 | cpu_wait = r4k_wait; | ||
209 | */ | ||
203 | break; | 210 | break; |
204 | case CPU_RM9000: | 211 | case CPU_RM9000: |
205 | if ((c->processor_id & 0x00ff) >= 0x40) | 212 | if ((c->processor_id & 0x00ff) >= 0x40) |
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index aab89e97abb5..1ba00c15505b 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c | |||
@@ -56,8 +56,6 @@ static struct chan_waitqueues { | |||
56 | struct mutex mutex; | 56 | struct mutex mutex; |
57 | } channel_wqs[RTLX_CHANNELS]; | 57 | } channel_wqs[RTLX_CHANNELS]; |
58 | 58 | ||
59 | static struct irqaction irq; | ||
60 | static int irq_num; | ||
61 | static struct vpe_notifications notify; | 59 | static struct vpe_notifications notify; |
62 | static int sp_stopping = 0; | 60 | static int sp_stopping = 0; |
63 | 61 | ||
@@ -111,7 +109,7 @@ static void __used dump_rtlx(void) | |||
111 | static int rtlx_init(struct rtlx_info *rtlxi) | 109 | static int rtlx_init(struct rtlx_info *rtlxi) |
112 | { | 110 | { |
113 | if (rtlxi->id != RTLX_ID) { | 111 | if (rtlxi->id != RTLX_ID) { |
114 | printk(KERN_ERR "no valid RTLX id at 0x%p 0x%x\n", rtlxi, rtlxi->id); | 112 | printk(KERN_ERR "no valid RTLX id at 0x%p 0x%lx\n", rtlxi, rtlxi->id); |
115 | return -ENOEXEC; | 113 | return -ENOEXEC; |
116 | } | 114 | } |
117 | 115 | ||
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 53d7a977193c..118be24224f2 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -375,7 +375,7 @@ EXPORT(sysn32_call_table) | |||
375 | PTR sys_mkdirat | 375 | PTR sys_mkdirat |
376 | PTR sys_mknodat | 376 | PTR sys_mknodat |
377 | PTR sys_fchownat | 377 | PTR sys_fchownat |
378 | PTR sys_futimesat /* 6255 */ | 378 | PTR compat_sys_futimesat /* 6255 */ |
379 | PTR sys_newfstatat | 379 | PTR sys_newfstatat |
380 | PTR sys_unlinkat | 380 | PTR sys_unlinkat |
381 | PTR sys_renameat | 381 | PTR sys_renameat |
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index d48d1d5bea0a..9a5596bf8571 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
18 | #include <linux/param.h> | 18 | #include <linux/param.h> |
19 | #include <linux/profile.h> | ||
19 | #include <linux/time.h> | 20 | #include <linux/time.h> |
20 | #include <linux/timex.h> | 21 | #include <linux/timex.h> |
21 | #include <linux/smp.h> | 22 | #include <linux/smp.h> |
diff --git a/arch/mips/mips-boards/malta/malta_int.c b/arch/mips/mips-boards/malta/malta_int.c index 97aeb8c4e601..b73f21823c5e 100644 --- a/arch/mips/mips-boards/malta/malta_int.c +++ b/arch/mips/mips-boards/malta/malta_int.c | |||
@@ -256,7 +256,7 @@ asmlinkage void plat_irq_dispatch(void) | |||
256 | 256 | ||
257 | if (irq == MIPSCPU_INT_I8259A) | 257 | if (irq == MIPSCPU_INT_I8259A) |
258 | malta_hw0_irqdispatch(); | 258 | malta_hw0_irqdispatch(); |
259 | else if (irq > 0) | 259 | else if (irq >= 0) |
260 | do_IRQ(MIPS_CPU_IRQ_BASE + irq); | 260 | do_IRQ(MIPS_CPU_IRQ_BASE + irq); |
261 | else | 261 | else |
262 | spurious_interrupt(); | 262 | spurious_interrupt(); |
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 9cb39644b6f1..6c425b052442 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -58,6 +58,21 @@ static __init int __maybe_unused r10000_llsc_war(void) | |||
58 | } | 58 | } |
59 | 59 | ||
60 | /* | 60 | /* |
61 | * Found by experiment: At least some revisions of the 4kc throw under | ||
62 | * some circumstances a machine check exception, triggered by invalid | ||
63 | * values in the index register. Delaying the tlbp instruction until | ||
64 | * after the next branch, plus adding an additional nop in front of | ||
65 | * tlbwi/tlbwr avoids the invalid index register values. Nobody knows | ||
66 | * why; it's not an issue caused by the core RTL. | ||
67 | * | ||
68 | */ | ||
69 | static __init int __attribute__((unused)) m4kc_tlbp_war(void) | ||
70 | { | ||
71 | return (current_cpu_data.processor_id & 0xffff00) == | ||
72 | (PRID_COMP_MIPS | PRID_IMP_4KC); | ||
73 | } | ||
74 | |||
75 | /* | ||
61 | * A little micro-assembler, intended for TLB refill handler | 76 | * A little micro-assembler, intended for TLB refill handler |
62 | * synthesizing. It is intentionally kept simple, does only support | 77 | * synthesizing. It is intentionally kept simple, does only support |
63 | * a subset of instructions, and does not try to hide pipeline effects | 78 | * a subset of instructions, and does not try to hide pipeline effects |
@@ -894,6 +909,8 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l, | |||
894 | case CPU_20KC: | 909 | case CPU_20KC: |
895 | case CPU_25KF: | 910 | case CPU_25KF: |
896 | case CPU_LOONGSON2: | 911 | case CPU_LOONGSON2: |
912 | if (m4kc_tlbp_war()) | ||
913 | i_nop(p); | ||
897 | tlbw(p); | 914 | tlbw(p); |
898 | break; | 915 | break; |
899 | 916 | ||
@@ -1705,7 +1722,8 @@ build_r4000_tlbchange_handler_head(u32 **p, struct label **l, | |||
1705 | l_smp_pgtable_change(l, *p); | 1722 | l_smp_pgtable_change(l, *p); |
1706 | # endif | 1723 | # endif |
1707 | iPTE_LW(p, l, pte, ptr); /* get even pte */ | 1724 | iPTE_LW(p, l, pte, ptr); /* get even pte */ |
1708 | build_tlb_probe_entry(p); | 1725 | if (!m4kc_tlbp_war()) |
1726 | build_tlb_probe_entry(p); | ||
1709 | } | 1727 | } |
1710 | 1728 | ||
1711 | static void __init | 1729 | static void __init |
@@ -1747,6 +1765,8 @@ static void __init build_r4000_tlb_load_handler(void) | |||
1747 | 1765 | ||
1748 | build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); | 1766 | build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); |
1749 | build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl); | 1767 | build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl); |
1768 | if (m4kc_tlbp_war()) | ||
1769 | build_tlb_probe_entry(&p); | ||
1750 | build_make_valid(&p, &r, K0, K1); | 1770 | build_make_valid(&p, &r, K0, K1); |
1751 | build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); | 1771 | build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); |
1752 | 1772 | ||
@@ -1781,6 +1801,8 @@ static void __init build_r4000_tlb_store_handler(void) | |||
1781 | 1801 | ||
1782 | build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); | 1802 | build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); |
1783 | build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs); | 1803 | build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs); |
1804 | if (m4kc_tlbp_war()) | ||
1805 | build_tlb_probe_entry(&p); | ||
1784 | build_make_write(&p, &r, K0, K1); | 1806 | build_make_write(&p, &r, K0, K1); |
1785 | build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); | 1807 | build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); |
1786 | 1808 | ||
@@ -1815,6 +1837,8 @@ static void __init build_r4000_tlb_modify_handler(void) | |||
1815 | 1837 | ||
1816 | build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); | 1838 | build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); |
1817 | build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm); | 1839 | build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm); |
1840 | if (m4kc_tlbp_war()) | ||
1841 | build_tlb_probe_entry(&p); | ||
1818 | /* Present and writable bits set, set accessed and dirty bits. */ | 1842 | /* Present and writable bits set, set accessed and dirty bits. */ |
1819 | build_make_write(&p, &r, K0, K1); | 1843 | build_make_write(&p, &r, K0, K1); |
1820 | build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); | 1844 | build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); |
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h index 2b928577be5d..a77128362a7d 100644 --- a/include/asm-mips/mach-generic/ide.h +++ b/include/asm-mips/mach-generic/ide.h | |||
@@ -29,6 +29,35 @@ | |||
29 | 29 | ||
30 | #define IDE_ARCH_OBSOLETE_DEFAULTS | 30 | #define IDE_ARCH_OBSOLETE_DEFAULTS |
31 | 31 | ||
32 | static __inline__ int ide_probe_legacy(void) | ||
33 | { | ||
34 | #ifdef CONFIG_PCI | ||
35 | struct pci_dev *dev; | ||
36 | /* | ||
37 | * This can be called on the ide_setup() path, super-early in | ||
38 | * boot. But the down_read() will enable local interrupts, | ||
39 | * which can cause some machines to crash. So here we detect | ||
40 | * and flag that situation and bail out early. | ||
41 | */ | ||
42 | if (no_pci_devices()) | ||
43 | return 0; | ||
44 | dev = pci_get_class(PCI_CLASS_BRIDGE_EISA << 8, NULL); | ||
45 | if (dev) | ||
46 | goto found; | ||
47 | dev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL); | ||
48 | if (dev) | ||
49 | goto found; | ||
50 | return 0; | ||
51 | found: | ||
52 | pci_dev_put(dev); | ||
53 | return 1; | ||
54 | #elif defined(CONFIG_EISA) || defined(CONFIG_ISA) | ||
55 | return 1; | ||
56 | #else | ||
57 | return 0; | ||
58 | #endif | ||
59 | } | ||
60 | |||
32 | static __inline__ int ide_default_irq(unsigned long base) | 61 | static __inline__ int ide_default_irq(unsigned long base) |
33 | { | 62 | { |
34 | switch (base) { | 63 | switch (base) { |
@@ -45,6 +74,8 @@ static __inline__ int ide_default_irq(unsigned long base) | |||
45 | 74 | ||
46 | static __inline__ unsigned long ide_default_io_base(int index) | 75 | static __inline__ unsigned long ide_default_io_base(int index) |
47 | { | 76 | { |
77 | if (!ide_probe_legacy()) | ||
78 | return 0; | ||
48 | /* | 79 | /* |
49 | * If PCI is present then it is not safe to poke around | 80 | * If PCI is present then it is not safe to poke around |
50 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are | 81 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are |