10 May, 2013

1 commit

  • These enums have been separate since the dawn of SAS, mainly because the
    latter is a procotol only enum and the former includes additional state
    for libsas. The dichotomy causes endless confusion about which one you
    should use where and leads to pointless warnings like this:

    drivers/scsi/mvsas/mv_sas.c: In function 'mvs_update_phyinfo':
    drivers/scsi/mvsas/mv_sas.c:1162:34: warning: comparison between 'enum sas_device_type' and 'enum sas_dev_type' [-Wenum-compare]

    Fix by eliminating one of them. The one kept is effectively the sas.h
    one, but call it sas_device_type and make sure the enums are all
    properly namespaced with the SAS_ prefix.

    Signed-off-by: James Bottomley

    James Bottomley
     

18 May, 2012

12 commits


01 Mar, 2012

2 commits


31 Oct, 2011

2 commits


03 Oct, 2011

1 commit

  • 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
     

03 Jul, 2011

22 commits

  • Most of these simple dereference macros are longer than their open coded
    equivalent. Deleting enum sci_controller_mode is thrown in for good
    measure.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • The distinction between scic_sds_ scic_ and sci_ are no longer relevant
    so just unify the prefixes on sci_. The distinction between isci_ and
    sci_ is historically significant, and useful for comparing the old
    'core' to the current Linux driver. 'sci_' represents the former core as
    well as the routines that are closer to the hardware and protocol than
    their 'isci_' brethren. sci == sas controller interface.

    Also unwind the 'sds1' out of the parameter structs.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Remove the distinction between these two implementations and unify on
    isci_host (local instances named ihost). Hmmm, we had two
    'oem_parameters' instances, one was unused... nice.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Remove the distinction between these two implementations and unify on
    isci_remote_device (local instances named idev).

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Remove the distinction between these two implementations and unify on
    isci_port (local instances named iport). The duplicate '->owning_port' and
    '->isci_port' in both isci_phy and isci_remote_device will be fixed in a later
    patch... this is just the straightforward rename/unification.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • They are one in the same object so remove the distinction. The near
    duplicate fields (owning_controller, and isci_host) will be cleaned up
    after the scic_sds_contoller isci_host unification.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • When the remote device transitions to a not-ready state because of
    an NCQ error condition, all outstanding requests to that device
    are terminated and completed to libsas on the normal path. The
    device then waits for a READ LOG EXT command to issue on the task
    management path.

    Signed-off-by: Jeff Skirvin
    Signed-off-by: Dan Williams

    Jeff Skirvin
     
  • Now that we have upleveled device reassignment protection to the
    isci_remote_device reference count we no longer need this level of
    self-defense.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • Now that "stopping/stopped" are one in the same and signalled by a NULL device
    pointer the rest of the device status infrastructure can be removed (->status
    and ->state_lock). The "not ready for i/o state" is replaced with a state
    flag, and is evaluated under scic_lock so that we don't see transients from
    taking the device reference to submitting the i/o.

    This also fixes a potential leakage of can_queue slots in the rare case that
    SAS_TASK_ABORTED is set at submission.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • We have unsafe references to remote devices that are notified to
    disappear at lldd_dev_gone. In order to clean this up we need a single
    canonical source for device lookups and stable references once a lookup
    succeeds. Towards that end guarantee that domain_device.lldd_dev is
    NULL as soon as we start the process of stopping a device. Any code
    path that wants to safely lookup a remote device must do so through
    task->dev->lldd_dev (isci_lookup_device()).

    For in-flight references outside of scic_lock we need reference counting
    to ensure that the device is not recycled before we are done with it.
    Simplify device back references to just scic_sds_request.target_device
    which is now the only permissible internal reference that is maintained
    relative to the reference count.

    There were two occasions where we wanted new i/o's to be treated as
    SAS_TASK_UNDELIVERED but where the domain_dev->lldd_dev link is still
    intact. Introduce a 'gone' flag to prevent i/o while waiting for libsas
    to take action on the port down event.

    One 'core' leftover is that we currently call
    scic_remote_device_destruct() from isci_remote_device_deconstruct()
    which is called when the 'core' says the device is stopped. It would be
    more natural for the final put to trigger
    isci_remote_device_deconstruct() but this implementation is deferred as
    it requires other changes.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • This cleans up several areas of the state machine mechanism:

    o Rename sci_base_state_machine_change_state to sci_change_state
    o Remove sci_base_state_machine_get_state function
    o Rename 'state_machine' struct member to 'sm' in client structs
    o Shorten the name of request states
    o Shorten state machine state names as follows:
    SCI_BASE_CONTROLLER_STATE_xxx to SCIC_xxx
    SCI_BASE_PHY_STATE_xxx to SCI_PHY_xxx
    SCIC_SDS_PHY_STARTING_SUBSTATE_xxx to SCI_PHY_SUB_xxx
    SCI_BASE_PORT_STATE_xxx to SCI_PORT_xxx and
    SCIC_SDS_PORT_READY_SUBSTATE_xxx to SCI_PORT_SUB_xxx
    SCI_BASE_REMOTE_DEVICE_STATE_xxx to SCI_DEV_xxx
    SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_xxx to SCI_STP_DEV_xxx
    SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_xxx to SCI_SMP_DEV_xxx
    SCIC_SDS_REMOTE_NODE_CONTEXT_xxx_STATE to SCI_RNC_xxx

    Signed-off-by: Edmund Nadolski
    Signed-off-by: Dave Jiang
    Signed-off-by: Dan Williams

    Edmund Nadolski
     
  • cross driver constants are spread out over multiple header files, consolidate
    them into isci.h, and push some includes out to the source files that need
    them.

    TODO: remove SCI_MODE_SIZE infrastructure.
    TODO: task.h is full of inlines that are too large

    Signed-off-by: Dan Williams

    Dan Williams
     
  • This is a requirement for 2.6.39's new libata eh.

    Still some questions about lldd_dev_gone racing against dev->lldd_dev
    lookups, but we are at least no more broken than mvsas in this regard.

    We also short-circuit I_T_nexus_reset invocations from the device
    discovery path (IDEV_EH similar to MVS_DEV_EH) to filter out the
    resulting domain rediscoveries triggered by the reset.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • Signed-off-by: Dave Jiang
    Signed-off-by: Dan Williams

    Dave Jiang
     
  • Remove the now unused state_handler infrastructure for remote_devices.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Implement all states in scic_sds_remote_device_frame() and delete
    the state handler.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Implement all states in scic_sds_remote_device_event() and delete
    the state handler.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • This is unused infrastructure.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Implement all states in scic_sds_remote_device_suspend() and delete
    the state handler.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • This is unused infrastructure.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Implement all states in scic_sds_remote_device_start_task() and delete
    the state handler.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • This is unused infrastructure.

    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams