[source] lantiq: vr9 fxs support: fixed check of SMP state within vpe-mt.c

LEDE Commits lede-commits at lists.infradead.org
Fri Mar 17 00:59:06 PDT 2017


mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/443e67a4597f90184ba0a41b4a38b54990babd4d

commit 443e67a4597f90184ba0a41b4a38b54990babd4d
Author: Stefan Koch <stefan.koch10 at gmail.com>
AuthorDate: Mon Mar 13 23:42:10 2017 +0100

    lantiq: vr9 fxs support: fixed check of SMP state within vpe-mt.c
    
    SMP state is generally affected by
    - CONFIG_SMP build-time kernel configuration option and
    - 'nosmp' runtime kernel commandline option
    
    The SMP state within vpe-mt.c is determined by CONFIG_SMP option.
    A runtime check is needed if VPE functionality
    should be used with a kernel image that supports SMP.
    
    This fix introduces a check for 'nosmp' command line option
    if CONFIG_SMP kernel configuration option is enabled.
    
    Note: This patch is needed to use lantiq FXS if CONFIG_MIPS_MT_SMP
    (that activates CONFIG_SMP) is enabled within kernel configuration
    and the 'nosmp' command line argument is given to disable SMP at runtime.
    
    Without this patch CONFIG_MIPS_MT_SMP must be disabled before using FXS.
    With this patch setting the 'nosmp' parameter is enough.
    
    In general, concurrent usage of FXS and SMP
    is incompatible and will cause kernel panics.
    
    Signed-off-by: Stefan Koch <stefan.koch10 at gmail.com>
---
 .../linux/lantiq/patches-4.9/0155-lantiq-VPE-nosmp.patch   | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/target/linux/lantiq/patches-4.9/0155-lantiq-VPE-nosmp.patch b/target/linux/lantiq/patches-4.9/0155-lantiq-VPE-nosmp.patch
new file mode 100644
index 0000000..898c2d4
--- /dev/null
+++ b/target/linux/lantiq/patches-4.9/0155-lantiq-VPE-nosmp.patch
@@ -0,0 +1,14 @@
+--- a/arch/mips/kernel/vpe-mt.c
++++ b/arch/mips/kernel/vpe-mt.c
+@@ -132,7 +132,10 @@ int vpe_run(struct vpe *v)
+ 	 * kernels need to turn it on, even if that wasn't the pre-dvpe() state.
+ 	 */
+ #ifdef CONFIG_SMP
+-	evpe(vpeflags);
++	if (!setup_max_cpus) /* nosmp is set */
++		evpe(EVPE_ENABLE);
++	else
++		evpe(vpeflags);
+ #else
+ 	evpe(EVPE_ENABLE);
+ #endif



More information about the lede-commits mailing list