22 Sep, 2011

1 commit

  • Basic support to initialize the gpio unit, accept an incomming
    SAS_GPIO_REG_TX_GP bitstream, and translate it to the ODx.n fields in
    the hardware registers. If register indexes outside the supported range
    are specified in the SMP frame we simply accept the write and return how
    many registers (SFF-8485) were written (libsas reports this as residue
    in the request).

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

    Dan Williams
     

24 Aug, 2011

1 commit

  • Hardware allows both an outstanding number commands and a timeout value
    (whichever occurs first) as a gate to the next interrupt generation. This
    scheme at completion time looks at the remaining number of outstanding tasks
    and sets the timeout to maximize small transaction operation. If transactions
    are large (take more than a few 10s of microseconds to complete) then
    performance is not interrupt processing bound, so the small timeouts this
    scheme generates are overridden by the time it takes for a completion to
    arrive.

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

    Dan Williams
     

03 Jul, 2011

38 commits

  • Perform checking per-pci device (even though all systems will only have
    1 pci device in this generation), and delete support for silicon that
    does not report a proper revision (i.e. A0).

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

    Dan Williams
     
  • Does not need its own file.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • 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 dma_pool interface is optimized for object_size << page_size which
    is not the case with isci_request objects and the dma_pool routines show
    up in the top of the profile.

    The old io_request_table which tracked whether tci slots were in-flight
    or not is replaced with an IREQ_ACTIVE flag per request.

    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
     
  • 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
     
  • Every single i/o or event completion incurs a test and branch to see if
    the cycle bit changed. For power-of-2 queue sizes the cycle bit can be
    read directly from the rollover of the queue pointer.

    Likely premature optimization, but the hidden if() and hidden
    assignments / side-effects in the macros were already asking to be
    cleaned up.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • A tag is a 16 bit number where the upper four bits is a sequence number
    and the remainder is the task context index (tci). Sanitize the macro
    names and shave 256-bytes out of scic_sds_controller by reducing the size of
    io_request_sequence.

    scic_sds_io_tag_construct --> ISCI_TAG
    scic_sds_io_tag_get_sequence --> ISCI_TAG_SEQ
    scic_sds_io_tag_get_index() --> ISCI_TAG_TCI
    scic_sds_io_sequence_increment() [delete / open code]

    Signed-off-by: Dan Williams

    Dan Williams
     
  • The circ_buf macros are ~6% faster, as measured by perf, because they take
    advantage of power-of-two math assumptions i.e. no test and branch for
    rollover. Their semantics are clearer than the hidden side effects in pool.h
    (like sci_pool_get() which hides an assignment).

    Signed-off-by: Dan Williams

    Dan Williams
     
  • The old 'core' had aspirations of running in severely memory constrained
    environments like bios option-rom, it's not needed for Linux and gets in
    the way of other cleanups (like unifying/reducing the number of structure
    members in scic_sds_controller/isci_host).

    This also fixes a theoretical bug in that the driver would blindly override
    the silicon advertised limits for number of ports, task contexts, and remote
    node contexts.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • C0 silicon updates the pci revision id and requires new AFE parameters
    for phy signal integrity. Support for previous silicon revisions is
    deprecated (it's also broken for the theoretical case of multiple
    controllers at different silicon revisions, all the more reason to get
    it removed as soon as possible)

    Signed-off-by: Adam Gruchala
    [fixed up deprecated silicon support]
    Signed-off-by: Dan Williams

    Adam Gruchala
     
  • Additional state machine cleanups:

    o Remove static functions sci_state_machine_exit_state() and
    sci_state_machine_enter_state()
    o Combines sci_base_state_machine_construct() and
    sci_base_state_machine_start() into a single function,
    sci_init_sm()
    o Remove sci_base_state_machine_stop() which is unused.
    o Kill state_machine.[ch]

    Signed-off-by: Edmund Nadolski
    [fixed too large to inline functions]
    Signed-off-by: Dan Williams

    Edmund Nadolski
     
  • 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
     
  • Delete code which is no longer used.

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

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

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

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

    Edmund Nadolski
     
  • Signed-off-by: Edmund Nadolski
    [squashed collateral cleanups]
    Signed-off-by: Dan Williams

    Edmund Nadolski
     
  • * 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
     
  • unify core/sci_base_state.h and core/sci_base_state_machine.[ch] into
    state_machine.[ch]

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

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

    Dan Williams
     
  • Now that the data structures are unified unify the implementation in
    host.[ch] and cleanup namespace pollution.

    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_request a proper member of isci_request. Also let's us
    get rid of the dma pool object size tracking since we now know that all
    requests are sizeof(isci_request). While cleaning up the construct
    routine incidentally replaced SCI_FIELD_OFFSET with offsetof.

    Reported-by: Christoph Hellwig
    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
     
  • Make it explicit that isci_remote_device and scic_sds_remote_device are
    one in the same object.

    Signed-off-by: Dan Williams

    Dan Williams
     
  • Remove the insane infrastructure for preallocating coheren DMA regions,
    and just allocate the memory where needed. This also gets rid of the
    aligment adjustments given that Documentation/DMA-API-HOWTO.txt sais:

    "The cpu return address and the DMA bus master address are both
    guaranteed to be aligned to the smallest PAGE_SIZE order which
    is greater than or equal to the requested size. This invariant
    exists (for example) to guarantee that if you allocate a chunk
    which is smaller than or equal to 64 kilobytes, the extent of the
    buffer you receive will not cross a 64K boundary."

    Signed-off-by: Christoph Hellwig
    [djbw: moved allocation from start to init, re-add memset]
    Signed-off-by: Dan Williams

    Christoph Hellwig
     
  • 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
     
  • We need to scan the OROM for signature and grab the OEM parameters. We
    also need to do the same for EFI. If all fails then we resort to user
    binary blob, and if that fails then we go to the defaults.

    Share the format with the create_fw utility so that all possible sources
    of the parameters are in-sync.

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

    Dan Williams
     
  • Changes to move management of the reqs_in_process entry for the request here.
    Made changes to note when the task is already in the abort path and
    cannot be completed through callbacks.

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

    Jeff Skirvin