Commit a5cb2366fba7b34da285ef627ee44472235d5bee

Authored by Linus Torvalds

Merge tag 'nios2-fixes-v3.19-rc3' of git://git.rocketboards.org/linux-socfpga-next

Pull arch/nios2 fixes from Ley Foon Tan:

 - fix compilation error when enable CONFIG_PREEMPT

 - initialize cpuinfo.mmu variable supplied by the device tree

* tag 'nios2-fixes-v3.19-rc3' of git://git.rocketboards.org/linux-socfpga-next:
  nios2: Use preempt_schedule_irq
  nios2: Initialize cpuinfo.mmu

Showing 2 changed files Side-by-side Diff

arch/nios2/kernel/cpuinfo.c
... ... @@ -72,6 +72,7 @@
72 72 cpuinfo.has_div = fcpu_has(cpu, "altr,has-div");
73 73 cpuinfo.has_mul = fcpu_has(cpu, "altr,has-mul");
74 74 cpuinfo.has_mulx = fcpu_has(cpu, "altr,has-mulx");
  75 + cpuinfo.mmu = fcpu_has(cpu, "altr,has-mmu");
75 76  
76 77 if (IS_ENABLED(CONFIG_NIOS2_HW_DIV_SUPPORT) && !cpuinfo.has_div)
77 78 err_cpu("DIV");
arch/nios2/kernel/entry.S
... ... @@ -365,30 +365,14 @@
365 365 GET_THREAD_INFO r1
366 366 ldw r4, TI_PREEMPT_COUNT(r1)
367 367 bne r4, r0, restore_all
368   -
369   -need_resched:
370 368 ldw r4, TI_FLAGS(r1) /* ? Need resched set */
371 369 BTBZ r10, r4, TIF_NEED_RESCHED, restore_all
372 370 ldw r4, PT_ESTATUS(sp) /* ? Interrupts off */
373 371 andi r10, r4, ESTATUS_EPIE
374 372 beq r10, r0, restore_all
375   - movia r4, PREEMPT_ACTIVE
376   - stw r4, TI_PREEMPT_COUNT(r1)
377   - rdctl r10, status /* enable intrs again */
378   - ori r10, r10 ,STATUS_PIE
379   - wrctl status, r10
380   - PUSH r1
381   - call schedule
382   - POP r1
383   - mov r4, r0
384   - stw r4, TI_PREEMPT_COUNT(r1)
385   - rdctl r10, status /* disable intrs */
386   - andi r10, r10, %lo(~STATUS_PIE)
387   - wrctl status, r10
388   - br need_resched
389   -#else
390   - br restore_all
  373 + call preempt_schedule_irq
391 374 #endif
  375 + br restore_all
392 376  
393 377 /***********************************************************************
394 378 * A few syscall wrappers