1. 21 3月, 2007 1 次提交
  2. 18 2月, 2007 1 次提交
  3. 17 2月, 2007 2 次提交
  4. 27 1月, 2007 1 次提交
  5. 14 1月, 2007 1 次提交
    • K
      [SCSI] scsi_scan message cosmetic error · 3424a65d
      Kurt Garloff 提交于
      Hi,
      
      Minor typo ...
      In my first iteration of patches (that got merged), the
      BLIST_ATTACH_PQ3 actually had the value 0x800000, but that
      got changed later to avoid conflicts. This piece must have
      been overlooked.
      You could obviously do something like %x and then add the
      bitflags, but that looks overkill for something that does
      not tend to change.
      
      Please merge.
      (Patch applied against latest 2.6.20rc version that I tested.)
      
      From: Kurt Garloff <kurt@garloff.de>
      Subject: [SCSI SCAN] Fix logging message for PQ3 devices
      
      The blacklist flags BLIST_ATTACH_PQ3 has value 0x1000000,
      not 0x800000.
      Signed-off-by: NKurt Garloff <garloff@suse.de>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      3424a65d
  6. 06 1月, 2007 1 次提交
    • J
      [SCSI] scsi_scan: fix report lun problems with CDROM or RBC devices · ddaf6fc8
      James Bottomley 提交于
      Apparently no ATAPI CD/DVD actually supports REPORT LUNS (in spite of
      claiming scsi-3 compliance, where it's mandatory) and worse, some
      crash or flake out on being sent the command.  This may actually be
      due to a conflict between SPC and MMC with MMC not listing REPORT LUNS
      as mandatory.  The same standards conflict exists for RBC as well.
      
      Fix all of this by reversing the blacklists for CDROM and RBC devices
      (i.e. now they have to have the BLIST_REPORTLUNS2 flag set even if the
      inquiry data returns scsi-3 compliance).
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      ddaf6fc8
  7. 04 1月, 2007 1 次提交
    • M
      [SCSI] Add missing completion to scsi_complete_async_scans() · 8bcc2412
      Matthew Wilcox 提交于
      If either scsi_complete_async_scans() is called a second time
      before the first call has finished, or a host scan is started while
      scsi_complete_async_scans() is still sleeping, it would fail to wake up
      the other task, which would sleep forever.
      
      I've changed the kernel-doc to make it clear that
      scsi_complete_async_scans() only guarantees that scans which started
      before it was called are guaranteed to have finished when it returns.
      I considered making it wait until all scans are completed, but it can't
      guarantee that no more scans will start before it returns anyway, and it
      runs the risk of confusing other callers of scsi_complete_async_scans()
      for hosts actually scanning.
      Signed-off-by: NMatthew Wilcox <matthew@wil.cx>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      8bcc2412
  8. 23 11月, 2006 3 次提交
  9. 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
  10. 13 11月, 2006 1 次提交
  11. 12 10月, 2006 1 次提交
    • M
      [SCSI] Add ability to scan scsi busses asynchronously · 3e082a91
      Matthew Wilcox 提交于
      Since it often takes around 20-30 seconds to scan a scsi bus, it's
      highly advantageous to do this in parallel with other things.  The bulk
      of this patch is ensuring that devices don't change numbering, and that
      all devices are discovered prior to trying to start init.  For those
      who build SCSI as modules, there's a new scsi_wait_scan module that will
      ensure all bus scans are finished.
      
      This patch only handles drivers which call scsi_scan_host.  Fibre Channel,
      SAS, SATA, USB and Firewire all need additional work.
      Signed-off-by: NMatthew Wilcox <matthew@wil.cx>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      3e082a91
  12. 07 9月, 2006 1 次提交
  13. 03 9月, 2006 1 次提交
    • A
      [SCSI] SCSI: sanitize INQUIRY strings · e5b3cd42
      Alan Stern 提交于
      Sanitize the Vendor, Product, and Revision strings contained in an
      INQUIRY result by setting all non-graphic or non-ASCII characters to ' '.
      Since the standard disallows such characters, this will affect
      only non-compliant devices.
      
      To help maintain backward compatibility, NUL characters are treated
      specially.  They are taken as string terminators; they and all the
      following characters are set to ' '.  If some valid characters get
      erased as a result... well, we weren't seeing them before so we haven't
      lost anything.
      
      The primary purpose of this change is to allow blacklist entries to
      match devices with illegal Vendor or Product strings.
      
      In addition, the patch updates a couple of function prototypes, giving
      inq_result its correct type (unsigned char *).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      e5b3cd42
  14. 20 8月, 2006 1 次提交
    • D
      [SCSI] Don't add scsi_device for devices that return PQ=1, PDT=0x1f · 84961f28
      dave wysochanski 提交于
      Some targets may return slight variations of PQ and PDT to indicate
      no LUN mapped.  USB UFI setting PDT=0x1f but having reserved bits for
      PQ is one example, and NetApp targets returning PQ=1 and PDT=0x1f is
      another.  Both instances seem like reasonable responses according to
      SPC-3 and UFI specs.
      
      The current scsi_probe_and_add_lun() code adds a scsi_device
      for targets that return PQ=1 and PDT=0x1f.  This causes LUNs of type
      "UNKNOWN" to show up in /proc/scsi/scsi when no LUNs are mapped.
      In addition, subsequent rescans fail to recognize LUNs that may be
      added on the target, unless preceded by a write to the delete attribute
      of the "UNKNOWN" LUN.
      
      This patch addresses this problem by skipping over the scsi_add_lun()
      when PQ=1,PDT=0x1f is encountered, and just returns
      SCSI_SCAN_TARGET_PRESENT.
      Signed-off-by: NDave Wysochanski <davidw@netapp.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      84961f28
  15. 07 8月, 2006 2 次提交
  16. 01 7月, 2006 1 次提交
  17. 29 6月, 2006 1 次提交
    • B
      [SCSI] scsi: Device scanning oops for offlined devices (resend) · 309bd271
      Brian King 提交于
      If a device gets offlined as a result of the Inquiry sent
      during scanning, the following oops can occur. After the
      disk gets put into the SDEV_OFFLINE state, the error handler
      sends back the failed inquiry, which wakes the thread doing
      the scan. This starts a race between the scanning thread
      freeing the scsi device and the error handler calling
      scsi_run_host_queues to restart the host. Since the disk
      is in the SDEV_OFFLINE state, scsi_device_get will still
      work, which results in __scsi_iterate_devices getting
      a reference to the scsi disk when it shouldn't.
      
      The following execution thread causes the oops:
      
      CPU 0 (scan)				CPU 1 (eh)
      
      ---------------------------------------------------------
      scsi_probe_and_add_lun
                              ....
                                              scsi_eh_offline_sdevs
                                              scsi_eh_flush_done_q
      scsi_destroy_sdev
      scsi_device_dev_release
                                              scsi_restart_operations
                                               scsi_run_host_queues
                                                __scsi_iterate_devices
                                                 get_device
      scsi_device_dev_release_usercontext
                                                scsi_run_queue
                                                  <---OOPS--->
      
      The patch fixes this by changing the state of the sdev to SDEV_DEL
      before doing the final put_device, which should prevent the race
      from occurring.
      
      Original oops follows:
      
      Badness in kref_get at lib/kref.c:32
      Call Trace:
      [C00000002F4476D0] [C00000000000EE20] .show_stack+0x68/0x1b0 (unreliable)
      [C00000002F447770] [C00000000037515C] .program_check_exception+0x1cc/0x5a8
      [C00000002F447840] [C00000000000446C] program_check_common+0xec/0x100
       Exception: 700 at .kref_get+0x10/0x28
          LR = .kobject_get+0x20/0x3c
      [C00000002F447B30] [C00000002F447BC0] 0xc00000002f447bc0 (unreliable)
      [C00000002F447BB0] [C000000000254BDC] .get_device+0x20/0x3c
      [C00000002F447C30] [D000000000063188] .scsi_device_get+0x34/0xdc [scsi_mod]
      [C00000002F447CC0] [D0000000000633EC] .__scsi_iterate_devices+0x50/0xbc [scsi_mod]
      [C00000002F447D60] [D00000000006A910] .scsi_run_host_queues+0x34/0x5c [scsi_mod]
      [C00000002F447DF0] [D000000000069054] .scsi_error_handler+0xdb4/0xe44 [scsi_mod]
      [C00000002F447EE0] [C00000000007B4E0] .kthread+0x128/0x178
      [C00000002F447F90] [C000000000025E84] .kernel_thread+0x4c/0x68
      Unable to handle kernel paging request for <7>PCI: Enabling device: (0002:41:01.1), cmd 143
      data at address 0x000001b8
      Faulting instruction address: 0xd0000000000698e4
      sym1: <1010-66> rev 0x1 at pci 0002:41:01.1 irq 216
      sym1: No NVRAM, ID 7, Fast-80, LVD, parity checking
      sym1: SCSI BUS has been reset.
      scsi2 : sym-2.2.2
      cpu 0x0: Vector: 300 (Data Access) at [c00000002f447a30]
          pc: d0000000000698e4: .scsi_run_queue+0x2c/0x218 [scsi_mod]
          lr: d00000000006a904: .scsi_run_host_queues+0x28/0x5c [scsi_mod]
          sp: c00000002f447cb0
         msr: 9000000000009032
         dar: 1b8
       dsisr: 40000000
        current = 0xc0000000045fecd0
        paca    = 0xc00000000048ee80
          pid   = 1123, comm = scsi_eh_1
      enter ? for help
      [c00000002f447d60] d00000000006a904 .scsi_run_host_queues+0x28/0x5c [scsi_mod]
      [c00000002f447df0] d000000000069054 .scsi_error_handler+0xdb4/0xe44 [scsi_mod]
      [c00000002f447ee0] c00000000007b4e0 .kthread+0x128/0x178
      [c00000002f447f90] c000000000025e84 .kernel_thread+0x4c/0x68
      Signed-off-by: NBrian King <brking@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      309bd271
  18. 11 6月, 2006 1 次提交
  19. 29 5月, 2006 1 次提交
  20. 15 4月, 2006 4 次提交
    • A
      [SCSI] scsi_scan.c: fix compile warnings · c5f2e640
      akpm@osdl.org 提交于
      drivers/scsi/scsi_scan.c: In function `scsi_probe_and_add_lun':
      drivers/scsi/scsi_scan.c:926: warning: unused variable `vend'
      drivers/scsi/scsi_scan.c:926: warning: unused variable `mod'
      drivers/scsi/scsi_scan.c: At top level:
      drivers/scsi/scsi_scan.c:829: warning: `scsi_inq_str' defined but not used
      
      Fix those, tighten up the (somewhat poorly-designed) logging macro and fix
      some coding-style warts.
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      c5f2e640
    • K
      [SCSI] BLIST_ATTACH_PQ3 flags · 13f7e5ac
      Kurt Garloff 提交于
      Some devices report a peripheral qualifier of 3 for LUN 0; with the original
      code, we would still try a REPORT_LUNS scan (if SCSI level is >= 3 or if we
      have the BLIST_REPORTLUNS2 passed in), but NOT any sequential scan.
      Also, the device at LUN 0 (which is not connected according to the PQ) is not
      registered with the OS.
      
      Unfortunately, SANs exist that are SCSI-2 and do NOT support REPORT_LUNS, but
      report a unknown device with PQ 3 on LUN 0. We still need to scan them, and
      most probably we even need BLIST_SPARSELUN (and BLIST_LARGELUN). See the bug
      reference for an infamous example.
      
      This is patch 3/3:
      3. Implement the blacklist flag BLIST_ATTACH_PQ3 that makes the scsi
         scanning code register PQ3 devices and continues scanning; only sg
         will attach thanks to scsi_bus_match().
      Signed-off-by: NKurt Garloff <garloff@suse.de>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      13f7e5ac
    • K
      [SCSI] Better log messages for PQ3 devs · 6c7154c9
      Kurt Garloff 提交于
      Some devices report a peripheral qualifier of 3 for LUN 0; with the original
      code, we would still try a REPORT_LUNS scan (if SCSI level is >= 3 or if we
      have the BLIST_REPORTLUNS2 passed in), but NOT any sequential scan.
      Also, the device at LUN 0 (which is not connected according to the PQ) is not
      registered with the OS.
      
      Unfortunately, SANs exist that are SCSI-2 and do NOT support REPORT_LUNS, but
      report a unknown device with PQ 3 on LUN 0. We still need to scan them, and
      most probably we even need BLIST_SPARSELUN (and BLIST_LARGELUN). See the bug
      reference for an infamous example.
      
      This patch 2/3:
      If a PQ3 device is found, log a message that describes the device
      (INQUIRY DATA and C:B:T:U tuple) and make a suggestion for blacklisting
      it.
      Signed-off-by: NKurt Garloff <garloff@suse.de>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      6c7154c9
    • K
      [SCSI] Try LUN 1 and use bflags · 4186ab19
      Kurt Garloff 提交于
      Some devices report a peripheral qualifier of 3 for LUN 0; with the original
      code, we would still try a REPORT_LUNS scan (if SCSI level is >= 3 or if we
      have the BLIST_REPORTLUNS2 passed in), but NOT any sequential scan.
      Also, the device at LUN 0 (which is not connected according to the PQ) is not
      registered with the OS.
      
      Unfortunately, SANs exist that are SCSI-2 and do NOT support REPORT_LUNS, but
      report a unknown device with PQ 3 on LUN 0. We still need to scan them, and
      most probably we even need BLIST_SPARSELUN (and BLIST_LARGELUN). See the bug
      reference for an infamous example.
      
      This is patch 1/3:
      If we end up in sequential scan, at least try LUN 1 for devices
      that reported a PQ of 3 for LUN 0.
      Also return blacklist flags, even for PQ3 devices.
      Signed-off-by: NKurt Garloff <garloff@suse.de>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      4186ab19
  21. 13 4月, 2006 1 次提交
  22. 15 3月, 2006 1 次提交
  23. 12 3月, 2006 1 次提交
  24. 28 2月, 2006 7 次提交
  25. 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
  26. 15 1月, 2006 1 次提交
    • C
      [SCSI] remove target parent limitiation · e02f3f59
      Christoph Hellwig 提交于
      When James Smart fixed the issue of the userspace scan atributes
      crashing the system with the FC transport class he added a patch to
      let the transport class check if the parent is valid for a given
      transport class.
      
      When adding support for the integrated raid of fusion sas devices
      we ran into a problem with that, as it didn't allow adding virtual
      raid volumes without the transport class knowing about it.
      
      So this patch adds a user_scan attribute instead, that takes over from
      scsi_scan_host_selected if the transport class sets it and thus lets
      the transport class control the user-initiated scanning.  As this
      plugs the hole about user-initiated scanning the target_parent hook
      goes away and we rely on callers of the scanning routines to do
      something sensible.
      
      For SAS this meant I had to switch from a spinlock to a mutex to
      synchronize the topology linked lists, in FC they were completely
      unsynchronized which seems wrong.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      e02f3f59
  27. 13 1月, 2006 1 次提交