09 Jan, 2012

1 commit

  • With previous change, now the ata port runtime suspend will happen as:

    disk suspend --> scsi target suspend --> scsi host suspend --> ata port
    suspend

    ata port(parent device) suspend need to schedule scsi EH which will resume
    scsi host(child device). Then the child device resume will in turn make
    parent device resume first. This is kind of recursive.

    This patch adds a new flag Scsi_Host::eh_noresume.
    ata port will set this flag to skip the runtime PM calls on scsi host.

    Acked-by: Alan Stern
    Signed-off-by: Lin Ming
    Signed-off-by: Jeff Garzik

    Lin Ming
     

29 Aug, 2011

1 commit

  • The problem is that if we are doing a scsi scan then the device goes
    into recovery then we will wait for the recovery to complete. It waits
    because scsi-ml will send inquiries or report luns and the queueing code
    will have been blocked due to the host not being ready. However, if we
    are in recovery and then a scan is started the scan will silently fail
    and some devices will not be added.

    It is easy to hit the problem where devices do not show up with
    FC where we are doing tests that disrupt the target controllers.
    When the controller is disruprted (reboot, or setting firmware, etc),
    and we cause the dev loss tmo to fire then devices will be removed
    Then when the problem has been fixed, the rport will be scanned and
    devices should be added back. But if we cause another disruption before
    scanning has started then devices will not get added back. If the problem
    is not started until the scan is started then the devices will be added
    back.

    This patch fixes that problem by not failing scans when the host
    is in recovery. We will let scsi-ml send the IO and let the queueing
    and scsi error handling deal with it like is done if we went into
    recovery while scanning.

    For recovery cases where the host is being torn down then with the
    patch we will still fail the scan since there is not point in scanning.

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

    Mike Christie
     

27 Aug, 2011

1 commit

  • Added new sysfs attr 'host_reset' in scsi_sysfs.c to
    perform adapter or firmware reset as suggested by
    Mike Christie here:
    http://marc.info/?l=linux-scsi&m=127359347111167&w=2

    user/application can write "adapter" or "firmware" on
    this attr and it will call newly added function hook
    in scsi_host_template to call LDD adapter or firmware
    reset implementation.

    Signed-off-by: Vikas Chaudhary
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Vikas Chaudhary
     

31 Mar, 2011

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
     

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
     

03 Jun, 2010

1 commit

  • Implement sd_unlock_native_capacity() method which calls into
    hostt->unlock_native_capacity() if implemented. This will be invoked
    by block layer if partitions extend beyond the end of the device and
    can be used to implement, for example, on-demand ATA host protected
    area unlocking.

    Signed-off-by: Tejun Heo
    Cc: Ben Hutchings
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

10 Dec, 2009

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (222 commits)
    [SCSI] zfcp: Remove flag ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP
    [SCSI] zfcp: Activate fc4s attributes for zfcp in FC transport class
    [SCSI] zfcp: Block scsi_eh thread for rport state BLOCKED
    [SCSI] zfcp: Update FSF error reporting
    [SCSI] zfcp: Improve ELS ADISC handling
    [SCSI] zfcp: Simplify handling of ct and els requests
    [SCSI] zfcp: Remove ZFCP_DID_MASK
    [SCSI] zfcp: Move WKA port to zfcp FC code
    [SCSI] zfcp: Use common code definitions for FC CT structs
    [SCSI] zfcp: Use common code definitions for FC ELS structs
    [SCSI] zfcp: Update FCP protocol related code
    [SCSI] zfcp: Dont fail SCSI commands when transitioning to blocked fc_rport
    [SCSI] zfcp: Assign scheduled work to driver queue
    [SCSI] zfcp: Remove STATUS_COMMON_REMOVE flag as it is not required anymore
    [SCSI] zfcp: Implement module unloading
    [SCSI] zfcp: Merge trace code for fsf requests in one function
    [SCSI] zfcp: Access ports and units with container_of in sysfs code
    [SCSI] zfcp: Remove suspend callback
    [SCSI] zfcp: Remove global config_mutex
    [SCSI] zfcp: Replace local reference counting with common kref
    ...

    Linus Torvalds
     

05 Dec, 2009

2 commits

  • Some of our virtual SCSI hosts don't have a proper bus parent at the
    top, which can be a problem for doing DMA on them

    This patch makes the host device cache a pointer to the physical bus
    device and provides an extra API for setting it (the normal API picks
    it up from the parent). This patch also modifies the qla2xxx and lpfc
    vport logic to use the new DMA host setting API.

    Acked-By: James Smart
    Cc: Stable Tree
    Signed-off-by: James Bottomley

    James Bottomley
     
  • 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
     

07 Nov, 2009

1 commit


02 Oct, 2009

1 commit

  • So far we have only issued DIF commands if CONFIG_BLK_DEV_INTEGRITY is
    enabled. However, communication between initiator and target should be
    independent of protection information DMA. There are DIF-only host
    adapters coming out that will be able to take advantage of this.

    Move the relevant DIF bits to sd.c.

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

    Martin K. Petersen
     

13 Jun, 2009

1 commit

  • Attached is the ELS/CT pass-thru patch for the FC Transport. The patch
    creates a generic framework that lays on top of bsg and the SGIO v4 ioctl
    in order to pass transaction requests to LLDD's.

    The interface supports the following operations:
    On an fc_host basis:
    Request login to the specified N_Port_ID, creating an fc_rport.
    Request logout of the specified N_Port_ID, deleting an fc_rport
    Send ELS request to specified N_Port_ID w/o requiring a login, and
    wait for ELS response.
    Send CT request to specified N_Port_ID and wait for CT response.
    Login is required, but LLDD is allowed to manage login and decide
    whether it stays in place after the request is satisfied.
    Vendor-Unique request. Allows a LLDD-specific request to be passed
    to the LLDD, and the passing of a response back to the application.
    On an fc_rport basis:
    Send ELS request to nport and wait for ELS response.
    Send CT request to nport and wait for CT response.

    The patch also exports several headers from include/scsi such that
    they can be available to user-space applications:
    include/scsi/scsi.h
    include/scsi/scsi_netlink.h
    include/scsi/scsi_netlink_fc.h
    include/scsi/scsi_bsg_fc.h

    For further information, refer to the last RFC:
    http://marc.info/?l=linux-scsi&m=123436574018579&w=2

    Note: Documentation is still spotty and will be added later.

    [bharrosh@panasas.com: update for new block API]
    Signed-off-by: James Smart
    Signed-off-by: James Bottomley

    James Smart
     

09 Oct, 2008

1 commit

  • Right now SCSI and others do their own command timeout handling.
    Move those bits to the block layer.

    Instead of having a timer per command, we try to be a bit more clever
    and simply have one per-queue. This avoids the overhead of having to
    tear down and setup a timer for each command, so it will result in a lot
    less timer fiddling.

    Signed-off-by: Mike Anderson
    Signed-off-by: Jens Axboe

    Jens Axboe
     

27 Jul, 2008

2 commits

  • Controllers that support protection information must indicate this to
    the SCSI midlayer so that the ULD can prepare scsi_cmnds accordingly.

    This patch implements a host mask and various types of protection:

    - DIF Type 1-3 (between HBA and disk)
    - DIX Type 0-3 (between OS and HBA)

    The patch also allows the HBA to set the guard type to something
    different than the T10-mandated CRC.

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

    Martin K. Petersen
     
  • Daniel Debonzi reports that he has managed to wrap host_no. Increasing
    the number of host numbers available to 32-bit from 16-bit allows the
    problem to be evaded for another hundred years.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     

22 Jul, 2008

1 commit


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
     

20 Apr, 2008

1 commit


08 Apr, 2008

1 commit

  • The problem is that serveral drivers are sending a target reset from the
    device reset handler, and if we have multiple devices a target reset gets
    sent for each device when only one would be sufficient. And if we do a target
    reset it affects all the commands on the target so the device reset handler
    code only cleaning up one devices's commands makes programming the driver a
    little more difficult than it should be.

    This patch adds a target reset handler, which drivers can use to send
    a target reset. If successful it cleans up the commands for a devices
    accessed through that starget.

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

    Mike Christie
     

12 Feb, 2008

1 commit

  • Since the sg chaining patches went in, our current value of 255 for
    SG_ALL excites chaining on some drivers which cannot support it (and
    would thus oops). Redefine SG_ALL to mean no sg table size
    preference, but use the single allocation (non chained) limit. This
    also helps for drivers that use it to size an internal table.

    We'll do an opt in system later where truly chaining supporting
    drivers can define their sg_tablesize to be anything up to
    SCSI_MAX_SG_CHAIN_ELEMENTS.

    Signed-off-by: James Bottomley

    James Bottomley
     

08 Feb, 2008

1 commit


31 Jan, 2008

2 commits

  • With the sg table code, every SCSI driver is now either chain capable
    or broken (or has sg_tablesize set so chaining is never activated), so
    there's no need to have a check in the host template.

    Also tidy up the code by moving the scatterlist size defines into the
    SCSI includes and permit the last entry of the scatterlist pools not
    to be a power of two.
    Signed-off-by: James Bottomley

    James Bottomley
     
  • In preparation for bidi we abstract all IO members of scsi_cmnd,
    that will need to duplicate, into a substructure.

    - Group all IO members of scsi_cmnd into a scsi_data_buffer
    structure.
    - Adjust accessors to new members.
    - scsi_{alloc,free}_sgtable receive a scsi_data_buffer instead of
    scsi_cmnd. And work on it.
    - Adjust scsi_init_io() and scsi_release_buffers() for above
    change.
    - Fix other parts of scsi_lib/scsi.c to members migration. Use
    accessors where appropriate.

    - fix Documentation about scsi_cmnd in scsi_host.h

    - scsi_error.c
    * Changed needed members of struct scsi_eh_save.
    * Careful considerations in scsi_eh_prep/restore_cmnd.

    - sd.c and sr.c
    * sd and sr would adjust IO size to align on device's block
    size so code needs to change once we move to scsi_data_buff
    implementation.
    * Convert code to use scsi_for_each_sg
    * Use data accessors where appropriate.

    - tgt: convert libsrp to use scsi_data_buffer

    - isd200: This driver still bangs on scsi_cmnd IO members,
    so need changing

    [jejb: rebased on top of sg_table patches fixed up conflicts
    and used the synergy to eliminate use_sg and sg_count]

    Signed-off-by: Boaz Harrosh
    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    Boaz Harrosh
     

16 Oct, 2007

1 commit


13 Oct, 2007

4 commits

  • The pid field is a duplicate of the serial_number field and has been
    scheduled for removal for a long time. A few drivers were still using
    it, so just change them to use serial_number instead.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     
  • This adds supported_mode and active_mode attributes to
    /sys/class/sys_host/hostX/ for specifying the mode that a lld supports
    and the currently activated mode. The output format is similar to fc
    rport roles:

    luce:/sys/class/scsi_host/host0$ cat supported_mode
    Initiator
    luce:/sys/class/scsi_host/host0$ cat active_mode
    Initiator

    The mode values uses bitmap since we would support dual-mode llds in
    the future like this:

    luce:/sys/class/scsi_host/host0$ cat supported_mode
    Initiator, Target

    The supported_mode attribute looks at a scsi_host_template and the
    active_mode attribute looks at a scsi_host. We would add a hook to a
    scsi_host_template to change the active_mode attribute
    dynamically. But now there is no hook since no lld supports that
    feature.

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

    FUJITA Tomonori
     
  • This moves tsk_mgmt_response callback in struct scsi_host_template to
    struct scsi_transport_template since struct scsi_transport_template is
    more suitable for the task management stuff.

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

    FUJITA Tomonori
     
  • tgt uses scsi_host as I_T nexus. This works for ibmvstgt because it
    creates one scsi_host for one initiator. However, other target drivers
    don't work like that.

    This adds I_T nexus support, which enable one scsi_host to handle
    multiple initiators. New scsi_tgt_it_nexus_create/destroy functions
    are expected be called transport classes. For example, ibmvstgt
    creates an initiator remote port, then the srp transport calls
    tgt_it_nexus_create. tgt doesn't manages I_T nexus, instead it tells
    tgtd, user-space daemon, to create a new I_T nexus.

    On the receiving the response from tgtd, tgt calls
    shost->transportt->it_nexus_response. transports should notify a
    lld. The srp transport uses it_nexus_response callback in
    srp_function_template to do that.

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

    FUJITA Tomonori
     

20 Jul, 2007

1 commit


01 Jun, 2007

1 commit

  • Currently accessing the scsi host private data is rather messy because
    it comes as an unsigned long that always needs a cast first. This patch
    introduces a helper that does the cast called shost_priv. It's similar
    in spirit to netdev_priv for network drivers.

    This is the first patch introducing the macro, and the second patch
    in the series will convert esp and it's subdrivers as an example.
    Further conversion will wait until the helper is in the tree to make
    patch juggling easier.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: James Bottomley

    Christoph Hellwig
     

22 May, 2007

1 commit

  • With libata converted to use sdev->manage_start_stop for suspend and
    resume, sht->suspend/resume() has no user left and low level
    suspend/ressume should be taken care of by low level driver's
    suspend/resume callbacks (e.g. PCI or PCMCIA driver callbacks). This
    patch removes sht->suspend/resume() callbacks.

    This change is suggested by Christoph Hellwig.

    Signed-off-by: Tejun Heo
    Cc: Christoph Hellwig
    Signed-off-by: James Bottomley

    Tejun Heo
     

20 Mar, 2007

1 commit


12 Mar, 2007

1 commit

  • This patch simplify the way to notify LLDs of the command completion
    and addresses the following sense buffer problems:

    - can't handle both data and sense.
    - forces user-space to use aligned sense buffer

    tgt copies sense_data from userspace to cmnd->sense_buffer (if
    necessary), maps user-space pages (if necessary) and then calls
    host->transfer_response (host->transfer_data is removed).

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

    FUJITA Tomonori
     

26 Nov, 2006

1 commit

  • This patch contains the needed changes to the scsi-ml for the target
    mode support.

    Note, per the last review we moved almost all the fields we added
    to the scsi_cmnd to our internal data structure which we are going
    to try and kill off when we can replace it with support from other
    parts of the kernel.

    The one field we left on was the offset variable. This is needed to handle
    the case where the target gets request that is so large that it cannot
    execute it in one dma operation. So max_secotors or a segment limit may
    limit the size of the transfer. In this case our tgt core code will
    break up the command into managable transfers and send them to the
    LLD one at a time. The offset is then used to tell the LLD where in
    the command we are at. Is there another field on the scsi_cmd for
    that?

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

    FUJITA Tomonori
     

23 Nov, 2006

1 commit

  • If a driver can find its own targets, it can now fill in scan_finished and
    (optionally) scan_start in the scsi_host_template. Then, when it calls
    scsi_scan_host(), it will be called back (from a thread if asynchronous
    discovery is enabled), first to start the scan, and then at intervals to
    check if the scan is completed.

    Also make scsi_prep_async_scan and scsi_finish_async_scan static.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     

16 Nov, 2006

1 commit


12 Oct, 2006

1 commit

  • Since it often takes around 20-30 seconds to scan a scsi bus, it's
    highly advantageous to do this in parallel with other things. The bulk
    of this patch is ensuring that devices don't change numbering, and that
    all devices are discovered prior to trying to start init. For those
    who build SCSI as modules, there's a new scsi_wait_scan module that will
    ensure all bus scans are finished.

    This patch only handles drivers which call scsi_scan_host. Fibre Channel,
    SAS, SATA, USB and Firewire all need additional work.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     

31 Aug, 2006

1 commit

  • This patch adds support for sharing tag maps at the host level
    (i.e. either every queue [LUN] has its own tag map or there's a single
    one for the entire host). This formulation is primarily intended to
    help single issue queue hardware, like the aic7xxx

    Signed-off-by: James Bottomley

    James Bottomley
     

27 Jun, 2006

1 commit