accel/ivpu: Disallow setting sched mode OS starting from NPU6
Karol Wachowski
maintainerPATCH v2 1/1 accel/ivpu: Disallow setting sched mode OS starting from NPU6
OS scheduling mode gets deprecated starting from NPU6 onward. Print warning and fallback to HW scheduling mode if OS mode is explicitly selected with sched_mode parameter.
Signed-off-by Karol Wachowski <[email protected]>
---
Changes in v2:
- Fix subject description typo mentiniong that HW mode is deprecated instead of OS mode
--- drivers/accel/ivpu/ivpu_drv.c | 2 +- drivers/accel/ivpu/ivpu_fw.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/accel/ivpu/ivpu_drv.c +1 -1
@@ -57,7 +57,7 @@ MODULE_PARM_DESC(pll_max_ratio, "Maximum PLL ratio used to set NPU frequency");int ivpu_sched_mode =IVPU_SCHED_MODE_AUTO ;module_param_named (sched_mode, ivpu_sched_mode, int,0444 ); -MODULE_PARM_DESC (sched_mode,"Scheduler mode: -1 - Use default scheduler, 0 - Use OS scheduler, 1 - Use HW scheduler" ); +MODULE_PARM_DESC (sched_mode,"Scheduler mode: -1 - Use default scheduler, 0 - Use OS scheduler (supported on 27XX - 50XX), 1 - Use HW scheduler" );bool ivpu_disable_mmu_cont_pages;module_param_named (disable_mmu_cont_pages, ivpu_disable_mmu_cont_pages, bool,0444 );
drivers/accel/ivpu/ivpu_fw.c +6 -0
@@ -144,6 +144,12 @@ bool ivpu_is_within_range(u64 addr, size_t size, struct ivpu_addr_range *range)static u32 ivpu_fw_sched_mode_select (struct ivpu_device *vdev,const struct vpu_firmware_header *fw_hdr) { +if (ivpu_hw_ip_gen (vdev) >=IVPU_HW_IP_60XX && + ivpu_sched_mode ==VPU_SCHEDULING_MODE_OS ) { +ivpu_warn (vdev,"OS sched mode is not supported, using HW mode\n" ); +return VPU_SCHEDULING_MODE_HW ; + } +if (ivpu_sched_mode !=IVPU_SCHED_MODE_AUTO )return ivpu_sched_mode;
Signature · 1 line
2.43.0
Quoted 5 lines · Karol Wachowski
OS scheduling mode gets deprecated starting from NPU6 onward. Print warning and fallback to HW scheduling mode if OS mode is explicitly selected with
sched_modeparameter.Signed-off-by Karol Wachowski <[email protected]>
Reviewed-by Jeff Hugo <[email protected]>
Quoted 8 lines · Jeff Hugo
Quoted 5 lines · Karol Wachowski
OS scheduling mode gets deprecated starting from NPU6 onward. Print warning and fallback to HW scheduling mode if OS mode is explicitly selected with
sched_modeparameter.Signed-off-by Karol Wachowski <[email protected]>Reviewed-by Jeff Hugo <[email protected]>
Pushed to drm-misc-next.
-Karol