Lines Matching refs:rgn_idx

38 static void ufshpb_update_active_info(struct ufshpb_lu *hpb, int rgn_idx,
95 static bool ufshpb_is_pinned_region(struct ufshpb_lu *hpb, int rgn_idx) in ufshpb_is_pinned_region() argument
98 rgn_idx >= hpb->lu_pinned_start && rgn_idx <= hpb->lu_pinned_end; in ufshpb_is_pinned_region()
146 static void ufshpb_iterate_rgn(struct ufshpb_lu *hpb, int rgn_idx, int srgn_idx, in ufshpb_iterate_rgn() argument
156 rgn = hpb->rgn_tbl + rgn_idx; in ufshpb_iterate_rgn()
204 ufshpb_update_active_info(hpb, rgn_idx, srgn_idx); in ufshpb_iterate_rgn()
207 "activate region %d-%d\n", rgn_idx, srgn_idx); in ufshpb_iterate_rgn()
216 rgn_idx++; in ufshpb_iterate_rgn()
224 static bool ufshpb_test_ppn_dirty(struct ufshpb_lu *hpb, int rgn_idx, in ufshpb_test_ppn_dirty() argument
233 rgn = hpb->rgn_tbl + rgn_idx; in ufshpb_test_ppn_dirty()
252 srgn->rgn_idx, srgn->srgn_idx); in ufshpb_test_ppn_dirty()
268 rgn_idx++; in ufshpb_test_ppn_dirty()
313 ufshpb_get_pos_from_lpn(struct ufshpb_lu *hpb, unsigned long lpn, int *rgn_idx, in ufshpb_get_pos_from_lpn() argument
318 *rgn_idx = lpn >> hpb->entries_per_rgn_shift; in ufshpb_get_pos_from_lpn()
355 int transfer_len, rgn_idx, srgn_idx, srgn_offset; in ufshpb_prep() local
382 ufshpb_get_pos_from_lpn(hpb, lpn, &rgn_idx, &srgn_idx, &srgn_offset); in ufshpb_prep()
383 rgn = hpb->rgn_tbl + rgn_idx; in ufshpb_prep()
388 ufshpb_iterate_rgn(hpb, rgn_idx, srgn_idx, srgn_offset, in ufshpb_prep()
401 ufshpb_iterate_rgn(hpb, rgn_idx, srgn_idx, srgn_offset, in ufshpb_prep()
410 if (ufshpb_test_ppn_dirty(hpb, rgn_idx, srgn_idx, srgn_offset, in ufshpb_prep()
437 int rgn_idx, enum req_opf dir, in ufshpb_get_req() argument
462 rq->rb.rgn_idx = rgn_idx; in ufshpb_get_req()
493 map_req = ufshpb_get_req(hpb, srgn->rgn_idx, REQ_OP_DRV_IN, false); in ufshpb_get_map_req()
537 srgn->rgn_idx, srgn->srgn_idx); in ufshpb_clear_dirty_bitmap()
546 rgn = hpb->rgn_tbl + srgn->rgn_idx; in ufshpb_clear_dirty_bitmap()
552 static void ufshpb_update_active_info(struct ufshpb_lu *hpb, int rgn_idx, in ufshpb_update_active_info() argument
558 rgn = hpb->rgn_tbl + rgn_idx; in ufshpb_update_active_info()
569 static void ufshpb_update_inactive_info(struct ufshpb_lu *hpb, int rgn_idx) in ufshpb_update_inactive_info() argument
575 rgn = hpb->rgn_tbl + rgn_idx; in ufshpb_update_inactive_info()
600 srgn->rgn_idx, srgn->srgn_idx); in ufshpb_activate_subregion()
605 rgn = hpb->rgn_tbl + srgn->rgn_idx; in ufshpb_activate_subregion()
610 srgn->rgn_idx, srgn->srgn_idx); in ufshpb_activate_subregion()
631 srgn = hpb->rgn_tbl[map_req->rb.rgn_idx].srgn_tbl + in ufshpb_map_req_compl_fn()
648 put_unaligned_be16(rgn->rgn_idx, &cdb[2]); in ufshpb_set_unmap_cmd()
652 static void ufshpb_set_read_buf_cmd(unsigned char *cdb, int rgn_idx, in ufshpb_set_read_buf_cmd() argument
658 put_unaligned_be16(rgn_idx, &cdb[2]); in ufshpb_set_read_buf_cmd()
701 map_req->rb.rgn_idx, map_req->rb.srgn_idx); in ufshpb_execute_map_req()
717 ufshpb_set_read_buf_cmd(scmd->cmnd, map_req->rb.rgn_idx, in ufshpb_execute_map_req()
832 ufshpb_update_inactive_info(hpb, rgn->rgn_idx); in ufshpb_read_to_handler()
918 int rgn_idx = rgn ? rgn->rgn_idx : 0; in ufshpb_issue_umap_req() local
920 umap_req = ufshpb_get_req(hpb, rgn_idx, REQ_OP_DRV_OUT, atomic); in ufshpb_issue_umap_req()
944 dev_dbg(&hpb->sdev_ufs_lu->sdev_dev, "evict region %d\n", rgn->rgn_idx); in __ufshpb_evict_region()
961 rgn->rgn_idx); in ufshpb_evict_region()
1033 rgn->rgn_idx, srgn->srgn_idx); in ufshpb_issue_map_req()
1048 __func__, ret, srgn->rgn_idx, srgn->srgn_idx); in ufshpb_issue_map_req()
1114 victim_rgn->rgn_idx); in ufshpb_add_region()
1291 ufshpb_submit_region_inactive(hpb, rgn->rgn_idx); in ufshpb_dev_reset_handler()
1428 rgn = hpb->rgn_tbl + srgn->rgn_idx; in ufshpb_run_active_subregion_list()
1437 ret, rgn->rgn_idx, srgn->srgn_idx); in ufshpb_run_active_subregion_list()
1447 rgn->rgn_idx, srgn->srgn_idx); in ufshpb_run_active_subregion_list()
1488 int rgn_idx; in ufshpb_normalization_work_handler() local
1491 for (rgn_idx = 0; rgn_idx < hpb->rgns_per_lu; rgn_idx++) { in ufshpb_normalization_work_handler()
1492 struct ufshpb_region *rgn = hpb->rgn_tbl + rgn_idx; in ufshpb_normalization_work_handler()
1510 ufshpb_update_inactive_info(hpb, rgn->rgn_idx); in ufshpb_normalization_work_handler()
1574 srgn->rgn_idx = rgn->rgn_idx; in ufshpb_init_subregion_tbl()
1651 int rgn_idx, i; in ufshpb_alloc_region_tbl() local
1659 for (rgn_idx = 0; rgn_idx < hpb->rgns_per_lu; rgn_idx++) { in ufshpb_alloc_region_tbl()
1663 rgn = rgn_table + rgn_idx; in ufshpb_alloc_region_tbl()
1664 rgn->rgn_idx = rgn_idx; in ufshpb_alloc_region_tbl()
1672 if (rgn_idx == hpb->rgns_per_lu - 1) { in ufshpb_alloc_region_tbl()
1683 if (ufshpb_is_pinned_region(hpb, rgn_idx)) { in ufshpb_alloc_region_tbl()
1700 for (i = 0; i <= rgn_idx; i++) in ufshpb_alloc_region_tbl()
1722 int rgn_idx; in ufshpb_destroy_region_tbl() local
1724 for (rgn_idx = 0; rgn_idx < hpb->rgns_per_lu; rgn_idx++) { in ufshpb_destroy_region_tbl()
1727 rgn = hpb->rgn_tbl + rgn_idx; in ufshpb_destroy_region_tbl()