1. 23 4月, 2012 2 次提交
    • M
      m68k: Correct the Atari ALLOWINT definition · c6636005
      Mikael Pettersson 提交于
      Booting a 3.2, 3.3, or 3.4-rc4 kernel on an Atari using the
      `nfeth' ethernet device triggers a WARN_ONCE() in generic irq
      handling code on the first irq for that device:
      
      WARNING: at kernel/irq/handle.c:146 handle_irq_event_percpu+0x134/0x142()
      irq 3 handler nfeth_interrupt+0x0/0x194 enabled interrupts
      Modules linked in:
      Call Trace: [<000299b2>] warn_slowpath_common+0x48/0x6a
       [<000299c0>] warn_slowpath_common+0x56/0x6a
       [<00029a4c>] warn_slowpath_fmt+0x2a/0x32
       [<0005b34c>] handle_irq_event_percpu+0x134/0x142
       [<0005b34c>] handle_irq_event_percpu+0x134/0x142
       [<0000a584>] nfeth_interrupt+0x0/0x194
       [<001ba0a8>] schedule_preempt_disabled+0x0/0xc
       [<0005b37a>] handle_irq_event+0x20/0x2c
       [<0005add4>] generic_handle_irq+0x2c/0x3a
       [<00002ab6>] do_IRQ+0x20/0x32
       [<0000289e>] auto_irqhandler_fixup+0x4/0x6
       [<00003144>] cpu_idle+0x22/0x2e
       [<001b8a78>] printk+0x0/0x18
       [<0024d112>] start_kernel+0x37a/0x386
       [<0003021d>] __do_proc_dointvec+0xb1/0x366
       [<0003021d>] __do_proc_dointvec+0xb1/0x366
       [<0024c31e>] _sinittext+0x31e/0x9c0
      
      After invoking the irq's handler the kernel sees !irqs_disabled()
      and concludes that the handler erroneously enabled interrupts.
      
      However, debugging shows that !irqs_disabled() is true even before
      the handler is invoked, which indicates a problem in the platform
      code rather than the specific driver.
      
      The warning does not occur in 3.1 or older kernels.
      
      It turns out that the ALLOWINT definition for Atari is incorrect.
      
      The Atari definition of ALLOWINT is ~0x400, the stated purpose of
      that is to avoid taking HSYNC interrupts.  irqs_disabled() returns
      true if the 3-bit ipl & 4 is non-zero.  The nfeth interrupt runs at
      ipl 3 (it's autovector 3), but 3 & 4 is zero so irqs_disabled() is
      false, and the warning above is generated.
      
      When interrupts are explicitly disabled, ipl is set to 7.  When they
      are enabled, ipl is masked with ALLOWINT.  On Atari this will result
      in ipl = 3, which blocks interrupts at ipl 3 and below.  So how come
      nfeth interrupts at ipl 3 are received at all?  That's because ipl
      is reset to 2 by Atari-specific code in default_idle(), again with
      the stated purpose of blocking HSYNC interrupts.  This discrepancy
      means that ipl 3 can remain blocked for longer than intended.
      
      Both default_idle() and falcon_hblhandler() identify HSYNC with
      ipl 2, and the "Atari ST/.../F030 Hardware Register Listing" agrees,
      but ALLOWINT is defined as if HSYNC was ipl 3.
      
      [As an experiment I modified default_idle() to reset ipl to 3, and
      as expected that resulted in all nfeth interrupts being blocked.]
      
      The fix is simple: define ALLOWINT as ~0x500 instead.  This makes
      arch_local_irq_enable() consistent with default_idle(), and prevents
      the !irqs_disabled() problems for ipl 3 interrupts.
      
      Tested on Atari running in an Aranym VM.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Tested-by: Michael Schmitz <schmitzmic@googlemail.com> (on Falcon/CT60)
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      c6636005
    • G
      2712a643
  2. 30 12月, 2011 1 次提交
  3. 18 10月, 2011 1 次提交
    • G
      m68k: merge mmu and non-mmu include/asm/entry.h files · 61619b12
      Greg Ungerer 提交于
      The changes in the mmu version of entry.h (entry_mm.h) and the non-mmu
      version (entry_no.h) are not about the presence or use of an MMU at all.
      The main changes are to support the ColdFire processors. The code for
      trap entry and exit for all types of 68k processor outside coldfire is
      the same.
      
      So merge the files back to a single entry.h and share the common 68k
      entry/exit code. Some changes are required for the non-mmu entry
      handlers to adopt the differing macros for system call and interrupt
      entry, but this is quite strait forward. The changes for the ColdFire
      remove a couple of instructions for the separate a7 register case, and
      are no worse for the older single a7 register case.
      Signed-off-by: NGreg Ungerer <gerg@uclinux.org>
      61619b12
  4. 16 1月, 2009 1 次提交
    • S
      m68k,m68knommu: merge header files · 49148020
      Sam Ravnborg 提交于
      Merge header files for m68k and m68knommu to the single location:
      
          arch/m68k/include/asm
      
      The majority of this patch was the result of the
      script that is included in the changelog below.
      
      The script was originally written by Arnd Bergman and
      exten by me to cover a few more files.
      
      When the header files differed the script uses the following:
      
      The original m68k file is named <file>_mm.h  [mm for memory manager]
      The m68knommu file is named <file>_no.h [no for no memory manager]
      
      The files uses the following include guard:
      
      This include gaurd works as the m68knommu toolchain set
      the __uClinux__ symbol - so this should work in userspace too.
      
      Merging the header files for m68k and m68knommu exposes the
      (unexpected?) ABI differences thus it is easier to actually
      identify these and thus to fix them.
      
      The commit has been build tested with both a m68k and
      a m68knommu toolchain - with success.
      
      The commit has also been tested with "make headers_check"
      and this patch fixes make headers_check for m68knommu.
      
      The script used:
      TARGET=arch/m68k/include/asm
      SOURCE=arch/m68knommu/include/asm
      
      INCLUDE="cachectl.h errno.h fcntl.h hwtest.h ioctls.h ipcbuf.h \
      linkage.h math-emu.h md.h mman.h movs.h msgbuf.h openprom.h \
      oplib.h poll.h posix_types.h resource.h rtc.h sembuf.h shmbuf.h \
      shm.h shmparam.h socket.h sockios.h spinlock.h statfs.h stat.h \
      termbits.h termios.h tlb.h types.h user.h"
      
      EQUAL="auxvec.h cputime.h device.h emergency-restart.h futex.h \
      ioctl.h irq_regs.h kdebug.h local.h mutex.h percpu.h \
      sections.h topology.h"
      
      NOMUUFILES="anchor.h bootstd.h coldfire.h commproc.h dbg.h \
      elia.h flat.h m5206sim.h m520xsim.h m523xsim.h m5249sim.h \
      m5272sim.h m527xsim.h m528xsim.h m5307sim.h m532xsim.h \
      m5407sim.h m68360_enet.h m68360.h m68360_pram.h m68360_quicc.h \
      m68360_regs.h MC68328.h MC68332.h MC68EZ328.h MC68VZ328.h \
      mcfcache.h mcfdma.h mcfmbus.h mcfne.h mcfpci.h mcfpit.h \
      mcfsim.h mcfsmc.h mcftimer.h mcfuart.h mcfwdebug.h \
      nettel.h quicc_simple.h smp.h"
      
      FILES="atomic.h bitops.h bootinfo.h bug.h bugs.h byteorder.h cache.h \
      cacheflush.h checksum.h current.h delay.h div64.h \
      dma-mapping.h dma.h elf.h entry.h fb.h fpu.h hardirq.h hw_irq.h io.h \
      irq.h kmap_types.h machdep.h mc146818rtc.h mmu.h mmu_context.h \
      module.h page.h page_offset.h param.h pci.h pgalloc.h \
      pgtable.h processor.h ptrace.h scatterlist.h segment.h \
      setup.h sigcontext.h siginfo.h signal.h string.h system.h swab.h \
      thread_info.h timex.h tlbflush.h traps.h uaccess.h ucontext.h \
      unaligned.h unistd.h"
      
      mergefile() {
      	BASE=${1%.h}
      	git mv ${SOURCE}/$1 ${TARGET}/${BASE}_no.h
      	git mv ${TARGET}/$1 ${TARGET}/${BASE}_mm.h
      
      cat << EOF > ${TARGET}/$1
      EOF
      
      	git add ${TARGET}/$1
      }
      
      set -e
      
      mkdir -p ${TARGET}
      
      git mv include/asm-m68k/* ${TARGET}
      rmdir include/asm-m68k
      
      git rm ${SOURCE}/Kbuild
      for F in $INCLUDE $EQUAL; do
      	git rm ${SOURCE}/$F
      done
      
      for F in $NOMUUFILES; do
      	git mv ${SOURCE}/$F ${TARGET}/$F
      done
      
      for F in $FILES ; do
      	mergefile $F
      done
      
      rmdir arch/m68knommu/include/asm
      rmdir arch/m68knommu/include
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NGreg Ungerer <gerg@uclinux.org>
      49148020