summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-07-03isci: Added support for C0 to SCU DriverAdam Gruchala6-39/+88
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 <adam.gruchala@intel.com> [fixed up deprecated silicon support] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: additional state machine cleanupEdmund Nadolski13-294/+62
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 <edmund.nadolski@intel.com> [fixed too large to inline functions] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: state machine cleanupEdmund Nadolski15-1160/+1076
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 <edmund.nadolski@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: Removing unused variables compiler warningsDave Jiang2-10/+1
Newer gcc's are better at identifying "set, but not used" variables. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: Retrieve the EFI variable for OEM parameterDave Jiang2-51/+24
We can call the EFI get_variable service routine directly to retrieve the EFI variable that holds the OEM parameters table. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: removing the kmalloc in smp request constructDave Jiang1-16/+10
It doesn't look like there is any reason to do a kmalloc. We can do the byte swap in place and avoid the allocation. This allow us to remove a kmalloc and a memcpy. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove isci_timer interfaceEdmund Nadolski9-352/+1
Delete code which is no longer used. Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: Remove tmf timeout_timerEdmund Nadolski2-87/+20
Replace the timeout_timer in the isci_tmf with a call to wait_for_completion_timeout Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: convert phy_startup_timer to sci_timerEdmund Nadolski2-47/+34
Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: convert scic_timeout_timer to sci_timerEdmund Nadolski2-28/+36
Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: convert power control timer to sci_timerEdmund Nadolski2-58/+50
Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: convert phy sata_timeout_timer to sci_timerEdmund Nadolski3-49/+35
Convert the sata_timeout_timer in the scic_sds_phy struct to use a struct sci_timer Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: convert port config agent timer to sci_timerEdmund Nadolski3-77/+53
Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> [squashed collateral cleanups] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: replace isci_timer list with proper embedded timersEdmund Nadolski4-25/+60
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 <edmund.nadolski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: add some type safety to the state machine interfaceDan Williams8-194/+148
Now that any given object type only has one state_machine we can use container_of() to get back to the given state machine owner. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify rnc start{io|task} handlersDan Williams3-307/+47
Unify rnc start{io|task} handlers and delete the state handler infrastructure. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify rnc suspend/resume handlersDan Williams2-234/+104
Unify rnc suspend/resume handlers and delete the state handlers. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify rnc destruct handlersDan Williams2-80/+39
Unify rnc destruct handlers and delete the state handler. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify rnc event handlersDan Williams2-270/+111
Unify rnc event handlers and delete the state handler. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify port start_io and complete_io handlersDan Williams2-428/+59
Unify the handlers and kill the state handler infrastructure. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify port link_up and link_down handlersPiotr Sawicki2-179/+76
Unify the handlers and kill the state handler implementations. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove port frame and event handlersPiotr Sawicki2-43/+0
Unused infrastructure. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify port reset, add_phy, and remove_phy handlersPiotr Sawicki2-327/+163
Unify the implementations and remove the state handlers. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove port destruct handlerPiotr Sawicki2-40/+0
The handler was never used. Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify port stop handlersPiotr Sawicki3-62/+24
Implement the stop handlers directly in scic_sds_port_stop() Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove port start handlerPiotr Sawicki3-110/+80
remove the handler from the port state handler table and implement the logic directly in scic_sds_port_start(). Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com> [remove a level of indirection] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: merge port ready substates into primary state machinePiotr Sawicki2-256/+210
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 <hch@lst.de> Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com> [fix ready state exit handling] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: c99 port state handlersPiotr Sawicki1-121/+106
Name the table fields for consistancy and clarity. Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: clarify phy to port lookupsDan Williams5-12/+11
While cleaning up the driver it is very tempting to convert scic_sds_get_* macros to their open coded equivalent. They are all just pointer dereferences *except* scic_sds_phy_get_port() which returns NULL if the phy is assigned to the dummy port. Clarify this by renaming it to phy_get_non_dummy_port(). Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify phy consume_power handlersDan Williams2-527/+83
Unify the implementations in scic_sds_phy_consume_power_handler(), and kill the state handler plus infrastructure. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify phy event handlersDan Williams2-642/+384
Unify the implementations in scic_sds_phy_event_handler(), and kill the state handler Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify phy frame handlersDan Williams2-179/+93
Unify the implementations in scic_sds_phy_frame_handler(), and kill the state handler Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove phy destruct handlersDan Williams2-34/+0
Unused infrastructure. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify phy reset handlersDan Williams2-47/+12
Unify the implementations in scic_sds_phy_reset(), and kill the state handler Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify phy stop handlersDan Williams2-62/+23
Merge all implementations in scic_sds_phy_stop(), and kill the state handler Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify phy start handlersDan Williams2-61/+19
Implement all handlers in scic_sds_phy_start(), and kill the state handler Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: merge phy substatesAdam Gruchala3-299/+276
Merged states and substates into one state machine, as we always unconditionally transitioned to the substate machine it was straightforward to enter that substate from the starting state. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Adam Gruchala <adam.gruchala@intel.com> [fixed construction, starting_state_enter, and starting check] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove the completion and event state handlersDan Williams2-469/+82
With these handlers gone the rest of the state handler infrastructure is removed. Added some WARN_ONCEs where previously we would cause NULL pointer dereferences or silently run handlers from a previous state. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove request task context completion state handlerDan Williams2-337/+197
Unlike the other conversions this only updates scic_sds_io_request_tc_completion() to call the old state handlers directly (with less verbose names). This was done for future patch readability, the implementations have only minor differences for different completion codes. Without a reference to the function name it would be difficult to dicern which state is being updated. Considered changing the order to look up the completion code before the state but that was not a clean conversion either. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify request frame handlersDan Williams3-607/+422
Unify the implementation in scic_sds_io_request_frame_handler and kill the state handler. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify request start handlersPiotr Sawicki3-94/+74
Unify the implementation in scic_sds_request_start and kill the state handler. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com> [remove scic_sds_request_constructed_state_start_handler] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: unify request abort handlersDan Williams2-103/+50
Unify the implementation in scic_sds_io_request_terminate and kill the state handler. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: merge stp request substates into primary state machineDan Williams5-1927/+1571
Remove usage of the request substate machine for stp requests, and kill the request substate infrastructure. Similar to the previous conversions this adds the substates to the primary state machine and arranges for the 'started' state to transition to the proper stp substate. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: merge smp request substates into primary state machineDan Williams5-593/+436
Remove usage of the request substate machine for smp requests identified by: task->task_proto == SAS_PROTOCOL_SMP While merging over the smp_request infrastructure noticed that all the assign buffer implementations are now equal, so moved it to scic_sds_general_request_construct. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: merge ssp task management substates into primary state machineDan Williams4-286/+178
Remove usage of the request substate machine for ssp task management requests identified by: ireq->ttype == tmf_task && dev->dev_type == SAS_END_DEV; The only routine that checks the base 'started' state is scic_sds_io_request_tc_completion which calls the substate machine handler if we are not in the 'started' state or we are 'started' and no substate machine is defined. This routine requires no conversion because we have transitioned out of 'started' and the substate routine will be called naturally as a result. There are also no side effects of this conversion on exiting the 'started', state because it only stops the substate machine, which is no longer relevant for this transaction type. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: uplevel port infrastructureDan Williams17-3425/+2929
* Move port configuration agent implementation * Merge core/scic_sds_port.[ch] into port.[ch] Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: uplevel phy infrastructureDan Williams11-3031/+2784
Merge core/scic_sds_phy.[ch] into phy.[ch] Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: uplevel request infrastructureDan Williams27-3198/+2194
* Consolidate tiny header files * Move files out of core/ (drop core/scic_sds_ prefix) * Merge core/scic_sds_request.[ch] into request.[ch] * Cleanup request.c namespace (clean forward declarations and global namespace pollution) Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: uplevel state machineDan Williams15-116/+31
unify core/sci_base_state.h and core/sci_base_state_machine.[ch] into state_machine.[ch] Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: uplevel register hardware data structures and unsolicited frame handlingDan Williams17-257/+121
Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>