From 41ee61132822580204c2272dda03c2681117b70f Mon Sep 17 00:00:00 2001 From: Miroslav Ondra Date: Sat, 6 Feb 2021 13:39:43 +0100 Subject: [PATCH] Fix setting kworker_task priority to be compatible with 5.9+ kernel --- modules/unipi/src/unipi_common.h | 2 +- modules/unipi/src/unipi_spi.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/unipi/src/unipi_common.h b/modules/unipi/src/unipi_common.h index 9114cb6..b9cd1a9 100644 --- a/modules/unipi/src/unipi_common.h +++ b/modules/unipi/src/unipi_common.h @@ -52,7 +52,7 @@ #if NEURONSPI_SCHED_REQUIRED > 0 #include #endif -#define NEURONSPI_MAJOR_VERSIONSTRING "Version 1.60:2021:02:02" +#define NEURONSPI_MAJOR_VERSIONSTRING "Version 1.61:2021:02:06" #define NEURONSPI_MAX_DEVS 3 #define NEURONSPI_MAX_UART 16 diff --git a/modules/unipi/src/unipi_spi.c b/modules/unipi/src/unipi_spi.c index 0356bfa..dc5a15c 100644 --- a/modules/unipi/src/unipi_spi.c +++ b/modules/unipi/src/unipi_spi.c @@ -1235,6 +1235,7 @@ s32 neuronspi_spi_probe(struct spi_device *spi) spi->bits_per_word = 8; spi->mode = spi->mode ? spi->mode : SPI_MODE_0; spi->max_speed_hz = spi->max_speed_hz ? spi->max_speed_hz : 12000000; + spi->master->rt = 1; ret = spi_setup(spi); if (ret) { kfree(n_spi); @@ -1319,9 +1320,11 @@ s32 neuronspi_spi_probe(struct spi_device *spi) // Set rt priority to spi controller //dev_info(&ctlr->dev, "will run message pump with realtime priority\n"); +#if 0 + /* replaced by spi->master->rt = 1 */ if (spi->controller->kworker_task) sched_setscheduler(spi->controller->kworker_task, SCHED_FIFO, &rt_param); - +#endif if (spi->controller->set_cs != unipi_spi_set_cs) { unipi_spi_master_set_cs = spi->controller->set_cs; unipi_spi_master_flag = spi->controller->flags; -- 2.34.1