Lines Matching refs:ihost
179 static bool sci_controller_completion_queue_has_entries(struct isci_host *ihost) in sci_controller_completion_queue_has_entries() argument
181 u32 get_value = ihost->completion_queue_get; in sci_controller_completion_queue_has_entries()
185 COMPLETION_QUEUE_CYCLE_BIT(ihost->completion_queue[get_index])) in sci_controller_completion_queue_has_entries()
191 static bool sci_controller_isr(struct isci_host *ihost) in sci_controller_isr() argument
193 if (sci_controller_completion_queue_has_entries(ihost)) in sci_controller_isr()
200 writel(SMU_ISR_COMPLETION, &ihost->smu_registers->interrupt_status); in sci_controller_isr()
208 spin_lock(&ihost->scic_lock); in sci_controller_isr()
209 if (test_bit(IHOST_IRQ_ENABLED, &ihost->flags)) { in sci_controller_isr()
210 writel(0xFF000000, &ihost->smu_registers->interrupt_mask); in sci_controller_isr()
211 writel(0, &ihost->smu_registers->interrupt_mask); in sci_controller_isr()
213 spin_unlock(&ihost->scic_lock); in sci_controller_isr()
220 struct isci_host *ihost = data; in isci_msix_isr() local
222 if (sci_controller_isr(ihost)) in isci_msix_isr()
223 tasklet_schedule(&ihost->completion_tasklet); in isci_msix_isr()
228 static bool sci_controller_error_isr(struct isci_host *ihost) in sci_controller_error_isr() argument
233 readl(&ihost->smu_registers->interrupt_status); in sci_controller_error_isr()
249 writel(0xff, &ihost->smu_registers->interrupt_mask); in sci_controller_error_isr()
250 writel(0, &ihost->smu_registers->interrupt_mask); in sci_controller_error_isr()
255 static void sci_controller_task_completion(struct isci_host *ihost, u32 ent) in sci_controller_task_completion() argument
258 struct isci_request *ireq = ihost->reqs[index]; in sci_controller_task_completion()
263 ISCI_TAG_SEQ(ireq->io_tag) == ihost->io_request_sequence[index]) in sci_controller_task_completion()
270 static void sci_controller_sdma_completion(struct isci_host *ihost, u32 ent) in sci_controller_sdma_completion() argument
281 ireq = ihost->reqs[index]; in sci_controller_sdma_completion()
282 dev_warn(&ihost->pdev->dev, "%s: %x for io request %p\n", in sci_controller_sdma_completion()
291 idev = ihost->device_table[index]; in sci_controller_sdma_completion()
292 dev_warn(&ihost->pdev->dev, "%s: %x for device %p\n", in sci_controller_sdma_completion()
299 dev_warn(&ihost->pdev->dev, "%s: unknown completion type %x\n", in sci_controller_sdma_completion()
305 static void sci_controller_unsolicited_frame(struct isci_host *ihost, u32 ent) in sci_controller_unsolicited_frame() argument
318 frame_header = ihost->uf_control.buffers.array[frame_index].header; in sci_controller_unsolicited_frame()
319 ihost->uf_control.buffers.array[frame_index].state = UNSOLICITED_FRAME_IN_USE; in sci_controller_unsolicited_frame()
326 sci_controller_release_frame(ihost, frame_index); in sci_controller_unsolicited_frame()
332 iphy = &ihost->phys[index]; in sci_controller_unsolicited_frame()
344 iphy = &ihost->phys[index]; in sci_controller_unsolicited_frame()
347 if (index < ihost->remote_node_entries) in sci_controller_unsolicited_frame()
348 idev = ihost->device_table[index]; in sci_controller_unsolicited_frame()
355 sci_controller_release_frame(ihost, frame_index); in sci_controller_unsolicited_frame()
366 static void sci_controller_event_completion(struct isci_host *ihost, u32 ent) in sci_controller_event_completion() argument
378 dev_err(&ihost->pdev->dev, in sci_controller_event_completion()
382 ihost, in sci_controller_event_completion()
392 dev_err(&ihost->pdev->dev, in sci_controller_event_completion()
396 ihost, in sci_controller_event_completion()
401 ireq = ihost->reqs[index]; in sci_controller_event_completion()
409 ireq = ihost->reqs[index]; in sci_controller_event_completion()
413 dev_warn(&ihost->pdev->dev, in sci_controller_event_completion()
418 ihost, in sci_controller_event_completion()
424 idev = ihost->device_table[index]; in sci_controller_event_completion()
428 dev_warn(&ihost->pdev->dev, in sci_controller_event_completion()
433 ihost, in sci_controller_event_completion()
450 iphy = &ihost->phys[index]; in sci_controller_event_completion()
457 if (index < ihost->remote_node_entries) { in sci_controller_event_completion()
458 idev = ihost->device_table[index]; in sci_controller_event_completion()
463 dev_err(&ihost->pdev->dev, in sci_controller_event_completion()
468 ihost, in sci_controller_event_completion()
475 dev_warn(&ihost->pdev->dev, in sci_controller_event_completion()
483 static void sci_controller_process_completions(struct isci_host *ihost) in sci_controller_process_completions() argument
492 dev_dbg(&ihost->pdev->dev, in sci_controller_process_completions()
495 ihost->completion_queue_get); in sci_controller_process_completions()
498 get_index = NORMALIZE_GET_POINTER(ihost->completion_queue_get); in sci_controller_process_completions()
499 get_cycle = SMU_CQGR_CYCLE_BIT & ihost->completion_queue_get; in sci_controller_process_completions()
501 event_get = NORMALIZE_EVENT_POINTER(ihost->completion_queue_get); in sci_controller_process_completions()
502 event_cycle = SMU_CQGR_EVENT_CYCLE_BIT & ihost->completion_queue_get; in sci_controller_process_completions()
506 == COMPLETION_QUEUE_CYCLE_BIT(ihost->completion_queue[get_index]) in sci_controller_process_completions()
510 ent = ihost->completion_queue[get_index]; in sci_controller_process_completions()
517 dev_dbg(&ihost->pdev->dev, in sci_controller_process_completions()
524 sci_controller_task_completion(ihost, ent); in sci_controller_process_completions()
528 sci_controller_sdma_completion(ihost, ent); in sci_controller_process_completions()
532 sci_controller_unsolicited_frame(ihost, ent); in sci_controller_process_completions()
536 sci_controller_event_completion(ihost, ent); in sci_controller_process_completions()
544 sci_controller_event_completion(ihost, ent); in sci_controller_process_completions()
548 dev_warn(&ihost->pdev->dev, in sci_controller_process_completions()
559 ihost->completion_queue_get = in sci_controller_process_completions()
567 writel(ihost->completion_queue_get, in sci_controller_process_completions()
568 &ihost->smu_registers->completion_queue_get); in sci_controller_process_completions()
572 dev_dbg(&ihost->pdev->dev, in sci_controller_process_completions()
575 ihost->completion_queue_get); in sci_controller_process_completions()
579 static void sci_controller_error_handler(struct isci_host *ihost) in sci_controller_error_handler() argument
584 readl(&ihost->smu_registers->interrupt_status); in sci_controller_error_handler()
587 sci_controller_completion_queue_has_entries(ihost)) { in sci_controller_error_handler()
589 sci_controller_process_completions(ihost); in sci_controller_error_handler()
590 writel(SMU_ISR_QUEUE_SUSPEND, &ihost->smu_registers->interrupt_status); in sci_controller_error_handler()
592 dev_err(&ihost->pdev->dev, "%s: status: %#x\n", __func__, in sci_controller_error_handler()
595 sci_change_state(&ihost->sm, SCIC_FAILED); in sci_controller_error_handler()
603 writel(0, &ihost->smu_registers->interrupt_mask); in sci_controller_error_handler()
609 struct isci_host *ihost = data; in isci_intx_isr() local
611 if (sci_controller_isr(ihost)) { in isci_intx_isr()
612 writel(SMU_ISR_COMPLETION, &ihost->smu_registers->interrupt_status); in isci_intx_isr()
613 tasklet_schedule(&ihost->completion_tasklet); in isci_intx_isr()
615 } else if (sci_controller_error_isr(ihost)) { in isci_intx_isr()
616 spin_lock(&ihost->scic_lock); in isci_intx_isr()
617 sci_controller_error_handler(ihost); in isci_intx_isr()
618 spin_unlock(&ihost->scic_lock); in isci_intx_isr()
627 struct isci_host *ihost = data; in isci_error_isr() local
629 if (sci_controller_error_isr(ihost)) in isci_error_isr()
630 sci_controller_error_handler(ihost); in isci_error_isr()
643 static void isci_host_start_complete(struct isci_host *ihost, enum sci_status completion_status) in isci_host_start_complete() argument
646 dev_info(&ihost->pdev->dev, in isci_host_start_complete()
648 clear_bit(IHOST_START_PENDING, &ihost->flags); in isci_host_start_complete()
649 wake_up(&ihost->eventq); in isci_host_start_complete()
655 struct isci_host *ihost = ha->lldd_ha; in isci_host_scan_finished() local
657 if (test_bit(IHOST_START_PENDING, &ihost->flags)) in isci_host_scan_finished()
677 static u32 sci_controller_get_suggested_start_timeout(struct isci_host *ihost) in sci_controller_get_suggested_start_timeout() argument
680 if (!ihost) in sci_controller_get_suggested_start_timeout()
702 static void sci_controller_enable_interrupts(struct isci_host *ihost) in sci_controller_enable_interrupts() argument
704 set_bit(IHOST_IRQ_ENABLED, &ihost->flags); in sci_controller_enable_interrupts()
705 writel(0, &ihost->smu_registers->interrupt_mask); in sci_controller_enable_interrupts()
708 void sci_controller_disable_interrupts(struct isci_host *ihost) in sci_controller_disable_interrupts() argument
710 clear_bit(IHOST_IRQ_ENABLED, &ihost->flags); in sci_controller_disable_interrupts()
711 writel(0xffffffff, &ihost->smu_registers->interrupt_mask); in sci_controller_disable_interrupts()
712 readl(&ihost->smu_registers->interrupt_mask); /* flush */ in sci_controller_disable_interrupts()
715 static void sci_controller_enable_port_task_scheduler(struct isci_host *ihost) in sci_controller_enable_port_task_scheduler() argument
720 readl(&ihost->scu_registers->peg0.ptsg.control); in sci_controller_enable_port_task_scheduler()
725 &ihost->scu_registers->peg0.ptsg.control); in sci_controller_enable_port_task_scheduler()
728 static void sci_controller_assign_task_entries(struct isci_host *ihost) in sci_controller_assign_task_entries() argument
738 readl(&ihost->smu_registers->task_context_assignment[0]); in sci_controller_assign_task_entries()
741 (SMU_TCA_GEN_VAL(ENDING, ihost->task_context_entries - 1)) | in sci_controller_assign_task_entries()
745 &ihost->smu_registers->task_context_assignment[0]); in sci_controller_assign_task_entries()
749 static void sci_controller_initialize_completion_queue(struct isci_host *ihost) in sci_controller_initialize_completion_queue() argument
756 ihost->completion_queue_get = 0; in sci_controller_initialize_completion_queue()
763 &ihost->smu_registers->completion_queue_control); in sci_controller_initialize_completion_queue()
775 &ihost->smu_registers->completion_queue_get); in sci_controller_initialize_completion_queue()
784 &ihost->smu_registers->completion_queue_put); in sci_controller_initialize_completion_queue()
792 ihost->completion_queue[index] = 0x80000000; in sci_controller_initialize_completion_queue()
796 static void sci_controller_initialize_unsolicited_frame_queue(struct isci_host *ihost) in sci_controller_initialize_unsolicited_frame_queue() argument
807 &ihost->scu_registers->sdma.unsolicited_frame_queue_control); in sci_controller_initialize_unsolicited_frame_queue()
816 &ihost->scu_registers->sdma.unsolicited_frame_get_pointer); in sci_controller_initialize_unsolicited_frame_queue()
820 &ihost->scu_registers->sdma.unsolicited_frame_put_pointer); in sci_controller_initialize_unsolicited_frame_queue()
823 void sci_controller_transition_to_ready(struct isci_host *ihost, enum sci_status status) in sci_controller_transition_to_ready() argument
825 if (ihost->sm.current_state_id == SCIC_STARTING) { in sci_controller_transition_to_ready()
830 sci_change_state(&ihost->sm, SCIC_READY); in sci_controller_transition_to_ready()
832 isci_host_start_complete(ihost, status); in sci_controller_transition_to_ready()
859 bool is_controller_start_complete(struct isci_host *ihost) in is_controller_start_complete() argument
864 struct isci_phy *iphy = &ihost->phys[i]; in is_controller_start_complete()
871 if (is_port_config_apc(ihost)) in is_controller_start_complete()
885 (ihost->port_agent.phy_ready_mask != ihost->port_agent.phy_configured_mask)) in is_controller_start_complete()
900 static enum sci_status sci_controller_start_next_phy(struct isci_host *ihost) in sci_controller_start_next_phy() argument
902 struct sci_oem_params *oem = &ihost->oem_parameters; in sci_controller_start_next_phy()
908 if (ihost->phy_startup_timer_pending) in sci_controller_start_next_phy()
911 if (ihost->next_phy_to_start >= SCI_MAX_PHYS) { in sci_controller_start_next_phy()
912 if (is_controller_start_complete(ihost)) { in sci_controller_start_next_phy()
913 sci_controller_transition_to_ready(ihost, SCI_SUCCESS); in sci_controller_start_next_phy()
914 sci_del_timer(&ihost->phy_timer); in sci_controller_start_next_phy()
915 ihost->phy_startup_timer_pending = false; in sci_controller_start_next_phy()
918 iphy = &ihost->phys[ihost->next_phy_to_start]; in sci_controller_start_next_phy()
922 ihost->next_phy_to_start++; in sci_controller_start_next_phy()
933 return sci_controller_start_next_phy(ihost); in sci_controller_start_next_phy()
940 sci_mod_timer(&ihost->phy_timer, in sci_controller_start_next_phy()
942 ihost->phy_startup_timer_pending = true; in sci_controller_start_next_phy()
944 dev_warn(&ihost->pdev->dev, in sci_controller_start_next_phy()
949 ihost->phys[ihost->next_phy_to_start].phy_index, in sci_controller_start_next_phy()
953 ihost->next_phy_to_start++; in sci_controller_start_next_phy()
962 struct isci_host *ihost = container_of(tmr, typeof(*ihost), phy_timer); in phy_startup_timeout() local
966 spin_lock_irqsave(&ihost->scic_lock, flags); in phy_startup_timeout()
971 ihost->phy_startup_timer_pending = false; in phy_startup_timeout()
974 status = sci_controller_start_next_phy(ihost); in phy_startup_timeout()
978 spin_unlock_irqrestore(&ihost->scic_lock, flags); in phy_startup_timeout()
981 static u16 isci_tci_active(struct isci_host *ihost) in isci_tci_active() argument
983 return CIRC_CNT(ihost->tci_head, ihost->tci_tail, SCI_MAX_IO_REQUESTS); in isci_tci_active()
986 static enum sci_status sci_controller_start(struct isci_host *ihost, in sci_controller_start() argument
992 if (ihost->sm.current_state_id != SCIC_INITIALIZED) { in sci_controller_start()
993 dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", in sci_controller_start()
994 __func__, ihost->sm.current_state_id); in sci_controller_start()
999 BUILD_BUG_ON(SCI_MAX_IO_REQUESTS > 1 << sizeof(ihost->tci_pool[0]) * 8); in sci_controller_start()
1000 ihost->tci_head = 0; in sci_controller_start()
1001 ihost->tci_tail = 0; in sci_controller_start()
1002 for (index = 0; index < ihost->task_context_entries; index++) in sci_controller_start()
1003 isci_tci_free(ihost, index); in sci_controller_start()
1006 sci_remote_node_table_initialize(&ihost->available_remote_nodes, in sci_controller_start()
1007 ihost->remote_node_entries); in sci_controller_start()
1013 sci_controller_disable_interrupts(ihost); in sci_controller_start()
1016 sci_controller_enable_port_task_scheduler(ihost); in sci_controller_start()
1019 sci_controller_assign_task_entries(ihost); in sci_controller_start()
1022 sci_controller_initialize_completion_queue(ihost); in sci_controller_start()
1025 sci_controller_initialize_unsolicited_frame_queue(ihost); in sci_controller_start()
1028 for (index = 0; index < ihost->logical_port_entries; index++) { in sci_controller_start()
1029 struct isci_port *iport = &ihost->ports[index]; in sci_controller_start()
1036 sci_controller_start_next_phy(ihost); in sci_controller_start()
1038 sci_mod_timer(&ihost->timer, timeout); in sci_controller_start()
1040 sci_change_state(&ihost->sm, SCIC_STARTING); in sci_controller_start()
1047 struct isci_host *ihost = SHOST_TO_SAS_HA(shost)->lldd_ha; in isci_host_start() local
1048 unsigned long tmo = sci_controller_get_suggested_start_timeout(ihost); in isci_host_start()
1050 set_bit(IHOST_START_PENDING, &ihost->flags); in isci_host_start()
1052 spin_lock_irq(&ihost->scic_lock); in isci_host_start()
1053 sci_controller_start(ihost, tmo); in isci_host_start()
1054 sci_controller_enable_interrupts(ihost); in isci_host_start()
1055 spin_unlock_irq(&ihost->scic_lock); in isci_host_start()
1058 static void isci_host_stop_complete(struct isci_host *ihost) in isci_host_stop_complete() argument
1060 sci_controller_disable_interrupts(ihost); in isci_host_stop_complete()
1061 clear_bit(IHOST_STOP_PENDING, &ihost->flags); in isci_host_stop_complete()
1062 wake_up(&ihost->eventq); in isci_host_stop_complete()
1065 static void sci_controller_completion_handler(struct isci_host *ihost) in sci_controller_completion_handler() argument
1068 if (sci_controller_completion_queue_has_entries(ihost)) in sci_controller_completion_handler()
1069 sci_controller_process_completions(ihost); in sci_controller_completion_handler()
1072 writel(SMU_ISR_COMPLETION, &ihost->smu_registers->interrupt_status); in sci_controller_completion_handler()
1074 writel(0xFF000000, &ihost->smu_registers->interrupt_mask); in sci_controller_completion_handler()
1075 writel(0, &ihost->smu_registers->interrupt_mask); in sci_controller_completion_handler()
1078 void ireq_done(struct isci_host *ihost, struct isci_request *ireq, struct sas_task *task) in ireq_done() argument
1084 dev_dbg(&ihost->pdev->dev, in ireq_done()
1090 dev_dbg(&ihost->pdev->dev, in ireq_done()
1101 wake_up_all(&ihost->eventq); in ireq_done()
1104 isci_free_tag(ihost, ireq->io_tag); in ireq_done()
1116 struct isci_host *ihost = (struct isci_host *)data; in isci_host_completion_routine() local
1119 spin_lock_irq(&ihost->scic_lock); in isci_host_completion_routine()
1120 sci_controller_completion_handler(ihost); in isci_host_completion_routine()
1121 spin_unlock_irq(&ihost->scic_lock); in isci_host_completion_routine()
1127 active = isci_tci_active(ihost) - SCI_MAX_PORTS; in isci_host_completion_routine()
1135 &ihost->smu_registers->interrupt_coalesce_control); in isci_host_completion_routine()
1156 static enum sci_status sci_controller_stop(struct isci_host *ihost, u32 timeout) in sci_controller_stop() argument
1158 if (ihost->sm.current_state_id != SCIC_READY) { in sci_controller_stop()
1159 dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", in sci_controller_stop()
1160 __func__, ihost->sm.current_state_id); in sci_controller_stop()
1164 sci_mod_timer(&ihost->timer, timeout); in sci_controller_stop()
1165 sci_change_state(&ihost->sm, SCIC_STOPPING); in sci_controller_stop()
1181 static enum sci_status sci_controller_reset(struct isci_host *ihost) in sci_controller_reset() argument
1183 switch (ihost->sm.current_state_id) { in sci_controller_reset()
1192 sci_change_state(&ihost->sm, SCIC_RESETTING); in sci_controller_reset()
1195 dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", in sci_controller_reset()
1196 __func__, ihost->sm.current_state_id); in sci_controller_reset()
1201 static enum sci_status sci_controller_stop_phys(struct isci_host *ihost) in sci_controller_stop_phys() argument
1210 phy_status = sci_phy_stop(&ihost->phys[index]); in sci_controller_stop_phys()
1216 dev_warn(&ihost->pdev->dev, in sci_controller_stop_phys()
1220 ihost->phys[index].phy_index, phy_status); in sci_controller_stop_phys()
1239 void isci_host_deinit(struct isci_host *ihost) in isci_host_deinit() argument
1244 for (i = 0; i < isci_gpio_count(ihost); i++) in isci_host_deinit()
1245 writel(SGPIO_HW_CONTROL, &ihost->scu_registers->peg0.sgpio.output_data_select[i]); in isci_host_deinit()
1247 set_bit(IHOST_STOP_PENDING, &ihost->flags); in isci_host_deinit()
1249 spin_lock_irq(&ihost->scic_lock); in isci_host_deinit()
1250 sci_controller_stop(ihost, SCIC_CONTROLLER_STOP_TIMEOUT); in isci_host_deinit()
1251 spin_unlock_irq(&ihost->scic_lock); in isci_host_deinit()
1253 wait_for_stop(ihost); in isci_host_deinit()
1260 sci_controller_stop_phys(ihost); in isci_host_deinit()
1265 writel(0, &ihost->scu_registers->peg0.sgpio.interface_control); in isci_host_deinit()
1267 spin_lock_irq(&ihost->scic_lock); in isci_host_deinit()
1268 sci_controller_reset(ihost); in isci_host_deinit()
1269 spin_unlock_irq(&ihost->scic_lock); in isci_host_deinit()
1272 for (i = 0; i < ihost->logical_port_entries; i++) { in isci_host_deinit()
1273 struct isci_port *iport = &ihost->ports[i]; in isci_host_deinit()
1279 struct isci_phy *iphy = &ihost->phys[i]; in isci_host_deinit()
1283 del_timer_sync(&ihost->port_agent.timer.timer); in isci_host_deinit()
1285 del_timer_sync(&ihost->power_control.timer.timer); in isci_host_deinit()
1287 del_timer_sync(&ihost->timer.timer); in isci_host_deinit()
1289 del_timer_sync(&ihost->phy_timer.timer); in isci_host_deinit()
1310 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_initial_state_enter() local
1312 sci_change_state(&ihost->sm, SCIC_RESET); in sci_controller_initial_state_enter()
1317 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_starting_state_exit() local
1319 sci_del_timer(&ihost->timer); in sci_controller_starting_state_exit()
1347 sci_controller_set_interrupt_coalescence(struct isci_host *ihost, in sci_controller_set_interrupt_coalescence() argument
1432 &ihost->smu_registers->interrupt_coalesce_control); in sci_controller_set_interrupt_coalescence()
1435 ihost->interrupt_coalesce_number = (u16)coalesce_number; in sci_controller_set_interrupt_coalescence()
1436 ihost->interrupt_coalesce_timeout = coalesce_timeout / 100; in sci_controller_set_interrupt_coalescence()
1444 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_ready_state_enter() local
1448 val = readl(&ihost->smu_registers->clock_gating_control); in sci_controller_ready_state_enter()
1453 writel(val, &ihost->smu_registers->clock_gating_control); in sci_controller_ready_state_enter()
1456 sci_controller_set_interrupt_coalescence(ihost, 0, 0); in sci_controller_ready_state_enter()
1461 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_ready_state_exit() local
1464 sci_controller_set_interrupt_coalescence(ihost, 0, 0); in sci_controller_ready_state_exit()
1467 static enum sci_status sci_controller_stop_ports(struct isci_host *ihost) in sci_controller_stop_ports() argument
1473 for (index = 0; index < ihost->logical_port_entries; index++) { in sci_controller_stop_ports()
1474 struct isci_port *iport = &ihost->ports[index]; in sci_controller_stop_ports()
1482 dev_warn(&ihost->pdev->dev, in sci_controller_stop_ports()
1494 static enum sci_status sci_controller_stop_devices(struct isci_host *ihost) in sci_controller_stop_devices() argument
1502 for (index = 0; index < ihost->remote_node_entries; index++) { in sci_controller_stop_devices()
1503 if (ihost->device_table[index] != NULL) { in sci_controller_stop_devices()
1505 device_status = sci_remote_device_stop(ihost->device_table[index], 0); in sci_controller_stop_devices()
1509 dev_warn(&ihost->pdev->dev, in sci_controller_stop_devices()
1514 ihost->device_table[index], device_status); in sci_controller_stop_devices()
1524 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_stopping_state_enter() local
1526 sci_controller_stop_devices(ihost); in sci_controller_stopping_state_enter()
1527 sci_controller_stop_ports(ihost); in sci_controller_stopping_state_enter()
1529 if (!sci_controller_has_remote_devices_stopping(ihost)) in sci_controller_stopping_state_enter()
1530 isci_host_stop_complete(ihost); in sci_controller_stopping_state_enter()
1535 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_stopping_state_exit() local
1537 sci_del_timer(&ihost->timer); in sci_controller_stopping_state_exit()
1540 static void sci_controller_reset_hardware(struct isci_host *ihost) in sci_controller_reset_hardware() argument
1543 sci_controller_disable_interrupts(ihost); in sci_controller_reset_hardware()
1546 writel(0xFFFFFFFF, &ihost->smu_registers->soft_reset_control); in sci_controller_reset_hardware()
1552 writel(0x00000000, &ihost->smu_registers->completion_queue_get); in sci_controller_reset_hardware()
1555 writel(0, &ihost->scu_registers->sdma.unsolicited_frame_get_pointer); in sci_controller_reset_hardware()
1558 writel(~SMU_INTERRUPT_STATUS_RESERVED_MASK, &ihost->smu_registers->interrupt_status); in sci_controller_reset_hardware()
1563 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); in sci_controller_resetting_state_enter() local
1565 sci_controller_reset_hardware(ihost); in sci_controller_resetting_state_enter()
1566 sci_change_state(&ihost->sm, SCIC_RESET); in sci_controller_resetting_state_enter()
1596 struct isci_host *ihost = container_of(tmr, typeof(*ihost), timer); in controller_timeout() local
1597 struct sci_base_state_machine *sm = &ihost->sm; in controller_timeout()
1600 spin_lock_irqsave(&ihost->scic_lock, flags); in controller_timeout()
1606 sci_controller_transition_to_ready(ihost, SCI_FAILURE_TIMEOUT); in controller_timeout()
1609 isci_host_stop_complete(ihost); in controller_timeout()
1611 dev_err(&ihost->pdev->dev, in controller_timeout()
1617 spin_unlock_irqrestore(&ihost->scic_lock, flags); in controller_timeout()
1620 static enum sci_status sci_controller_construct(struct isci_host *ihost, in sci_controller_construct() argument
1626 sci_init_sm(&ihost->sm, sci_controller_state_table, SCIC_INITIAL); in sci_controller_construct()
1628 ihost->scu_registers = scu_base; in sci_controller_construct()
1629 ihost->smu_registers = smu_base; in sci_controller_construct()
1631 sci_port_configuration_agent_construct(&ihost->port_agent); in sci_controller_construct()
1635 sci_port_construct(&ihost->ports[i], i, ihost); in sci_controller_construct()
1636 sci_port_construct(&ihost->ports[i], SCIC_SDS_DUMMY_PORT, ihost); in sci_controller_construct()
1641 sci_phy_construct(&ihost->phys[i], in sci_controller_construct()
1642 &ihost->ports[SCI_MAX_PORTS], i); in sci_controller_construct()
1645 ihost->invalid_phy_mask = 0; in sci_controller_construct()
1647 sci_init_timer(&ihost->timer, controller_timeout); in sci_controller_construct()
1649 return sci_controller_reset(ihost); in sci_controller_construct()
1728 static u8 max_spin_up(struct isci_host *ihost) in max_spin_up() argument
1730 if (ihost->user_parameters.max_concurr_spinup) in max_spin_up()
1731 return min_t(u8, ihost->user_parameters.max_concurr_spinup, in max_spin_up()
1734 return min_t(u8, ihost->oem_parameters.controller.max_concurr_spin_up, in max_spin_up()
1741 struct isci_host *ihost = container_of(tmr, typeof(*ihost), power_control.timer); in power_control_timeout() local
1746 spin_lock_irqsave(&ihost->scic_lock, flags); in power_control_timeout()
1751 ihost->power_control.phys_granted_power = 0; in power_control_timeout()
1753 if (ihost->power_control.phys_waiting == 0) { in power_control_timeout()
1754 ihost->power_control.timer_started = false; in power_control_timeout()
1760 if (ihost->power_control.phys_waiting == 0) in power_control_timeout()
1763 iphy = ihost->power_control.requesters[i]; in power_control_timeout()
1767 if (ihost->power_control.phys_granted_power >= max_spin_up(ihost)) in power_control_timeout()
1770 ihost->power_control.requesters[i] = NULL; in power_control_timeout()
1771 ihost->power_control.phys_waiting--; in power_control_timeout()
1772 ihost->power_control.phys_granted_power++; in power_control_timeout()
1779 struct isci_phy *requester = ihost->power_control.requesters[j]; in power_control_timeout()
1792 ihost->power_control.requesters[j] = NULL; in power_control_timeout()
1793 ihost->power_control.phys_waiting--; in power_control_timeout()
1806 ihost->power_control.timer_started = true; in power_control_timeout()
1809 spin_unlock_irqrestore(&ihost->scic_lock, flags); in power_control_timeout()
1812 void sci_controller_power_control_queue_insert(struct isci_host *ihost, in sci_controller_power_control_queue_insert() argument
1817 if (ihost->power_control.phys_granted_power < max_spin_up(ihost)) { in sci_controller_power_control_queue_insert()
1818 ihost->power_control.phys_granted_power++; in sci_controller_power_control_queue_insert()
1825 if (ihost->power_control.timer_started) in sci_controller_power_control_queue_insert()
1826 sci_del_timer(&ihost->power_control.timer); in sci_controller_power_control_queue_insert()
1828 sci_mod_timer(&ihost->power_control.timer, in sci_controller_power_control_queue_insert()
1830 ihost->power_control.timer_started = true; in sci_controller_power_control_queue_insert()
1842 current_phy = &ihost->phys[i]; in sci_controller_power_control_queue_insert()
1858 ihost->power_control.requesters[iphy->phy_index] = iphy; in sci_controller_power_control_queue_insert()
1859 ihost->power_control.phys_waiting++; in sci_controller_power_control_queue_insert()
1864 void sci_controller_power_control_queue_remove(struct isci_host *ihost, in sci_controller_power_control_queue_remove() argument
1869 if (ihost->power_control.requesters[iphy->phy_index]) in sci_controller_power_control_queue_remove()
1870 ihost->power_control.phys_waiting--; in sci_controller_power_control_queue_remove()
1872 ihost->power_control.requesters[iphy->phy_index] = NULL; in sci_controller_power_control_queue_remove()
1893 static unsigned char *to_cable_select(struct isci_host *ihost) in to_cable_select() argument
1897 + ihost->id; in to_cable_select()
1899 return &ihost->oem_parameters.controller.cable_selection_mask; in to_cable_select()
1902 enum cable_selections decode_cable_selection(struct isci_host *ihost, int phy) in decode_cable_selection() argument
1904 return decode_selection_byte(phy, *to_cable_select(ihost)); in decode_cable_selection()
1921 static void sci_controller_afe_initialization(struct isci_host *ihost) in sci_controller_afe_initialization() argument
1923 struct scu_afe_registers __iomem *afe = &ihost->scu_registers->afe; in sci_controller_afe_initialization()
1924 const struct sci_oem_params *oem = &ihost->oem_parameters; in sci_controller_afe_initialization()
1925 struct pci_dev *pdev = ihost->pdev; in sci_controller_afe_initialization()
1928 unsigned char cable_selection_mask = *to_cable_select(ihost); in sci_controller_afe_initialization()
2122 static void sci_controller_initialize_power_control(struct isci_host *ihost) in sci_controller_initialize_power_control() argument
2124 sci_init_timer(&ihost->power_control.timer, power_control_timeout); in sci_controller_initialize_power_control()
2126 memset(ihost->power_control.requesters, 0, in sci_controller_initialize_power_control()
2127 sizeof(ihost->power_control.requesters)); in sci_controller_initialize_power_control()
2129 ihost->power_control.phys_waiting = 0; in sci_controller_initialize_power_control()
2130 ihost->power_control.phys_granted_power = 0; in sci_controller_initialize_power_control()
2133 static enum sci_status sci_controller_initialize(struct isci_host *ihost) in sci_controller_initialize() argument
2135 struct sci_base_state_machine *sm = &ihost->sm; in sci_controller_initialize()
2139 if (ihost->sm.current_state_id != SCIC_RESET) { in sci_controller_initialize()
2140 dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", in sci_controller_initialize()
2141 __func__, ihost->sm.current_state_id); in sci_controller_initialize()
2147 sci_init_timer(&ihost->phy_timer, phy_startup_timeout); in sci_controller_initialize()
2149 ihost->next_phy_to_start = 0; in sci_controller_initialize()
2150 ihost->phy_startup_timer_pending = false; in sci_controller_initialize()
2152 sci_controller_initialize_power_control(ihost); in sci_controller_initialize()
2159 sci_controller_afe_initialization(ihost); in sci_controller_initialize()
2163 writel(0, &ihost->smu_registers->soft_reset_control); in sci_controller_initialize()
2173 status = readl(&ihost->smu_registers->control_status); in sci_controller_initialize()
2184 val = readl(&ihost->smu_registers->device_context_capacity); in sci_controller_initialize()
2187 ihost->logical_port_entries = min(smu_max_ports(val), SCI_MAX_PORTS); in sci_controller_initialize()
2188 ihost->task_context_entries = min(smu_max_task_contexts(val), SCI_MAX_IO_REQUESTS); in sci_controller_initialize()
2189 ihost->remote_node_entries = min(smu_max_rncs(val), SCI_MAX_REMOTE_DEVICES); in sci_controller_initialize()
2195 for (i = 0; i < ihost->logical_port_entries; i++) { in sci_controller_initialize()
2197 *ptsg = &ihost->scu_registers->peg0.ptsg; in sci_controller_initialize()
2203 val = readl(&ihost->scu_registers->sdma.pdma_configuration); in sci_controller_initialize()
2205 writel(val, &ihost->scu_registers->sdma.pdma_configuration); in sci_controller_initialize()
2207 val = readl(&ihost->scu_registers->sdma.cdma_configuration); in sci_controller_initialize()
2209 writel(val, &ihost->scu_registers->sdma.cdma_configuration); in sci_controller_initialize()
2216 result = sci_phy_initialize(&ihost->phys[i], in sci_controller_initialize()
2217 &ihost->scu_registers->peg0.pe[i].tl, in sci_controller_initialize()
2218 &ihost->scu_registers->peg0.pe[i].ll); in sci_controller_initialize()
2223 for (i = 0; i < ihost->logical_port_entries; i++) { in sci_controller_initialize()
2224 struct isci_port *iport = &ihost->ports[i]; in sci_controller_initialize()
2226 iport->port_task_scheduler_registers = &ihost->scu_registers->peg0.ptsg.port[i]; in sci_controller_initialize()
2227 iport->port_pe_configuration_register = &ihost->scu_registers->peg0.ptsg.protocol_engine[0]; in sci_controller_initialize()
2228 iport->viit_registers = &ihost->scu_registers->peg0.viit[i]; in sci_controller_initialize()
2231 result = sci_port_configuration_agent_initialize(ihost, &ihost->port_agent); in sci_controller_initialize()
2244 static int sci_controller_dma_alloc(struct isci_host *ihost) in sci_controller_dma_alloc() argument
2246 struct device *dev = &ihost->pdev->dev; in sci_controller_dma_alloc()
2251 if (ihost->completion_queue) in sci_controller_dma_alloc()
2255 ihost->completion_queue = dmam_alloc_coherent(dev, size, &ihost->cq_dma, in sci_controller_dma_alloc()
2257 if (!ihost->completion_queue) in sci_controller_dma_alloc()
2260 size = ihost->remote_node_entries * sizeof(union scu_remote_node_context); in sci_controller_dma_alloc()
2261 ihost->remote_node_context_table = dmam_alloc_coherent(dev, size, &ihost->rnc_dma, in sci_controller_dma_alloc()
2264 if (!ihost->remote_node_context_table) in sci_controller_dma_alloc()
2267 size = ihost->task_context_entries * sizeof(struct scu_task_context), in sci_controller_dma_alloc()
2268 ihost->task_context_table = dmam_alloc_coherent(dev, size, &ihost->tc_dma, in sci_controller_dma_alloc()
2270 if (!ihost->task_context_table) in sci_controller_dma_alloc()
2274 ihost->ufi_buf = dmam_alloc_coherent(dev, size, &ihost->ufi_dma, GFP_KERNEL); in sci_controller_dma_alloc()
2275 if (!ihost->ufi_buf) in sci_controller_dma_alloc()
2286 ireq->tc = &ihost->task_context_table[i]; in sci_controller_dma_alloc()
2287 ireq->owning_controller = ihost; in sci_controller_dma_alloc()
2289 ireq->isci_host = ihost; in sci_controller_dma_alloc()
2290 ihost->reqs[i] = ireq; in sci_controller_dma_alloc()
2296 static int sci_controller_mem_init(struct isci_host *ihost) in sci_controller_mem_init() argument
2298 int err = sci_controller_dma_alloc(ihost); in sci_controller_mem_init()
2303 writel(lower_32_bits(ihost->cq_dma), &ihost->smu_registers->completion_queue_lower); in sci_controller_mem_init()
2304 writel(upper_32_bits(ihost->cq_dma), &ihost->smu_registers->completion_queue_upper); in sci_controller_mem_init()
2306 writel(lower_32_bits(ihost->rnc_dma), &ihost->smu_registers->remote_node_context_lower); in sci_controller_mem_init()
2307 writel(upper_32_bits(ihost->rnc_dma), &ihost->smu_registers->remote_node_context_upper); in sci_controller_mem_init()
2309 writel(lower_32_bits(ihost->tc_dma), &ihost->smu_registers->host_task_table_lower); in sci_controller_mem_init()
2310 writel(upper_32_bits(ihost->tc_dma), &ihost->smu_registers->host_task_table_upper); in sci_controller_mem_init()
2312 sci_unsolicited_frame_control_construct(ihost); in sci_controller_mem_init()
2318 writel(lower_32_bits(ihost->uf_control.headers.physical_address), in sci_controller_mem_init()
2319 &ihost->scu_registers->sdma.uf_header_base_address_lower); in sci_controller_mem_init()
2320 writel(upper_32_bits(ihost->uf_control.headers.physical_address), in sci_controller_mem_init()
2321 &ihost->scu_registers->sdma.uf_header_base_address_upper); in sci_controller_mem_init()
2323 writel(lower_32_bits(ihost->uf_control.address_table.physical_address), in sci_controller_mem_init()
2324 &ihost->scu_registers->sdma.uf_address_table_lower); in sci_controller_mem_init()
2325 writel(upper_32_bits(ihost->uf_control.address_table.physical_address), in sci_controller_mem_init()
2326 &ihost->scu_registers->sdma.uf_address_table_upper); in sci_controller_mem_init()
2339 int isci_host_init(struct isci_host *ihost) in isci_host_init() argument
2344 spin_lock_irq(&ihost->scic_lock); in isci_host_init()
2345 status = sci_controller_construct(ihost, scu_base(ihost), smu_base(ihost)); in isci_host_init()
2346 spin_unlock_irq(&ihost->scic_lock); in isci_host_init()
2348 dev_err(&ihost->pdev->dev, in isci_host_init()
2355 spin_lock_irq(&ihost->scic_lock); in isci_host_init()
2356 status = sci_controller_initialize(ihost); in isci_host_init()
2357 spin_unlock_irq(&ihost->scic_lock); in isci_host_init()
2359 dev_warn(&ihost->pdev->dev, in isci_host_init()
2366 err = sci_controller_mem_init(ihost); in isci_host_init()
2371 writel(1, &ihost->scu_registers->peg0.sgpio.interface_control); in isci_host_init()
2372 for (i = 0; i < isci_gpio_count(ihost); i++) in isci_host_init()
2373 writel(SGPIO_HW_CONTROL, &ihost->scu_registers->peg0.sgpio.output_data_select[i]); in isci_host_init()
2374 writel(0, &ihost->scu_registers->peg0.sgpio.vendor_specific_code); in isci_host_init()
2379 void sci_controller_link_up(struct isci_host *ihost, struct isci_port *iport, in sci_controller_link_up() argument
2382 switch (ihost->sm.current_state_id) { in sci_controller_link_up()
2384 sci_del_timer(&ihost->phy_timer); in sci_controller_link_up()
2385 ihost->phy_startup_timer_pending = false; in sci_controller_link_up()
2386 ihost->port_agent.link_up_handler(ihost, &ihost->port_agent, in sci_controller_link_up()
2388 sci_controller_start_next_phy(ihost); in sci_controller_link_up()
2391 ihost->port_agent.link_up_handler(ihost, &ihost->port_agent, in sci_controller_link_up()
2395 dev_dbg(&ihost->pdev->dev, in sci_controller_link_up()
2398 ihost->sm.current_state_id); in sci_controller_link_up()
2402 void sci_controller_link_down(struct isci_host *ihost, struct isci_port *iport, in sci_controller_link_down() argument
2405 switch (ihost->sm.current_state_id) { in sci_controller_link_down()
2408 ihost->port_agent.link_down_handler(ihost, &ihost->port_agent, in sci_controller_link_down()
2412 dev_dbg(&ihost->pdev->dev, in sci_controller_link_down()
2417 ihost->sm.current_state_id); in sci_controller_link_down()
2421 bool sci_controller_has_remote_devices_stopping(struct isci_host *ihost) in sci_controller_has_remote_devices_stopping() argument
2425 for (index = 0; index < ihost->remote_node_entries; index++) { in sci_controller_has_remote_devices_stopping()
2426 if ((ihost->device_table[index] != NULL) && in sci_controller_has_remote_devices_stopping()
2427 (ihost->device_table[index]->sm.current_state_id == SCI_DEV_STOPPING)) in sci_controller_has_remote_devices_stopping()
2434 void sci_controller_remote_device_stopped(struct isci_host *ihost, in sci_controller_remote_device_stopped() argument
2437 if (ihost->sm.current_state_id != SCIC_STOPPING) { in sci_controller_remote_device_stopped()
2438 dev_dbg(&ihost->pdev->dev, in sci_controller_remote_device_stopped()
2441 ihost, idev, in sci_controller_remote_device_stopped()
2442 ihost->sm.current_state_id); in sci_controller_remote_device_stopped()
2446 if (!sci_controller_has_remote_devices_stopping(ihost)) in sci_controller_remote_device_stopped()
2447 isci_host_stop_complete(ihost); in sci_controller_remote_device_stopped()
2450 void sci_controller_post_request(struct isci_host *ihost, u32 request) in sci_controller_post_request() argument
2452 dev_dbg(&ihost->pdev->dev, "%s[%d]: %#x\n", in sci_controller_post_request()
2453 __func__, ihost->id, request); in sci_controller_post_request()
2455 writel(request, &ihost->smu_registers->post_context_port); in sci_controller_post_request()
2458 struct isci_request *sci_request_by_tag(struct isci_host *ihost, u16 io_tag) in sci_request_by_tag() argument
2465 if (task_index < ihost->task_context_entries) { in sci_request_by_tag()
2466 struct isci_request *ireq = ihost->reqs[task_index]; in sci_request_by_tag()
2471 if (task_sequence == ihost->io_request_sequence[task_index]) in sci_request_by_tag()
2494 enum sci_status sci_controller_allocate_remote_node_context(struct isci_host *ihost, in sci_controller_allocate_remote_node_context() argument
2502 &ihost->available_remote_nodes, remote_node_count in sci_controller_allocate_remote_node_context()
2506 ihost->device_table[node_index] = idev; in sci_controller_allocate_remote_node_context()
2516 void sci_controller_free_remote_node_context(struct isci_host *ihost, in sci_controller_free_remote_node_context() argument
2522 if (ihost->device_table[node_id] == idev) { in sci_controller_free_remote_node_context()
2523 ihost->device_table[node_id] = NULL; in sci_controller_free_remote_node_context()
2526 &ihost->available_remote_nodes, remote_node_count, node_id in sci_controller_free_remote_node_context()
2543 void sci_controller_release_frame(struct isci_host *ihost, u32 frame_index) in sci_controller_release_frame() argument
2545 if (sci_unsolicited_frame_control_release_frame(&ihost->uf_control, frame_index)) in sci_controller_release_frame()
2546 writel(ihost->uf_control.get, in sci_controller_release_frame()
2547 &ihost->scu_registers->sdma.unsolicited_frame_get_pointer); in sci_controller_release_frame()
2550 void isci_tci_free(struct isci_host *ihost, u16 tci) in isci_tci_free() argument
2552 u16 tail = ihost->tci_tail & (SCI_MAX_IO_REQUESTS-1); in isci_tci_free()
2554 ihost->tci_pool[tail] = tci; in isci_tci_free()
2555 ihost->tci_tail = tail + 1; in isci_tci_free()
2558 static u16 isci_tci_alloc(struct isci_host *ihost) in isci_tci_alloc() argument
2560 u16 head = ihost->tci_head & (SCI_MAX_IO_REQUESTS-1); in isci_tci_alloc()
2561 u16 tci = ihost->tci_pool[head]; in isci_tci_alloc()
2563 ihost->tci_head = head + 1; in isci_tci_alloc()
2567 static u16 isci_tci_space(struct isci_host *ihost) in isci_tci_space() argument
2569 return CIRC_SPACE(ihost->tci_head, ihost->tci_tail, SCI_MAX_IO_REQUESTS); in isci_tci_space()
2572 u16 isci_alloc_tag(struct isci_host *ihost) in isci_alloc_tag() argument
2574 if (isci_tci_space(ihost)) { in isci_alloc_tag()
2575 u16 tci = isci_tci_alloc(ihost); in isci_alloc_tag()
2576 u8 seq = ihost->io_request_sequence[tci]; in isci_alloc_tag()
2584 enum sci_status isci_free_tag(struct isci_host *ihost, u16 io_tag) in isci_free_tag() argument
2590 if (isci_tci_active(ihost) == 0) in isci_free_tag()
2593 if (seq == ihost->io_request_sequence[tci]) { in isci_free_tag()
2594 ihost->io_request_sequence[tci] = (seq+1) & (SCI_MAX_SEQ-1); in isci_free_tag()
2596 isci_tci_free(ihost, tci); in isci_free_tag()
2603 enum sci_status sci_controller_start_io(struct isci_host *ihost, in sci_controller_start_io() argument
2609 if (ihost->sm.current_state_id != SCIC_READY) { in sci_controller_start_io()
2610 dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", in sci_controller_start_io()
2611 __func__, ihost->sm.current_state_id); in sci_controller_start_io()
2615 status = sci_remote_device_start_io(ihost, idev, ireq); in sci_controller_start_io()
2620 sci_controller_post_request(ihost, ireq->post_context); in sci_controller_start_io()
2624 enum sci_status sci_controller_terminate_request(struct isci_host *ihost, in sci_controller_terminate_request() argument
2634 if (ihost->sm.current_state_id != SCIC_READY) { in sci_controller_terminate_request()
2635 dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", in sci_controller_terminate_request()
2636 __func__, ihost->sm.current_state_id); in sci_controller_terminate_request()
2641 dev_dbg(&ihost->pdev->dev, "%s: status=%d; ireq=%p; flags=%lx\n", in sci_controller_terminate_request()
2651 ihost, ireq->post_context | in sci_controller_terminate_request()
2668 enum sci_status sci_controller_complete_io(struct isci_host *ihost, in sci_controller_complete_io() argument
2674 switch (ihost->sm.current_state_id) { in sci_controller_complete_io()
2679 status = sci_remote_device_complete_io(ihost, idev, ireq); in sci_controller_complete_io()
2686 dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", in sci_controller_complete_io()
2687 __func__, ihost->sm.current_state_id); in sci_controller_complete_io()
2695 struct isci_host *ihost = ireq->owning_controller; in sci_controller_continue_io() local
2697 if (ihost->sm.current_state_id != SCIC_READY) { in sci_controller_continue_io()
2698 dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", in sci_controller_continue_io()
2699 __func__, ihost->sm.current_state_id); in sci_controller_continue_io()
2704 sci_controller_post_request(ihost, ireq->post_context); in sci_controller_continue_io()
2717 enum sci_status sci_controller_start_task(struct isci_host *ihost, in sci_controller_start_task() argument
2723 if (ihost->sm.current_state_id != SCIC_READY) { in sci_controller_start_task()
2724 dev_warn(&ihost->pdev->dev, in sci_controller_start_task()
2731 status = sci_remote_device_start_task(ihost, idev, ireq); in sci_controller_start_task()
2744 sci_controller_post_request(ihost, ireq->post_context); in sci_controller_start_task()
2753 static int sci_write_gpio_tx_gp(struct isci_host *ihost, u8 reg_index, u8 reg_count, u8 *write_data) in sci_write_gpio_tx_gp() argument
2761 for (d = 0; d < isci_gpio_count(ihost); d++) { in sci_write_gpio_tx_gp()
2780 writel(val, &ihost->scu_registers->peg0.sgpio.output_data_select[d]); in sci_write_gpio_tx_gp()
2792 struct isci_host *ihost = sas_ha->lldd_ha; in isci_gpio_write() local
2797 written = sci_write_gpio_tx_gp(ihost, reg_index, reg_count, write_data); in isci_gpio_write()