We dropped support for page sizes that are not power of 2.
Signed-off-by: Ohad Sharabi <osharabi@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
* @get_sob_addr: get SOB base address offset.
* @set_pci_memory_regions: setting properties of PCI memory regions
* @get_stream_master_qid_arr: get pointer to stream masters QID array
- * @is_valid_dram_page_size: return true if page size is supported in device
- * memory allocation, otherwise false.
* @get_valid_dram_page_orders: get valid device memory allocation page orders
* @access_dev_mem: access device memory
* @set_dram_bar_base: set the base of the DRAM BAR
u32 (*get_sob_addr)(struct hl_device *hdev, u32 sob_id);
void (*set_pci_memory_regions)(struct hl_device *hdev);
u32* (*get_stream_master_qid_arr)(void);
- bool (*is_valid_dram_page_size)(u32 page_size);
int (*mmu_get_real_page_size)(struct hl_device *hdev, struct hl_mmu_properties *mmu_prop,
u32 page_size, u32 *real_page_size, bool is_dram_addr);
void (*get_valid_dram_page_orders)(struct hl_info_dev_memalloc_page_sizes *info);
if (prop->supports_user_set_page_size && args->alloc.page_size) {
psize = args->alloc.page_size;
- if (!hdev->asic_funcs->is_valid_dram_page_size(psize)) {
- dev_err(hdev->dev, "user page size (%#x) is not valid\n", psize);
+ if (!is_power_of_2(psize)) {
+ dev_err(hdev->dev, "user page size (%#x) is not power of 2\n", psize);
return -EINVAL;
}
} else {
.get_sob_addr = gaudi_get_sob_addr,
.set_pci_memory_regions = gaudi_set_pci_memory_regions,
.get_stream_master_qid_arr = gaudi_get_stream_master_qid_arr,
- .is_valid_dram_page_size = NULL,
.mmu_get_real_page_size = hl_mmu_get_real_page_size,
.get_valid_dram_page_orders = gaudi_get_valid_dram_page_orders,
.access_dev_mem = hl_access_dev_mem,
.get_sob_addr = &goya_get_sob_addr,
.set_pci_memory_regions = goya_set_pci_memory_regions,
.get_stream_master_qid_arr = goya_get_stream_master_qid_arr,
- .is_valid_dram_page_size = NULL,
.mmu_get_real_page_size = hl_mmu_get_real_page_size,
.get_valid_dram_page_orders = goya_get_valid_dram_page_orders,
.access_dev_mem = hl_access_dev_mem,