Lines Matching refs:fusion
247 struct fusion_context *fusion; in megasas_get_cmd_fusion() local
249 fusion = instance->ctrl_context; in megasas_get_cmd_fusion()
250 return fusion->cmd_list[blk_tag]; in megasas_get_cmd_fusion()
375 struct fusion_context *fusion = instance->ctrl_context; in megasas_free_cmds_fusion() local
378 if (fusion->sense) in megasas_free_cmds_fusion()
379 dma_pool_free(fusion->sense_dma_pool, fusion->sense, in megasas_free_cmds_fusion()
380 fusion->sense_phys_addr); in megasas_free_cmds_fusion()
383 if (fusion->cmd_list) { in megasas_free_cmds_fusion()
385 cmd = fusion->cmd_list[i]; in megasas_free_cmds_fusion()
388 dma_pool_free(fusion->sg_dma_pool, in megasas_free_cmds_fusion()
394 kfree(fusion->cmd_list); in megasas_free_cmds_fusion()
397 if (fusion->sg_dma_pool) { in megasas_free_cmds_fusion()
398 dma_pool_destroy(fusion->sg_dma_pool); in megasas_free_cmds_fusion()
399 fusion->sg_dma_pool = NULL; in megasas_free_cmds_fusion()
401 if (fusion->sense_dma_pool) { in megasas_free_cmds_fusion()
402 dma_pool_destroy(fusion->sense_dma_pool); in megasas_free_cmds_fusion()
403 fusion->sense_dma_pool = NULL; in megasas_free_cmds_fusion()
414 if (fusion->req_frames_desc) in megasas_free_cmds_fusion()
416 fusion->request_alloc_sz, fusion->req_frames_desc, in megasas_free_cmds_fusion()
417 fusion->req_frames_desc_phys); in megasas_free_cmds_fusion()
418 if (fusion->io_request_frames) in megasas_free_cmds_fusion()
419 dma_pool_free(fusion->io_request_frames_pool, in megasas_free_cmds_fusion()
420 fusion->io_request_frames, in megasas_free_cmds_fusion()
421 fusion->io_request_frames_phys); in megasas_free_cmds_fusion()
422 if (fusion->io_request_frames_pool) { in megasas_free_cmds_fusion()
423 dma_pool_destroy(fusion->io_request_frames_pool); in megasas_free_cmds_fusion()
424 fusion->io_request_frames_pool = NULL; in megasas_free_cmds_fusion()
437 struct fusion_context *fusion; in megasas_create_sg_sense_fusion() local
442 fusion = instance->ctrl_context; in megasas_create_sg_sense_fusion()
446 fusion->sg_dma_pool = in megasas_create_sg_sense_fusion()
451 fusion->sense_dma_pool = in megasas_create_sg_sense_fusion()
455 if (!fusion->sense_dma_pool || !fusion->sg_dma_pool) { in megasas_create_sg_sense_fusion()
461 fusion->sense = dma_pool_alloc(fusion->sense_dma_pool, in megasas_create_sg_sense_fusion()
462 GFP_KERNEL, &fusion->sense_phys_addr); in megasas_create_sg_sense_fusion()
463 if (!fusion->sense) { in megasas_create_sg_sense_fusion()
480 if (!megasas_check_same_4gb_region(instance, fusion->sense_phys_addr, in megasas_create_sg_sense_fusion()
482 dma_pool_free(fusion->sense_dma_pool, fusion->sense, in megasas_create_sg_sense_fusion()
483 fusion->sense_phys_addr); in megasas_create_sg_sense_fusion()
484 fusion->sense = NULL; in megasas_create_sg_sense_fusion()
485 dma_pool_destroy(fusion->sense_dma_pool); in megasas_create_sg_sense_fusion()
487 fusion->sense_dma_pool = in megasas_create_sg_sense_fusion()
491 if (!fusion->sense_dma_pool) { in megasas_create_sg_sense_fusion()
496 fusion->sense = dma_pool_alloc(fusion->sense_dma_pool, in megasas_create_sg_sense_fusion()
498 &fusion->sense_phys_addr); in megasas_create_sg_sense_fusion()
499 if (!fusion->sense) { in megasas_create_sg_sense_fusion()
510 cmd = fusion->cmd_list[i]; in megasas_create_sg_sense_fusion()
511 cmd->sg_frame = dma_pool_alloc(fusion->sg_dma_pool, in megasas_create_sg_sense_fusion()
515 cmd->sense = (u8 *)fusion->sense + offset; in megasas_create_sg_sense_fusion()
516 cmd->sense_phys_addr = fusion->sense_phys_addr + offset; in megasas_create_sg_sense_fusion()
527 cmd = fusion->cmd_list[i]; in megasas_create_sg_sense_fusion()
529 cmd->sense = (u8 *)fusion->sense + offset; in megasas_create_sg_sense_fusion()
530 cmd->sense_phys_addr = fusion->sense_phys_addr + offset; in megasas_create_sg_sense_fusion()
541 struct fusion_context *fusion; in megasas_alloc_cmdlist_fusion() local
543 fusion = instance->ctrl_context; in megasas_alloc_cmdlist_fusion()
552 fusion->cmd_list = in megasas_alloc_cmdlist_fusion()
555 if (!fusion->cmd_list) { in megasas_alloc_cmdlist_fusion()
562 fusion->cmd_list[i] = kzalloc(sizeof(struct megasas_cmd_fusion), in megasas_alloc_cmdlist_fusion()
564 if (!fusion->cmd_list[i]) { in megasas_alloc_cmdlist_fusion()
566 kfree(fusion->cmd_list[j]); in megasas_alloc_cmdlist_fusion()
567 kfree(fusion->cmd_list); in megasas_alloc_cmdlist_fusion()
580 struct fusion_context *fusion; in megasas_alloc_request_fusion() local
582 fusion = instance->ctrl_context; in megasas_alloc_request_fusion()
585 fusion->io_request_frames_pool = in megasas_alloc_request_fusion()
587 fusion->io_frames_alloc_sz, 16, 0); in megasas_alloc_request_fusion()
589 if (!fusion->io_request_frames_pool) { in megasas_alloc_request_fusion()
595 fusion->io_request_frames = in megasas_alloc_request_fusion()
596 dma_pool_alloc(fusion->io_request_frames_pool, in megasas_alloc_request_fusion()
597 GFP_KERNEL, &fusion->io_request_frames_phys); in megasas_alloc_request_fusion()
598 if (!fusion->io_request_frames) { in megasas_alloc_request_fusion()
601 dma_pool_destroy(fusion->io_request_frames_pool); in megasas_alloc_request_fusion()
612 fusion->io_request_frames_phys, in megasas_alloc_request_fusion()
613 fusion->io_frames_alloc_sz)) { in megasas_alloc_request_fusion()
614 dma_pool_free(fusion->io_request_frames_pool, in megasas_alloc_request_fusion()
615 fusion->io_request_frames, in megasas_alloc_request_fusion()
616 fusion->io_request_frames_phys); in megasas_alloc_request_fusion()
617 fusion->io_request_frames = NULL; in megasas_alloc_request_fusion()
618 dma_pool_destroy(fusion->io_request_frames_pool); in megasas_alloc_request_fusion()
620 fusion->io_request_frames_pool = in megasas_alloc_request_fusion()
623 fusion->io_frames_alloc_sz, in megasas_alloc_request_fusion()
624 roundup_pow_of_two(fusion->io_frames_alloc_sz), in megasas_alloc_request_fusion()
627 if (!fusion->io_request_frames_pool) { in megasas_alloc_request_fusion()
633 fusion->io_request_frames = in megasas_alloc_request_fusion()
634 dma_pool_alloc(fusion->io_request_frames_pool, in megasas_alloc_request_fusion()
636 &fusion->io_request_frames_phys); in megasas_alloc_request_fusion()
638 if (!fusion->io_request_frames) { in megasas_alloc_request_fusion()
645 fusion->req_frames_desc = in megasas_alloc_request_fusion()
647 fusion->request_alloc_sz, in megasas_alloc_request_fusion()
648 &fusion->req_frames_desc_phys, GFP_KERNEL); in megasas_alloc_request_fusion()
649 if (!fusion->req_frames_desc) { in megasas_alloc_request_fusion()
662 struct fusion_context *fusion; in megasas_alloc_reply_fusion() local
664 fusion = instance->ctrl_context; in megasas_alloc_reply_fusion()
667 fusion->reply_frames_desc_pool = in megasas_alloc_reply_fusion()
669 fusion->reply_alloc_sz * count, 16, 0); in megasas_alloc_reply_fusion()
671 if (!fusion->reply_frames_desc_pool) { in megasas_alloc_reply_fusion()
677 fusion->reply_frames_desc[0] = in megasas_alloc_reply_fusion()
678 dma_pool_alloc(fusion->reply_frames_desc_pool, in megasas_alloc_reply_fusion()
679 GFP_KERNEL, &fusion->reply_frames_desc_phys[0]); in megasas_alloc_reply_fusion()
680 if (!fusion->reply_frames_desc[0]) { in megasas_alloc_reply_fusion()
687 fusion->reply_frames_desc_phys[0], in megasas_alloc_reply_fusion()
688 (fusion->reply_alloc_sz * count))) { in megasas_alloc_reply_fusion()
689 dma_pool_free(fusion->reply_frames_desc_pool, in megasas_alloc_reply_fusion()
690 fusion->reply_frames_desc[0], in megasas_alloc_reply_fusion()
691 fusion->reply_frames_desc_phys[0]); in megasas_alloc_reply_fusion()
692 fusion->reply_frames_desc[0] = NULL; in megasas_alloc_reply_fusion()
693 dma_pool_destroy(fusion->reply_frames_desc_pool); in megasas_alloc_reply_fusion()
695 fusion->reply_frames_desc_pool = in megasas_alloc_reply_fusion()
698 fusion->reply_alloc_sz * count, in megasas_alloc_reply_fusion()
699 roundup_pow_of_two(fusion->reply_alloc_sz * count), in megasas_alloc_reply_fusion()
702 if (!fusion->reply_frames_desc_pool) { in megasas_alloc_reply_fusion()
708 fusion->reply_frames_desc[0] = in megasas_alloc_reply_fusion()
709 dma_pool_alloc(fusion->reply_frames_desc_pool, in megasas_alloc_reply_fusion()
711 &fusion->reply_frames_desc_phys[0]); in megasas_alloc_reply_fusion()
713 if (!fusion->reply_frames_desc[0]) { in megasas_alloc_reply_fusion()
720 reply_desc = fusion->reply_frames_desc[0]; in megasas_alloc_reply_fusion()
721 for (i = 0; i < fusion->reply_q_depth * count; i++, reply_desc++) in megasas_alloc_reply_fusion()
728 fusion->reply_frames_desc[i + 1] = in megasas_alloc_reply_fusion()
729 fusion->reply_frames_desc[i] + in megasas_alloc_reply_fusion()
730 (fusion->reply_alloc_sz)/sizeof(union MPI2_REPLY_DESCRIPTORS_UNION); in megasas_alloc_reply_fusion()
739 struct fusion_context *fusion; in megasas_alloc_rdpq_fusion() local
746 fusion = instance->ctrl_context; in megasas_alloc_rdpq_fusion()
747 chunk_size = fusion->reply_alloc_sz * RDPQ_MAX_INDEX_IN_ONE_CHUNK; in megasas_alloc_rdpq_fusion()
751 fusion->rdpq_virt = dma_alloc_coherent(&instance->pdev->dev, in megasas_alloc_rdpq_fusion()
752 array_size, &fusion->rdpq_phys, in megasas_alloc_rdpq_fusion()
754 if (!fusion->rdpq_virt) { in megasas_alloc_rdpq_fusion()
762 fusion->reply_frames_desc_pool = dma_pool_create("mr_rdpq", in megasas_alloc_rdpq_fusion()
765 fusion->reply_frames_desc_pool_align = in megasas_alloc_rdpq_fusion()
772 if (!fusion->reply_frames_desc_pool || in megasas_alloc_rdpq_fusion()
773 !fusion->reply_frames_desc_pool_align) { in megasas_alloc_rdpq_fusion()
791 dma_pool_alloc(fusion->reply_frames_desc_pool, in megasas_alloc_rdpq_fusion()
812 dma_pool_free(fusion->reply_frames_desc_pool, in megasas_alloc_rdpq_fusion()
817 dma_pool_alloc(fusion->reply_frames_desc_pool_align, in megasas_alloc_rdpq_fusion()
825 fusion->rdpq_tracker[i].dma_pool_ptr = in megasas_alloc_rdpq_fusion()
826 fusion->reply_frames_desc_pool_align; in megasas_alloc_rdpq_fusion()
828 fusion->rdpq_tracker[i].dma_pool_ptr = in megasas_alloc_rdpq_fusion()
829 fusion->reply_frames_desc_pool; in megasas_alloc_rdpq_fusion()
832 fusion->rdpq_tracker[i].pool_entry_phys = rdpq_chunk_phys[i]; in megasas_alloc_rdpq_fusion()
833 fusion->rdpq_tracker[i].pool_entry_virt = rdpq_chunk_virt[i]; in megasas_alloc_rdpq_fusion()
842 offset = fusion->reply_alloc_sz * i; in megasas_alloc_rdpq_fusion()
843 fusion->rdpq_virt[abs_index].RDPQBaseAddress = in megasas_alloc_rdpq_fusion()
845 fusion->reply_frames_desc_phys[abs_index] = in megasas_alloc_rdpq_fusion()
847 fusion->reply_frames_desc[abs_index] = in megasas_alloc_rdpq_fusion()
850 reply_desc = fusion->reply_frames_desc[abs_index]; in megasas_alloc_rdpq_fusion()
851 for (j = 0; j < fusion->reply_q_depth; j++, reply_desc++) in megasas_alloc_rdpq_fusion()
863 struct fusion_context *fusion; in megasas_free_rdpq_fusion() local
865 fusion = instance->ctrl_context; in megasas_free_rdpq_fusion()
868 if (fusion->rdpq_tracker[i].pool_entry_virt) in megasas_free_rdpq_fusion()
869 dma_pool_free(fusion->rdpq_tracker[i].dma_pool_ptr, in megasas_free_rdpq_fusion()
870 fusion->rdpq_tracker[i].pool_entry_virt, in megasas_free_rdpq_fusion()
871 fusion->rdpq_tracker[i].pool_entry_phys); in megasas_free_rdpq_fusion()
875 dma_pool_destroy(fusion->reply_frames_desc_pool); in megasas_free_rdpq_fusion()
876 dma_pool_destroy(fusion->reply_frames_desc_pool_align); in megasas_free_rdpq_fusion()
878 if (fusion->rdpq_virt) in megasas_free_rdpq_fusion()
881 fusion->rdpq_virt, fusion->rdpq_phys); in megasas_free_rdpq_fusion()
887 struct fusion_context *fusion; in megasas_free_reply_fusion() local
889 fusion = instance->ctrl_context; in megasas_free_reply_fusion()
891 if (fusion->reply_frames_desc[0]) in megasas_free_reply_fusion()
892 dma_pool_free(fusion->reply_frames_desc_pool, in megasas_free_reply_fusion()
893 fusion->reply_frames_desc[0], in megasas_free_reply_fusion()
894 fusion->reply_frames_desc_phys[0]); in megasas_free_reply_fusion()
896 dma_pool_destroy(fusion->reply_frames_desc_pool); in megasas_free_reply_fusion()
921 struct fusion_context *fusion; in megasas_alloc_cmds_fusion() local
928 fusion = instance->ctrl_context; in megasas_alloc_cmds_fusion()
947 io_req_base = fusion->io_request_frames + MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE; in megasas_alloc_cmds_fusion()
948 io_req_base_phys = fusion->io_request_frames_phys + MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE; in megasas_alloc_cmds_fusion()
956 cmd = fusion->cmd_list[i]; in megasas_alloc_cmds_fusion()
1038 struct fusion_context *fusion; in megasas_ioc_init_fusion() local
1049 fusion = instance->ctrl_context; in megasas_ioc_init_fusion()
1051 ioc_init_handle = fusion->ioc_init_request_phys; in megasas_ioc_init_fusion()
1052 IOCInitMessage = fusion->ioc_init_request; in megasas_ioc_init_fusion()
1054 cmd = fusion->ioc_init_cmd; in megasas_ioc_init_fusion()
1104 IOCInitMessage->ReplyDescriptorPostQueueDepth = cpu_to_le16(fusion->reply_q_depth); in megasas_ioc_init_fusion()
1106 cpu_to_le64(fusion->rdpq_phys) : in megasas_ioc_init_fusion()
1107 cpu_to_le64(fusion->reply_frames_desc_phys[0]); in megasas_ioc_init_fusion()
1110 IOCInitMessage->SystemRequestFrameBaseAddress = cpu_to_le64(fusion->io_request_frames_phys); in megasas_ioc_init_fusion()
1111 IOCInitMessage->SenseBufferAddressHigh = cpu_to_le32(upper_32_bits(fusion->sense_phys_addr)); in megasas_ioc_init_fusion()
1256 struct fusion_context *fusion = instance->ctrl_context; in megasas_sync_pd_seq_num() local
1260 pd_sync = (void *)fusion->pd_seq_sync[(instance->pd_seq_map_id & 1)]; in megasas_sync_pd_seq_num()
1261 pd_seq_h = fusion->pd_seq_phys[(instance->pd_seq_map_id & 1)]; in megasas_sync_pd_seq_num()
1348 struct fusion_context *fusion; in megasas_get_ld_map_info() local
1357 fusion = instance->ctrl_context; in megasas_get_ld_map_info()
1359 if (!fusion) { in megasas_get_ld_map_info()
1366 size_map_info = fusion->current_map_sz; in megasas_get_ld_map_info()
1368 ci = (void *) fusion->ld_map[(instance->map_id & 1)]; in megasas_get_ld_map_info()
1369 ci_h = fusion->ld_map_phys[(instance->map_id & 1)]; in megasas_get_ld_map_info()
1377 memset(ci, 0, fusion->max_map_sz); in megasas_get_ld_map_info()
1407 struct fusion_context *fusion = instance->ctrl_context; in megasas_get_map_info() local
1409 fusion->fast_path_io = 0; in megasas_get_map_info()
1412 fusion->fast_path_io = 1; in megasas_get_map_info()
1434 struct fusion_context *fusion; in megasas_sync_map_info() local
1449 fusion = instance->ctrl_context; in megasas_sync_map_info()
1451 if (!fusion) { in megasas_sync_map_info()
1456 map = fusion->ld_drv_map[instance->map_id & 1]; in megasas_sync_map_info()
1465 fusion->ld_map[(instance->map_id - 1) & 1]; in megasas_sync_map_info()
1466 memset(ci, 0, fusion->max_map_sz); in megasas_sync_map_info()
1468 ci_h = fusion->ld_map_phys[(instance->map_id - 1) & 1]; in megasas_sync_map_info()
1478 size_map_info = fusion->current_map_sz; in megasas_sync_map_info()
1581 struct fusion_context *fusion; in megasas_allocate_raid_maps() local
1584 fusion = instance->ctrl_context; in megasas_allocate_raid_maps()
1586 fusion->drv_map_pages = get_order(fusion->drv_map_sz); in megasas_allocate_raid_maps()
1589 fusion->ld_map[i] = NULL; in megasas_allocate_raid_maps()
1591 fusion->ld_drv_map[i] = (void *) in megasas_allocate_raid_maps()
1593 fusion->drv_map_pages); in megasas_allocate_raid_maps()
1595 if (!fusion->ld_drv_map[i]) { in megasas_allocate_raid_maps()
1596 fusion->ld_drv_map[i] = vzalloc(fusion->drv_map_sz); in megasas_allocate_raid_maps()
1598 if (!fusion->ld_drv_map[i]) { in megasas_allocate_raid_maps()
1602 fusion->drv_map_sz); in megasas_allocate_raid_maps()
1609 fusion->ld_map[i] = dma_alloc_coherent(&instance->pdev->dev, in megasas_allocate_raid_maps()
1610 fusion->max_map_sz, in megasas_allocate_raid_maps()
1611 &fusion->ld_map_phys[i], in megasas_allocate_raid_maps()
1613 if (!fusion->ld_map[i]) { in megasas_allocate_raid_maps()
1625 if (fusion->ld_map[i]) in megasas_allocate_raid_maps()
1627 fusion->max_map_sz, in megasas_allocate_raid_maps()
1628 fusion->ld_map[i], in megasas_allocate_raid_maps()
1629 fusion->ld_map_phys[i]); in megasas_allocate_raid_maps()
1634 if (fusion->ld_drv_map[i]) { in megasas_allocate_raid_maps()
1635 if (is_vmalloc_addr(fusion->ld_drv_map[i])) in megasas_allocate_raid_maps()
1636 vfree(fusion->ld_drv_map[i]); in megasas_allocate_raid_maps()
1638 free_pages((ulong)fusion->ld_drv_map[i], in megasas_allocate_raid_maps()
1639 fusion->drv_map_pages); in megasas_allocate_raid_maps()
1656 struct fusion_context *fusion; in megasas_configure_queue_sizes() local
1659 fusion = instance->ctrl_context; in megasas_configure_queue_sizes()
1671 fusion->reply_q_depth = 2 * ((max_cmd + 1 + 15) / 16) * 16; in megasas_configure_queue_sizes()
1673 fusion->request_alloc_sz = sizeof(union MEGASAS_REQUEST_DESCRIPTOR_UNION) * in megasas_configure_queue_sizes()
1675 fusion->reply_alloc_sz = sizeof(union MPI2_REPLY_DESCRIPTORS_UNION) * in megasas_configure_queue_sizes()
1676 (fusion->reply_q_depth); in megasas_configure_queue_sizes()
1677 fusion->io_frames_alloc_sz = MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + in megasas_configure_queue_sizes()
1684 struct fusion_context *fusion; in megasas_alloc_ioc_init_frame() local
1687 fusion = instance->ctrl_context; in megasas_alloc_ioc_init_frame()
1708 fusion->ioc_init_cmd = cmd; in megasas_alloc_ioc_init_frame()
1718 struct fusion_context *fusion; in megasas_free_ioc_init_cmd() local
1720 fusion = instance->ctrl_context; in megasas_free_ioc_init_cmd()
1722 if (fusion->ioc_init_cmd && fusion->ioc_init_cmd->frame) in megasas_free_ioc_init_cmd()
1725 fusion->ioc_init_cmd->frame, in megasas_free_ioc_init_cmd()
1726 fusion->ioc_init_cmd->frame_phys_addr); in megasas_free_ioc_init_cmd()
1728 kfree(fusion->ioc_init_cmd); in megasas_free_ioc_init_cmd()
1740 struct fusion_context *fusion; in megasas_init_adapter_fusion() local
1745 fusion = instance->ctrl_context; in megasas_init_adapter_fusion()
1781 fusion->max_sge_in_main_msg = in megasas_init_adapter_fusion()
1785 fusion->max_sge_in_chain = in megasas_init_adapter_fusion()
1790 rounddown_pow_of_two(fusion->max_sge_in_main_msg in megasas_init_adapter_fusion()
1791 + fusion->max_sge_in_chain - 2); in megasas_init_adapter_fusion()
1794 fusion->chain_offset_mfi_pthru = in megasas_init_adapter_fusion()
1797 fusion->chain_offset_io_request = in megasas_init_adapter_fusion()
1803 fusion->last_reply_idx[i] = 0; in megasas_init_adapter_fusion()
1853 fusion->fast_path_io = 0; in megasas_init_adapter_fusion()
1964 map_cmd_status(struct fusion_context *fusion, in map_cmd_status() argument
2272 struct fusion_context *fusion; in megasas_make_sgl_fusion() local
2274 fusion = instance->ctrl_context; in megasas_make_sgl_fusion()
2278 sgl_ptr_end += fusion->max_sge_in_main_msg - 1; in megasas_make_sgl_fusion()
2292 if ((sg_processed == (fusion->max_sge_in_main_msg - 1)) && in megasas_make_sgl_fusion()
2293 (sge_count > fusion->max_sge_in_main_msg)) { in megasas_make_sgl_fusion()
2301 fusion-> in megasas_make_sgl_fusion()
2307 fusion->chain_offset_io_request; in megasas_make_sgl_fusion()
2558 struct fusion_context *fusion = instance->ctrl_context; in megasas_stream_detect() local
2561 = fusion->stream_detect_by_ld[device_id]; in megasas_stream_detect()
2637 megasas_set_raidflag_cpu_affinity(struct fusion_context *fusion, in megasas_set_raidflag_cpu_affinity() argument
2698 if ((fusion->pcie_bw_limitation) && (raid->level == 1) && (!is_read) && in megasas_set_raidflag_cpu_affinity()
2726 struct fusion_context *fusion; in megasas_build_ldio_fusion() local
2737 fusion = instance->ctrl_context; in megasas_build_ldio_fusion()
2813 local_map_ptr = fusion->ld_drv_map[(instance->map_id & 1)]; in megasas_build_ldio_fusion()
2819 if (!raid || (!fusion->fast_path_io)) { in megasas_build_ldio_fusion()
2858 } else if (fusion->pcie_bw_limitation && in megasas_build_ldio_fusion()
2885 megasas_set_raidflag_cpu_affinity(fusion, &io_request->RaidContext, in megasas_build_ldio_fusion()
2914 if (fusion->load_balance_info && in megasas_build_ldio_fusion()
2915 (fusion->load_balance_info[device_id].loadBalanceFlag) && in megasas_build_ldio_fusion()
2919 &fusion->load_balance_info[device_id], in megasas_build_ldio_fusion()
2991 struct fusion_context *fusion = instance->ctrl_context; in megasas_build_ld_nonrw_fusion() local
3001 local_map_ptr = fusion->ld_drv_map[(instance->map_id & 1)]; in megasas_build_ld_nonrw_fusion()
3010 if (fusion->fast_path_io && ( in megasas_build_ld_nonrw_fusion()
3087 struct fusion_context *fusion = instance->ctrl_context; in megasas_build_syspd_fusion() local
3088 pd_sync = (void *)fusion->pd_seq_sync[(instance->pd_seq_map_id - 1) & 1]; in megasas_build_syspd_fusion()
3149 if (fusion->fast_path_io) { in megasas_build_syspd_fusion()
3151 fusion->ld_drv_map[(instance->map_id & 1)]; in megasas_build_syspd_fusion()
3313 struct fusion_context *fusion; in megasas_get_request_descriptor() local
3315 fusion = instance->ctrl_context; in megasas_get_request_descriptor()
3316 p = fusion->req_frames_desc + in megasas_get_request_descriptor()
3331 struct fusion_context *fusion; in megasas_prepare_secondRaid1_IO() local
3332 fusion = instance->ctrl_context; in megasas_prepare_secondRaid1_IO()
3338 (fusion->max_sge_in_main_msg * sizeof(union MPI2_SGE_IO_UNION))); in megasas_prepare_secondRaid1_IO()
3465 struct fusion_context *fusion; in megasas_complete_r1_command() local
3471 fusion = instance->ctrl_context; in megasas_complete_r1_command()
3474 r1_cmd = fusion->cmd_list[peer_smid - 1]; in megasas_complete_r1_command()
3494 map_cmd_status(fusion, scmd_local, status, ex_status, in megasas_complete_r1_command()
3518 struct fusion_context *fusion; in complete_cmd_fusion() local
3531 fusion = instance->ctrl_context; in complete_cmd_fusion()
3536 desc = fusion->reply_frames_desc[MSIxIndex] + in complete_cmd_fusion()
3537 fusion->last_reply_idx[MSIxIndex]; in complete_cmd_fusion()
3555 cmd_fusion = fusion->cmd_list[smid - 1]; in complete_cmd_fusion()
3578 if (fusion->load_balance_info && in complete_cmd_fusion()
3582 lbinfo = &fusion->load_balance_info[device_id]; in complete_cmd_fusion()
3590 map_cmd_status(fusion, scmd_local, status, in complete_cmd_fusion()
3616 fusion->last_reply_idx[MSIxIndex]++; in complete_cmd_fusion()
3617 if (fusion->last_reply_idx[MSIxIndex] >= in complete_cmd_fusion()
3618 fusion->reply_q_depth) in complete_cmd_fusion()
3619 fusion->last_reply_idx[MSIxIndex] = 0; in complete_cmd_fusion()
3626 if (!fusion->last_reply_idx[MSIxIndex]) in complete_cmd_fusion()
3627 desc = fusion->reply_frames_desc[MSIxIndex]; in complete_cmd_fusion()
3649 fusion->last_reply_idx[MSIxIndex], in complete_cmd_fusion()
3653 fusion->last_reply_idx[MSIxIndex], in complete_cmd_fusion()
3671 fusion->last_reply_idx[MSIxIndex], in complete_cmd_fusion()
3675 fusion->last_reply_idx[MSIxIndex], in complete_cmd_fusion()
3823 struct fusion_context *fusion; in build_mpt_mfi_pass_thru() local
3826 fusion = instance->ctrl_context; in build_mpt_mfi_pass_thru()
3848 sgl_ptr_end += fusion->max_sge_in_main_msg - 1; in build_mpt_mfi_pass_thru()
3858 io_req->ChainOffset = fusion->chain_offset_mfi_pthru; in build_mpt_mfi_pass_thru()
4205 struct fusion_context *fusion; in megasas_reset_reply_desc() local
4208 fusion = instance->ctrl_context; in megasas_reset_reply_desc()
4211 fusion->last_reply_idx[i] = 0; in megasas_reset_reply_desc()
4212 reply_desc = fusion->reply_frames_desc[i]; in megasas_reset_reply_desc()
4213 for (j = 0 ; j < fusion->reply_q_depth; j++, reply_desc++) in megasas_reset_reply_desc()
4226 struct fusion_context *fusion; in megasas_refire_mgmt_cmd() local
4234 fusion = instance->ctrl_context; in megasas_refire_mgmt_cmd()
4240 cmd_fusion = fusion->cmd_list[j]; in megasas_refire_mgmt_cmd()
4314 struct fusion_context *fusion; in megasas_track_scsiio() local
4315 fusion = instance->ctrl_context; in megasas_track_scsiio()
4318 cmd_fusion = fusion->cmd_list[i]; in megasas_track_scsiio()
4414 struct fusion_context *fusion = NULL; in megasas_issue_tm() local
4420 fusion = instance->ctrl_context; in megasas_issue_tm()
4497 scsi_lookup = fusion->cmd_list[smid_task - 1]; in megasas_issue_tm()
4545 struct fusion_context *fusion; in megasas_fusion_smid_lookup() local
4549 fusion = instance->ctrl_context; in megasas_fusion_smid_lookup()
4552 cmd_fusion = fusion->cmd_list[i]; in megasas_fusion_smid_lookup()
4575 struct fusion_context *fusion; in megasas_get_tm_devhandle() local
4580 fusion = instance->ctrl_context; in megasas_get_tm_devhandle()
4586 pd_sync = (void *)fusion->pd_seq_sync in megasas_get_tm_devhandle()
4788 struct fusion_context *fusion; in megasas_reset_fusion() local
4799 fusion = instance->ctrl_context; in megasas_reset_fusion()
4868 cmd_fusion = fusion->cmd_list[i]; in megasas_reset_fusion()
4871 r1_cmd = fusion->cmd_list[i + instance->max_fw_cmds]; in megasas_reset_fusion()
4957 if (fusion->load_balance_info) in megasas_reset_fusion()
4958 memset(fusion->load_balance_info, 0, in megasas_reset_fusion()
4970 memset(fusion->stream_detect_by_ld[j], in megasas_reset_fusion()
4972 fusion->stream_detect_by_ld[j]->mru_bit_map in megasas_reset_fusion()
5151 struct fusion_context *fusion; in megasas_alloc_fusion_context() local
5161 fusion = instance->ctrl_context; in megasas_alloc_fusion_context()
5163 fusion->log_to_span_pages = get_order(MAX_LOGICAL_DRIVES_EXT * in megasas_alloc_fusion_context()
5165 fusion->log_to_span = in megasas_alloc_fusion_context()
5167 fusion->log_to_span_pages); in megasas_alloc_fusion_context()
5168 if (!fusion->log_to_span) { in megasas_alloc_fusion_context()
5169 fusion->log_to_span = in megasas_alloc_fusion_context()
5172 if (!fusion->log_to_span) { in megasas_alloc_fusion_context()
5179 fusion->load_balance_info_pages = get_order(MAX_LOGICAL_DRIVES_EXT * in megasas_alloc_fusion_context()
5181 fusion->load_balance_info = in megasas_alloc_fusion_context()
5183 fusion->load_balance_info_pages); in megasas_alloc_fusion_context()
5184 if (!fusion->load_balance_info) { in megasas_alloc_fusion_context()
5185 fusion->load_balance_info = in megasas_alloc_fusion_context()
5188 if (!fusion->load_balance_info) in megasas_alloc_fusion_context()
5199 struct fusion_context *fusion = instance->ctrl_context; in megasas_free_fusion_context() local
5201 if (fusion) { in megasas_free_fusion_context()
5202 if (fusion->load_balance_info) { in megasas_free_fusion_context()
5203 if (is_vmalloc_addr(fusion->load_balance_info)) in megasas_free_fusion_context()
5204 vfree(fusion->load_balance_info); in megasas_free_fusion_context()
5206 free_pages((ulong)fusion->load_balance_info, in megasas_free_fusion_context()
5207 fusion->load_balance_info_pages); in megasas_free_fusion_context()
5210 if (fusion->log_to_span) { in megasas_free_fusion_context()
5211 if (is_vmalloc_addr(fusion->log_to_span)) in megasas_free_fusion_context()
5212 vfree(fusion->log_to_span); in megasas_free_fusion_context()
5214 free_pages((ulong)fusion->log_to_span, in megasas_free_fusion_context()
5215 fusion->log_to_span_pages); in megasas_free_fusion_context()
5218 kfree(fusion); in megasas_free_fusion_context()