Skip to content

Commit 18a022d

Browse files
committed
Merge tag 'for-3.7' of git://openrisc.net/jonas/linux
Pull OpenRISC updates from Jonas Bonn: "Fixups for some corner cases, build issues, and some obvious bugs in IRQ handling. No major changes." * tag 'for-3.7' of git://openrisc.net/jonas/linux: openrisc: mask interrupts in irq_mask_ack function openrisc: fix typos in comments and warnings openrisc: PIC should act on domain-local irqs openrisc: Make cpu_relax() invoke barrier() audit: define AUDIT_ARCH_OPENRISC openrisc: delay: fix handling of counter overflow openrisc: delay: fix loops calculation for __const_udelay
2 parents 02a650e + d23b579 commit 18a022d

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

arch/openrisc/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ extern unsigned long thread_saved_pc(struct task_struct *t);
103103

104104
#define init_stack (init_thread_union.stack)
105105

106-
#define cpu_relax() do { } while (0)
106+
#define cpu_relax() barrier()
107107

108108
#endif /* __ASSEMBLY__ */
109109
#endif /* __ASM_OPENRISC_PROCESSOR_H */

arch/openrisc/kernel/irq.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,19 @@ EXPORT_SYMBOL(arch_local_irq_restore);
4646

4747
static void or1k_pic_mask(struct irq_data *data)
4848
{
49-
mtspr(SPR_PICMR, mfspr(SPR_PICMR) & ~(1UL << data->irq));
49+
mtspr(SPR_PICMR, mfspr(SPR_PICMR) & ~(1UL << data->hwirq));
5050
}
5151

5252
static void or1k_pic_unmask(struct irq_data *data)
5353
{
54-
mtspr(SPR_PICMR, mfspr(SPR_PICMR) | (1UL << data->irq));
54+
mtspr(SPR_PICMR, mfspr(SPR_PICMR) | (1UL << data->hwirq));
5555
}
5656

5757
static void or1k_pic_ack(struct irq_data *data)
5858
{
5959
/* EDGE-triggered interrupts need to be ack'ed in order to clear
6060
* the latch.
61-
* LEVER-triggered interrupts do not need to be ack'ed; however,
61+
* LEVEL-triggered interrupts do not need to be ack'ed; however,
6262
* ack'ing the interrupt has no ill-effect and is quicker than
6363
* trying to figure out what type it is...
6464
*/
@@ -75,10 +75,10 @@ static void or1k_pic_ack(struct irq_data *data)
7575
* as opposed to a 1 as mandated by the spec
7676
*/
7777

78-
mtspr(SPR_PICSR, mfspr(SPR_PICSR) & ~(1UL << data->irq));
78+
mtspr(SPR_PICSR, mfspr(SPR_PICSR) & ~(1UL << data->hwirq));
7979
#else
80-
WARN(1, "Interrupt handling possibily broken\n");
81-
mtspr(SPR_PICSR, (1UL << irq));
80+
WARN(1, "Interrupt handling possibly broken\n");
81+
mtspr(SPR_PICSR, (1UL << data->hwirq));
8282
#endif
8383
}
8484

@@ -87,10 +87,12 @@ static void or1k_pic_mask_ack(struct irq_data *data)
8787
/* Comments for pic_ack apply here, too */
8888

8989
#ifdef CONFIG_OR1K_1200
90-
mtspr(SPR_PICSR, mfspr(SPR_PICSR) & ~(1UL << data->irq));
90+
mtspr(SPR_PICMR, mfspr(SPR_PICMR) & ~(1UL << data->hwirq));
91+
mtspr(SPR_PICSR, mfspr(SPR_PICSR) & ~(1UL << data->hwirq));
9192
#else
92-
WARN(1, "Interrupt handling possibily broken\n");
93-
mtspr(SPR_PICSR, (1UL << irq));
93+
WARN(1, "Interrupt handling possibly broken\n");
94+
mtspr(SPR_PICMR, (1UL << data->hwirq));
95+
mtspr(SPR_PICSR, (1UL << data->hwirq));
9496
#endif
9597
}
9698

arch/openrisc/kernel/ptrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
187187
*/
188188
ret = -1L;
189189

190-
audit_syscall_entry(audit_arch(), regs->gpr[11],
190+
audit_syscall_entry(AUDIT_ARCH_OPENRISC, regs->gpr[11],
191191
regs->gpr[3], regs->gpr[4],
192192
regs->gpr[5], regs->gpr[6]);
193193

arch/openrisc/lib/delay.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ int __devinit read_current_timer(unsigned long *timer_value)
3030

3131
void __delay(unsigned long cycles)
3232
{
33-
cycles_t target = get_cycles() + cycles;
33+
cycles_t start = get_cycles();
3434

35-
while (get_cycles() < target)
35+
while ((get_cycles() - start) < cycles)
3636
cpu_relax();
3737
}
3838
EXPORT_SYMBOL(__delay);
@@ -41,7 +41,7 @@ inline void __const_udelay(unsigned long xloops)
4141
{
4242
unsigned long long loops;
4343

44-
loops = xloops * loops_per_jiffy * HZ;
44+
loops = (unsigned long long)xloops * loops_per_jiffy * HZ;
4545

4646
__delay(loops >> 32);
4747
}

include/linux/audit.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ enum {
337337
#define AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE)
338338
#define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
339339
#define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
340+
#define AUDIT_ARCH_OPENRISC (EM_OPENRISC)
340341
#define AUDIT_ARCH_PARISC (EM_PARISC)
341342
#define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)
342343
#define AUDIT_ARCH_PPC (EM_PPC)

0 commit comments

Comments
 (0)