Skip to contentSkip to conversation

accel/ivpu: Remove sched_mode module parameter

PATCH New Andrzej Kacprowski 1 participant 1 message Nov 16

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 accel/ivpu: Remove sched_mode module parameter

From: Andrzej Kacprowski <[email protected]>

OS scheduling supports only a limited subset of NPU functionality and is not intended for production use. However, the sched_mode module parameter exposes it as a regular configuration option, and the driver silently falls back to it when the firmware JSM API is older than 3.24.

Make hardware scheduling the only production mode:
- remove the sched_mode module parameter,
- require BOOT API 3.17 and JSM API 3.24 or newer, and fail probe with a message requesting a firmware update otherwise,
- allow OS scheduling on pre-60XX devices only through the IVPU_TEST_MODE_HWS_DISABLE test_mode bit, for debugging.

The initial 37xx and 40xx firmware added to linux-firmware in March 2025 reports BOOT and JSM APIs 3.27, meeting both minimum requirements.

Extend IVPU_FW_CHECK_API_COMPAT() to accept minimum major and minor versions so both API requirements can be checked explicitly.

---
 drivers/accel/ivpu/ivpu_drv.c |  4 --
 drivers/accel/ivpu/ivpu_drv.h |  4 +-
 drivers/accel/ivpu/ivpu_fw.c  | 84 ++++++++++++++++-------------------
 3 files changed, 39 insertions(+), 53 deletions(-)
drivers/accel/ivpu/ivpu_drv.c +0 -4
index 28cb18dcfa9b..2c761a6aa6ca 100644
@@ -55,10 +55,6 @@ u8 ivpu_pll_max_ratio = U8_MAX;
 module_param_named(pll_max_ratio, ivpu_pll_max_ratio, byte, 0644);
 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 (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);
 MODULE_PARM_DESC(disable_mmu_cont_pages, "Disable MMU contiguous pages optimization");
drivers/accel/ivpu/ivpu_drv.h +1 -3
index fe8b66e779a7..9b24d6c9d864 100644
@@ -56,8 +56,6 @@
 #define IVPU_PLATFORM_HSLE    4
 #define IVPU_PLATFORM_INVALID 8
 
-#define IVPU_SCHED_MODE_AUTO -1
-
 #define IVPU_DBG_REG	 BIT(0)
 #define IVPU_DBG_IRQ	 BIT(1)
 #define IVPU_DBG_MMU	 BIT(2)
@@ -224,7 +222,6 @@ struct ivpu_file_priv {
 extern int ivpu_dbg_mask;
 extern u8 ivpu_pll_min_ratio;
 extern u8 ivpu_pll_max_ratio;
-extern int ivpu_sched_mode;
 extern bool ivpu_disable_mmu_cont_pages;
 extern bool ivpu_force_snoop;
 
@@ -233,6 +230,7 @@ extern bool ivpu_force_snoop;
 #define IVPU_TEST_MODE_NULL_SUBMISSION    BIT(2)
 #define IVPU_TEST_MODE_FREQ_CHANGE_ENABLE BIT(3)
 #define IVPU_TEST_MODE_MIP_DISABLE        BIT(6)
+#define IVPU_TEST_MODE_HWS_DISABLE        BIT(7)
 #define IVPU_TEST_MODE_DISABLE_TIMEOUTS   BIT(8)
 #define IVPU_TEST_MODE_TURBO_ENABLE       BIT(9)
 #define IVPU_TEST_MODE_TURBO_DISABLE      BIT(10)
drivers/accel/ivpu/ivpu_fw.c +38 -46

126 lines not on this page · raw message

Signature · 9 lines
2.43.0

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.