23 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
     

02 Nov, 2010

1 commit

  • "gadget", "through", "command", "maintain", "maintain", "controller", "address",
    "between", "initiali[zs]e", "instead", "function", "select", "already",
    "equal", "access", "management", "hierarchy", "registration", "interest",
    "relative", "memory", "offset", "already",

    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Jiri Kosina

    Uwe Kleine-König
     

23 Oct, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (84 commits)
    [SCSI] be2iscsi: SGE Len == 64K
    [SCSI] be2iscsi: Remove premature free of cid
    [SCSI] be2iscsi: More time for FW
    [SCSI] libsas: fix bug for vacant phy
    [SCSI] sd: Fix overflow with big physical blocks
    [SCSI] st: add MTWEOFI to write filemarks without flushing drive buffer
    [SCSI] libsas: Don't issue commands to devices that have been hot-removed
    [SCSI] megaraid_sas: Add Online Controller Reset to MegaRAID SAS drive
    [SCSI] lpfc 8.3.17: Update lpfc driver version to 8.3.17
    [SCSI] lpfc 8.3.17: Replace function reset methodology
    [SCSI] lpfc 8.3.17: SCSI fixes
    [SCSI] lpfc 8.3.17: BSG fixes
    [SCSI] lpfc 8.3.17: SLI Additions and Fixes
    [SCSI] lpfc 8.3.17: Code Cleanup and Locking fixes
    [SCSI] zfcp: Remove scsi_cmnd->serial_number from debug traces
    [SCSI] ipr: fix array error logging
    [SCSI] aha152x: enable PCMCIA on 64bit
    [SCSI] scsi_dh_alua: Handle all states correctly
    [SCSI] cxgb4i: connection and ddp setting update
    [SCSI] cxgb3i: fixed connection over vlan
    ...

    Linus Torvalds
     

05 Oct, 2010

1 commit

  • The block device drivers have all gained new lock_kernel
    calls from a recent pushdown, and some of the drivers
    were already using the BKL before.

    This turns the BKL into a set of per-driver mutexes.
    Still need to check whether this is safe to do.

    file=$1
    name=$2
    if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
    sed -i '/include.*/d' ${file}
    else
    sed -i 's/include.*.*$/include /g' ${file}
    fi
    sed -i ${file} \
    -e "/^#include.*linux.mutex.h/,$ {
    1,/^\(static\|int\|long\)/ {
    /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

    } }" \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[ ]*cycle_kernel_lock();/d'
    else
    sed -i -e '/include.*\/d' ${file} \
    -e '/cycle_kernel_lock()/d'
    fi

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

16 Sep, 2010

1 commit

  • All these files use the big kernel lock in a trivial
    way to serialize their private file operations,
    typically resulting from an earlier semi-automatic
    pushdown from VFS.

    None of these drivers appears to want to lock against
    other code, and they all use the BKL as the top-level
    lock in their file operations, meaning that there
    is no lock-order inversion problem.

    Consequently, we can remove the BKL completely,
    replacing it with a per-file mutex in every case.
    Using a scripted approach means we can avoid
    typos.

    file=$1
    name=$2
    if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
    sed -i '/include.*/d' ${file}
    else
    sed -i 's/include.*.*$/include /g' ${file}
    fi
    sed -i ${file} \
    -e "/^#include.*linux.mutex.h/,$ {
    1,/^\(static\|int\|long\)/ {
    /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

    } }" \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[ ]*cycle_kernel_lock();/d'
    else
    sed -i -e '/include.*\/d' ${file} \
    -e '/cycle_kernel_lock()/d'
    fi

    Signed-off-by: Arnd Bergmann
    Cc: linux-scsi@vger.kernel.org
    Cc: "James E.J. Bottomley"

    Arnd Bergmann
     

06 Sep, 2010

1 commit

  • In this code, 0 is returned on memory allocation failure, even though other
    failures return -ENOMEM or other similar values.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression ret;
    expression x,e1,e2,e3;
    @@

    ret = 0
    ... when != ret = e1
    *x = \(kmalloc\|kcalloc\|kzalloc\)(...)
    ... when != ret = e2
    if (x == NULL) { ... when != ret = e3
    return ret;
    }
    //

    Signed-off-by: Julia Lawall
    Acked-by: "Desai, Kashyap"
    Signed-off-by: James Bottomley

    Julia Lawall
     

15 Aug, 2010

3 commits

  • Fix fusion missing kernel-doc:

    Warning(drivers/message/fusion/mptbase.c:649): No description found for parameter 'func_name'
    Warning(drivers/message/fusion/mptbase.c:8010): No description found for parameter 'cb_idx'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Fix comment begin notation not to look like kernel-doc
    since it's not. Removes kernel-doc warnings.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (28 commits)
    [SCSI] qla4xxx: fix compilation warning
    [SCSI] make error handling more robust in the face of reservations
    [SCSI] tgt: fix warning
    [SCSI] drivers/message/fusion: Adjust confusing if indentation
    [SCSI] Return NEEDS_RETRY for eh commands with status BUSY
    [SCSI] ibmvfc: Driver version 1.0.9
    [SCSI] ibmvfc: Fix terminate_rport_io
    [SCSI] ibmvfc: Fix rport add/delete race resulting in oops
    [SCSI] lpfc 8.3.16: Change LPFC driver version to 8.3.16
    [SCSI] lpfc 8.3.16: FCoE Discovery and Failover Fixes
    [SCSI] lpfc 8.3.16: SLI Additions, updates, and code cleanup
    [SCSI] pm8001: introduce missing kfree
    [SCSI] qla4xxx: Update driver version to 5.02.00-k3
    [SCSI] qla4xxx: Added AER support for ISP82xx
    [SCSI] qla4xxx: Handle outstanding mbx cmds on hung f/w scenarios
    [SCSI] qla4xxx: updated mbx_sys_info struct to sync with FW 4.6.x
    [SCSI] qla4xxx: clear AF_DPC_SCHEDULED flage when exit from do_dpc
    [SCSI] qla4xxx: Stop firmware before doing init firmware.
    [SCSI] qla4xxx: Use the correct request queue.
    [SCSI] qla4xxx: set correct value in sess->recovery_tmo
    ...

    Linus Torvalds
     

13 Aug, 2010

1 commit

  • * 'params' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (22 commits)
    param: don't deref arg in __same_type() checks
    param: update drivers/acpi/debug.c to new scheme
    param: use module_param in drivers/message/fusion/mptbase.c
    ide: use module_param_named rather than module_param_call
    param: update drivers/char/ipmi/ipmi_watchdog.c to new scheme
    param: lock if_sdio's lbs_helper_name and lbs_fw_name against sysfs changes.
    param: lock myri10ge_fw_name against sysfs changes.
    param: simple locking for sysfs-writable charp parameters
    param: remove unnecessary writable charp
    param: add kerneldoc to moduleparam.h
    param: locking for kernel parameters
    param: make param sections const.
    param: use free hook for charp (fix leak of charp parameters)
    param: add a free hook to kernel_param_ops.
    param: silence .init.text references from param ops
    Add param ops struct for hvc_iucv driver.
    nfs: update for module_param_named API change
    AppArmor: update for module_param_named API change
    param: use ops in struct kernel_param, rather than get and set fns directly
    param: move the EXPORT_SYMBOL to after the definitions.
    ...

    Linus Torvalds
     

11 Aug, 2010

9 commits

  • Fix (delete) empty kernel-doc lines/warnings:
    Warning(drivers/message/fusion/mptbase.c:6916): bad line:
    Warning(drivers/message/fusion/mptbase.c:7060): bad line:

    Signed-off-by: Randy Dunlap
    Cc: Eric Moore
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Check return value of put_user() and return -EFAULT if it failed.
    Original comment "We did a get user...so assuming mem is ok...is this
    bad?" is incorrect because memory can be read only.

    Signed-off-by: Kulikov Vasiliy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kulikov Vasiliy
     
  • If (len > reslen) we must not call copy_to_user() since kernel buffer is
    smaller than we want to copy. Similar code in this file is correct, so
    this bug was a typo.

    Signed-off-by: Kulikov Vasiliy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kulikov Vasiliy
     
  • Add a mutex_unlock missing on the error path.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression E1;
    @@

    * mutex_lock(E1,...);

    * mutex_unlock(E1,...);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Convert everything except ->proc_info() stuff, it is done within separate
    ->proc_info path series.

    Problem with ->read_proc et al is described here commit
    786d7e1612f0b0adb6046f19b906609e4fe8b1ba "Fix rmmod/read/write races in
    /proc entries"

    Signed-off-by: Alexey Dobriyan
    Cc: Eric Moore
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • If the NULL test on dev->i2o_dev or i2o_dev is needed, then the dereference
    should be after the NULL test.

    A simplified version of the semantic match that detects this problem is as
    follows (http://coccinelle.lip6.fr/):

    //
    @match exists@
    expression x, E;
    identifier fld;
    @@

    * x->fld
    ... when != \(x = E\|&x\)
    * x == NULL
    //

    Signed-off-by: Julia Lawall
    Cc: James Bottomley
    Cc: Kashyap Desai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • No need to open code this!

    Signed-off-by: Rusty Russell
    Reviewed-by: Takashi Iwai

    Rusty Russell
     
  • Indent the branch of an if.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable braces4@
    position p1,p2;
    statement S1,S2;
    @@

    (
    if (...) { ... }
    |
    if (...) S1@p1 S2@p2
    )

    @script:python@
    p1 << r.p1;
    p2 << r.p2;
    @@

    if (p1[0].column == p2[0].column):
    cocci.print_main("branch",p1)
    cocci.print_secs("after",p2)
    //

    Signed-off-by: Julia Lawall
    Acked-by: "Desai, Kashyap"
    Signed-off-by: James Bottomley

    Julia Lawall
     
  • * 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block: (149 commits)
    block: make sure that REQ_* types are seen even with CONFIG_BLOCK=n
    xen-blkfront: fix missing out label
    blkdev: fix blkdev_issue_zeroout return value
    block: update request stacking methods to support discards
    block: fix missing export of blk_types.h
    writeback: fix bad _bh spinlock nesting
    drbd: revert "delay probes", feature is being re-implemented differently
    drbd: Initialize all members of sync_conf to their defaults [Bugz 315]
    drbd: Disable delay probes for the upcomming release
    writeback: cleanup bdi_register
    writeback: add new tracepoints
    writeback: remove unnecessary init_timer call
    writeback: optimize periodic bdi thread wakeups
    writeback: prevent unnecessary bdi threads wakeups
    writeback: move bdi threads exiting logic to the forker thread
    writeback: restructure bdi forker loop a little
    writeback: move last_active to bdi
    writeback: do not remove bdi from bdi_list
    writeback: simplify bdi code a little
    writeback: do not lose wake-ups in bdi threads
    ...

    Fixed up pretty trivial conflicts in drivers/block/virtio_blk.c and
    drivers/scsi/scsi_error.c as per Jens.

    Linus Torvalds
     

08 Aug, 2010

5 commits

  • This restores the changes from "scsi/i2o_block: cleanup ioctl
    handling", which accidentally got reverted.

    Origignal changelog:
    This fixes the ioctl function of the i2o_block driver, which
    has multiple problems:

    * The BLKI2OSRSTRAT and BLKI2OSWSTRAT commands always return
    -ENOTTY on success, where they should return 0.
    * Support for 32 bit compat is missing
    * The driver should use the .ioctl function and because
    .locked_ioctl is going away.

    The use of the big kernel lock remains for now, but gets
    made explictit in the ioctl function.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     
  • The open and release block_device_operations are currently
    called with the BKL held. In order to change that, we must
    first make sure that all drivers that currently rely
    on this have no regressions.

    This blindly pushes the BKL into all .open and .release
    operations for all block drivers to prepare for the
    next step. The drivers can subsequently replace the BKL
    with their own locks or remove it completely when it can
    be shown that it is not needed.

    The functions blkdev_get and blkdev_put are the only
    remaining users of the big kernel lock in the block
    layer, besides a few uses in the ioctl code, none
    of which need to serialize with blkdev_{get,put}.

    Most of these two functions is also under the protection
    of bdev->bd_mutex, including the actual calls to
    ->open and ->release, and the common code does not
    access any global data structures that need the BKL.

    Signed-off-by: Arnd Bergmann
    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     
  • As a preparation for the removal of the big kernel
    lock in the block layer, this removes the BKL
    from the common ioctl handling code, moving it
    into every single driver still using it.

    Signed-off-by: Arnd Bergmann
    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     
  • This fixes the ioctl function of the i2o_block driver, which
    has multiple problems:

    * The BLKI2OSRSTRAT and BLKI2OSWSTRAT commands always return
    -ENOTTY on success, where they should return 0.
    * Support for 32 bit compat is missing
    * The driver should use the .ioctl function and because
    .locked_ioctl is going away.

    The use of the big kernel lock remains for now, but gets
    made explictit in the ioctl function.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     
  • Remove all the trivial wrappers for the cmd_type and cmd_flags fields in
    struct requests. This allows much easier grepping for different request
    types instead of unwinding through macros.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

05 Aug, 2010

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (48 commits)
    Documentation: update broken web addresses.
    fix comment typo "choosed" -> "chosen"
    hostap:hostap_hw.c Fix typo in comment
    Fix spelling contorller -> controller in comments
    Kconfig.debug: FAIL_IO_TIMEOUT: typo Faul -> Fault
    fs/Kconfig: Fix typo Userpace -> Userspace
    Removing dead MACH_U300_BS26
    drivers/infiniband: Remove unnecessary casts of private_data
    fs/ocfs2: Remove unnecessary casts of private_data
    libfc: use ARRAY_SIZE
    scsi: bfa: use ARRAY_SIZE
    drm: i915: use ARRAY_SIZE
    drm: drm_edid: use ARRAY_SIZE
    synclink: use ARRAY_SIZE
    block: cciss: use ARRAY_SIZE
    comment typo fixes: charater => character
    fix comment typos concerning "challenge"
    arm: plat-spear: fix typo in kerneldoc
    reiserfs: typo comment fix
    update email address
    ...

    Linus Torvalds
     

28 Jul, 2010

14 commits

  • We should release the resources in error return code path.
    The requested pci bars should be released under an error condition,
    when mpt_mapresources fails.

    Signed-off-by: Tomas Henzl
    Acked-by: "Desai, Kashyap"
    Signed-off-by: James Bottomley

    Tomas Henzl
     
  • Version upgrade patch.

    Signed-off-by: Kashyap Desai
    Signed-off-by: James Bottomley

    Kashyap, Desai
     
  • Adding function name in original debug prints and few more debug prints are
    added.

    Signed-off-by: Kashyap Desai
    Cc: Stable Tree
    Signed-off-by: James Bottomley

    Kashyap, Desai
     
  • Issue description:
    In multipath topology, when device deletion is in transient state,
    multipath driver can call blk_flush_queue() as part of path failure.
    Before device get deleted from OS, Device may go OFFLINE as part of error
    handling kicked off triggered from multipathing driver. Above condition hits
    more frequently if device missing delay timer (which is LSI specific firmware
    parameter) is non zero value.

    root cause of this issue is Error handling thread is getting kicked off for
    device which is not really present(in transient state of deleting).

    This patch has solution for this issue. driver is now using eh_timed_out
    callback. See below.

    mptsas_transport_template->eh_timed_out = mptsas_eh_timed_out

    Using mptsas_eh_timed_out function, driver can decide weather vdevice is
    under Device missing delay or deleting state.

    for either of those cases, there is BLK_EH_RESET_TIMER return to scsi mid
    and error handling thread will not be kicked off for that particular scsi
    command.

    Signed-off-by: Kashyap Desai
    Cc: Stable Tree
    Signed-off-by: James Bottomley

    Kashyap, Desai
     
  • Printing Doorbell register in a case of hard reset and timeout
    should be useful for figuring out the state of the system.

    Signed-off-by: Kei Tokunaga
    Acked-by: "Desai, Kashyap"
    Signed-off-by: James Bottomley

    Kei Tokunaga
     
  • This patch fixes mptsas disk hot-removal processing. The
    hot-removal processing doesn't complete because of this condition.

    drivers/message/fusion/mptsas.c:
    mptsas_taskmgmt_complete()

    if ((mptsas_find_vtarget(ioc, channel, id)) && !ioc->fw_events_off)
    mptsas_queue_device_delete(...);

    mptsas_queue_device_delete(), which must be called for
    hot-removal, never gets called because mptsas_find_vtarget()
    always returns 0 here. At that time, the vtarget has already
    been freed in mptsas_target_destroy(), and also the scsi_device
    has been marked as SDEV_DEL.

    As a result of the issue, port deletion functions won't get
    called and the device ends up being in an incomplete state.
    (Some data structures and sysfs entries, which should be
    removed in hot-removal, remain.) One side effect of this is
    that a hot-addition of the device (bringing the device back
    on) fails.

    This patch just removes mptsas_find_vtarget() from the if-state
    condition.

    Signed-off-by: Kei Tokunaga
    Acked-by: "Desai, Kashyap"
    Signed-off-by: James Bottomley

    Kei Tokunaga
     
  • In mpt_detach, call to pci_set_drvdata is redundant because it
    has already been called in mpt_adapter_disable. In mpt_attach,
    ioc->pcidev is set to pdev two times.

    Signed-off-by: Bandan Das
    Acked-by: "Desai, Kashyap"
    Signed-off-by: James Bottomley

    Bandan Das
     
  • Upgrade driver version to 3.4.16

    Signed-off-by: Kashyap Desai
    Signed-off-by: James Bottomley

    Kashyap, Desai
     
  • Added missing part which will reset ioc_reset_in_progress before returning from SoftResetHandler.

    Signed-off-by: Kashyap Desai
    Signed-off-by: James Bottomley

    Kashyap, Desai
     
  • Issue: SATA hotplug does not work sometimes.
    At the time of ADD device/ADD phys disk, drive may fail to add SATA device
    due to temporary SAS Address for SATA device generated by firmware. Final
    SAS address for SATA driver will be generated only after disk spinup is
    done. This may take some times for slow spining SATA drives.

    At phy link up driver gets attached device sas address and stores into
    phyinfo. At the time of ADD event driver will read sas device page0 using
    channel and FW ID provided in ADD Device event. Here in case of SATA drives,
    driver will see miss match in phyinfo->sas_address and latest sas address
    read from SAS DEVICE PAGE0 and eventually device won't be added to OS.

    Fix:
    When Driver read SAS DEVICE PAGE0, it can identify Device type looking at
    device_info. If device is SATA drive and sas address mismatch happens,
    Driver will do same stuffs which happened at the time of LINK UP to get
    correct piece of information from Pages. ( Find parent device and refresh
    parent device phys either HBA refresh/Exp refresh)

    Signed-off-by: Kashyap Desai
    Signed-off-by: James Bottomley

    Kashyap, Desai
     
  • Issue:
    target reset will be queued to driver's internal queue to get schedule
    later. When driver add target into internal target_reset queue we will block IOs
    on those target using scsi midlayer API. Now due to some cause driver is not
    executing those target_reset list and it is always in block state.

    Changes:
    now we are clearing target_reset queue from all other Callback context
    instead of only DeviceReset context.Now wherever driver is clearing
    taskmgmt_in_progress flag it is considering target_reset queue cleanup
    also.

    Signed-off-by: Kashyap Desai
    Signed-off-by: James Bottomley

    Kashyap, Desai
     
  • Added sanity check before treating any device is a valid device.
    It is possible that firmware can have device page0 in its table, but that
    devicemay not be available in topology. Device will be available in topology
    only if there is Bus Target mapping is done in firmware. Driver will always
    check B_T mapping of firmware before reporting device to upper layer.

    Signed-off-by: Kashyap Desai
    Signed-off-by: James Bottomley

    Kashyap, Desai
     
  • device missing delay is 8 bit value in io unit pg1. Making correct variable
    declaration for device_missing_delay.

    The driver is storing the calculated device missing delay in IOC structure
    as a u8 instead of a u16. It needs to be a u16 if the delay is > 255.

    Signed-off-by: Kashyap Desai
    Signed-off-by: James Bottomley

    Kashyap, Desai
     
  • Changed the return value for Nexus Loss IOs to be DID_TRANSPORT_DISRUPTED.
    What this will allow is the multi-path driver to delay the fail over
    process. They would like the path to keep up as long as the nexus loss
    Loginfo is return from firmware. With DID_BUS_BUSY the path fails over
    immediately.

    Signed-off-by: Kashyap Desai
    Signed-off-by: James Bottomley

    Kashyap, Desai