30 Jun, 2011

1 commit

  • If a Virtual I/O server fails in a dual virtual I/O server multipath
    configuration, ensure we delete all remote ports so that path failover
    can occur. For a single path configuration, the remote ports will
    go into devloss state.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     

02 May, 2011

1 commit

  • This patch fixes an issue seen where an event occurs
    which causes the ibmvscsi driver to reset its CRQ. Upon
    re-registering its CRQ, it receives H_CLOSED, indicating
    the Virtual I/O Server is not yet ready to receive commands.
    This resulted in the ibmvscsi driver essentially offlining
    the adapter and not recovering. The fix is to re-enable
    our interrupt so that when the Virtual I/O server is ready
    and sends a CRQ init, we will be able to receive it and
    resume initialization of the VSCSI adapter.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     

22 Dec, 2010

1 commit


17 Nov, 2010

1 commit

  • Move the mid-layer's ->queuecommand() invocation from being locked
    with the host lock to being unlocked to facilitate speeding up the
    critical path for drivers who don't need this lock taken anyway.

    The patch below presents a simple SCSI host lock push-down as an
    equivalent transformation. No locking or other behavior should change
    with this patch. All existing bugs and locking orders are preserved.

    Additionally, add one parameter to queuecommand,
    struct Scsi_Host *
    and remove one parameter from queuecommand,
    void (*done)(struct scsi_cmnd *)

    Scsi_Host* is a convenient pointer that most host drivers need anyway,
    and 'done' is redundant to struct scsi_cmnd->scsi_done.

    Minimal code disturbance was attempted with this change. Most drivers
    needed only two one-line modifications for their host lock push-down.

    Signed-off-by: Jeff Garzik
    Acked-by: James Bottomley
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     

08 Oct, 2010

2 commits

  • If a Virtual I/O server is rebooted, the client fibre channel sees a
    transport event on its CRQ, which causes it to attempt to reconnect
    to the CRQ. For a period of time during the VIOS reboot, the client's
    attempts to register the CRQ will return H_CLOSED, indicating the server
    side is not currently registered. The ibmvfc driver was not handling
    this well and was taking the virtual adapter offline. Fix this by
    re-enabling our interrupt and waiting for the event on our CRQ
    indicating the server is back, at which point we can reconnect.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • This removes the driver's get_host_def_dev_loss_tmo
    callback and just has the driver set the dev loss
    using the fc class fc_host_dev_loss_tmo macro like is
    done for other fc params.

    This patch also removes the module dev loss param.
    To override the value the fc host sysfs value being
    added in the fc class patch can be used instead of the driver
    module param.

    Signed-off-by: Mike Christie
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Mike Christie
     

17 Sep, 2010

1 commit

  • By default, ibmvfc does not log any async events in order
    to avoid flooding the log with them. Improve on this by
    logging by default events that are not likely to flood the
    log, such as link up/down. Having these events in the log
    will improve the ability to debug issues with ibmvfc.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     

06 Sep, 2010

1 commit


07 Aug, 2010

3 commits

  • Bump driver version.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • The ibmvfc driver was incorrectly obtaining a scsi_target pointer
    from an fc_rport. The way it is coded ensures that ibmvfc's
    terminate_rport_io handler does absolutely nothing. Fix this up
    to iterate through affected devices differently, sending cancel
    and abort task set as appropriate. Without this patch,
    fast_io_fail_tmo is broken for ibmvfc.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • Commit 43c8da907ccc656935d1085701f4db83385d8a59 introduced a race
    condition which can occur when adding/deleting rports. There are
    two possible threads now that can be deleting rports in the ibmvfc
    driver, which can result in list_del being called twice, resulting
    in an oops. This patch adds a new state to the ibmvfc_target struct
    to indicate the target has been removed from the list and is in
    the process of being deleted.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     

28 Jul, 2010

9 commits

  • Add the __init and __exit macros to the module_init / module_exit
    functions from drivers/scsi/ibmvscsi/ibmvstgt.c

    Signed-off-by: Peter Huewe
    Signed-off-by: Andrew Morton
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Peter Huewe
     
  • Bump driver version

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • If we encounter an error when sending a management datagram (i.e. non
    SCSI command, such as virtual adapter initialization command), we
    end up incrementing the request_limit, even though we don't decrement
    it for these commands. Fix this up by doing this increment in
    the error path for SRP commands only.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • Fixes a deadlock that can occur if we hit a command timeout
    during the virtual adapter initialization. The event done
    functions are written with the assumption that no locks are held,
    however, when purging requests this is not true. Fix up the
    purge function to drop the lock so that the done function
    is not called with the lock held, which can cause a deadlock.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • This fixes a softlockup seen on resume. During resume, the CRQ
    must be reenabled. However, the H_ENABLE_CRQ hcall used to do
    this may return H_BUSY or H_LONG_BUSY. When this happens, the
    caller is expected to retry later. This patch changes a simple
    loop, which was causing the softlockup, to a loop at task level
    which sleeps between retries rather than simply spinning.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • Bump driver version.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • Adds support for fc_block_scsi_eh to block the EH handlers if
    the target device is in the blocked state to ensure we don't
    take devices offline.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • This fixes a softlockup seen on resume. During resume, the CRQ
    must be reenabled. However, the H_ENABLE_CRQ hcall used to do
    this may return H_BUSY or H_LONG_BUSY. When this happens, the
    caller is expected to retry later. Normally the H_ENABLE_CRQ
    succeeds relatively soon. However, we have seen cases where
    this can take long enough to see softlockup warnings.
    This patch changes a simple loop, which was causing the
    softlockup, to a loop at task level which sleeps between
    retries rather than simply spinning.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • A driver needs to be ready to take an interrupt as soon as it registers
    an interrupt handler. I noticed the following oops when testing kdump:

    ipr: IBM Power RAID SCSI Device Driver version: 2.5.0 (February 11, 2010)
    ibmvscsi 30000002: SRP_VERSION: 16.a
    ibmvscsi 30000002: SRP_VERSION: 16.a
    Unable to handle kernel paging request for data at address 0x00000000
    ...
    pc: c000000004085e34: .tasklet_action+0xf4/0x1dc
    ...
    c000000004086fe4 .__do_softirq+0x16c/0x2c0
    c00000000403138c .call_do_softirq+0x14/0x24
    c00000000400ee14 .do_softirq+0xa0/0x104
    c00000000408690c .irq_exit+0x70/0xd0
    c00000000400f190 .do_IRQ+0x214/0x2a8
    c000000004004804 hardware_interrupt_entry+0x1c/0x98
    --- Exception: 501 (Hardware Interrupt) at c00000000400c544 .raw_local_irq_restore+0x48/0x54
    c00000000465d2a8 ._raw_spin_unlock_irqrestore+0x74/0xa0
    c0000000040e7f00 .__setup_irq+0x2ec/0x3f0
    c0000000040e8198 .request_threaded_irq+0x194/0x22c
    c00000000446d854 .rpavscsi_init_crq_queue+0x284/0x3f0
    c00000000446c764 .ibmvscsi_probe+0x688/0x710
    c00000000402903c .vio_bus_probe+0x37c/0x3e4
    c000000004403f10 .driver_probe_device+0xec/0x1b8
    c000000004404088 .__driver_attach+0xac/0xf4
    c000000004403184 .bus_for_each_dev+0x98/0x104
    c000000004403c98 .driver_attach+0x40/0x60
    c0000000044026f0 .bus_add_driver+0x154/0x324
    c0000000044045d0 .driver_register+0xe8/0x1ac
    c00000000402b2a8 .vio_register_driver+0x54/0x74
    c000000004933ea4 .ibmvscsi_module_init+0x80/0xc0
    c000000004009834 .do_one_initcall+0x98/0x1d8
    c0000000049005b4 .kernel_init+0x27c/0x33c
    c000000004031550 .kernel_thread+0x54/0x70

    srp_task needs to be setup before request_irq. The patch below fixes the oops.

    Signed-off-by: Anton Blanchard
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Anton Blanchard
     

22 May, 2010

2 commits


19 May, 2010

1 commit


18 May, 2010

1 commit


02 May, 2010

2 commits

  • If a command times out resulting in EH getting invoked, we wait for the
    aborted commands to come back after sending the abort. Shorten
    the amount of time we wait for these responses, to ensure we don't
    get stuck in EH for several minutes.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • Commands which are completed by the VIOS are placed on a CRQ
    in kernel memory for the ibmvfc driver to process. Each CRQ
    entry is 16 bytes. The ibmvfc driver reads the first 8 bytes
    to check if the entry is valid, then reads the next 8 bytes to get
    the handle, which is a pointer the completed command. This fixes
    an issue seen on Power 7 where the processor reordered the
    loads from memory, resulting in processing command completion
    with a stale handle. This could result in command timeouts,
    and also early completion of commands.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     

12 Apr, 2010

1 commit

  • ibmvscsi uses dma_unmap_single() for buffers mapped via
    dma_map_sg(). It works however it's the API violation. The DMA debug
    facility complains about it:

    http://marc.info/?l=linux-scsi&m=127018555013151&w=2

    Reported-by: Sachin Sant
    Tested-by: Sachin Sant
    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     

30 Mar, 2010

1 commit

  • …it 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: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

03 Mar, 2010

2 commits

  • Adds support for resuming from suspend for IBM VFC devices. We may have
    lost an interrupt over the suspend, so we just kick the interrupt handler
    to process anything that is outstanding. We expect to find a transport event
    indicating we need to reestablish our CRQ.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • Adds support for resuming from suspend for IBM VSCSI devices. We may have
    lost an interrupt over the suspend, so we just kick the interrupt handler
    to process anything that is outstanding. We expect to find a transport event
    indicating we need to reestablish our CRQ.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     

02 Mar, 2010

1 commit

  • * 'for-2.6.34' of git://git.kernel.dk/linux-2.6-block: (38 commits)
    block: don't access jiffies when initialising io_context
    cfq: remove 8 bytes of padding from cfq_rb_root on 64 bit builds
    block: fix for "Consolidate phys_segment and hw_segment limits"
    cfq-iosched: quantum check tweak
    blktrace: perform cleanup after setup error
    blkdev: fix merge_bvec_fn return value checks
    cfq-iosched: requests "in flight" vs "in driver" clarification
    cciss: Fix problem with scatter gather elements in the scsi half of the driver
    cciss: eliminate unnecessary pointer use in cciss scsi code
    cciss: do not use void pointer for scsi hba data
    cciss: factor out scatter gather chain block mapping code
    cciss: fix scatter gather chain block dma direction kludge
    cciss: simplify scatter gather code
    cciss: factor out scatter gather chain block allocation and freeing
    cciss: detect bad alignment of scsi commands at build time
    cciss: clarify command list padding calculation
    cfq-iosched: rethink seeky detection for SSDs
    cfq-iosched: rework seeky detection
    block: remove padding from io_context on 64bit builds
    block: Consolidate phys_segment and hw_segment limits
    ...

    Linus Torvalds
     

26 Feb, 2010

1 commit


19 Jan, 2010

1 commit


05 Dec, 2009

7 commits

  • This patch modifies scsi_host_template->change_queue_depth so that
    it takes an argument indicating why it is being called. This will be
    used so that if a LLD needs to do some extra processing when
    handling queue fulls or later ramp ups, it can do so.

    This is a simple port of the drivers setting a change_queue_depth
    callback. In the patch I just have these LLDs adjust the queue depth
    if the user was requesting it.

    Signed-off-by: Mike Christie

    [Vasu.Dev: v2
    Also converted pmcraid_change_queue_depth and then verified
    all modules compile using "make allmodconfig" for any new build
    warnings on X86_64.

    Updated original description after combing two original
    patches from Mike to make this patch git bisectable.]
    Signed-off-by: Vasu Dev
    [jejb: fixed up 53c700]
    Signed-off-by: James Bottomley

    Mike Christie
     
  • Bump driver version to 1.0.7.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • Adds support for FC passthru via BSG.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • When issuing a Cancel to the virtual fibre channel adapter,
    the interface specifies a flags field for the client to indicate
    what kind of error recovery is being performed. Fix up these
    flags for terminate_rport_io to indicate an abort task set
    rather than a target reset.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • Remove a parameter to ibmvfc_init_host which is always set to
    zero by all callers.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • Need to grab the host lock around the call to ibmvfc_link_down.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • When processing the response to either a LUN reset,
    target reset, or an abort task set, the ibmvfc driver needs to
    treat as success receiving a response with a non-zero
    status in the response IU along with a general transport
    error with the FCP response code being zero. The VIOS
    currently guarantees this cannot happen, but a future version
    of VIOS may allow this to be returned, so ensure we handle
    this response combination correctly for TMFs, as we already
    do for SCSI commands.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King