1. 29 6月, 2006 2 次提交
    • 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
    • B
      [SCSI] scsi: Add allow_restart sysfs class attribute · a144c5ae
      Brian King 提交于
      This is a resend of a patch I generated in response to an email sent
      by Ruben Faelens <parasietje@gmail.com>. His original email to
      linux-scsi requested a method in which he could spin down a scsi disk
      when not in use and have the kernel automatically spin it back up when
      an I/O was generated to the disk. The infrastructure to automatically
      spin a disk up has been in the scsi error handler for some time now,
      but it is not enabled by default. This patch adds an sd sysfs attribute
      which allows userspace to enable this behavior.
      Signed-off-by: NBrian King <brking@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      a144c5ae
  2. 28 6月, 2006 1 次提交
    • J
      [SCSI] fc transport: bug fix: correct references · 3bdad7bd
      James Smart 提交于
      Original post was incorrect as it didn't realize that we already had
      a self-referenc due to device_initialize(), and we were really only
      missing the put on our own reference. This was hidden by the other bug
      which had the midlayer reusing stargets after they were already free,
      which was doing too many puts on our rport.
      
      Updating FC transport for:
      - Add put in fc_rport_final_delete(), to release the rport.
        Prior, we were leaving the rport with a reference, thus the shost
        with references, etc. If the driver was unloaded, shosts and rports
        remained, along with work threads, etc
      - Fix fc_rport_create failure path - too many put's on parent
      - Add commenting to easily track ref taking.
      Signed-off-by: NJames Smart <james.smart@emulex.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      3bdad7bd
  3. 27 6月, 2006 22 次提交
  4. 26 6月, 2006 13 次提交
    • A
      [SCSI] SCSI core: Allow QUIESCE -> CANCEL sdev transition · 9ea72909
      Alan Stern 提交于
      We have to be able to remove SCSI devices even when they are suspended, so
      QUIESCE -> CANCEL must be a legal state transition.  This patch (as727)
      adds the transition to the state machine.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      9ea72909
    • L
      [SCSI] sd/scsi_lib simplify sd_rw_intr and scsi_io_completion · 03aba2f7
      Luben Tuikov 提交于
      This patch simplifies "good_bytes" computation in sd_rw_intr().
      sd: "good_bytes" computation is always done in terms of the resolution
      of the device's medium, since after that it is the number of good bytes
      we pass around and other layers/contexts (as opposed ot sd) can translate
      that to their own resolution (block layer:512).  It also makes
      scsi_io_completion() processing more straightforward, eliminating the
      3rd argument to the function.
      
      It also fixes a couple of bugs like not checking return value,
      using "break" instead of "return;", etc.
      
      I've been running with this patch for some time now on a
      test (do-it-all) system.
      Signed-off-by: NLuben Tuikov <ltuikov@yahoo.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      03aba2f7
    • H
      [SCSI] aic79xx: remove slave_destroy · f89d0a4e
      Hannes Reinecke 提交于
      Even with the latest fixes aic79xx still occasionally triggers the
      BUG_ON in slave_destroy. Rather than trying to figure out the various
      levels of interaction here I've decided to remove the callback altogether.
      
      The primary reason for the slave_alloc / slave_destroy is to keep an
      index of pointers to the sdevs associated with a given target.
      However, by changing the arguments to the affected functions slightly
      it's possible to avoid the use of that index entirely.
      The only performance penalty we'll incur is in writing the
      information for /proc/scsi/XXX, as we'll have to recurse over all
      available sdevs to find the correct ones. But I doubt that reading
      from /proc is in any way time-critical.
      Signed-off-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      f89d0a4e
    • H
      [SCSI] HP XP devinfo update · 9ba0883c
      Hannes Reinecke 提交于
      According to Anthony Cheung all HP XP arrays with "OPEN-" 
      types support REPORT_LUN. So there is no reason why we
      shouldn't use it.
      Signed-off-by: NAnthony Cheung <anthony.cheung@hp.com>
      Signed-off-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      9ba0883c
    • S
      [SCSI] megaraid_sas: zcr with fix · 0e98936c
      Sumant Patro 提交于
      The patch adds support for a ZCR controller (Device ID : 0x413).
      
      It also has a critical bug fix :
      
      Disable controller interrupt before firing INIT cmd to FW.  Interrupt
      is enabled after required initialization is over. This is done to
      ensure that driver is ready to handle interrupts when it is generated
      by the controller.
      Signed-off-by: NSumant Patro <Sumant.Patro@lsil.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      0e98936c
    • D
      [SCSI] ibmvscsi: treat busy and error conditions separately · cefbda2d
      Dave C Boutcher 提交于
      This patch fixes a condition where ibmvscsi treats a transport error as a
      "busy" condition, so no errors were returned to the scsi mid-layer.
      In a RAID environment this means that I/O hung rather than failing
      over.
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      cefbda2d
    • D
      [SCSI] scsi_debug version 1.79 · c65b1445
      Douglas Gilbert 提交于
        - add 'virtual_gb' parameter to simulate large storage
          (by wrapping in dev_size_mb megabytes of actual ram)
        - add 'no_lun_0' parameter to skip lun 0 on each target
          (but still respond as required to INQUIRY + REPORT LUNS)
        - add well know lu support
        - add MODE SELECT commands support [pages: 0xa and 0x1c]
        - add LOG SENSE command support [pages: 0xd and 0x2f]
        - add READ CAPACITY (16) support
        - increase number of mode pages supported (to read),
          mainly transport specific (SAS) mode (sub)pages
        - add more VPD pages and extend others, including
          ATA information VPD page
        - START STOP UNIT now maintains a state machine
        - READ (16) and WRITE (16) cope with lbas larger
          than 32 bits (needed for the 'virtual_gb' parameter)
        - allow single command transfers up to 32 MB
        - more precise error (sense data) messages
      Signed-off-by: NDouglas Gilbert <dougg@torque.net>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      c65b1445
    • D
      [SCSI] kmalloc argument switcheroo in recent 53c700 change. · 4311fa60
      Dave Jones 提交于
      On Wed, Jun 21, 2006 at 07:00:34PM +0000, Linux Kernel wrote:
       > commit 67d59dfd
       > tree ae85703651d81740f4a6cd398f9dd4d6aabe6a2f
       > parent 6db874fb
       > author James Bottomley <James.Bottomley@steeleye.com> Wed, 14 Jun 2006 07:31:19 -0500
       > committer James Bottomley <jejb@mulgrave.il.steeleye.com> Tue, 20 Jun 2006 05:34:01 -0500
       >
       > [SCSI] 53c700: remove reliance on deprecated cmnd fields
       >  ...
       >
       > +	SDp->hostdata = kmalloc(GFP_KERNEL, sizeof(struct NCR_700_sense));
       > +
       > +	if (!SDp->hostdata)
       > +		return -ENOMEM;
      
      "I'll take reversed arguments for $100 please Alex".
      Signed-off-by: NDave Jones <davej@redhat.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      4311fa60
    • R
      [PATCH] advansys section fixes · c836043e
      Randy Dunlap 提交于
      Priority: not critical.
      Mark 3 functions __init.  Saves a little memory.
      This makes these functions' calls to AdvWaitEEPCmd() (which is __init)
      be clean (i.e., eliminates text -> init -> text call chain).
      
      Fix multiple section mismatch warnings:
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet3550EEPConfig' (at offset 0x7a22) and 'AdvSet38C0800EEPConfig'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet3550EEPConfig' (at offset 0x7a4e) and 'AdvSet38C0800EEPConfig'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet3550EEPConfig' (at offset 0x7a79) and 'AdvSet38C0800EEPConfig'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet3550EEPConfig' (at offset 0x7aa2) and 'AdvSet38C0800EEPConfig'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet3550EEPConfig' (at offset 0x7abb) and 'AdvSet38C0800EEPConfig'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet38C0800EEPConfig' (at offset 0x7ae0) and 'AdvSet38C1600EEPConfig'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet38C0800EEPConfig' (at offset 0x7b0c) and 'AdvSet38C1600EEPConfig'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet38C0800EEPConfig' (at offset 0x7b37) and 'AdvSet38C1600EEPConfig'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet38C0800EEPConfig' (at offset 0x7b60) and 'AdvSet38C1600EEPConfig'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet38C0800EEPConfig' (at offset 0x7b79) and 'AdvSet38C1600EEPConfig'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet38C1600EEPConfig' (at offset 0x7b9e) and 'AdvExeScsiQueue'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet38C1600EEPConfig' (at offset 0x7bca) and 'AdvExeScsiQueue'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet38C1600EEPConfig' (at offset 0x7bf5) and 'AdvExeScsiQueue'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet38C1600EEPConfig' (at offset 0x7c1e) and 'AdvExeScsiQueue'
      WARNING: drivers/scsi/advansys.o - Section mismatch: reference to .init.text: from .text between 'AdvSet38C1600EEPConfig' (at offset 0x7c37) and 'AdvExeScsiQueue'
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Cc: James Bottomley <James.Bottomley@steeleye.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c836043e
    • R
      [PATCH] megaraid_mbox: fix section mismatch warnings · cedfb178
      Randy Dunlap 提交于
      Fix section warning:
      WARNING: drivers/scsi/megaraid/megaraid_mbox.o - Section mismatch: reference to .init.text: from .text between 'megaraid_probe_one' (at offset 0x171e) and 'megaraid_queue_command'
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      cedfb178
    • R
      [PATCH] wd7000: fix section mismatch warnings · b9bcf9c1
      Randy.Dunlap 提交于
      From: Randy Dunlap <rdunlap@xenotime.net>
      
      Fix section mismatch in wd7000 driver:
      WARNING: drivers/scsi/wd7000.o - Section mismatch: reference to .init.text: from .text after 'wd7000_detect' (at offset 0xa5d)
      WARNING: drivers/scsi/wd7000.o - Section mismatch: reference to .init.text: from .text after 'wd7000_detect' (at offset 0xab6)
      WARNING: drivers/scsi/wd7000.o - Section mismatch: reference to .init.text: from .text after 'wd7000_detect' (at offset 0xb67
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b9bcf9c1
    • R
      [PATCH] m68k: convert mac irq code · 9c5f4afd
      Roman Zippel 提交于
      Signed-off-by: NRoman Zippel <zippel@linux-m68k.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9c5f4afd
    • R
      b035c96b
  5. 24 6月, 2006 2 次提交