1. 04 Aug, 2010 5 commits
    • Jesper Nilsson's avatar
      cris: autoconvert trivial BKL users to private mutex · 096b7bdc
      Jesper Nilsson authored
      All these files use the big kernel lock in a trivial
      way to serialize their private file operations,
      typically resulting from an earlier semi-automatic
      pushdown from VFS.
      
      None of these drivers appears to want to lock against
      other code, and they all use the BKL as the top-level
      lock in their file operations, meaning that there
      is no lock-order inversion problem.
      
      Consequently, we can remove the BKL completely,
      replacing it with a per-file mutex in every case.
      Using a scripted approach means we can avoid
      typos.
      
      file=$1
      name=$2
      if grep -q lock_kernel ${file} ; then
          if grep -q 'include.*linux.mutex.h' ${file} ; then
                  sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
          else
                  sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
          fi
          sed -i ${file} \
              -e "/^#include.*linux.mutex.h/,$ {
                      1,/^\(static\|int\|long\)/ {
                           /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);
      
      } }"  \
          -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
          -e '/[      ]*cycle_kernel_lock();/d'
      else
          sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                      -e '/cycle_kernel_lock()/d'
      fi
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
      096b7bdc
    • Jesper Nilsson's avatar
      cris: Pushdown the bkl from ioctl · 90276a1a
      Jesper Nilsson authored
      From: Frederic Weisbecker <fweisbec@gmail.com>
      
      Pushdown the bkl to the remaining drivers using the
      deprecated .ioctl.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: John Kacur <jkacur@redhat.com>
      90276a1a
    • Jesper Nilsson's avatar
      CRIS: invoke oom-killer from page fault · 3648bdf7
      Jesper Nilsson authored
      As explained in commit 1c0fe6e3, we want to call the architecture independent
      oom killer when getting an unexplained OOM from handle_mm_fault, rather than
      simply killing current.
      Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Signed-off-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
      Signed-off-by: default avatarMikael Starvik <starvik@axis.com>
      3648bdf7
    • Jesper Nilsson's avatar
      CRIS: GENERIC_TIME fixes · 60dbd663
      Jesper Nilsson authored
      GENERIC_TIME was not functional for CRIS, giving random backward
      time jumps.
      
      For CRISv32 implement a new clocksource using the free running counter
      and ditch the arch_gettimeoffset.
      
      The random time jumps still existed, but turned out to be the write_seqlock
      which was missing around our do_timer() call.
      
      So switch over to GENERIC_TIME using the clocksource for CRISv32.
      
      CRISv10 doesn't have the free running counter needed for the
      clocksource trick, but we can still use GENERIC_TIME with
      arch_gettimeoffset.
      
      Unfortunately, there were problems in using the prescaler register
      to timer0 for the gettimeoffset calculation, so it is now ignored,
      making our resolution worse by the tune of 40usec (0.4%) worst case.
      
      At the same time, clean up some formatting and use NSEC_PER_SEC
      instead of 1000000000.
      Signed-off-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
      60dbd663
    • Latchesar Ionkov's avatar
      9p: Pass the correct end of buffer to p9stat_read · 26bfeea3
      Latchesar Ionkov authored
      Pass the correct end of the buffer to p9stat_read.
      Signed-off-by: default avatarLatchesar Ionkov <lucho@ionkov.net>
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
      26bfeea3
  2. 27 Jul, 2010 8 commits
  3. 26 Jul, 2010 27 commits