aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-09-14 18:56:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-09-14 18:56:42 -0400
commiteae4f8851f35ceb75f56a861659800c33603a476 (patch)
tree92fece55ab53a76c934ef98852b082f5bd201a1a
parent3e153256d9f18b0568fb568958db2d3f83a5365c (diff)
parent4a7f50f78c221aac7253ea7059e1986eb622b0e5 (diff)
Merge tag 'xtensa-20180914' of git://github.com/jcmvbkbc/linux-xtensa
Pull Xtensa fixes and cleanups from Max Filippov: - don't allocate memory in platform_setup as the memory allocator is not initialized at that point yet; - remove unnecessary ifeq KBUILD_SRC from arch/xtensa/Makefile; - enable SG chaining in arch/xtensa/Kconfig. * tag 'xtensa-20180914' of git://github.com/jcmvbkbc/linux-xtensa: xtensa: enable SG chaining in Kconfig xtensa: remove unnecessary KBUILD_SRC ifeq conditional xtensa: ISS: don't allocate memory in platform_setup
-rw-r--r--arch/xtensa/Kconfig1
-rw-r--r--arch/xtensa/Makefile4
-rw-r--r--arch/xtensa/platforms/iss/setup.c25
3 files changed, 16 insertions, 14 deletions
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 04d038f3b6fa..b9ad83a0ee5d 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -4,6 +4,7 @@ config ZONE_DMA
4 4
5config XTENSA 5config XTENSA
6 def_bool y 6 def_bool y
7 select ARCH_HAS_SG_CHAIN
7 select ARCH_HAS_SYNC_DMA_FOR_CPU 8 select ARCH_HAS_SYNC_DMA_FOR_CPU
8 select ARCH_HAS_SYNC_DMA_FOR_DEVICE 9 select ARCH_HAS_SYNC_DMA_FOR_DEVICE
9 select ARCH_NO_COHERENT_DMA_MMAP if !MMU 10 select ARCH_NO_COHERENT_DMA_MMAP if !MMU
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 295c120ed099..d67e30faff9c 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -64,11 +64,7 @@ endif
64vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y)) 64vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
65plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y)) 65plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
66 66
67ifeq ($(KBUILD_SRC),)
68KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(vardirs) $(plfdirs))
69else
70KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs)) 67KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
71endif
72 68
73KBUILD_DEFCONFIG := iss_defconfig 69KBUILD_DEFCONFIG := iss_defconfig
74 70
diff --git a/arch/xtensa/platforms/iss/setup.c b/arch/xtensa/platforms/iss/setup.c
index f4bbb28026f8..58709e89a8ed 100644
--- a/arch/xtensa/platforms/iss/setup.c
+++ b/arch/xtensa/platforms/iss/setup.c
@@ -78,23 +78,28 @@ static struct notifier_block iss_panic_block = {
78 78
79void __init platform_setup(char **p_cmdline) 79void __init platform_setup(char **p_cmdline)
80{ 80{
81 static void *argv[COMMAND_LINE_SIZE / sizeof(void *)] __initdata;
82 static char cmdline[COMMAND_LINE_SIZE] __initdata;
81 int argc = simc_argc(); 83 int argc = simc_argc();
82 int argv_size = simc_argv_size(); 84 int argv_size = simc_argv_size();
83 85
84 if (argc > 1) { 86 if (argc > 1) {
85 void **argv = alloc_bootmem(argv_size); 87 if (argv_size > sizeof(argv)) {
86 char *cmdline = alloc_bootmem(argv_size); 88 pr_err("%s: command line too long: argv_size = %d\n",
87 int i; 89 __func__, argv_size);
90 } else {
91 int i;
88 92
89 cmdline[0] = 0; 93 cmdline[0] = 0;
90 simc_argv((void *)argv); 94 simc_argv((void *)argv);
91 95
92 for (i = 1; i < argc; ++i) { 96 for (i = 1; i < argc; ++i) {
93 if (i > 1) 97 if (i > 1)
94 strcat(cmdline, " "); 98 strcat(cmdline, " ");
95 strcat(cmdline, argv[i]); 99 strcat(cmdline, argv[i]);
100 }
101 *p_cmdline = cmdline;
96 } 102 }
97 *p_cmdline = cmdline;
98 } 103 }
99 104
100 atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block); 105 atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block);