1. 23 10月, 2010 1 次提交
  2. 24 8月, 2010 1 次提交
  3. 11 8月, 2010 2 次提交
    • J
      5bd6e8b3
    • A
      USB: autoconvert trivial BKL users to private mutex · 925ce689
      Arnd Bergmann 提交于
      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: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      925ce689
  4. 21 5月, 2010 1 次提交
  5. 03 3月, 2010 2 次提交
  6. 20 9月, 2009 1 次提交
  7. 13 7月, 2009 1 次提交
  8. 16 6月, 2009 1 次提交
  9. 24 8月, 2008 1 次提交
  10. 22 7月, 2008 1 次提交
  11. 25 4月, 2008 2 次提交
  12. 02 2月, 2008 1 次提交
  13. 26 10月, 2007 2 次提交
  14. 19 10月, 2007 1 次提交
    • J
      Add missing newlines to some uses of dev_<level> messages · 898eb71c
      Joe Perches 提交于
      Found these while looking at printk uses.
      
      Add missing newlines to dev_<level> uses
      Add missing KERN_<level> prefixes to multiline dev_<level>s
      Fixed a wierd->weird spelling typo
      Added a newline to a printk
      Signed-off-by: NJoe Perches <joe@perches.com>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Mark M. Hoffman <mhoffman@lightlink.com>
      Cc: Roland Dreier <rolandd@cisco.com>
      Cc: Tilman Schmidt <tilman@imap.cc>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Stephen Hemminger <shemminger@linux-foundation.org>
      Cc: Greg KH <greg@kroah.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: James Smart <James.Smart@Emulex.Com>
      Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
      Cc: "Antonino A. Daplas" <adaplas@pol.net>
      Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Jaroslav Kysela <perex@suse.cz>
      Cc: Takashi Iwai <tiwai@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      898eb71c
  15. 20 7月, 2007 1 次提交
  16. 13 7月, 2007 1 次提交
    • A
      USB: prevent char device open/deregister race · d4ead16f
      Alan Stern 提交于
      This patch (as908) adds central protection in usbcore for the
      prototypical race between opening and unregistering a char device.
      The spinlock used to protect the minor-numbers array is replaced with
      an rwsem, which can remain locked across a call to a driver's open()
      method.  This guarantees that open() and deregister() will be mutually
      exclusive.
      
      The private locks currently used in several individual drivers for
      this purpose are no longer necessary, and the patch removes them.  The
      following USB drivers are affected: usblcd, idmouse, auerswald,
      legousbtower, sisusbvga/sisusb, ldusb, adutux, iowarrior, and
      usb-skeleton.
      
      As a side effect of this change, usb_deregister_dev() must not be
      called while holding a lock that is acquired by open().  Unfortunately
      a number of drivers do this, but luckily the solution is simple: call
      usb_deregister_dev() before acquiring the lock.
      
      In addition to these changes (and their consequent code
      simplifications), the patch fixes a use-after-free bug in adutux and a
      race between open() and release() in iowarrior.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d4ead16f
  17. 26 6月, 2007 1 次提交
  18. 28 4月, 2007 2 次提交
    • E
      USB: iowarrior.c: timeouts too small in usb_control_msg calls · 147c5a17
      Eberhard Fahle 提交于
      The driver uses usb_control_msg() for exchanging data with the device.
      When the driver lived freeley _outside_ the kernel tree (pre 2.6.21) the
      timeouts for these calls where set to 5*HZ for reading, 1HZ for writing.
      (These timeouts seemed to work fine for all users of the driver, at
      least nobody complained in the last 2 years.
      
      The current code (2.6.21-rc5) removed the 'HZ' from the timeouts and
      left the driver with 5 jiffies for reading and 1 jiffy for writing. My
      new machine is fast, but not that fast.
      
      The patch also removes a useless debug statement, which was left over
      from testing a broken firmware version
      
      From: Eberhard Fahle <e.fahle@wayoda.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      147c5a17
    • O
      USB: iowarrior.c: fix NULL dereference · f81ee4d5
      Oliver Neukum 提交于
      Am Montag, 19. 2007 10:25 schrieb Adrian Bunk:
      > The Coverity checker spotted the following NULL dereference:
      
      And this fixes an oops upon allocation failures.
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f81ee4d5
  19. 24 2月, 2007 1 次提交