Fix setting kworker_task priority to be compatible with 5.9+ kernel
authorMiroslav Ondra <ondra@faster.cz>
Sat, 6 Feb 2021 12:39:43 +0000 (13:39 +0100)
committerMiroslav Ondra <ondra@faster.cz>
Sat, 6 Feb 2021 12:39:43 +0000 (13:39 +0100)
modules/unipi/src/unipi_common.h
modules/unipi/src/unipi_spi.c

index 9114cb6d284dc6c6d8bf4fb11fce840c65d5c541..b9cd1a9be1ca7fce5fa830c52372ef01d1bdfbb2 100644 (file)
@@ -52,7 +52,7 @@
 #if NEURONSPI_SCHED_REQUIRED > 0
        #include <uapi/linux/sched/types.h>
 #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
index 0356bfa41d278a1ad394b5dad7cab1b2602d9f5b..dc5a15c87191e8d5b48326c3db0ae54c2316f464 100644 (file)
@@ -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;