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()
436 static struct ufshpb_req *ufshpb_get_req(struct ufshpb_lu *hpb, int rgn_idx, in ufshpb_get_req() argument
461 rq->rb.rgn_idx = rgn_idx; in ufshpb_get_req()
492 map_req = ufshpb_get_req(hpb, srgn->rgn_idx, REQ_OP_DRV_IN, false); in ufshpb_get_map_req()
536 srgn->rgn_idx, srgn->srgn_idx); in ufshpb_clear_dirty_bitmap()
545 rgn = hpb->rgn_tbl + srgn->rgn_idx; in ufshpb_clear_dirty_bitmap()
551 static void ufshpb_update_active_info(struct ufshpb_lu *hpb, int rgn_idx, in ufshpb_update_active_info() argument
557 rgn = hpb->rgn_tbl + rgn_idx; in ufshpb_update_active_info()
568 static void ufshpb_update_inactive_info(struct ufshpb_lu *hpb, int rgn_idx) in ufshpb_update_inactive_info() argument
574 rgn = hpb->rgn_tbl + rgn_idx; in ufshpb_update_inactive_info()
599 srgn->rgn_idx, srgn->srgn_idx); in ufshpb_activate_subregion()
604 rgn = hpb->rgn_tbl + srgn->rgn_idx; in ufshpb_activate_subregion()
609 srgn->rgn_idx, srgn->srgn_idx); in ufshpb_activate_subregion()
633 srgn = hpb->rgn_tbl[map_req->rb.rgn_idx].srgn_tbl + in ufshpb_map_req_compl_fn()
651 put_unaligned_be16(rgn->rgn_idx, &cdb[2]); in ufshpb_set_unmap_cmd()
655 static void ufshpb_set_read_buf_cmd(unsigned char *cdb, int rgn_idx, in ufshpb_set_read_buf_cmd() argument
661 put_unaligned_be16(rgn_idx, &cdb[2]); in ufshpb_set_read_buf_cmd()
704 map_req->rb.rgn_idx, map_req->rb.srgn_idx); in ufshpb_execute_map_req()
720 ufshpb_set_read_buf_cmd(scmd->cmnd, map_req->rb.rgn_idx, in ufshpb_execute_map_req()
835 ufshpb_update_inactive_info(hpb, rgn->rgn_idx); in ufshpb_read_to_handler()
921 int rgn_idx = rgn ? rgn->rgn_idx : 0; in ufshpb_issue_umap_req() local
923 umap_req = ufshpb_get_req(hpb, rgn_idx, REQ_OP_DRV_OUT, atomic); in ufshpb_issue_umap_req()
947 dev_dbg(&hpb->sdev_ufs_lu->sdev_dev, "evict region %d\n", rgn->rgn_idx); in __ufshpb_evict_region()
964 rgn->rgn_idx); in ufshpb_evict_region()
1036 rgn->rgn_idx, srgn->srgn_idx); in ufshpb_issue_map_req()
1051 __func__, ret, srgn->rgn_idx, srgn->srgn_idx); in ufshpb_issue_map_req()
1117 victim_rgn->rgn_idx); in ufshpb_add_region()
1294 ufshpb_submit_region_inactive(hpb, rgn->rgn_idx); in ufshpb_dev_reset_handler()
1431 rgn = hpb->rgn_tbl + srgn->rgn_idx; in ufshpb_run_active_subregion_list()
1440 ret, rgn->rgn_idx, srgn->srgn_idx); in ufshpb_run_active_subregion_list()
1450 rgn->rgn_idx, srgn->srgn_idx); in ufshpb_run_active_subregion_list()
1491 int rgn_idx; in ufshpb_normalization_work_handler() local
1494 for (rgn_idx = 0; rgn_idx < hpb->rgns_per_lu; rgn_idx++) { in ufshpb_normalization_work_handler()
1495 struct ufshpb_region *rgn = hpb->rgn_tbl + rgn_idx; in ufshpb_normalization_work_handler()
1513 ufshpb_update_inactive_info(hpb, rgn->rgn_idx); in ufshpb_normalization_work_handler()
1577 srgn->rgn_idx = rgn->rgn_idx; in ufshpb_init_subregion_tbl()
1654 int rgn_idx, i; in ufshpb_alloc_region_tbl() local
1662 for (rgn_idx = 0; rgn_idx < hpb->rgns_per_lu; rgn_idx++) { in ufshpb_alloc_region_tbl()
1666 rgn = rgn_table + rgn_idx; in ufshpb_alloc_region_tbl()
1667 rgn->rgn_idx = rgn_idx; in ufshpb_alloc_region_tbl()
1675 if (rgn_idx == hpb->rgns_per_lu - 1) { in ufshpb_alloc_region_tbl()
1686 if (ufshpb_is_pinned_region(hpb, rgn_idx)) { in ufshpb_alloc_region_tbl()
1703 for (i = 0; i <= rgn_idx; i++) in ufshpb_alloc_region_tbl()
1725 int rgn_idx; in ufshpb_destroy_region_tbl() local
1727 for (rgn_idx = 0; rgn_idx < hpb->rgns_per_lu; rgn_idx++) { in ufshpb_destroy_region_tbl()
1730 rgn = hpb->rgn_tbl + rgn_idx; in ufshpb_destroy_region_tbl()