diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-15 17:45:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-15 17:45:52 -0400 |
commit | d8efd82eece89f8a5790b0febf17522affe9e1f1 (patch) | |
tree | f441f9070639e08734de38180027c6a32ebe6c53 | |
parent | cd619e21ea468b02af9eeed75eae2307ec7de1cb (diff) | |
parent | 1b4676330aa6782bd73ec24cb4896467475f29f5 (diff) |
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS fixes from Ralf Baechle:
"These are four patches for three construction sites:
- Fix register decoding for the combination of multi-core processors
and multi-threading.
- Two more fixes that are part of the ongoing DECstation resurrection
work. One of these touches a DECstation-only network driver.
- Finally Markos' trivial build fix for the AP/SP support.
(With this applied now all MIPS defconfigs are building again)"
* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
MIPS: kernel: vpe: Make vpe_attrs an array of pointers.
MIPS: Fix SMP core calculations when using MT support.
MIPS: DECstation I/O ASIC DMA interrupt handling fix
MIPS: DECstation HRT initialization rearrangement
-rw-r--r-- | arch/mips/dec/ioasic-irq.c | 8 | ||||
-rw-r--r-- | arch/mips/dec/time.c | 22 | ||||
-rw-r--r-- | arch/mips/include/asm/dec/ioasic.h | 4 | ||||
-rw-r--r-- | arch/mips/kernel/csrc-ioasic.c | 8 | ||||
-rw-r--r-- | arch/mips/kernel/smp-cmp.c | 13 | ||||
-rw-r--r-- | arch/mips/kernel/vpe.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/amd/declance.c | 1 |
7 files changed, 50 insertions, 8 deletions
diff --git a/arch/mips/dec/ioasic-irq.c b/arch/mips/dec/ioasic-irq.c index 824e08c73798..4b3e3a4375a6 100644 --- a/arch/mips/dec/ioasic-irq.c +++ b/arch/mips/dec/ioasic-irq.c | |||
@@ -51,6 +51,14 @@ static struct irq_chip ioasic_irq_type = { | |||
51 | .irq_unmask = unmask_ioasic_irq, | 51 | .irq_unmask = unmask_ioasic_irq, |
52 | }; | 52 | }; |
53 | 53 | ||
54 | void clear_ioasic_dma_irq(unsigned int irq) | ||
55 | { | ||
56 | u32 sir; | ||
57 | |||
58 | sir = ~(1 << (irq - ioasic_irq_base)); | ||
59 | ioasic_write(IO_REG_SIR, sir); | ||
60 | } | ||
61 | |||
54 | static struct irq_chip ioasic_dma_irq_type = { | 62 | static struct irq_chip ioasic_dma_irq_type = { |
55 | .name = "IO-ASIC-DMA", | 63 | .name = "IO-ASIC-DMA", |
56 | .irq_ack = ack_ioasic_irq, | 64 | .irq_ack = ack_ioasic_irq, |
diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c index 56ebc7f2bede..1914e56f0d96 100644 --- a/arch/mips/dec/time.c +++ b/arch/mips/dec/time.c | |||
@@ -125,12 +125,16 @@ int rtc_mips_set_mmss(unsigned long nowtime) | |||
125 | 125 | ||
126 | void __init plat_time_init(void) | 126 | void __init plat_time_init(void) |
127 | { | 127 | { |
128 | int ioasic_clock = 0; | ||
128 | u32 start, end; | 129 | u32 start, end; |
129 | int i = HZ / 8; | 130 | int i = HZ / 8; |
130 | 131 | ||
131 | /* Set up the rate of periodic DS1287 interrupts. */ | 132 | /* Set up the rate of periodic DS1287 interrupts. */ |
132 | ds1287_set_base_clock(HZ); | 133 | ds1287_set_base_clock(HZ); |
133 | 134 | ||
135 | /* On some I/O ASIC systems we have the I/O ASIC's counter. */ | ||
136 | if (IOASIC) | ||
137 | ioasic_clock = dec_ioasic_clocksource_init() == 0; | ||
134 | if (cpu_has_counter) { | 138 | if (cpu_has_counter) { |
135 | ds1287_timer_state(); | 139 | ds1287_timer_state(); |
136 | while (!ds1287_timer_state()) | 140 | while (!ds1287_timer_state()) |
@@ -147,9 +151,21 @@ void __init plat_time_init(void) | |||
147 | mips_hpt_frequency = (end - start) * 8; | 151 | mips_hpt_frequency = (end - start) * 8; |
148 | printk(KERN_INFO "MIPS counter frequency %dHz\n", | 152 | printk(KERN_INFO "MIPS counter frequency %dHz\n", |
149 | mips_hpt_frequency); | 153 | mips_hpt_frequency); |
150 | } else if (IOASIC) | 154 | |
151 | /* For pre-R4k systems we use the I/O ASIC's counter. */ | 155 | /* |
152 | dec_ioasic_clocksource_init(); | 156 | * All R4k DECstations suffer from the CP0 Count erratum, |
157 | * so we can't use the timer as a clock source, and a clock | ||
158 | * event both at a time. An accurate wall clock is more | ||
159 | * important than a high-precision interval timer so only | ||
160 | * use the timer as a clock source, and not a clock event | ||
161 | * if there's no I/O ASIC counter available to serve as a | ||
162 | * clock source. | ||
163 | */ | ||
164 | if (!ioasic_clock) { | ||
165 | init_r4k_clocksource(); | ||
166 | mips_hpt_frequency = 0; | ||
167 | } | ||
168 | } | ||
153 | 169 | ||
154 | ds1287_clockevent_init(dec_interrupt[DEC_IRQ_RTC]); | 170 | ds1287_clockevent_init(dec_interrupt[DEC_IRQ_RTC]); |
155 | } | 171 | } |
diff --git a/arch/mips/include/asm/dec/ioasic.h b/arch/mips/include/asm/dec/ioasic.h index 98badd6bf22d..a6e505a0e44b 100644 --- a/arch/mips/include/asm/dec/ioasic.h +++ b/arch/mips/include/asm/dec/ioasic.h | |||
@@ -31,8 +31,10 @@ static inline u32 ioasic_read(unsigned int reg) | |||
31 | return ioasic_base[reg / 4]; | 31 | return ioasic_base[reg / 4]; |
32 | } | 32 | } |
33 | 33 | ||
34 | extern void clear_ioasic_dma_irq(unsigned int irq); | ||
35 | |||
34 | extern void init_ioasic_irqs(int base); | 36 | extern void init_ioasic_irqs(int base); |
35 | 37 | ||
36 | extern void dec_ioasic_clocksource_init(void); | 38 | extern int dec_ioasic_clocksource_init(void); |
37 | 39 | ||
38 | #endif /* __ASM_DEC_IOASIC_H */ | 40 | #endif /* __ASM_DEC_IOASIC_H */ |
diff --git a/arch/mips/kernel/csrc-ioasic.c b/arch/mips/kernel/csrc-ioasic.c index 87e88feb4a25..6cbbf6e106b9 100644 --- a/arch/mips/kernel/csrc-ioasic.c +++ b/arch/mips/kernel/csrc-ioasic.c | |||
@@ -37,7 +37,7 @@ static struct clocksource clocksource_dec = { | |||
37 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 37 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
38 | }; | 38 | }; |
39 | 39 | ||
40 | void __init dec_ioasic_clocksource_init(void) | 40 | int __init dec_ioasic_clocksource_init(void) |
41 | { | 41 | { |
42 | unsigned int freq; | 42 | unsigned int freq; |
43 | u32 start, end; | 43 | u32 start, end; |
@@ -56,8 +56,14 @@ void __init dec_ioasic_clocksource_init(void) | |||
56 | end = dec_ioasic_hpt_read(&clocksource_dec); | 56 | end = dec_ioasic_hpt_read(&clocksource_dec); |
57 | 57 | ||
58 | freq = (end - start) * 8; | 58 | freq = (end - start) * 8; |
59 | |||
60 | /* An early revision of the I/O ASIC didn't have the counter. */ | ||
61 | if (!freq) | ||
62 | return -ENXIO; | ||
63 | |||
59 | printk(KERN_INFO "I/O ASIC clock frequency %dHz\n", freq); | 64 | printk(KERN_INFO "I/O ASIC clock frequency %dHz\n", freq); |
60 | 65 | ||
61 | clocksource_dec.rating = 200 + freq / 10000000; | 66 | clocksource_dec.rating = 200 + freq / 10000000; |
62 | clocksource_register_hz(&clocksource_dec, freq); | 67 | clocksource_register_hz(&clocksource_dec, freq); |
68 | return 0; | ||
63 | } | 69 | } |
diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c index c2e5d74739b4..5969f1e9b62a 100644 --- a/arch/mips/kernel/smp-cmp.c +++ b/arch/mips/kernel/smp-cmp.c | |||
@@ -99,7 +99,9 @@ static void cmp_init_secondary(void) | |||
99 | 99 | ||
100 | c->core = (read_c0_ebase() >> 1) & 0x1ff; | 100 | c->core = (read_c0_ebase() >> 1) & 0x1ff; |
101 | #if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC) | 101 | #if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC) |
102 | c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE; | 102 | if (cpu_has_mipsmt) |
103 | c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & | ||
104 | TCBIND_CURVPE; | ||
103 | #endif | 105 | #endif |
104 | #ifdef CONFIG_MIPS_MT_SMTC | 106 | #ifdef CONFIG_MIPS_MT_SMTC |
105 | c->tc_id = (read_c0_tcbind() & TCBIND_CURTC) >> TCBIND_CURTC_SHIFT; | 107 | c->tc_id = (read_c0_tcbind() & TCBIND_CURTC) >> TCBIND_CURTC_SHIFT; |
@@ -177,9 +179,16 @@ void __init cmp_smp_setup(void) | |||
177 | } | 179 | } |
178 | 180 | ||
179 | if (cpu_has_mipsmt) { | 181 | if (cpu_has_mipsmt) { |
180 | unsigned int nvpe, mvpconf0 = read_c0_mvpconf0(); | 182 | unsigned int nvpe = 1; |
183 | #ifdef CONFIG_MIPS_MT_SMP | ||
184 | unsigned int mvpconf0 = read_c0_mvpconf0(); | ||
185 | |||
186 | nvpe = ((mvpconf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT) + 1; | ||
187 | #elif defined(CONFIG_MIPS_MT_SMTC) | ||
188 | unsigned int mvpconf0 = read_c0_mvpconf0(); | ||
181 | 189 | ||
182 | nvpe = ((mvpconf0 & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1; | 190 | nvpe = ((mvpconf0 & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1; |
191 | #endif | ||
183 | smp_num_siblings = nvpe; | 192 | smp_num_siblings = nvpe; |
184 | } | 193 | } |
185 | pr_info("Detected %i available secondary CPU(s)\n", ncpu); | 194 | pr_info("Detected %i available secondary CPU(s)\n", ncpu); |
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index faf84c5f2629..59b2b3cd7885 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -1368,7 +1368,7 @@ out_einval: | |||
1368 | } | 1368 | } |
1369 | static DEVICE_ATTR_RW(ntcs); | 1369 | static DEVICE_ATTR_RW(ntcs); |
1370 | 1370 | ||
1371 | static struct attribute vpe_attrs[] = { | 1371 | static struct attribute *vpe_attrs[] = { |
1372 | &dev_attr_kill.attr, | 1372 | &dev_attr_kill.attr, |
1373 | &dev_attr_ntcs.attr, | 1373 | &dev_attr_ntcs.attr, |
1374 | NULL, | 1374 | NULL, |
diff --git a/drivers/net/ethernet/amd/declance.c b/drivers/net/ethernet/amd/declance.c index 3d86ffeb4e15..94edc9c6fbbf 100644 --- a/drivers/net/ethernet/amd/declance.c +++ b/drivers/net/ethernet/amd/declance.c | |||
@@ -725,6 +725,7 @@ static irqreturn_t lance_dma_merr_int(int irq, void *dev_id) | |||
725 | { | 725 | { |
726 | struct net_device *dev = dev_id; | 726 | struct net_device *dev = dev_id; |
727 | 727 | ||
728 | clear_ioasic_dma_irq(irq); | ||
728 | printk(KERN_ERR "%s: DMA error\n", dev->name); | 729 | printk(KERN_ERR "%s: DMA error\n", dev->name); |
729 | return IRQ_HANDLED; | 730 | return IRQ_HANDLED; |
730 | } | 731 | } |