1. 14 10月, 2009 1 次提交
    • J
      [SCSI] fix memory leak in initialization · 37e6ba00
      James Bottomley 提交于
      The root cause of the problem is the fact that dev_set_name() now
      allocates storage instead of using the original array within the kobj.
      That means that the SCSI assumption that if you haven't made the
      containing object or any sub objects visible, you can just destroy it
      (and its component devices) lock stock and barrel becomes false.
      
      Fix this by doing the get of sdev_dev at parent time and thus do an
      extra put of it in scsi_destroy_sdev() (and all other destruction
      without add paths).
      Reported-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      37e6ba00
  2. 16 9月, 2009 1 次提交
  3. 22 6月, 2009 1 次提交
  4. 13 3月, 2009 1 次提交
  5. 03 1月, 2009 1 次提交
  6. 09 10月, 2008 1 次提交
  7. 04 10月, 2008 1 次提交
  8. 27 7月, 2008 1 次提交
  9. 05 6月, 2008 1 次提交
  10. 24 5月, 2008 1 次提交
    • J
      [SCSI] fix intermittent oops in scsi_bus_uevent · 1f42ea7b
      James Bottomley 提交于
      Reported-by: NSitsofe Wheeler <sitsofe@yahoo.com>
      > BUG: unable to handle kernel paging request at e6f17fac
      > IP: [<c02604d6>] scsi_bus_uevent+0x1/0x17
      > *pde = 2714b163 *pte = 26f17160
      > Oops: 0000 [#1] DEBUG_PAGEALLOC
      > last sysfs file:
      >
      > Pid:  1, comm: swapper Not tainted (2.6.26-rc2-next-20080516skw #30)
      > EIP: 0060:[<c02604d6>] EFLAGS: 00010282 CPU: 0
      > EIP is at scsi_bus_uevent+0x1/0x17
      > EAX: e6f18014 EBX: e6f18014 ECX: c02604d5 EDX: e7173000
      > ESI: e7173000 EDI: e7173000 EBP: e7851ca0 ESP: e7851c90
      >  DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
      
      The problem is caused by:
      
      commit b0ed4336
      Author: Hannes Reinecke <hare@suse.de>
      Date:   Tue Mar 18 14:32:28 2008 +0100
      
          [SCSI] add scsi_host and scsi_target to scsi_bus
      
      which added scsi_bus_type to the struct scsi_target device.  This
      causes both the scsi_device and scsi_target to fire scsi_bus_uevents.
      However, the actualy scsi_bus_uevent() call assumes blindly that it's
      a struct scsi_device.  Check for this and return immediately if it
      isn't.
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      1f42ea7b
  11. 23 4月, 2008 4 次提交
  12. 20 4月, 2008 1 次提交
  13. 27 3月, 2008 1 次提交
  14. 14 3月, 2008 1 次提交
  15. 24 1月, 2008 1 次提交
  16. 03 1月, 2008 1 次提交
  17. 04 11月, 2007 1 次提交
  18. 18 10月, 2007 1 次提交
  19. 13 10月, 2007 4 次提交
  20. 21 7月, 2007 1 次提交
    • J
      [SCSI] bsg: make class backlinks · 39dca558
      James Bottomley 提交于
      Currently, bsg doesn't make class backlinks (a process whereby you'd get
      a link to bsg in the device directory in the same way you get one for
      sg).  This is because the bsg device is uninitialised, so the class
      device has nothing it can attach to.  The fix is to make the bsg device
      point to the cdevice of the entity creating the bsg, necessitating
      changing the bsg_register_queue() prototype into a form that takes the
      generic device.
      Acked-by: NFUJITA Tomonori <tomof@acm.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      39dca558
  21. 20 7月, 2007 1 次提交
  22. 19 7月, 2007 1 次提交
  23. 22 5月, 2007 1 次提交
  24. 18 4月, 2007 1 次提交
    • M
      [SCSI] modalias for scsi devices · d7b8bcb0
      Michael Tokarev 提交于
      The following patch adds support for sysfs/uevent modalias
      attribute for scsi devices (like disks, tapes, cdroms etc),
      based on whatever current sd.c, sr.c, st.c and osst.c drivers
      supports.
      
      The modalias format is like this:
      
       scsi:type-0x04
      
      (for TYPE_WORM, handled by sr.c now).
      
      Several comments.
      
      o This hexadecimal type value is because all TYPE_XXX constants
        in include/scsi/scsi.h are given in hex, but __stringify() will
        not convert them to decimal (so it will NOT be scsi:type-4).
        Since it does not really matter in which format it is, while
        both modalias in module and modalias attribute match each other,
        I descided to go for that 0x%02x format (and added a comment in
        include/scsi/scsi.h to keep them that way), instead of changing
        them all to decimal.
      
      o There was no .uevent routine for SCSI bus.  It might be a good
        idea to add some more ueven environment variables in there.
      
      o osst.c driver handles tapes too, like st.c, but only SOME tapes.
        With this setup, hotplug scripts (or whatever is used by the
        user) will try to load both st and osst modules for all SCSI
        tapes found, because both modules have scsi:type-0x01 alias).
        It is not harmful, but one extra module is no good either.
        It is possible to solve this, by exporting more info in
        modalias attribute, including vendor and device identification
        strings, so that modalias becomes something like
          scsi:type-0x12:vendor-Adaptec LTD:device-OnStream Tape Drive
        and having that, match for all 3 attributes, not only device
        type.  But oh well, vendor and device strings may be large,
        and they do contain spaces and whatnot.
        So I left them for now, awaiting for comments first.
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      d7b8bcb0
  25. 21 3月, 2007 1 次提交
    • T
      [SCSI] sd: implement START/STOP management · c3c94c5a
      Tejun Heo 提交于
      Implement SBC START/STOP management.  sdev->mange_start_stop is added.
      When it's set to one, sd STOPs the device on suspend and shutdown and
      STARTs it on resume.  sdev->manage_start_stop defaults is in sdev
      instead of scsi_disk cdev to allow ->slave_config() override the
      default configuration but is exported under scsi_disk sysfs node as
      sdev->allow_restart is.
      
      When manage_start_stop is zero (the default value), this patch doesn't
      introduce any behavior change.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      
      Rejections fixed and
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      c3c94c5a
  26. 16 3月, 2007 1 次提交
    • A
      [PATCH] sysfs and driver core: add callback helper, used by SCSI and S390 · d9a9cdfb
      Alan Stern 提交于
      This patch (as868) adds a helper routine for device drivers that need
      to set up a callback to perform some action in a different process's
      context.  This is intended for use by attribute methods that want to
      unregister themselves or their parent device.  Attribute method calls
      are mutually exclusive with unregistration, so such actions cannot be
      taken directly.
      
      Two attribute methods are converted to use the new helper routine: one
      for SCSI device deletion and one for System/390 ccwgroup devices.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Oliver Neukum <oneukum@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d9a9cdfb
  27. 17 2月, 2007 1 次提交
  28. 22 11月, 2006 1 次提交
    • D
      WorkStruct: Pass the work_struct pointer instead of context data · 65f27f38
      David Howells 提交于
      Pass the work_struct pointer to the work function rather than context data.
      The work function can use container_of() to work out the data.
      
      For the cases where the container of the work_struct may go away the moment the
      pending bit is cleared, it is made possible to defer the release of the
      structure by deferring the clearing of the pending bit.
      
      To make this work, an extra flag is introduced into the management side of the
      work_struct.  This governs auto-release of the structure upon execution.
      
      Ordinarily, the work queue executor would release the work_struct for further
      scheduling or deallocation by clearing the pending bit prior to jumping to the
      work function.  This means that, unless the driver makes some guarantee itself
      that the work_struct won't go away, the work function may not access anything
      else in the work_struct or its container lest they be deallocated..  This is a
      problem if the auxiliary data is taken away (as done by the last patch).
      
      However, if the pending bit is *not* cleared before jumping to the work
      function, then the work function *may* access the work_struct and its container
      with no problems.  But then the work function must itself release the
      work_struct by calling work_release().
      
      In most cases, automatic release is fine, so this is the default.  Special
      initiators exist for the non-auto-release case (ending in _NAR).
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      65f27f38
  29. 26 10月, 2006 1 次提交
  30. 01 7月, 2006 1 次提交
  31. 10 6月, 2006 1 次提交
  32. 24 3月, 2006 1 次提交
    • N
      [PATCH] Make libata not powerdown drivers on PM_EVENT_FREEZE. · 082776e4
      Nigel Cunningham 提交于
      At the moment libata doesn't pass pm_message_t down ata_device_suspend.
      This causes drives to be powered down when we just want a freeze,
      causing unnecessary wear and tear. This patch gets pm_message_t passed
      down so that it can be used to determine whether to power down the
      drive.
      Signed-off-by: NNigel Cunningham <nigel@suspend2.net>
      
       drivers/scsi/libata-core.c |    5 +++--
       drivers/scsi/libata-scsi.c |    4 ++--
       drivers/scsi/scsi_sysfs.c  |    2 +-
       include/linux/libata.h     |    4 ++--
       include/scsi/scsi_host.h   |    2 +-
       5 files changed, 9 insertions(+), 8 deletions(-)
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      082776e4
  33. 28 2月, 2006 1 次提交
  34. 15 2月, 2006 1 次提交
    • J
      [SCSI] fix wrong context bugs in SCSI · 65110b21
      James Bottomley 提交于
      There's a bug in releasing scsi_device where the release function
      actually frees the block queue.  However, the block queue release
      calls flush_work(), which requires process context (the scsi_device
      structure may release from irq context).  Update the release function
      to invoke via the execute_in_process_context() API.
      
      Also clean up the scsi_target structure releasing via this API.
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      65110b21