diff options
author | Mathias Kresin <dev@kresin.me> | 2020-12-27 17:25:25 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2023-03-29 16:31:21 +0200 |
commit | 8e12360fcf157d421366e929737471830f77a4f0 (patch) | |
tree | 5e90c93c17892ba436d60a1279aac88302c88e58 | |
parent | 3d93d2cea5ce1f6120da4233cfdb168d408ad923 (diff) | |
download | upstream-8e12360fcf157d421366e929737471830f77a4f0.tar.gz upstream-8e12360fcf157d421366e929737471830f77a4f0.tar.bz2 upstream-8e12360fcf157d421366e929737471830f77a4f0.zip |
lantiq: ltq-tapi: add kernel 5.10 compatiblity
Due to SCHED_FIFO being a broken scheduler model, all users of
sched_setscheduler() are converted to sched_set_fifo_low() upstream and
sched_setscheduler() is no longer exported.
The callback handling of the tasklet API was redesigned and the macros
using the old syntax renamed to _OLD.
Signed-off-by: Mathias Kresin <dev@kresin.me>
(cherry picked from commit 31f3f797004ad318a1de88ec9cfdece523ee46d9)
[Add DECLARE_TASKLET handling for kernel 5.4.235 too]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r-- | package/kernel/lantiq/ltq-tapi/patches/500-linux-509.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/package/kernel/lantiq/ltq-tapi/patches/500-linux-509.patch b/package/kernel/lantiq/ltq-tapi/patches/500-linux-509.patch new file mode 100644 index 0000000000..9c012301de --- /dev/null +++ b/package/kernel/lantiq/ltq-tapi/patches/500-linux-509.patch @@ -0,0 +1,51 @@ +--- a/src/drv_tapi_linux.c ++++ b/src/drv_tapi_linux.c +@@ -3287,10 +3287,13 @@ static IFX_void_t proc_EntriesRemove(IFX + */ + static IFX_void_t tapi_wq_setscheduler (IFX_int32_t foo) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0) + struct sched_param sched_params; +- + sched_params.sched_priority = TAPI_OS_THREAD_PRIO_HIGH; + sched_setscheduler(current, SCHED_FIFO, &sched_params); ++#else ++ sched_set_fifo_low(current); ++#endif + } + #endif /* LINUX_2_6 */ + +@@ -3727,6 +3730,7 @@ static IFX_int32_t TAPI_SelectCh (TAPI_F + */ + IFX_int32_t TAPI_OS_ThreadPriorityModify(IFX_uint32_t newPriority) + { ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0)) + struct sched_param sched_params; + IFX_int32_t ret; + +@@ -3744,6 +3748,10 @@ IFX_int32_t TAPI_OS_ThreadPriorityModify + } + + return (ret < 0) ? IFX_ERROR : IFX_SUCCESS; ++#else ++ sched_set_fifo_low(current); ++ return IFX_SUCCESS; ++#endif + } + + +--- a/src/drv_tapi_kpi.c ++++ b/src/drv_tapi_kpi.c +@@ -134,7 +134,12 @@ extern IFX_int32_t block_ingre + /* ========================================================================== */ + static IFX_void_t ifx_tapi_KPI_IngressHandler (IFX_ulong_t foo); + #ifdef KPI_TASKLET ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0) && \ ++ !(LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0) && LINUX_VERSION_CODE > KERNEL_VERSION(5,4,235)) + DECLARE_TASKLET(tl_kpi_ingress, ifx_tapi_KPI_IngressHandler, 0L); ++#else ++DECLARE_TASKLET_OLD(tl_kpi_ingress, ifx_tapi_KPI_IngressHandler); ++#endif + #endif /* KPI_TASKLET */ + static IFX_int32_t ifx_tapi_KPI_IngressThread (IFXOS_ThreadParams_t *pThread); + static IFX_return_t ifx_tapi_KPI_GroupInit(IFX_uint32_t nKpiGroup); |