03 Oct, 2011

28 commits

  • Based on original implementation from Jiangbi Liu and Maciej Trela.

    ATAPI transfers happen in two-to-three stages. The two stage atapi
    commands are those that include a dma data transfer. The data transfer
    portion of these operations is handled by the hardware packet-dma
    acceleration. The three-stage commands do not have a data transfer and
    are handled without hardware assistance in raw frame mode.

    stage1: transmit host-to-device fis to notify the device of an incoming
    atapi cdb. Upon reception of the pio-setup-fis repost the task_context
    to perform the dma transfer of the cdb+data (go to stage3), or repost
    the task_context to transmit the cdb as a raw frame (go to stage 2).

    stage2: wait for hardware notification of the cdb transmission and then
    go to stage 3.

    stage3: wait for the arrival of the terminating device-to-host fis and
    terminate the command.

    To keep the implementation simple we only support ATAPI packet-dma
    protocol (for commands with data) to avoid needing to handle the data
    transfer manually (like we do for SATA-PIO). This may affect
    compatibility for a small number of devices (see
    ATA_HORKAGE_ATAPI_MOD16_DMA).

    If the data-transfer underruns, or encounters an error the
    device-to-host fis is expected to arrive in the unsolicited frame queue
    to pass to libata for disposition. However, in the DONE_UNEXP_FIS (data
    underrun) case it appears we need to craft a response. In the
    DONE_REG_ERR case we do receive the UF and propagate it to libsas.

    Signed-off-by: Maciej Trela
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • This will synchronize the version string with internal driver.

    Signed-off-by: Xiangliang Yu
    Signed-off-by: James Bottomley

    Xiangliang Yu
     
  • set SMP link timeout value to maximum.

    Signed-off-by: Xiangliang Yu
    Signed-off-by: James Bottomley

    Xiangliang Yu
     
  • with 1 expander, connect 8 HDD, the write performance will be
    improved by 80%.

    Signed-off-by: Xiangliang Yu
    Signed-off-by: James Bottomley

    Xiangliang Yu
     
  • -- change connection behavior
    -- set bit8 to 1 for performance tuning
    -- set bit0 to 0 to enable retry for no_dest reject case.

    Signed-off-by: Xiangliang Yu
    Signed-off-by: James Bottomley

    Xiangliang Yu
     
  • disable non data frame retry

    Signed-off-by: Xiangliang Yu
    Signed-off-by: James Bottomley

    Xiangliang Yu
     
  • spin up issue: some direct attached SAS device can't spin up

    Signed-off-by: Xiangliang Yu
    Signed-off-by: James Bottomley

    Xiangliang Yu
     
  • Add support for Marvell 88SE9480 SAS/SATA HBA

    Signed-off-by: Xiangliang Yu
    Signed-off-by: James Bottomley

    Xiangliang Yu
     
  • Expanders fail to link when the phy rates are mismatched.

    Signed-off-by: Xiangliang Yu
    Signed-off-by: James Bottomley

    Xiangliang Yu
     
  • Needed to jump to scic_lock unlock.

    Also spotted by coccicheck.

    Signed-off-by: Jeff Skirvin
    Cc:
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Jeff Skirvin
     
  • Kill the local smp response buffer.

    Besides being unnecessary, it is too small (currently truncates
    responses to 60 bytes). The mid-layer will have already allocated a
    sufficiently sized buffer, just kmap and copy into it directly.

    Cc:
    Reported-by: Derick Marks
    Tested-by: Derick Marks
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • Code Inspection: found two missing break directives. First one will
    result in not retrying an a task that report
    IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY, the second will result in cosmetic
    debug printk conflicting statement stutter. Because checkpatch.pl came
    up with a warning regarding unnecessary space before a newline on one of
    the fragments associated with the diff context, I took the liberty of
    fixing all the cases of this issue in the pair of files touched by this
    defect. These cosmetic changes hide the break changes :-(

    To help focus, break changes are in pm8001_hwi.c fragment line 1649 for
    the IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY case statement and pm8001_sas.c
    line 1000 deals with the conflicting debug print stutter.

    Signed-off-by: Mark Salyzyn
    Acked-by: Jack Wang
    Signed-off-by: James Bottomley

    Mark Salyzyn
     
  • On the pm8001, when a device is in the process of going away (device
    power off or hot plug), depending on the timing, the driver would return
    SAS_PHY_DOWN as the return value to the queuecommand DEV_IS_GONE logic.
    The net result is an near infinite retry (especially if SAS debugging is
    enabled), the logs will fill with:

    kernel: mpi_ssp_completion 2119:e21:SSP IO status 0x13 tag 0xcc1c0000
    dlen=90 param=0xe
    kernel: wwn=5000c50034069e86 cdb=12 00 00 00 5a 00 00 00 00 00 00 00 00
    00 00 00
    kernel: sas: lldd_execute_task returned: 138
    kernel: sas: lldd_execute_task returned: 138
    kernel: sas: lldd_execute_task returned: 138
    kernel: sas: lldd_execute_task returned: 138
    kernel: sas: lldd_execute_task returned: 138
    kernel: sas: lldd_execute_task returned: 138
    kernel: sas: lldd_execute_task returned: 138
    . . .

    This patch changes to leverage the port_attached logic to complete the
    command with a status of PHY_DOWN so that the disposition can be handled
    immediately and correctly.

    Signed-off-by: Mark Salyzyn
    Acked-by: Jack Wang
    Signed-off-by: James Bottomley

    Mark Salyzyn
     
  • Currently fcoe_ddp_min doesn't have default value
    so by default not used, so setting up default value
    as 4k as this works better by avoiding overhead
    of programing DDP for small IOs.

    Signed-off-by: Vasu Dev
    Tested-by: Ross Brattain
    Signed-off-by: Yi Zou
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • Use real dev in case it has HW vlan acceleration
    support since in this case the real dev would
    do needed vlan processing, this way unnecessary
    vlan layer processing avoided and it gives
    slightly better IOPS with 512B size IOs.

    Signed-off-by: Vasu Dev
    Tested-by: Ross Brattain
    Signed-off-by: Yi Zou
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • fix holes and better cache aligned fields.

    Signed-off-by: Vasu Dev
    Tested-by: Ross Brattain
    Signed-off-by: Yi Zou
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • cache aligned xid and ex_lock beside
    removing holes.

    Signed-off-by: Vasu Dev
    Tested-by: Ross Brattain
    Signed-off-by: Yi Zou
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • Re-arrange its fields to avoid padding and have better
    cacheline alignments.

    Removed not used start_time, end_time and last_pkt_time
    fields.

    This all reduced this struct size to 448 from 480 and
    that also reduced one cacheline on x86_64 beside
    eliminating 8 pads. However kept logical fields together.

    Signed-off-by: Vasu Dev
    Tested-by: Ross Brattain
    Signed-off-by: Yi Zou
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • Since fcoe_percpu_thread_create() creates percpu kthread, it makes sense
    to use kthread_create_on_node() to get proper NUMA affinity for kthread
    stack.

    Signed-off-by: Eric Dumazet
    Signed-off-by: Yi Zou
    Signed-off-by: James Bottomley

    Eric Dumazet
     
  • Several sas drivers legitimately check the protocol against the union of
    SAS_PROTOCOL_SATA and SAS_PROTOCOL_STP. Provide a SAS_PROTOCOL_STP_ALL
    to silence warnings like:

    drivers/scsi/pm8001/pm8001_sas.c:438:3: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch]
    drivers/scsi/mvsas/mv_sas.c:798:2: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch]
    drivers/scsi/mvsas/mv_sas.c:1783:2: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch]
    drivers/scsi/mvsas/mv_sas.c:1886:2: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch]
    drivers/scsi/isci/request.c:3565:2: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch]

    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • Libsas forget to set the sas_address and device type of rphy lead to file
    under /sys/class/sas_x show wrong value, fix that.

    Signed-off-by: Jack Wang
    Tested-by: Crystal Yu
    Cc: stable@kernel.org
    Signed-off-by: James Bottomley

    Jack Wang
     
  • If the user has disabled CONFIG_SCSI_SAS_HOST_SMP then libsas drivers
    will not be receiving smp-gpio frames and do not need this lookup code.

    Reported-by: Randy Dunlap
    Tested-by: Randy Dunlap
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • libsas handles:
    1/ limiting ata scanning to lun0
    2/ changes to /sys/block//device/queue_depth for ata devices

    libata handles turning off ncq globally via kernel command line
    (libata.force=noncq) or sysfs (echo 1 >
    /sys/block//device/queue_depth). A lldd specific compile option is
    not necessary.

    Cc: Jack Wang
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • libsas now handles:
    1/ limiting ata scanning to lun0
    2/ maximizing the queue_depth of sas devices (up to 256, mvsas only
    supports 64)
    3/ changes to /sys/block//device/queue_depth for ata devices

    Acked-by: Xiangliang Yu
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • The queue-depth for libsas-attached devices initializes to 32 and can
    only be increased manually via sysfs to a max of 64, while mpt2sas
    attached devices initialize to 254 and dynamically float via the
    midlayer ->change_queue_depth interface.

    No performance regression was observed with this change on the isci
    driver.

    Tested-by: Dave Jiang
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • Pass queue_depth change requests to libata, and prevent queue_type
    changes for ATA devices.

    Otherwise:
    1/ we do not honor the libata specific restrictions on the queue depth
    2/ libsas drivers that do not set sdev->tagged_supported are unable to
    change the queue_depth of ata devices via sysfs

    Signed-off-by: Dan Williams
    Acked-by: Jeff Garzik
    Signed-off-by: James Bottomley

    Dan Williams
     
  • Currently mvsas and pm8001 have custom ->slave_alloc implementations to
    achieve this. Uplevel it for all libsas drivers as isci encounters problems
    with atapi devices when scanning past lun0.

    Just do what Darrick suggested [1], and limit the scan for ata devices.

    [1] http://marc.info/?l=linux-scsi&m=116604101119861&w=2

    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • Allow expander table-to-table attachments for
    expanders that support it.

    Signed-off-by: Luben Tuikov
    Signed-off-by: James Bottomley

    Luben Tuikov
     

22 Sep, 2011

12 commits

  • When the ipr driver decides to dump the adapter, it changes the
    sdt_state to GET_DUMP, then prepares the adapter so that the dump
    can be read. However, if the ipr worker thread wakes up for some
    reason before the driver has put the adapter in a state where it
    can succesfully dump the adapter, the driver will start dumping
    the adapter too early, which can potentially trigger a BUG check
    in the pci config blocking API. Fix this by adding a new
    sdt_state to differentiate between the ipr driver wanting to dump
    the adapter in the near future and wanting to dump the adapter now.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     
  • Signed-off-by: Vijay Chauhan
    Reviewed-by: Bob Stankey
    Reviewed-by: Babu Moger
    Acked-by: Chandra Seetharaman
    Signed-off-by: James Bottomley

    Chauhan, Vijay
     
  • Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: James Bottomley

    Bhanu Prakash Gollapudi
     
  • Gracefully handle bnx2fc_map_sg failure, so that queuecommand returns host busy
    and SCSI-ml can retry the IO.

    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: James Bottomley

    Bhanu Prakash Gollapudi
     
  • scsi_dma_map doesn't work for NPIV since vport dev isn't fully initialized.

    For more details: http://marc.info/?l=linux-scsi&m=118312448030633&w=2 and
    commit - c59fd9ebc46da8d48b76955d4d48e3597f8c8726.

    Signed-off-by: Nithin Sujir
    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: James Bottomley

    Bhanu Prakash Gollapudi
     
  • When READ_16 command is issued, the setting of SILI Bit in CDB is confirmed
    and if SILI bit is off, the processing of relavent Errata is executed.

    Added code for checking SILI bit for READ_16 as described in "SSC-4".

    Signed-off-by: Nagalakshmi Nandigama
    Signed-off-by: James Bottomley

    nagalakshmi.nandigama@lsi.com
     
  • Sizeof a pointer-typed expression returns the size of the pointer, not that
    of the pointed data.

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

    //
    @@
    expression *e;
    type T;
    identifier f;
    @@

    f(...,(T)e,...,
    -sizeof(e)
    +sizeof(*e)
    ,...)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: James Bottomley

    Julia Lawall
     
  • bnx2fc.txt outlines the driver usage model.

    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: James Bottomley

    Bhanu Prakash Gollapudi
     
  • Mutual exclusion is redundant here because all the paths in the call graph
    leading to esp_driver_ops.send_dma_cmd() happen under spin_lock_irqsave/
    spin_lock_irqrestore. Remove it.

    Tested on a Mac Quadra 660av and a Mac LC 630.

    Signed-off-by: Finn Thain
    Signed-off-by: James Bottomley

    Finn Thain
     
  • Signed-off-by: Nagalakshmi Nandigama
    Signed-off-by: James Bottomley

    nagalakshmi.nandigama@lsi.com
     
  • Support added for controllers capable of multi reply queues.

    The following are the modifications to the driver to support NUMA.

    1) Create the new structure adapter_reply_queue to contain the reply queue
    info for every msix vector. This object will contain a
    reply_post_host_index, reply_post_free for each instance, msix_index, among
    other parameters. We will track all the reply queues on a link list called
    ioc->reply_queue_list. Each reply queue is aligned with each IRQ, and is
    passed to the interrupt via the bus_id parameter.

    (2) The driver will figure out the msix_vector_count from the PCIe MSIX
    capabilities register instead of the IOC Facts->MaxMSIxVectors. This is
    because the firmware is not filling in this field until the driver has
    already registered MSIX support.

    (3) If the ioc_facts reports that the controller is MSIX compatible in the
    capabilities, then the driver will request for multiple irqs. This count
    is calculated based on the minimum between the online cpus available and
    the ioc->msix_vector_count. This count is reported to firmware in the
    ioc_init request.

    (4) New routines were added _base_free_irq and _base_request_irq, so
    registering and freeing msix vectors were done thru simple function API.

    (5) The new routine _base_assign_reply_queues was added to align the msix
    indexes across cpus. This will initialize the array called
    ioc->cpu_msix_table. This array is looked up on every MPI request so the
    MSIxIndex is set appropriately.

    (6) A new shost sysfs attribute was added to report the reply_queue_count.

    (7) User needs to set the affinity cpu mask, so the interrupts occur on the
    same cpu that sent the original request.

    Signed-off-by: Nagalakshmi Nandigama
    Signed-off-by: James Bottomley

    nagalakshmi.nandigama@lsi.com
     
  • This patch adds couple more Vendor/Product IDs for RDAC.. There are no
    functional changes.

    Signed-off-by: Babu Moger
    Signed-off-by: James Bottomley

    Moger, Babu