23 Feb, 2017

3 commits

  • Coccinelle emits a warning about casting the return value of
    kmalloc(). Coccinelle suggests removing the cast as do
    kerneljanitors.

    Remove cast from kmalloc() call.

    Signed-off-by: Tobin C. Harding
    Acked-by: Don Brace
    Signed-off-by: Jens Axboe

    Tobin C. Harding
     
  • Checkpatch emits ERROR:OPEN_BRACE: that open brace { should be on the
    previous line.

    Move open brace to new line. Also add space after if/switch statement
    since we introduce more checkpatch errors if not fixed at the same
    time.

    Signed-off-by: Tobin C. Harding
    Acked-by: Don Brace
    Signed-off-by: Jens Axboe

    Tobin C. Harding
     
  • Checkpatch emits 85 trailing whitespace warnings.

    Remove trailing whitespace.

    Signed-off-by: Tobin C. Harding
    Acked-by: Don Brace
    Signed-off-by: Jens Axboe

    Tobin C. Harding
     

09 Nov, 2016

1 commit


01 Jun, 2015

1 commit


10 Apr, 2013

1 commit


18 Sep, 2012

1 commit

  • If a command completes with a status of CMD_PROTOCOL_ERR, this
    information should be conveyed to the SCSI mid layer, not dropped
    on the floor. Unlike a similar bug in the hpsa driver, this bug
    only affects tape drives and CD and DVD ROM drives in the cciss
    driver, and to induce it, you have to disconnect (or damage) a
    cable, so it is not a very likely scenario (which would explain
    why the bug has gone undetected for the last 10 years.)

    Signed-off-by: Stephen M. Cameron
    Cc: stable@vger.kernel.org
    Signed-off-by: Jens Axboe

    Stephen M. Cameron
     

22 Aug, 2012

1 commit

  • Delete code which sets SCSI status incorrectly as it's already been set
    correctly above this incorrect code. The bug was introduced in 2009 by
    commit b0e15f6db111 ("cciss: fix typo that causes scsi status to be
    lost.")

    Signed-off-by: Stephen M. Cameron
    Reported-by: Roel van Meer
    Tested-by: Roel van Meer
    Cc: Jens Axboe
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen M. Cameron
     

23 Mar, 2012

2 commits

  • The total number of scatter gather elements in the CISS command
    used by the scsi tape code was being cast to a u8, which can hold
    at most 255 scatter gather elements. It should have been cast to
    a u16. Without this patch the command gets rejected by the controller
    since the total scatter gather count did not add up to the right
    value resulting in an i/o error.

    Signed-off-by: Stephen M. Cameron
    Cc: stable@vger.kernel.org
    Signed-off-by: Jens Axboe

    Stephen M. Cameron
     
  • The default is too small (1024 blocks), use h->cciss_max_sectors (8192 blocks)
    Without this change, if you try to set the block size of a tape drive above
    512*1024, via "mt -f /dev/st0 setblk nnn" where nnn is greater than 524288,
    it won't work right.

    Signed-off-by: Stephen M. Cameron
    Cc: stable@vger.kernel.org
    Signed-off-by: Jens Axboe

    Stephen M. Cameron
     

16 Nov, 2011

1 commit

  • A long time ago, probably in 2002, one of the distros, or maybe more than
    one, loaded block drivers prior to loading the SCSI mid layer. This meant
    that the cciss driver, being a block driver, could not engage the SCSI mid
    layer at init time without panicking, and relied on being poked by a
    userland program after the system was up (and the SCSI mid layer was
    therefore present) to engage the SCSI mid layer.

    This is no longer the case, and cciss can safely rely on the SCSI mid
    layer being present at init time and engage the SCSI mid layer straight
    away. This means that users will see their tape drives and medium
    changers at driver load time without need for a script in /etc/rc.d that
    does this:

    for x in /proc/driver/cciss/cciss*
    do
    echo "engage scsi" > $x
    done

    However, if no tape drives or medium changers are detected, the SCSI mid
    layer will not be engaged. If a tape drive or medium change is later
    hot-added to the system it will then be necessary to use the above script
    or similar for the device(s) to be acceesible.

    Signed-off-by: Stephen M. Cameron
    Signed-off-by: Andrew Morton
    Signed-off-by: Jens Axboe

    Stephen M. Cameron
     

27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     

06 May, 2011

1 commit

  • This is to allow number of commands reserved for use by SCSI tape drives
    and medium changers to be adjusted at driver load time via the kernel
    parameter cciss_tape_cmds, with a default value of 6, and a range
    of 2 - 16 inclusive. Previously, the driver limited the number of
    commands which could be queued to the SCSI half of the the driver
    to only 2. This is to fix the problem that if you had more than
    two tape drives, you couldn't, for example, erase or rewind them all
    at the same time.

    Signed-off-by: Stephen M. Cameron
    Signed-off-by: Jens Axboe

    Stephen M. Cameron
     

12 Mar, 2011

3 commits


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 Aug, 2010

6 commits

  • cciss: change printks to dev_warn, etc.

    Signed-off-by: Stephen M. Cameron
    Signed-off-by: Jens Axboe

    Stephen M. Cameron
     
  • cciss: separate cmd_alloc() and cmd_special_alloc()
    cmd_alloc() took a parameter which caused it to either allocate
    from a pre-allocated pool, or allocate using pci_alloc_consistent.
    This parameter is always known at compile time, so this would
    be better handled by breaking the function into two functions
    and differentiating the cases by function names. Same goes
    for cmd_free().

    Signed-off-by: Stephen M. Cameron
    Signed-off-by: Jens Axboe

    Stephen M. Cameron
     
  • cciss: use consistent variable names
    "h", for the hba structure and "c" for the command structures.
    and get rid of trivial CCISS_LOCK macro.

    Signed-off-by: Stephen M. Cameron
    Signed-off-by: Jens Axboe

    Stephen M. Cameron
     
  • cciss: Set the performant mode bit in the scsi half of the driver
    In a couple of places, the performant mode bit wasn't being set in
    the scsi half of the driver, causing commands to seem to hang. Use
    enqueue_cmd_and_start_io() where appropriate. This fixes a bug that

    echo engage scsi > /proc/driver/cciss/cciss0

    would hang.

    Signed-off-by: Stephen M. Cameron
    Signed-off-by: Jens Axboe

    Stephen M. Cameron
     
  • Remove a debug statement left behind by accident Ths debug statement got
    left behind. It was commented out after use but not deleted.

    Signed-off-by: Mike Miller
    Cc: Stephen M. Cameron
    Signed-off-by: Andrew Morton
    Signed-off-by: Jens Axboe

    Mike Miller
     
  • Add a mode of controller operation called Performant Mode. Even though
    cciss has been deprecated in favor of hpsa there are new controllers due
    out next year that HP must support in older vendor distros. Vendors
    require all fixes/features be upstream. These new controllers support
    only 16 commands in simple mode but support up to 1024 in performant mode.
    This requires us to add this support at this late date.

    The performant mode transport minimizes host PCI accesses by performinf
    many completions per read. PCI writes are posted so the host can write
    then immediately get off the bus not waiting for the writwe to complete to
    the target. In the context of performant mode the host read out to a
    controller pulls all posted writes into host memory ensuring the reply
    queue is coherent.

    Signed-off-by: Mike Miller
    Cc: Stephen M. Cameron
    Signed-off-by: Andrew Morton
    Signed-off-by: Jens Axboe

    Mike Miller
     

15 Jun, 2010

1 commit


01 Jun, 2010

1 commit


01 Mar, 2010

4 commits


13 Nov, 2009

2 commits


09 Jun, 2009

4 commits


02 Jun, 2009

2 commits

  • Use schedule_timeout_interruptible() instead of open-coding the set and
    schedule parts.

    Cc: Mike Miller
    Cc: Stephen M. Cameron
    Signed-off-by: Andrew Morton
    Signed-off-by: Jens Axboe

    Andrew Morton
     
  • Fix the SCSI reset error handler to send a working, properly addressed
    reset message to the target device and add code to wait for the target
    device to become ready by polling it with Test Unit Ready.

    The existing reset code was broken in that it didn't bother to set the
    8-byte LUN address to anything besides zero, so the command was addressed
    to the controller, which pretended to the driver that the command
    succeeded, while doing nothing. Ages ago I tested this code, but
    unbeknownst to me, my test was flawed, and what I thought was a tape drive
    getting reset was actually nothing of the sort. Unfortunately, there is
    still lots of Smartarray firmware that doesn't handle doing target resets
    right, and this code won't help in those cases, but it also shouldn't make
    things worse in those cases than they already are.

    Signed-off-by: Stephen M. Cameron
    Cc: Mike Miller
    Signed-off-by: Jens Axboe

    Stephen M. Cameron
     

09 Oct, 2008

1 commit

  • Fix cciss SCSI rescan code to better notice device changes.
    If you hot-unplug a tape drive, then hot-plug a different
    tape drive into the same slot in a storage enclosure,
    the cciss driver wouldn't notice anything had changed, as
    it was only looking at the LUN address and device type.
    Now it looks at the inquiry page 0x83 device identifier,
    and vendor and model strings as well.

    Signed-off-by: Stephen M. Cameron
    Signed-off-by: Jens Axboe

    scameron@beardog.cca.cpqcorp.net
     

06 Aug, 2008

2 commits