26 Jul, 2012

1 commit


20 Jul, 2012

1 commit

  • During alua transitions, an array can return transitioning
    status in response to rtpg requests. These requests get
    retried for a maximum of 60 seconds by default before timing
    out. Sometimes this timeout isn't sufficient to allow the
    array to complete the transition. T10-spc4 addresses this
    under 'Report Target Port Groups' command.

    This update retrieves the timeout value from the storage
    array if available and retries the transitioning rtpgs
    for up to the 'implied transitioning timeout' value

    Signed-off-by: Rob Evers
    Reviewed-by: Babu Moger
    Signed-off-by: James Bottomley

    Rob Evers
     

29 Jun, 2012

1 commit


26 Feb, 2012

1 commit


21 Jul, 2011

1 commit

  • All these are instances of
    #define NAME value;
    or
    #define NAME(params_opt) value;

    These of course fail to build when used in contexts like
    if(foo $OP NAME)
    while(bar $OP NAME)
    and may silently generate the wrong code in contexts such as
    foo = NAME + 1; /* foo = value; + 1; */
    bar = NAME - 1; /* bar = value; - 1; */
    baz = NAME & quux; /* baz = value; & quux; */

    Reported on comp.lang.c,
    Message-ID:
    Initial analysis of the dangers provided by Keith Thompson in that thread.

    There are many more instances of more complicated macros having unnecessary
    trailing semicolons, but this pile seems to be all of the cases of simple
    values suffering from the problem. (Thus things that are likely to be found
    in one of the contexts above, more complicated ones aren't.)

    Signed-off-by: Phil Carmody
    Signed-off-by: Jiri Kosina

    Phil Carmody
     

18 Mar, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (170 commits)
    [SCSI] scsi_dh_rdac: Add MD36xxf into device list
    [SCSI] scsi_debug: add consecutive medium errors
    [SCSI] libsas: fix ata list corruption issue
    [SCSI] hpsa: export resettable host attribute
    [SCSI] hpsa: move device attributes to avoid forward declarations
    [SCSI] scsi_debug: Logical Block Provisioning (SBC3r26)
    [SCSI] sd: Logical Block Provisioning update
    [SCSI] Include protection operation in SCSI command trace
    [SCSI] hpsa: fix incorrect PCI IDs and add two new ones (2nd try)
    [SCSI] target: Fix volume size misreporting for volumes > 2TB
    [SCSI] bnx2fc: Broadcom FCoE offload driver
    [SCSI] fcoe: fix broken fcoe interface reset
    [SCSI] fcoe: precedence bug in fcoe_filter_frames()
    [SCSI] libfcoe: Remove stale fcoe-netdev entries
    [SCSI] libfcoe: Move FCOE_MTU definition from fcoe.h to libfcoe.h
    [SCSI] libfc: introduce __fc_fill_fc_hdr that accepts fc_hdr as an argument
    [SCSI] fcoe, libfc: initialize EM anchors list and then update npiv EMs
    [SCSI] Revert "[SCSI] libfc: fix exchange being deleted when the abort itself is timed out"
    [SCSI] libfc: Fixing a memory leak when destroying an interface
    [SCSI] megaraid_sas: Version and Changelog update
    ...

    Fix up trivial conflicts due to whitespace differences in
    drivers/scsi/libsas/{sas_ata.c,sas_scsi_host.c}

    Linus Torvalds
     

13 Feb, 2011

1 commit

  • Instead of just passing 'EIO' for any I/O error we should be
    notifying the upper layers with more details about the cause
    of this error.

    Update the possible I/O errors to:

    - ENOLINK: Link failure between host and target
    - EIO: Retryable I/O error
    - EREMOTEIO: Non-retryable I/O error
    - EBADE: I/O error restricted to the I_T_L nexus

    'Retryable' in this context means that an I/O error _might_ be
    restricted to the I_T_L nexus (vulgo: path), so retrying on another
    nexus / path might succeed.

    'Non-retryable' in general refers to a target failure, so this
    error will always be generated regardless of the I_T_L nexus
    it was send on.

    I/O errors restricted to the I_T_L nexus might be retried
    on another nexus / path, but they should _not_ be queued
    if no paths are available.

    Signed-off-by: Hannes Reinecke
    Signed-off-by: Mike Snitzer
    Signed-off-by: James Bottomley

    Hannes Reinecke
     

25 Jan, 2011

1 commit


14 Jan, 2011

1 commit

  • * 'for-2.6.38/core' of git://git.kernel.dk/linux-2.6-block: (43 commits)
    block: ensure that completion error gets properly traced
    blktrace: add missing probe argument to block_bio_complete
    block cfq: don't use atomic_t for cfq_group
    block cfq: don't use atomic_t for cfq_queue
    block: trace event block fix unassigned field
    block: add internal hd part table references
    block: fix accounting bug on cross partition merges
    kref: add kref_test_and_get
    bio-integrity: mark kintegrityd_wq highpri and CPU intensive
    block: make kblockd_workqueue smarter
    Revert "sd: implement sd_check_events()"
    block: Clean up exit_io_context() source code.
    Fix compile warnings due to missing removal of a 'ret' variable
    fs/block: type signature of major_to_index(int) to major_to_index(unsigned)
    block: convert !IS_ERR(p) && p to !IS_ERR_NOR_NULL(p)
    cfq-iosched: don't check cfqg in choose_service_tree()
    fs/splice: Pull buf->ops->confirm() from splice_from_pipe actors
    cdrom: export cdrom_check_events()
    sd: implement sd_check_events()
    sr: implement sr_check_events()
    ...

    Linus Torvalds
     

22 Dec, 2010

1 commit

  • This patch adds a handful of missing CDBs defs that are used by TCM
    persistent reservation logic in the SPC-4 defined CDB exclusion table for
    registrations and reservations.

    This includes a number of missing MI_* and MO_* prefixed service actions defs
    for MAINTENANCE_IN and MAINTENANCE_OUT that are mentioned wrt to persistent
    registration and reservation status for the SCSI Initiator Port.

    Signed-off-by: Nicholas A. Bellinger
    Signed-off-by: James Bottomley

    Nicholas Bellinger
     

17 Dec, 2010

1 commit

  • Replace sr_media_change() with sr_check_events(). It normally only
    uses GET_EVENT_STATUS_NOTIFICATION to check both media change and
    eject request. If @clearing includes DISK_EVENT_MEDIA_CHANGE, it
    issues TUR and compares whether media presence has changed. The SCSI
    specific media change uevent is kept for compatibility.

    sr_media_change() was doing both media change check and revalidation.
    The revalidation part is split into sr_block_revalidate_disk().

    Signed-off-by: Tejun Heo
    Cc: Kay Sievers
    Signed-off-by: Jens Axboe

    Tejun Heo
     

23 Oct, 2010

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (141 commits)
    USB: mct_u232: fix broken close
    USB: gadget: amd5536udc.c: fix error path
    USB: imx21-hcd - fix off by one resource size calculation
    usb: gadget: fix Kconfig warning
    usb: r8a66597-udc: Add processing when USB was removed.
    mxc_udc: add workaround for ENGcm09152 for i.MX35
    USB: ftdi_sio: add device ids for ScienceScope
    USB: musb: AM35x: Workaround for fifo read issue
    USB: musb: add musb support for AM35x
    USB: AM35x: Add musb support
    usb: Fix linker errors with CONFIG_PM=n
    USB: ohci-sh - use resource_size instead of defining its own resource_len macro
    USB: isp1362-hcd - use resource_size instead of defining its own resource_len macro
    USB: isp116x-hcd - use resource_size instead of defining its own resource_len macro
    USB: xhci: Fix compile error when CONFIG_PM=n
    USB: accept some invalid ep0-maxpacket values
    USB: xHCI: PCI power management implementation
    USB: xHCI: bus power management implementation
    USB: xHCI: port remote wakeup implementation
    USB: xHCI: port power management implementation
    ...

    Manually fix up (non-data) conflict: the SCSI merge gad renamed the
    'hw_sector_size' member to 'physical_block_size', and the USB tree
    brought a new use of it.

    Linus Torvalds
     
  • This commit changes storage_common.h, file_storage.c and
    f_mass_storage.c to use definitions of SCSI commands from
    scsi/scsi.h file instead of redefining the commands in
    storage_common.c.

    scsi/scsi.h header file was missing READ_FORMAT_CAPACITIES and
    READ_HEADER so this commit also add those to the header.

    Signed-off-by: Michal Nazarewicz
    Cc: Alan Stern
    Cc: James Bottomley
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     

11 Sep, 2010

1 commit

  • Some controllers have a hardware limit on the number of protection
    information scatter-gather list segments they can handle.

    Introduce a max_integrity_segments limit in the block layer and provide
    a new scsi_host_template setting that allows HBA drivers to provide a
    value suitable for the hardware.

    Add support for honoring the integrity segment limit when merging both
    bios and requests.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

11 Aug, 2010

1 commit

  • Commit 9e4f5e29 ("FC Pass Thru support") exported a number of header files
    in include/scsi to user space, but didn't change the uX types to the
    userspace-compatible __uX types. Without that you'll get compile errors
    when including them - E.G.:

    include/scsi/scsi.h:145: error: expected specifier-qualifier-list before `u8'

    Signed-off-by: Peter Korsgaard
    Cc: Boaz Harrosh
    Cc: James Smart
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Korsgaard
     

01 May, 2010

1 commit


11 Apr, 2010

1 commit

  • If the scsi eh is running and then a FC LLD calls
    fc_remote_port_delete, the SCSI commands sent from the eh will fail.
    To prevent this, a FC LLD can call fc_block_scsi_eh from the eh
    callback, blocking the eh thread until the dev_loss_tmo fires or the
    remote port is available again.

    If (e.g. for a multipathing setup) the dev_loss_tmo is set to a very
    large value, thus preventing the scsi device removal , the scsi eh can
    block for a long time. For multipathing, the fast_io_fail_tmo is then
    set to a low value to detect path problems sooner.

    This patch introduces a new return code FAST_IO_FAIL. The function
    fc_block_scsi_eh now returns FAST_IO_FAIL when the fast_io_fail_tmo
    fires. This indicates that the LLD terminated all pending I/O requests
    and there are no more pending SCSI commands for the scsi eh to wait
    for. This return code can be passed back to the scsi eh to stop the
    escalation and finish the recovery process for this device.

    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Christof Schmitt
     

05 Dec, 2009

1 commit


02 Oct, 2009

1 commit

  • Disks formatted with DIF Type 2 reject READ/WRITE 6/10/12/16 commands
    when protection is enabled. Only the 32-byte variants are supported.

    Implement support for issusing 32-byte READ/WRITE and enable Type 2
    drives in the protection type detection logic.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: James Bottomley

    Martin K. Petersen
     

13 Mar, 2009

3 commits


13 Oct, 2008

2 commits

  • Currently, if there is a transport problem the iscsi drivers will return
    outstanding commands (commands being exeucted by the driver/fw/hw) with
    DID_BUS_BUSY and block the session so no new commands can be queued.
    Commands that are caught between the failure handling and blocking are
    failed with DID_IMM_RETRY or one of the scsi ml queuecommand return values.
    When the recovery_timeout fires, the iscsi drivers then fail IO with
    DID_NO_CONNECT.

    For fcp, some drivers will fail some outstanding IO (disk but possibly not
    tape) with DID_BUS_BUSY or DID_ERROR or some other value that causes a retry
    and hits the scsi_error.c failfast check, block the rport, and commands
    caught in the race are failed with DID_IMM_RETRY. Other drivers, may
    hold onto all IO and wait for the terminate_rport_io or dev_loss_tmo_callbk
    to be called.

    The following patches attempt to unify what upper layers will see drivers
    like multipath can make a good guess. This relies on drivers being
    hooked into their transport class.

    This first patch just defines two new host byte errors so drivers can
    return the same value for when a rport/session is blocked and for
    when the fast_io_fail_tmo fires.

    The idea is that if the LLD/class detects a problem and is going to block
    a rport/session, then if the LLD wants or must return the command to scsi-ml,
    then it can return it with DID_TRANSPORT_DISRUPTED. This will requeue
    the IO into the same scsi queue it came from, until the fast io fail timer
    fires and the class decides what to do.

    When using multipath and the fast_io_fail_tmo fires then the class
    can fail commands with DID_TRANSPORT_FAILFAST or drivers can use
    DID_TRANSPORT_FAILFAST in their terminate_rport_io callbacks or
    the equivlent in iscsi if we ever implement more advanced recovery methods.
    A LLD, like lpfc, could continue to return DID_ERROR and then it will hit
    the normal failfast path, so drivers do not have fully be ported to
    work better. The point of the patches is that upper layers will
    not see a failure that could be recovered from while the rport/session is
    blocked until fast_io_fail_tmo/recovery_timeout fires.

    V3
    Remove some comments.
    V2
    Fixed patch/diff errors and renamed DID_TRANSPORT_BLOCKED to
    DID_TRANSPORT_DISRUPTED.
    V1
    initial patch.

    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Mike Christie
     
  • SCSI-ml manages the queueing limits for the device and host, but
    does not do so at the target level. However something something similar
    can come in userful when a driver is transitioning a transport object to
    the the blocked state, becuase at that time we do not want to queue
    io and we do not want the queuecommand to be called again.

    The patch adds code similar to the exisiting SCSI_ML_*BUSY handlers.
    You can now return SCSI_MLQUEUE_TARGET_BUSY when we hit
    a transport level queueing issue like the hw cannot allocate some
    resource at the iscsi session/connection level, or the target has temporarily
    closed or shrunk the queueing window, or if we are transitioning
    to the blocked state.

    bnx2i, when they rework their firmware according to netdev
    developers requests, will also need to be able to limit queueing at this
    level. bnx2i will hook into libiscsi, but will allocate a scsi host per
    netdevice/hba, so unlike pure software iscsi/iser which is allocating
    a host per session, it cannot set the scsi_host->can_queue and return
    SCSI_MLQUEUE_HOST_BUSY to reflect queueing limits on the transport.

    The iscsi class/driver can also set a scsi_target->can_queue value which
    reflects the max commands the driver/class can support. For iscsi this
    reflects the number of commands we can support for each session due to
    session/connection hw limits, driver limits, and to also reflect the
    session/targets's queueing window.

    Changes:
    v1 - initial patch.
    v2 - Fix scsi_run_queue handling of multiple blocked targets.
    Previously we would break from the main loop if a device was added back on
    the starved list. We now run over the list and check if any target is
    blocked.
    v3 - Rediff for scsi-misc.

    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Mike Christie
     

29 Aug, 2008

1 commit

  • For IBM z series certain LUNs can no longer be accessed.

    This is because kernel version 2.6.19 a check was introduced not to
    create a generic SCSI device for devices that return PQ=1 and
    PDT=0x1f. For WLUNs (see SAM-3, p. 41ff) generic SCSI devices should
    be created unconditionally without looking at the PQ bit, so add a
    check for WLUNs in with this test.

    Acked-by: Martin Petermann
    Signed-off-by: James Bottomley

    James Bottomley
     

27 Jul, 2008

1 commit


12 Jul, 2008

1 commit


05 Jun, 2008

1 commit

  • Some of the storage devices (that can be accessed through multiple paths),
    do need some special handling for
    1. Activating the passive path of the storage access.
    2. Decode and handle the special sense codes returned by the devices.
    3. Handle the I/Os being sent to the passive path, especially
    during the device probe time.
    when accessed through multiple paths.

    As of today this special device handling is done at the dm-multipath
    layer using dm-handlers. That works well for (1); for (2) to be handled
    at dm layer, scsi sense information need to be exported from SCSI to dm-layer,
    which is not very attractive; (3) cannot be done at all at the dm layer.

    Device handler has been moved to SCSI mainly to handle (2) and (3) properly.

    Signed-off-by: Chandra Seetharaman
    Signed-off-by: Mike Anderson
    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Chandra Seetharaman
     

03 May, 2008

1 commit

  • Add support for variable-length, extended, and vendor specific
    CDBs to scsi-ml. It is now possible for initiators and ULD's
    to issue these types of commands. LLDs need not change much.
    All they need is to raise the .max_cmd_len to the longest command
    they support (see iscsi patch).

    - clean-up some code paths that did not expect commands to be
    larger than 16, and change cmd_len members' type to short as
    char is not enough.

    Signed-off-by: Boaz Harrosh
    Signed-off-by: Benny Halevy
    Signed-off-by: James Bottomley

    Boaz Harrosh
     

08 Feb, 2008

1 commit


31 Jan, 2008

2 commits


16 Oct, 2007

1 commit

  • This is what enables large commands. If we need to allocate an
    sgtable that doesn't fit in a single page, allocate several
    SCSI_MAX_SG_SEGMENTS sized tables and chain them together.

    SCSI defaults to large chained sg tables, if the arch supports it.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

18 Apr, 2007

1 commit

  • The following patch adds support for sysfs/uevent modalias
    attribute for scsi devices (like disks, tapes, cdroms etc),
    based on whatever current sd.c, sr.c, st.c and osst.c drivers
    supports.

    The modalias format is like this:

    scsi:type-0x04

    (for TYPE_WORM, handled by sr.c now).

    Several comments.

    o This hexadecimal type value is because all TYPE_XXX constants
    in include/scsi/scsi.h are given in hex, but __stringify() will
    not convert them to decimal (so it will NOT be scsi:type-4).
    Since it does not really matter in which format it is, while
    both modalias in module and modalias attribute match each other,
    I descided to go for that 0x%02x format (and added a comment in
    include/scsi/scsi.h to keep them that way), instead of changing
    them all to decimal.

    o There was no .uevent routine for SCSI bus. It might be a good
    idea to add some more ueven environment variables in there.

    o osst.c driver handles tapes too, like st.c, but only SOME tapes.
    With this setup, hotplug scripts (or whatever is used by the
    user) will try to load both st and osst modules for all SCSI
    tapes found, because both modules have scsi:type-0x01 alias).
    It is not harmful, but one extra module is no good either.
    It is possible to solve this, by exporting more info in
    modalias attribute, including vendor and device identification
    strings, so that modalias becomes something like
    scsi:type-0x12:vendor-Adaptec LTD:device-OnStream Tape Drive
    and having that, match for all 3 attributes, not only device
    type. But oh well, vendor and device strings may be large,
    and they do contain spaces and whatnot.
    So I left them for now, awaiting for comments first.

    Signed-off-by: Michael Tokarev
    Signed-off-by: James Bottomley

    Michael Tokarev
     

26 Oct, 2006

2 commits


29 Aug, 2006

1 commit

  • This is the end point of the separate aic94xx driver based on the
    original driver and transport class from Luben Tuikov

    The log of the separate development is:

    Alexis Bruemmer:
    o aic94xx: fix hotplug/unplug for expanderless systems
    o aic94xx: disable split completion timer/setting by default
    o aic94xx: wide port off expander support
    o aic94xx: remove various inline functions
    o aic94xx: use bitops
    o aic94xx: remove queue comment
    o aic94xx: remove sas_common.c
    o aic94xx: sas remove depot's
    o aic94xx: use available list_for_each_entry_safe_reverse()
    o aic94xx: sas header file merge

    James Bottomley:
    o aic94xx: fix TF_TMF_NO_CTX processing
    o aic94xx: convert to request_firmware interface
    o aic94xx: fix hotplug/unplug
    o aic94xx: add link error counts to the expander phys
    o aic94xx: add transport class phy reset capability
    o aic94xx: remove local_attached flag
    o Remove README
    o Fixup Makefile variable for libsas rename
    o Rename sas->libsas
    o aic94xx: correct return code for sas_discover_event
    o aic94xx: use parent backlink port
    o aic94xx: remove channel abstraction
    o aic94xx: fix routing algorithms
    o aic94xx: add backlink port
    o aic94xx: fix cascaded expander properties
    o aic94xx: fix sleep under lock
    o aic94xx: fix panic on module removal in complex topology
    o aic94xx: make use of the new sas_port
    o rename sas_port to asd_sas_port
    o Fix for eh_strategy_handler move
    o aic94xx: move entirely over to correct transport class formulation
    o remove last vestages of sas_rphy_alloc()
    o update for eh_timed_out move
    o Preliminary expander support for aic94xx
    o sas: remove event thread
    o minor warning cleanups
    o remove last vestiges of id mapping arrays
    o Further updates
    o Convert aic94xx over entirely to the transport class end device and
    o update aic94xx/sas to use the new sas transport class end device
    o [PATCH] aic94xx: attaching to the sas transport class
    o Add missing completion removal from prior patch
    o [PATCH] aic94xx: attaching to the sas transport class
    o Build fixes from akpm

    Jeff Garzik:
    o [scsi aic94xx] Remove ->owner from PCI info table

    Luben Tuikov:
    o initial aic94xx driver

    Mike Anderson:
    o aic94xx: fix panic on module insertion
    o aic94xx: stub out SATA_DEV case
    o aic94xx: compile warning cleanups
    o aic94xx: sas_alloc_task
    o aic94xx: ref count update
    o aic94xx nexus loss time value
    o [PATCH] aic94xx: driver assertion in non-x86 BIOS env

    Randy Dunlap:
    o libsas: externs not needed

    Robert Tarte:
    o aic94xx: sequence patch - fixes SATA support

    Signed-off-by: James Bottomley

    James Bottomley
     

07 Aug, 2006

1 commit

  • - 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: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     

28 Feb, 2006

1 commit

  • In order to use the new execute_in_process_context() API, you have to
    provide it with the work storage, which I do in SCSI in scsi_device and
    scsi_target, but which also means that we can no longer queue up the
    target reaps, so instead I moved the target to a state model which
    allows target_alloc to detect if we've received a dying target and wait
    for it to be gone. Hopefully, this should also solve the target
    namespace race.

    Signed-off-by: James Bottomley

    James Bottomley
     

15 Feb, 2006

1 commit

  • We have several points in the SCSI stack (primarily for our device
    functions) where we need to guarantee process context, but (given the
    place where the last reference was released) we cannot guarantee this.

    This API gets around the issue by executing the function directly if
    the caller has process context, but scheduling a workqueue to execute
    in process context if the caller doesn't have it. Unfortunately, it
    requires memory allocation in interrupt context, but it's better than
    what we have previously. The true solution will require a bit of
    re-engineering, so isn't appropriate for 2.6.16.

    Signed-off-by: James Bottomley

    James Bottomley