31 Oct, 2011

2 commits

  • The initial bcn filtering implementation was validated on a kernel
    baseline that predated the switch to new libata error handling. Also,
    prior to that conversion we borrowed the mvsas MVS_DEV_EH approach to
    prevent the unwanted extra ap->ops->phy_reset(ap) that occurred in the
    ata_bus_probe() path.

    After the conversion to new libata eh resets at discovery are more
    frequent and get filtered prematurely by IDEV_EH. The result is that
    our bcn filtering has been blocked from running and at discovery and it
    appears to stall discovery completion to the point of triggering hung
    task timeouts. So, revert the implementation for now. When it returns
    it will go into libsas proper.

    The domain rediscovery that takes place due to ->lldd_I_T_nexus_reset()
    events should now be properly waited for by the ata_port_wait_eh() call
    in ata_port_probe(). So the hard coded delay in the isci
    ->lldd_I_T_nexus_reset() and other libsas drivers should help debounce
    the libsas thread from seeing temporary device removals.

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

    Dan Williams
     
  • A hard reset can timeout before or after the last phy in the
    port goes away. If after, then notify the OS that the last
    phy has failed.

    The recovery for the failed hard reset has been removed.
    This recovery code was unecessary in that the link would
    recover from the failure normally by a new link reset sequence
    or hotplug of the remote device.

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

    Jeff Skirvin
     

03 Jul, 2011

29 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_port, and isci_port) will be cleaned up
    after the scic_sds_port isci_port 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
     
  • The tci_pool tracks our outstanding command slots which are also the 'index'
    portion of our tags. Grabbing the tag early in ->lldd_execute_task let's us
    drop the isci_host_can_queue() and ->was_tag_assigned_by_user infrastructure.
    ->was_tag_assigned_by_user required the task context to be duplicated in
    request-local buffer. With the tci established early we can build the
    task_context directly into its final location and skip a memcpy.

    With the task context buffer at a known address at request construction we
    have the opportunity/obligation to also fix sgl handling. This rework feels
    like it belongs in another patch but the sgl handling and task_context are too
    intertwined.
    1/ fix the 'ab' pair embedded in the task context to point to the 'cd' pair in
    the task context (previously we were prematurely linking to the staging
    buffer).
    2/ fix the broken iteration of pio sgls that assumes all sgls are relative to
    the request, and does a dangerous looking reverse lookup of physical
    address to virtual address.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • When resetting a sata device in the domain we have seen occasions where
    libsas prematurely marks a device gone in the time it takes for the
    device to re-establish the link. This plays badly with software raid
    arrays. Other libsas drivers have non-uniform delays in their reset
    handlers to try to cover this condition, but not sufficient to close the
    hole. Given that a sata device can take many seconds to recover we
    filter bcns and poll for the device reattach state before notifying
    libsas that the port needs the domain to be rediscovered. Once this has
    been proven out at the lldd level we can think about uplevelling this
    feature to a common implementation in libsas.

    Signed-off-by: Jeff Skirvin
    [ use kzalloc instead of kmem_cache ]
    Signed-off-by: Dave Jiang
    [ use eventq and time macros ]
    Signed-off-by: Dan Williams

    Jeff Skirvin
     
  • 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
     
  • Rather than preallocating a list of timers and doling them out at runtime,
    embed a struct timerlist in each object that needs one. A struct sci_timer
    interface is introduced to manage the timer cancellation semantics which
    currently need to guarantee the timer is cancelled while holding
    spin_lock(ihost->scic_lock). Since the timeout functions also need to acquire
    the lock it currently prevents the driver from using del_timer_sync() for
    runtime cancellations.

    del_timer_sync() is used however before the objects go out of scope.

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

    Edmund Nadolski
     
  • Unify the handlers and kill the state handler infrastructure.

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

    Dan Williams
     
  • Unify the handlers and kill the state handler implementations.

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

    Piotr Sawicki
     
  • Unused infrastructure.

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

    Piotr Sawicki
     
  • Unify the implementations and remove the state handlers.

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

    Piotr Sawicki
     
  • The handler was never used.

    Signed-off-by: Piotr Sawicki
    Signed-off-by: Dan Williams

    Piotr Sawicki
     
  • Implement the stop handlers directly in scic_sds_port_stop()

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

    Piotr Sawicki
     
  • remove the handler from the port state handler table and implement the
    logic directly in scic_sds_port_start().

    Signed-off-by: Piotr Sawicki
    [remove a level of indirection]
    Signed-off-by: Dan Williams

    Piotr Sawicki
     
  • This conversion was complicated by the fact that the ready state exit routine
    took unconditional action beyond just stopping the substate machine (like in
    previous conversions). In order to ensure identical behaviour every state
    transition needs to be instrumented to catch ready-->!ready transitions and
    execute scic_sds_port_invalidate_dummy_remote_node()

    Reported-by: Christoph Hellwig
    Signed-off-by: Piotr Sawicki
    [fix ready state exit handling]
    Signed-off-by: Dan Williams

    Piotr Sawicki
     
  • * Move port configuration agent implementation
    * Merge core/scic_sds_port.[ch] into port.[ch]

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

    Dan Williams
     
  • 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
     
  • Make scic_sds_port a member of isci_port and merge their lifetimes which
    means removing the port table from scic_sds_controller in favor of the
    one at the isci_host level. Merge ihost->sas_ports into ihost->ports.
    _
    Reported-by: Christoph Hellwig
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Make it explicit that isci_host and scic_sds_controller are one in the same
    object.

    Signed-off-by: Artur Wojcik
    [removed ->ihost back pointer]
    Signed-off-by: Dan Williams

    Artur Wojcik
     
  • Now that the core/lldd remote_device data structures are nominally unified
    merge the corresponding sources into the top-level directory. Also move the
    remote_node_context infrastructure which has no analog at the lldd level.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • A domain_device can always reference back to ->lldd_ha unlike local lldd
    structures. Fix up cases where the driver uses local objects to look up the
    isci_host. This also changes the calling conventions of some routines to
    expect a valid isci_host parameter rather than re-lookup the pointer on entry.

    Incidentally cleans up some macros that are longer to type than the open-coded
    equivalent:
    isci_host_from_sas_ha
    isci_dev_from_domain_dev

    Signed-off-by: Dan Williams

    Dan Williams
     
  • Removed isci_event_* calls and call those functions directly.

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

    Dave Jiang
     
  • The remote_device_lock is currently used to protect a controller global
    resource (RNCs), but the remote_device_lock is per-port.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • The midlayer is already throttling i/o in the places where host_quiesce
    was trying to prevent further i/o to the device. It's also problematic
    in that it holds a lock over GFP_KERNEL allocations.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • Support for the up to 2x4-port 6Gb/s SAS controllers embedded in the
    chipset.

    This is a snapshot of the first publicly available version of the driver,
    commit 4c1db2d0 in the 'historical' branch.

    git://git.kernel.org/pub/scm/linux/kernel/git/djbw/isci.git historical

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

    Dan Williams