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


15 May, 2006

1 commit

  • libata needs to invoke EH without scmd. This patch adds
    shost->host_eh_scheduled to implement such behavior.

    Currently the only user of this feature is libata and no general
    interface is defined. This patch simply adds handling for
    host_eh_scheduled where needed and exports scsi_eh_wakeup() to
    modules. The rest is upto libata. This is the result of the
    following discussion.

    http://thread.gmane.org/gmane.linux.scsi/23853/focus=9760

    In short, SCSI host is not supposed to know about exceptions unrelated
    to specific device or command. Such exceptions should be handled by
    transport layer proper. However, the distinction is not essential to
    ATA and libata is planning to depart from SCSI, so, for the time
    being, libata will be using SCSI EH to handle such exceptions.

    Signed-off-by: Tejun Heo

    Tejun Heo
     

11 Apr, 2006

1 commit

  • Overriding the whole EH code is a per-transport, not per-host thing.
    Move ->eh_strategy_handler to the transport class, same as
    ->eh_timed_out.

    Downside is that scsi_host_alloc can't check for the total lack of EH
    anymore, but the transition period from old EH where we needed it is
    long gone already.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jeff Garzik

    Christoph Hellwig
     

24 Mar, 2006

1 commit

  • At the moment libata doesn't pass pm_message_t down ata_device_suspend.
    This causes drives to be powered down when we just want a freeze,
    causing unnecessary wear and tear. This patch gets pm_message_t passed
    down so that it can be used to determine whether to power down the
    drive.

    Signed-off-by: Nigel Cunningham

    drivers/scsi/libata-core.c | 5 +++--
    drivers/scsi/libata-scsi.c | 4 ++--
    drivers/scsi/scsi_sysfs.c | 2 +-
    include/linux/libata.h | 4 ++--
    include/scsi/scsi_host.h | 2 +-
    5 files changed, 9 insertions(+), 8 deletions(-)
    Signed-off-by: Jeff Garzik

    Nigel Cunningham
     

13 Mar, 2006

1 commit


25 Jan, 2006

1 commit


13 Jan, 2006

1 commit


07 Jan, 2006

2 commits

  • Manual fixup for merge with Jens' "Suspend support for libata", commit
    ID 9b847548663ef1039dd49f0eb4463d001e596bc3.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • This patch adds suspend patch to libata, and ata_piix in particular. For
    most low level drivers, they should just need to add the 4 hooks to
    work. As I can only test ata_piix, I didn't enable it for more
    though.

    Suspend support is the single most important feature on a notebook, and
    most new notebooks have sata drives. It's quite embarrassing that we
    _still_ do not support this. Right now, it's perfectly possible to
    suspend the drive in mid-transfer.

    Signed-off-by: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jens Axboe
     

06 Jan, 2006

1 commit

  • All ordered request related stuff delegated to HLD. Midlayer
    now doens't deal with ordered setting or prepare_flush
    callback. sd.c updated to deal with blk_queue_ordered
    setting. Currently, ordered tag isn't used as SCSI midlayer
    cannot guarantee request ordering.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jens Axboe

    Tejun Heo
     

07 Nov, 2005

2 commits


29 Oct, 2005

1 commit