Lines Matching refs:fusion
267 struct fusion_context *fusion; in megasas_get_cmd_fusion() local
269 fusion = instance->ctrl_context; in megasas_get_cmd_fusion()
270 return fusion->cmd_list[blk_tag]; in megasas_get_cmd_fusion()
423 struct fusion_context *fusion = instance->ctrl_context; in megasas_free_cmds_fusion() local
426 if (fusion->sense) in megasas_free_cmds_fusion()
427 dma_pool_free(fusion->sense_dma_pool, fusion->sense, in megasas_free_cmds_fusion()
428 fusion->sense_phys_addr); in megasas_free_cmds_fusion()
431 if (fusion->cmd_list) { in megasas_free_cmds_fusion()
433 cmd = fusion->cmd_list[i]; in megasas_free_cmds_fusion()
436 dma_pool_free(fusion->sg_dma_pool, in megasas_free_cmds_fusion()
442 kfree(fusion->cmd_list); in megasas_free_cmds_fusion()
445 if (fusion->sg_dma_pool) { in megasas_free_cmds_fusion()
446 dma_pool_destroy(fusion->sg_dma_pool); in megasas_free_cmds_fusion()
447 fusion->sg_dma_pool = NULL; in megasas_free_cmds_fusion()
449 if (fusion->sense_dma_pool) { in megasas_free_cmds_fusion()
450 dma_pool_destroy(fusion->sense_dma_pool); in megasas_free_cmds_fusion()
451 fusion->sense_dma_pool = NULL; in megasas_free_cmds_fusion()
462 if (fusion->req_frames_desc) in megasas_free_cmds_fusion()
464 fusion->request_alloc_sz, fusion->req_frames_desc, in megasas_free_cmds_fusion()
465 fusion->req_frames_desc_phys); in megasas_free_cmds_fusion()
466 if (fusion->io_request_frames) in megasas_free_cmds_fusion()
467 dma_pool_free(fusion->io_request_frames_pool, in megasas_free_cmds_fusion()
468 fusion->io_request_frames, in megasas_free_cmds_fusion()
469 fusion->io_request_frames_phys); in megasas_free_cmds_fusion()
470 if (fusion->io_request_frames_pool) { in megasas_free_cmds_fusion()
471 dma_pool_destroy(fusion->io_request_frames_pool); in megasas_free_cmds_fusion()
472 fusion->io_request_frames_pool = NULL; in megasas_free_cmds_fusion()
485 struct fusion_context *fusion; in megasas_create_sg_sense_fusion() local
490 fusion = instance->ctrl_context; in megasas_create_sg_sense_fusion()
494 fusion->sg_dma_pool = in megasas_create_sg_sense_fusion()
499 fusion->sense_dma_pool = in megasas_create_sg_sense_fusion()
503 if (!fusion->sense_dma_pool || !fusion->sg_dma_pool) { in megasas_create_sg_sense_fusion()
509 fusion->sense = dma_pool_alloc(fusion->sense_dma_pool, in megasas_create_sg_sense_fusion()
510 GFP_KERNEL, &fusion->sense_phys_addr); in megasas_create_sg_sense_fusion()
511 if (!fusion->sense) { in megasas_create_sg_sense_fusion()
528 if (!megasas_check_same_4gb_region(instance, fusion->sense_phys_addr, in megasas_create_sg_sense_fusion()
530 dma_pool_free(fusion->sense_dma_pool, fusion->sense, in megasas_create_sg_sense_fusion()
531 fusion->sense_phys_addr); in megasas_create_sg_sense_fusion()
532 fusion->sense = NULL; in megasas_create_sg_sense_fusion()
533 dma_pool_destroy(fusion->sense_dma_pool); in megasas_create_sg_sense_fusion()
535 fusion->sense_dma_pool = in megasas_create_sg_sense_fusion()
539 if (!fusion->sense_dma_pool) { in megasas_create_sg_sense_fusion()
544 fusion->sense = dma_pool_alloc(fusion->sense_dma_pool, in megasas_create_sg_sense_fusion()
546 &fusion->sense_phys_addr); in megasas_create_sg_sense_fusion()
547 if (!fusion->sense) { in megasas_create_sg_sense_fusion()
558 cmd = fusion->cmd_list[i]; in megasas_create_sg_sense_fusion()
559 cmd->sg_frame = dma_pool_alloc(fusion->sg_dma_pool, in megasas_create_sg_sense_fusion()
563 cmd->sense = (u8 *)fusion->sense + offset; in megasas_create_sg_sense_fusion()
564 cmd->sense_phys_addr = fusion->sense_phys_addr + offset; in megasas_create_sg_sense_fusion()
575 cmd = fusion->cmd_list[i]; in megasas_create_sg_sense_fusion()
577 cmd->sense = (u8 *)fusion->sense + offset; in megasas_create_sg_sense_fusion()
578 cmd->sense_phys_addr = fusion->sense_phys_addr + offset; in megasas_create_sg_sense_fusion()
589 struct fusion_context *fusion; in megasas_alloc_cmdlist_fusion() local
591 fusion = instance->ctrl_context; in megasas_alloc_cmdlist_fusion()
600 fusion->cmd_list = in megasas_alloc_cmdlist_fusion()
603 if (!fusion->cmd_list) { in megasas_alloc_cmdlist_fusion()
610 fusion->cmd_list[i] = kzalloc(sizeof(struct megasas_cmd_fusion), in megasas_alloc_cmdlist_fusion()
612 if (!fusion->cmd_list[i]) { in megasas_alloc_cmdlist_fusion()
614 kfree(fusion->cmd_list[j]); in megasas_alloc_cmdlist_fusion()
615 kfree(fusion->cmd_list); in megasas_alloc_cmdlist_fusion()
628 struct fusion_context *fusion; in megasas_alloc_request_fusion() local
630 fusion = instance->ctrl_context; in megasas_alloc_request_fusion()
633 fusion->io_request_frames_pool = in megasas_alloc_request_fusion()
635 fusion->io_frames_alloc_sz, 16, 0); in megasas_alloc_request_fusion()
637 if (!fusion->io_request_frames_pool) { in megasas_alloc_request_fusion()
643 fusion->io_request_frames = in megasas_alloc_request_fusion()
644 dma_pool_alloc(fusion->io_request_frames_pool, in megasas_alloc_request_fusion()
646 &fusion->io_request_frames_phys); in megasas_alloc_request_fusion()
647 if (!fusion->io_request_frames) { in megasas_alloc_request_fusion()
650 dma_pool_destroy(fusion->io_request_frames_pool); in megasas_alloc_request_fusion()
661 fusion->io_request_frames_phys, in megasas_alloc_request_fusion()
662 fusion->io_frames_alloc_sz)) { in megasas_alloc_request_fusion()
663 dma_pool_free(fusion->io_request_frames_pool, in megasas_alloc_request_fusion()
664 fusion->io_request_frames, in megasas_alloc_request_fusion()
665 fusion->io_request_frames_phys); in megasas_alloc_request_fusion()
666 fusion->io_request_frames = NULL; in megasas_alloc_request_fusion()
667 dma_pool_destroy(fusion->io_request_frames_pool); in megasas_alloc_request_fusion()
669 fusion->io_request_frames_pool = in megasas_alloc_request_fusion()
672 fusion->io_frames_alloc_sz, in megasas_alloc_request_fusion()
673 roundup_pow_of_two(fusion->io_frames_alloc_sz), in megasas_alloc_request_fusion()
676 if (!fusion->io_request_frames_pool) { in megasas_alloc_request_fusion()
682 fusion->io_request_frames = in megasas_alloc_request_fusion()
683 dma_pool_alloc(fusion->io_request_frames_pool, in megasas_alloc_request_fusion()
685 &fusion->io_request_frames_phys); in megasas_alloc_request_fusion()
687 if (!fusion->io_request_frames) { in megasas_alloc_request_fusion()
694 fusion->req_frames_desc = in megasas_alloc_request_fusion()
696 fusion->request_alloc_sz, in megasas_alloc_request_fusion()
697 &fusion->req_frames_desc_phys, GFP_KERNEL); in megasas_alloc_request_fusion()
698 if (!fusion->req_frames_desc) { in megasas_alloc_request_fusion()
711 struct fusion_context *fusion; in megasas_alloc_reply_fusion() local
713 fusion = instance->ctrl_context; in megasas_alloc_reply_fusion()
718 fusion->reply_frames_desc_pool = in megasas_alloc_reply_fusion()
720 fusion->reply_alloc_sz * count, 16, 0); in megasas_alloc_reply_fusion()
722 if (!fusion->reply_frames_desc_pool) { in megasas_alloc_reply_fusion()
728 fusion->reply_frames_desc[0] = in megasas_alloc_reply_fusion()
729 dma_pool_alloc(fusion->reply_frames_desc_pool, in megasas_alloc_reply_fusion()
730 GFP_KERNEL, &fusion->reply_frames_desc_phys[0]); in megasas_alloc_reply_fusion()
731 if (!fusion->reply_frames_desc[0]) { in megasas_alloc_reply_fusion()
738 fusion->reply_frames_desc_phys[0], in megasas_alloc_reply_fusion()
739 (fusion->reply_alloc_sz * count))) { in megasas_alloc_reply_fusion()
740 dma_pool_free(fusion->reply_frames_desc_pool, in megasas_alloc_reply_fusion()
741 fusion->reply_frames_desc[0], in megasas_alloc_reply_fusion()
742 fusion->reply_frames_desc_phys[0]); in megasas_alloc_reply_fusion()
743 fusion->reply_frames_desc[0] = NULL; in megasas_alloc_reply_fusion()
744 dma_pool_destroy(fusion->reply_frames_desc_pool); in megasas_alloc_reply_fusion()
746 fusion->reply_frames_desc_pool = in megasas_alloc_reply_fusion()
749 fusion->reply_alloc_sz * count, in megasas_alloc_reply_fusion()
750 roundup_pow_of_two(fusion->reply_alloc_sz * count), in megasas_alloc_reply_fusion()
753 if (!fusion->reply_frames_desc_pool) { in megasas_alloc_reply_fusion()
759 fusion->reply_frames_desc[0] = in megasas_alloc_reply_fusion()
760 dma_pool_alloc(fusion->reply_frames_desc_pool, in megasas_alloc_reply_fusion()
762 &fusion->reply_frames_desc_phys[0]); in megasas_alloc_reply_fusion()
764 if (!fusion->reply_frames_desc[0]) { in megasas_alloc_reply_fusion()
771 reply_desc = fusion->reply_frames_desc[0]; in megasas_alloc_reply_fusion()
772 for (i = 0; i < fusion->reply_q_depth * count; i++, reply_desc++) in megasas_alloc_reply_fusion()
779 fusion->reply_frames_desc[i + 1] = in megasas_alloc_reply_fusion()
780 fusion->reply_frames_desc[i] + in megasas_alloc_reply_fusion()
781 (fusion->reply_alloc_sz)/sizeof(union MPI2_REPLY_DESCRIPTORS_UNION); in megasas_alloc_reply_fusion()
790 struct fusion_context *fusion; in megasas_alloc_rdpq_fusion() local
797 fusion = instance->ctrl_context; in megasas_alloc_rdpq_fusion()
798 chunk_size = fusion->reply_alloc_sz * RDPQ_MAX_INDEX_IN_ONE_CHUNK; in megasas_alloc_rdpq_fusion()
802 fusion->rdpq_virt = dma_alloc_coherent(&instance->pdev->dev, in megasas_alloc_rdpq_fusion()
803 array_size, &fusion->rdpq_phys, in megasas_alloc_rdpq_fusion()
805 if (!fusion->rdpq_virt) { in megasas_alloc_rdpq_fusion()
814 fusion->reply_frames_desc_pool = dma_pool_create("mr_rdpq", in megasas_alloc_rdpq_fusion()
817 fusion->reply_frames_desc_pool_align = in megasas_alloc_rdpq_fusion()
824 if (!fusion->reply_frames_desc_pool || in megasas_alloc_rdpq_fusion()
825 !fusion->reply_frames_desc_pool_align) { in megasas_alloc_rdpq_fusion()
843 dma_pool_alloc(fusion->reply_frames_desc_pool, in megasas_alloc_rdpq_fusion()
864 dma_pool_free(fusion->reply_frames_desc_pool, in megasas_alloc_rdpq_fusion()
869 dma_pool_alloc(fusion->reply_frames_desc_pool_align, in megasas_alloc_rdpq_fusion()
877 fusion->rdpq_tracker[i].dma_pool_ptr = in megasas_alloc_rdpq_fusion()
878 fusion->reply_frames_desc_pool_align; in megasas_alloc_rdpq_fusion()
880 fusion->rdpq_tracker[i].dma_pool_ptr = in megasas_alloc_rdpq_fusion()
881 fusion->reply_frames_desc_pool; in megasas_alloc_rdpq_fusion()
884 fusion->rdpq_tracker[i].pool_entry_phys = rdpq_chunk_phys[i]; in megasas_alloc_rdpq_fusion()
885 fusion->rdpq_tracker[i].pool_entry_virt = rdpq_chunk_virt[i]; in megasas_alloc_rdpq_fusion()
894 offset = fusion->reply_alloc_sz * i; in megasas_alloc_rdpq_fusion()
895 fusion->rdpq_virt[abs_index].RDPQBaseAddress = in megasas_alloc_rdpq_fusion()
897 fusion->reply_frames_desc_phys[abs_index] = in megasas_alloc_rdpq_fusion()
899 fusion->reply_frames_desc[abs_index] = in megasas_alloc_rdpq_fusion()
902 reply_desc = fusion->reply_frames_desc[abs_index]; in megasas_alloc_rdpq_fusion()
903 for (j = 0; j < fusion->reply_q_depth; j++, reply_desc++) in megasas_alloc_rdpq_fusion()
915 struct fusion_context *fusion; in megasas_free_rdpq_fusion() local
917 fusion = instance->ctrl_context; in megasas_free_rdpq_fusion()
920 if (fusion->rdpq_tracker[i].pool_entry_virt) in megasas_free_rdpq_fusion()
921 dma_pool_free(fusion->rdpq_tracker[i].dma_pool_ptr, in megasas_free_rdpq_fusion()
922 fusion->rdpq_tracker[i].pool_entry_virt, in megasas_free_rdpq_fusion()
923 fusion->rdpq_tracker[i].pool_entry_phys); in megasas_free_rdpq_fusion()
927 dma_pool_destroy(fusion->reply_frames_desc_pool); in megasas_free_rdpq_fusion()
928 dma_pool_destroy(fusion->reply_frames_desc_pool_align); in megasas_free_rdpq_fusion()
930 if (fusion->rdpq_virt) in megasas_free_rdpq_fusion()
933 fusion->rdpq_virt, fusion->rdpq_phys); in megasas_free_rdpq_fusion()
939 struct fusion_context *fusion; in megasas_free_reply_fusion() local
941 fusion = instance->ctrl_context; in megasas_free_reply_fusion()
943 if (fusion->reply_frames_desc[0]) in megasas_free_reply_fusion()
944 dma_pool_free(fusion->reply_frames_desc_pool, in megasas_free_reply_fusion()
945 fusion->reply_frames_desc[0], in megasas_free_reply_fusion()
946 fusion->reply_frames_desc_phys[0]); in megasas_free_reply_fusion()
948 dma_pool_destroy(fusion->reply_frames_desc_pool); in megasas_free_reply_fusion()
973 struct fusion_context *fusion; in megasas_alloc_cmds_fusion() local
980 fusion = instance->ctrl_context; in megasas_alloc_cmds_fusion()
996 io_req_base = fusion->io_request_frames + MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE; in megasas_alloc_cmds_fusion()
997 io_req_base_phys = fusion->io_request_frames_phys + MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE; in megasas_alloc_cmds_fusion()
1005 cmd = fusion->cmd_list[i]; in megasas_alloc_cmds_fusion()
1088 struct fusion_context *fusion; in megasas_ioc_init_fusion() local
1099 fusion = instance->ctrl_context; in megasas_ioc_init_fusion()
1101 ioc_init_handle = fusion->ioc_init_request_phys; in megasas_ioc_init_fusion()
1102 IOCInitMessage = fusion->ioc_init_request; in megasas_ioc_init_fusion()
1104 cmd = fusion->ioc_init_cmd; in megasas_ioc_init_fusion()
1155 IOCInitMessage->ReplyDescriptorPostQueueDepth = cpu_to_le16(fusion->reply_q_depth); in megasas_ioc_init_fusion()
1157 cpu_to_le64(fusion->rdpq_phys) : in megasas_ioc_init_fusion()
1158 cpu_to_le64(fusion->reply_frames_desc_phys[0]); in megasas_ioc_init_fusion()
1161 IOCInitMessage->SystemRequestFrameBaseAddress = cpu_to_le64(fusion->io_request_frames_phys); in megasas_ioc_init_fusion()
1162 IOCInitMessage->SenseBufferAddressHigh = cpu_to_le32(upper_32_bits(fusion->sense_phys_addr)); in megasas_ioc_init_fusion()
1307 struct fusion_context *fusion = instance->ctrl_context; in megasas_sync_pd_seq_num() local
1311 pd_sync = (void *)fusion->pd_seq_sync[(instance->pd_seq_map_id & 1)]; in megasas_sync_pd_seq_num()
1312 pd_seq_h = fusion->pd_seq_phys[(instance->pd_seq_map_id & 1)]; in megasas_sync_pd_seq_num()
1401 struct fusion_context *fusion; in megasas_get_ld_map_info() local
1410 fusion = instance->ctrl_context; in megasas_get_ld_map_info()
1412 if (!fusion) { in megasas_get_ld_map_info()
1419 size_map_info = fusion->current_map_sz; in megasas_get_ld_map_info()
1421 ci = (void *) fusion->ld_map[(instance->map_id & 1)]; in megasas_get_ld_map_info()
1422 ci_h = fusion->ld_map_phys[(instance->map_id & 1)]; in megasas_get_ld_map_info()
1430 memset(ci, 0, fusion->max_map_sz); in megasas_get_ld_map_info()
1462 struct fusion_context *fusion = instance->ctrl_context; in megasas_get_map_info() local
1464 fusion->fast_path_io = 0; in megasas_get_map_info()
1467 fusion->fast_path_io = 1; in megasas_get_map_info()
1489 struct fusion_context *fusion; in megasas_sync_map_info() local
1504 fusion = instance->ctrl_context; in megasas_sync_map_info()
1506 if (!fusion) { in megasas_sync_map_info()
1511 map = fusion->ld_drv_map[instance->map_id & 1]; in megasas_sync_map_info()
1520 fusion->ld_map[(instance->map_id - 1) & 1]; in megasas_sync_map_info()
1521 memset(ci, 0, fusion->max_map_sz); in megasas_sync_map_info()
1523 ci_h = fusion->ld_map_phys[(instance->map_id - 1) & 1]; in megasas_sync_map_info()
1533 size_map_info = fusion->current_map_sz; in megasas_sync_map_info()
1636 struct fusion_context *fusion; in megasas_allocate_raid_maps() local
1639 fusion = instance->ctrl_context; in megasas_allocate_raid_maps()
1641 fusion->drv_map_pages = get_order(fusion->drv_map_sz); in megasas_allocate_raid_maps()
1644 fusion->ld_map[i] = NULL; in megasas_allocate_raid_maps()
1646 fusion->ld_drv_map[i] = (void *) in megasas_allocate_raid_maps()
1648 fusion->drv_map_pages); in megasas_allocate_raid_maps()
1650 if (!fusion->ld_drv_map[i]) { in megasas_allocate_raid_maps()
1651 fusion->ld_drv_map[i] = vzalloc(fusion->drv_map_sz); in megasas_allocate_raid_maps()
1653 if (!fusion->ld_drv_map[i]) { in megasas_allocate_raid_maps()
1657 fusion->drv_map_sz); in megasas_allocate_raid_maps()
1664 fusion->ld_map[i] = dma_alloc_coherent(&instance->pdev->dev, in megasas_allocate_raid_maps()
1665 fusion->max_map_sz, in megasas_allocate_raid_maps()
1666 &fusion->ld_map_phys[i], in megasas_allocate_raid_maps()
1668 if (!fusion->ld_map[i]) { in megasas_allocate_raid_maps()
1680 if (fusion->ld_map[i]) in megasas_allocate_raid_maps()
1682 fusion->max_map_sz, in megasas_allocate_raid_maps()
1683 fusion->ld_map[i], in megasas_allocate_raid_maps()
1684 fusion->ld_map_phys[i]); in megasas_allocate_raid_maps()
1689 if (fusion->ld_drv_map[i]) { in megasas_allocate_raid_maps()
1690 if (is_vmalloc_addr(fusion->ld_drv_map[i])) in megasas_allocate_raid_maps()
1691 vfree(fusion->ld_drv_map[i]); in megasas_allocate_raid_maps()
1693 free_pages((ulong)fusion->ld_drv_map[i], in megasas_allocate_raid_maps()
1694 fusion->drv_map_pages); in megasas_allocate_raid_maps()
1711 struct fusion_context *fusion; in megasas_configure_queue_sizes() local
1714 fusion = instance->ctrl_context; in megasas_configure_queue_sizes()
1726 fusion->reply_q_depth = 2 * ((max_cmd + 1 + 15) / 16) * 16; in megasas_configure_queue_sizes()
1728 fusion->request_alloc_sz = sizeof(union MEGASAS_REQUEST_DESCRIPTOR_UNION) * in megasas_configure_queue_sizes()
1730 fusion->reply_alloc_sz = sizeof(union MPI2_REPLY_DESCRIPTORS_UNION) * in megasas_configure_queue_sizes()
1731 (fusion->reply_q_depth); in megasas_configure_queue_sizes()
1732 fusion->io_frames_alloc_sz = MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + in megasas_configure_queue_sizes()
1739 struct fusion_context *fusion; in megasas_alloc_ioc_init_frame() local
1742 fusion = instance->ctrl_context; in megasas_alloc_ioc_init_frame()
1763 fusion->ioc_init_cmd = cmd; in megasas_alloc_ioc_init_frame()
1773 struct fusion_context *fusion; in megasas_free_ioc_init_cmd() local
1775 fusion = instance->ctrl_context; in megasas_free_ioc_init_cmd()
1777 if (fusion->ioc_init_cmd && fusion->ioc_init_cmd->frame) in megasas_free_ioc_init_cmd()
1780 fusion->ioc_init_cmd->frame, in megasas_free_ioc_init_cmd()
1781 fusion->ioc_init_cmd->frame_phys_addr); in megasas_free_ioc_init_cmd()
1783 kfree(fusion->ioc_init_cmd); in megasas_free_ioc_init_cmd()
1795 struct fusion_context *fusion; in megasas_init_adapter_fusion() local
1800 fusion = instance->ctrl_context; in megasas_init_adapter_fusion()
1836 fusion->max_sge_in_main_msg = in megasas_init_adapter_fusion()
1840 fusion->max_sge_in_chain = in megasas_init_adapter_fusion()
1845 rounddown_pow_of_two(fusion->max_sge_in_main_msg in megasas_init_adapter_fusion()
1846 + fusion->max_sge_in_chain - 2); in megasas_init_adapter_fusion()
1849 fusion->chain_offset_mfi_pthru = in megasas_init_adapter_fusion()
1852 fusion->chain_offset_io_request = in megasas_init_adapter_fusion()
1860 fusion->last_reply_idx[i] = 0; in megasas_init_adapter_fusion()
1872 atomic_set(&fusion->busy_mq_poll[i], 0); in megasas_init_adapter_fusion()
1913 fusion->fast_path_io = 0; in megasas_init_adapter_fusion()
2027 map_cmd_status(struct fusion_context *fusion, in map_cmd_status() argument
2274 struct fusion_context *fusion; in megasas_make_sgl_fusion() local
2276 fusion = instance->ctrl_context; in megasas_make_sgl_fusion()
2280 sgl_ptr_end += fusion->max_sge_in_main_msg - 1; in megasas_make_sgl_fusion()
2294 if ((sg_processed == (fusion->max_sge_in_main_msg - 1)) && in megasas_make_sgl_fusion()
2295 (sge_count > fusion->max_sge_in_main_msg)) { in megasas_make_sgl_fusion()
2303 fusion-> in megasas_make_sgl_fusion()
2309 fusion->chain_offset_io_request; in megasas_make_sgl_fusion()
2563 struct fusion_context *fusion = instance->ctrl_context; in megasas_stream_detect() local
2566 = fusion->stream_detect_by_ld[device_id]; in megasas_stream_detect()
2644 megasas_set_raidflag_cpu_affinity(struct fusion_context *fusion, in megasas_set_raidflag_cpu_affinity() argument
2705 if ((fusion->pcie_bw_limitation) && (raid->level == 1) && (!is_read) && in megasas_set_raidflag_cpu_affinity()
2733 struct fusion_context *fusion; in megasas_build_ldio_fusion() local
2744 fusion = instance->ctrl_context; in megasas_build_ldio_fusion()
2820 local_map_ptr = fusion->ld_drv_map[(instance->map_id & 1)]; in megasas_build_ldio_fusion()
2826 if (!raid || (!fusion->fast_path_io)) { in megasas_build_ldio_fusion()
2853 } else if (fusion->pcie_bw_limitation && in megasas_build_ldio_fusion()
2880 megasas_set_raidflag_cpu_affinity(fusion, &io_request->RaidContext, in megasas_build_ldio_fusion()
2909 if (fusion->load_balance_info && in megasas_build_ldio_fusion()
2910 (fusion->load_balance_info[device_id].loadBalanceFlag) && in megasas_build_ldio_fusion()
2914 &fusion->load_balance_info[device_id], in megasas_build_ldio_fusion()
2986 struct fusion_context *fusion = instance->ctrl_context; in megasas_build_ld_nonrw_fusion() local
2996 local_map_ptr = fusion->ld_drv_map[(instance->map_id & 1)]; in megasas_build_ld_nonrw_fusion()
3005 if (fusion->fast_path_io && ( in megasas_build_ld_nonrw_fusion()
3082 struct fusion_context *fusion = instance->ctrl_context; in megasas_build_syspd_fusion() local
3083 pd_sync = (void *)fusion->pd_seq_sync[(instance->pd_seq_map_id - 1) & 1]; in megasas_build_syspd_fusion()
3144 if (fusion->fast_path_io) { in megasas_build_syspd_fusion()
3146 fusion->ld_drv_map[(instance->map_id & 1)]; in megasas_build_syspd_fusion()
3302 struct fusion_context *fusion; in megasas_get_request_descriptor() local
3304 fusion = instance->ctrl_context; in megasas_get_request_descriptor()
3305 p = fusion->req_frames_desc + in megasas_get_request_descriptor()
3320 struct fusion_context *fusion; in megasas_prepare_secondRaid1_IO() local
3321 fusion = instance->ctrl_context; in megasas_prepare_secondRaid1_IO()
3327 (fusion->max_sge_in_main_msg * sizeof(union MPI2_SGE_IO_UNION))); in megasas_prepare_secondRaid1_IO()
3455 struct fusion_context *fusion; in megasas_complete_r1_command() local
3461 fusion = instance->ctrl_context; in megasas_complete_r1_command()
3464 r1_cmd = fusion->cmd_list[peer_smid - 1]; in megasas_complete_r1_command()
3484 map_cmd_status(fusion, scmd_local, status, ex_status, in megasas_complete_r1_command()
3547 struct fusion_context *fusion; in complete_cmd_fusion() local
3560 fusion = instance->ctrl_context; in complete_cmd_fusion()
3568 desc = fusion->reply_frames_desc[MSIxIndex] + in complete_cmd_fusion()
3569 fusion->last_reply_idx[MSIxIndex]; in complete_cmd_fusion()
3589 cmd_fusion = fusion->cmd_list[smid - 1]; in complete_cmd_fusion()
3612 if (fusion->load_balance_info && in complete_cmd_fusion()
3616 lbinfo = &fusion->load_balance_info[device_id]; in complete_cmd_fusion()
3625 map_cmd_status(fusion, scmd_local, status, in complete_cmd_fusion()
3652 fusion->last_reply_idx[MSIxIndex]++; in complete_cmd_fusion()
3653 if (fusion->last_reply_idx[MSIxIndex] >= in complete_cmd_fusion()
3654 fusion->reply_q_depth) in complete_cmd_fusion()
3655 fusion->last_reply_idx[MSIxIndex] = 0; in complete_cmd_fusion()
3662 if (!fusion->last_reply_idx[MSIxIndex]) in complete_cmd_fusion()
3663 desc = fusion->reply_frames_desc[MSIxIndex]; in complete_cmd_fusion()
3685 fusion->last_reply_idx[MSIxIndex], in complete_cmd_fusion()
3689 fusion->last_reply_idx[MSIxIndex], in complete_cmd_fusion()
3708 fusion->last_reply_idx[MSIxIndex], in complete_cmd_fusion()
3712 fusion->last_reply_idx[MSIxIndex], in complete_cmd_fusion()
3727 struct fusion_context *fusion; in megasas_blk_mq_poll() local
3731 fusion = instance->ctrl_context; in megasas_blk_mq_poll()
3735 if (!atomic_add_unless(&fusion->busy_mq_poll[queue_num], 1, 1)) in megasas_blk_mq_poll()
3739 atomic_dec(&fusion->busy_mq_poll[queue_num]); in megasas_blk_mq_poll()
3891 struct fusion_context *fusion; in build_mpt_mfi_pass_thru() local
3894 fusion = instance->ctrl_context; in build_mpt_mfi_pass_thru()
3916 sgl_ptr_end += fusion->max_sge_in_main_msg - 1; in build_mpt_mfi_pass_thru()
3926 io_req->ChainOffset = fusion->chain_offset_mfi_pthru; in build_mpt_mfi_pass_thru()
4274 struct fusion_context *fusion; in megasas_reset_reply_desc() local
4277 fusion = instance->ctrl_context; in megasas_reset_reply_desc()
4282 fusion->last_reply_idx[i] = 0; in megasas_reset_reply_desc()
4283 reply_desc = fusion->reply_frames_desc[i]; in megasas_reset_reply_desc()
4284 for (j = 0 ; j < fusion->reply_q_depth; j++, reply_desc++) in megasas_reset_reply_desc()
4298 struct fusion_context *fusion; in megasas_refire_mgmt_cmd() local
4307 fusion = instance->ctrl_context; in megasas_refire_mgmt_cmd()
4313 cmd_fusion = fusion->cmd_list[j]; in megasas_refire_mgmt_cmd()
4398 struct fusion_context *fusion; in megasas_return_polled_cmds() local
4401 fusion = instance->ctrl_context; in megasas_return_polled_cmds()
4404 cmd_fusion = fusion->cmd_list[i]; in megasas_return_polled_cmds()
4433 struct fusion_context *fusion; in megasas_track_scsiio() local
4434 fusion = instance->ctrl_context; in megasas_track_scsiio()
4437 cmd_fusion = fusion->cmd_list[i]; in megasas_track_scsiio()
4533 struct fusion_context *fusion = NULL; in megasas_issue_tm() local
4539 fusion = instance->ctrl_context; in megasas_issue_tm()
4615 scsi_lookup = fusion->cmd_list[smid_task - 1]; in megasas_issue_tm()
4663 struct fusion_context *fusion; in megasas_fusion_smid_lookup() local
4667 fusion = instance->ctrl_context; in megasas_fusion_smid_lookup()
4670 cmd_fusion = fusion->cmd_list[i]; in megasas_fusion_smid_lookup()
4693 struct fusion_context *fusion; in megasas_get_tm_devhandle() local
4698 fusion = instance->ctrl_context; in megasas_get_tm_devhandle()
4704 pd_sync = (void *)fusion->pd_seq_sync in megasas_get_tm_devhandle()
4906 struct fusion_context *fusion; in megasas_reset_fusion() local
4917 fusion = instance->ctrl_context; in megasas_reset_fusion()
4987 cmd_fusion = fusion->cmd_list[i]; in megasas_reset_fusion()
4990 r1_cmd = fusion->cmd_list[i + instance->max_fw_cmds]; in megasas_reset_fusion()
5078 if (fusion->load_balance_info) in megasas_reset_fusion()
5079 memset(fusion->load_balance_info, 0, in megasas_reset_fusion()
5099 memset(fusion->stream_detect_by_ld[j], in megasas_reset_fusion()
5101 fusion->stream_detect_by_ld[j]->mru_bit_map in megasas_reset_fusion()
5289 struct fusion_context *fusion; in megasas_alloc_fusion_context() local
5299 fusion = instance->ctrl_context; in megasas_alloc_fusion_context()
5301 fusion->log_to_span_pages = get_order(MAX_LOGICAL_DRIVES_EXT * in megasas_alloc_fusion_context()
5303 fusion->log_to_span = in megasas_alloc_fusion_context()
5305 fusion->log_to_span_pages); in megasas_alloc_fusion_context()
5306 if (!fusion->log_to_span) { in megasas_alloc_fusion_context()
5307 fusion->log_to_span = in megasas_alloc_fusion_context()
5310 if (!fusion->log_to_span) { in megasas_alloc_fusion_context()
5317 fusion->load_balance_info_pages = get_order(MAX_LOGICAL_DRIVES_EXT * in megasas_alloc_fusion_context()
5319 fusion->load_balance_info = in megasas_alloc_fusion_context()
5321 fusion->load_balance_info_pages); in megasas_alloc_fusion_context()
5322 if (!fusion->load_balance_info) { in megasas_alloc_fusion_context()
5323 fusion->load_balance_info = in megasas_alloc_fusion_context()
5326 if (!fusion->load_balance_info) in megasas_alloc_fusion_context()
5337 struct fusion_context *fusion = instance->ctrl_context; in megasas_free_fusion_context() local
5339 if (fusion) { in megasas_free_fusion_context()
5340 if (fusion->load_balance_info) { in megasas_free_fusion_context()
5341 if (is_vmalloc_addr(fusion->load_balance_info)) in megasas_free_fusion_context()
5342 vfree(fusion->load_balance_info); in megasas_free_fusion_context()
5344 free_pages((ulong)fusion->load_balance_info, in megasas_free_fusion_context()
5345 fusion->load_balance_info_pages); in megasas_free_fusion_context()
5348 if (fusion->log_to_span) { in megasas_free_fusion_context()
5349 if (is_vmalloc_addr(fusion->log_to_span)) in megasas_free_fusion_context()
5350 vfree(fusion->log_to_span); in megasas_free_fusion_context()
5352 free_pages((ulong)fusion->log_to_span, in megasas_free_fusion_context()
5353 fusion->log_to_span_pages); in megasas_free_fusion_context()
5356 kfree(fusion); in megasas_free_fusion_context()