Lines Matching full:bps
1634 struct ras_badpage **bps, unsigned int *count);
1691 struct ras_badpage *bps = NULL; in amdgpu_ras_sysfs_badpages_read() local
1696 if (amdgpu_ras_badpages_read(adev, &bps, &bps_count)) in amdgpu_ras_sysfs_badpages_read()
1702 bps[start].bp, in amdgpu_ras_sysfs_badpages_read()
1703 bps[start].size, in amdgpu_ras_sysfs_badpages_read()
1704 amdgpu_ras_badpage_flags_str(bps[start].flags)); in amdgpu_ras_sysfs_badpages_read()
1706 kfree(bps); in amdgpu_ras_sysfs_badpages_read()
2471 * caller need free bps.
2474 struct ras_badpage **bps, unsigned int *count) in amdgpu_ras_badpages_read() argument
2481 if (!con || !con->eh_data || !bps || !count) in amdgpu_ras_badpages_read()
2487 *bps = NULL; in amdgpu_ras_badpages_read()
2492 *bps = kmalloc(sizeof(struct ras_badpage) * data->count, GFP_KERNEL); in amdgpu_ras_badpages_read()
2493 if (!*bps) { in amdgpu_ras_badpages_read()
2499 (*bps)[i] = (struct ras_badpage){ in amdgpu_ras_badpages_read()
2500 .bp = data->bps[i].retired_page, in amdgpu_ras_badpages_read()
2505 data->bps[i].retired_page << AMDGPU_GPU_PAGE_SHIFT); in amdgpu_ras_badpages_read()
2507 (*bps)[i].flags = AMDGPU_RAS_RETIRE_PAGE_PENDING; in amdgpu_ras_badpages_read()
2509 (*bps)[i].flags = AMDGPU_RAS_RETIRE_PAGE_FAULT; in amdgpu_ras_badpages_read()
2640 /* alloc/realloc bps array */
2647 void *bps = kmalloc(align_space * sizeof(*data->bps), GFP_KERNEL); in amdgpu_ras_realloc_eh_data_space() local
2649 if (!bps) { in amdgpu_ras_realloc_eh_data_space()
2653 if (data->bps) { in amdgpu_ras_realloc_eh_data_space()
2654 memcpy(bps, data->bps, in amdgpu_ras_realloc_eh_data_space()
2655 data->count * sizeof(*data->bps)); in amdgpu_ras_realloc_eh_data_space()
2656 kfree(data->bps); in amdgpu_ras_realloc_eh_data_space()
2659 data->bps = bps; in amdgpu_ras_realloc_eh_data_space()
2666 struct eeprom_table_record *bps, int pages) in amdgpu_ras_add_bad_pages() argument
2673 if (!con || !con->eh_data || !bps || pages <= 0) in amdgpu_ras_add_bad_pages()
2683 bps[i].retired_page << AMDGPU_GPU_PAGE_SHIFT)) in amdgpu_ras_add_bad_pages()
2692 amdgpu_ras_reserve_page(adev, bps[i].retired_page); in amdgpu_ras_add_bad_pages()
2694 memcpy(&data->bps[data->count], &bps[i], sizeof(*data->bps)); in amdgpu_ras_add_bad_pages()
2736 &data->bps[control->ras_num_recs], in amdgpu_ras_save_bad_pages()
2756 struct eeprom_table_record *bps; in amdgpu_ras_load_bad_pages() local
2763 bps = kcalloc(control->ras_num_recs, sizeof(*bps), GFP_KERNEL); in amdgpu_ras_load_bad_pages()
2764 if (!bps) in amdgpu_ras_load_bad_pages()
2767 ret = amdgpu_ras_eeprom_read(control, bps, control->ras_num_recs); in amdgpu_ras_load_bad_pages()
2771 ret = amdgpu_ras_add_bad_pages(adev, bps, control->ras_num_recs); in amdgpu_ras_load_bad_pages()
2773 kfree(bps); in amdgpu_ras_load_bad_pages()
2785 if (addr == data->bps[i].retired_page) in amdgpu_ras_check_bad_page_unlock()
3234 kfree((*data)->bps); in amdgpu_ras_recovery_init()
3285 kfree(data->bps); in amdgpu_ras_recovery_fini()