1. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  2. 27 2月, 2010 1 次提交
    • R
      PM: Allow SCSI devices to suspend/resume asynchronously · 4cb077d9
      Rafael J. Wysocki 提交于
      Set power.async_suspend for all SCSI devices, targets and hosts, so
      that they can be suspended and resumed in parallel with the main
      suspend/resume thread and possibly with other devices they don't
      depend on in a known way (i.e. devices which are not their parents or
      children).
      
      The power.async_suspend flag is also set for devices that don't have
      suspend or resume callbacks, because otherwise they would make the
      main suspend/resume thread wait for their "asynchronous" children
      (during suspend) or parents (during resume), effectively negating the
      possible gains from executing these devices' suspend and resume
      callbacks asynchronously.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      4cb077d9
  3. 05 12月, 2009 1 次提交
  4. 27 11月, 2009 1 次提交
  5. 21 6月, 2009 1 次提交
  6. 13 3月, 2009 1 次提交
  7. 03 1月, 2009 1 次提交
  8. 04 10月, 2008 1 次提交
    • J
      [SCSI] scsi_host_lookup: error returns and NULL pointers · 315cb0ad
      James Smart 提交于
      This patch cleans up the behavior of scsi_host_lookup().
      
      The original implementation attempted to use the dual role of
      either returning a pointer value, or a negative error code.
      User's needed to use IS_ERR() to check the result. Additionally,
      the IS_ERR() macro never checks for when a NULL pointer was
      returned, so a NULL pointer actually passes with a success case.
      Note: scsi_host_get(), used by scsi_host_lookup(), can return
      a NULL pointer.
      
      Talk about a mudhole for the unitiated to step into....
      
      This patch converts scsi_host_lookup() to return either NULL
      or a valid pointer. The consumers were updated for the change.
      Signed-off-by: NJames Smart <james.smart@emulex.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      315cb0ad
  9. 22 7月, 2008 2 次提交
  10. 12 7月, 2008 1 次提交
  11. 16 6月, 2008 1 次提交
    • M
      [SCSI] scsi_host regression: fix scsi host leak · 3ed78972
      Mike Christie 提交于
      commit 9c770108
      Author: Dave Young <hidave.darkstar@gmail.com>
      Date:   Tue Jan 22 14:01:34 2008 +0800
      
          scsi: use class iteration api
      
      Isn't a correct replacement for the original hand rolled host
      lookup. The problem is that class_find_child would get a reference to
      the host's class device which is never released.  Since the host class
      device holds a reference to the host gendev, the host can never be
      freed.
      
      In 2.6.26 we started using class_find_device, and this function also
      gets a reference to the device, so we end up with an extra ref
      and the host will not get released.
      
      This patch adds a put_device to balance the class_find_device() get. I
      kept the scsi_host_get in scsi_host_lookup, because the target layer
      is using scsi_host_lookup and it looks like it needs the SHOST_DEL
      check.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      3ed78972
  12. 28 4月, 2008 1 次提交
    • J
      [SCSI] fix SLUB WARN_ON · 542bd137
      James Bottomley 提交于
      We're getting a WARN_ON from SLUB indicating that we're trying to free
      caches with in-use objects.  The root cause is a new dependency in the
      command/sense free on unchecked_isa_dma.  The WARN_ON is caused by
      drivers which change this in their setup after the command/sense cache
      is allocated.
      
      The fix is to move the allocation of this cache into scsi_add_host()
      so things like gdth have an opportunity to modify it between alloc and
      add (but *not* after).
      
      The true fix would be to move unchecked_isa_dma into the template and
      out of the host, so it because a truly read only variable.
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      542bd137
  13. 23 4月, 2008 2 次提交
  14. 20 4月, 2008 1 次提交
  15. 08 4月, 2008 1 次提交
  16. 28 3月, 2008 1 次提交
  17. 31 1月, 2008 1 次提交
    • J
      [SCSI] remove use_sg_chaining · d3f46f39
      James Bottomley 提交于
      With the sg table code, every SCSI driver is now either chain capable
      or broken (or has sg_tablesize set so chaining is never activated), so
      there's no need to have a check in the host template.
      
      Also tidy up the code by moving the scatterlist size defines into the
      SCSI includes and permit the last entry of the scatterlist pools not
      to be a power of two.
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      d3f46f39
  18. 25 1月, 2008 1 次提交
  19. 24 1月, 2008 2 次提交
  20. 12 1月, 2008 1 次提交
  21. 18 10月, 2007 1 次提交
  22. 16 10月, 2007 1 次提交
  23. 13 10月, 2007 1 次提交
    • F
      [SCSI] add supported_mode and active_mode attributes to the host · 5dc2b89e
      FUJITA Tomonori 提交于
      This adds supported_mode and active_mode attributes to
      /sys/class/sys_host/hostX/ for specifying the mode that a lld supports
      and the currently activated mode. The output format is similar to fc
      rport roles:
      
      luce:/sys/class/scsi_host/host0$ cat supported_mode
      Initiator
      luce:/sys/class/scsi_host/host0$ cat active_mode
      Initiator
      
      The mode values uses bitmap since we would support dual-mode llds in
      the future like this:
      
      luce:/sys/class/scsi_host/host0$ cat supported_mode
      Initiator, Target
      
      The supported_mode attribute looks at a scsi_host_template and the
      active_mode attribute looks at a scsi_host. We would add a hook to a
      scsi_host_template to change the active_mode attribute
      dynamically. But now there is no hook since no lld supports that
      feature.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      5dc2b89e
  24. 01 8月, 2007 1 次提交
  25. 28 4月, 2007 1 次提交
  26. 26 11月, 2006 1 次提交
    • F
      [SCSI] export scsi-ml functions needed by tgt_scsi_lib and its LLDs · b58d9154
      FUJITA Tomonori 提交于
      This patch contains the needed changes to the scsi-ml for the target
      mode support.
      
      Note, per the last review we moved almost all the fields we added
      to the scsi_cmnd to our internal data structure which we are going
      to try and kill off when we can replace it with support from other
      parts of the kernel.
      
      The one field we left on was the offset variable. This is needed to handle
      the case where the target gets request that is so large that it cannot
      execute it in one dma operation. So max_secotors or a segment limit may
      limit the size of the transfer. In this case our tgt core code will
      break up the command into managable transfers and send them to the
      LLD one at a time. The offset is then used to tell the LLD where in
      the command we are at. Is there another field on the scsi_cmd for
      that?
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      b58d9154
  27. 16 11月, 2006 1 次提交
  28. 31 8月, 2006 1 次提交
  29. 07 8月, 2006 1 次提交
  30. 11 4月, 2006 1 次提交
  31. 28 2月, 2006 1 次提交
  32. 13 1月, 2006 1 次提交
  33. 06 1月, 2006 1 次提交
  34. 30 10月, 2005 1 次提交
  35. 29 10月, 2005 1 次提交
  36. 28 10月, 2005 1 次提交
  37. 03 10月, 2005 1 次提交