1. 07 8月, 2006 1 次提交
    • M
      [SCSI] Improve inquiry printing · 4ff36718
      Matthew Wilcox 提交于
       - Replace scsi_device_types array API with scsi_device_type function API.
         Gets rid of a lot of common code, as well as being easier to use.
       - Add the new device types in SPC4 r05a, and rename some of the older ones.
       - Reformat the printing of inquiry data; now fits on one line and
         includes PQ.
      
      I think I've addressed all the feedback from the previous versions.  My
      current test box prints:
      
      scsi 2:0:1:0: Direct access     HP 18.2G ATLAS10K3_18_SCA HP05 PQ: 0 ANSI: 2
      Signed-off-by: NMatthew Wilcox <matthew@wil.cx>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      4ff36718
  2. 01 7月, 2006 1 次提交
  3. 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
  4. 11 6月, 2006 1 次提交
  5. 29 5月, 2006 1 次提交
  6. 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
  7. 13 4月, 2006 1 次提交
  8. 15 3月, 2006 1 次提交
  9. 12 3月, 2006 1 次提交
  10. 28 2月, 2006 7 次提交
  11. 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
  12. 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
  13. 13 1月, 2006 1 次提交
  14. 27 12月, 2005 1 次提交
  15. 18 12月, 2005 1 次提交
  16. 14 12月, 2005 1 次提交
  17. 13 12月, 2005 2 次提交
  18. 10 11月, 2005 1 次提交
  19. 09 11月, 2005 1 次提交
  20. 29 10月, 2005 3 次提交
  21. 26 9月, 2005 1 次提交
  22. 19 9月, 2005 1 次提交
    • A
      [SCSI] SCSI scanning and removal fixes · a64358db
      Alan Stern 提交于
      This patch (as545) fixes the list traversals in __scsi_remove_target and
      scsi_forget_host.  In each case the existing code list_for_each_entry_safe
      in an _unsafe_ manner, because the list was not protected from outside
      modification while the iteration was running.
      
      The new scsi_forget_host routine takes the moderately controversial step
      of iterating over devices for removal rather than iterating over targets.
      This makes more sense to me because the current scheme treats targets as
      second-class citizens, created and removed on demand, rather than as
      objects corresponding to actual hardware.  (Also I couldn't figure out any
      safe way to iterate over the target list, since it's not so easy to tell
      when a target has already been removed.)
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      a64358db
  23. 11 9月, 2005 2 次提交
  24. 09 9月, 2005 1 次提交
  25. 29 8月, 2005 1 次提交
  26. 28 8月, 2005 1 次提交
  27. 09 8月, 2005 1 次提交
    • J
      [SCSI] fix target scanning oops with fc transport class · 5c44cd2a
      James.Smart@Emulex.Com 提交于
      We have some nasty issues with 2.6.12-rc6. Any request to scan on
      the lpfc or qla2xxx FC adapters will oops. What is happening is the
      system is defaulting to non-transport registered targets, which
      inherit the parent of the scan. On this second scan, performed by
      the attribute, the parent becomes the shost instead of the rport.
      The slave functions in the 2 FC adapters use starget_to_rport()
      routines, which incorrectly map the shost as an rport pointer.
      
      Additionally, this pointed out other weaknesses:
      - If the target structure is torn down outside of the transport,
        we have no method for it to be regenerated at the proper parent.
      - We have race conditions on the target being allocated by both
        the midlayer scan (parent=shost) and by the fc transport
        (parent=rport).
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      5c44cd2a