1. 01 Nov, 2019 7 commits
  2. 31 Oct, 2019 1 commit
  3. 24 Oct, 2019 7 commits
  4. 12 Oct, 2019 3 commits
    • Paul Burton's avatar
      MIPS: Make builtin_cmdline const & variable length · 9dd422f6
      Paul Burton authored
      We have no need for the builtin_cmdline array to be fixed at the length
      of COMMAND_LINE_SIZE - we'll only copy out the string it contains up to
      its NULL terminator anyway, and cap the size at COMMAND_LINE_SIZE when
      copying into or concatenating with boot_command_line.
      
      The string value is also constant, so we can declare it as such to place
      it in the .init.rodata section.
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: linux-mips@vger.kernel.org
      9dd422f6
    • Paul Burton's avatar
      MIPS: Fix CONFIG_OF_EARLY_FLATTREE=n builds · 97272776
      Paul Burton authored
      Configurations with CONFIG_OF_EARLY_FLATTREE=n fail to build since
      commit 7784cac6 ("MIPS: cmdline: Clean up boot_command_line
      initialization") because of_scan_flat_dt() & of_scan_flat_dt() are not
      defined in these configurations. Fix this by #ifdef'ing the affected
      code...
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Fixes: 7784cac6 ("MIPS: cmdline: Clean up boot_command_line initialization")
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Cc: linux-mips@vger.kernel.org
      97272776
    • Paul Burton's avatar
      MIPS: Always define builtin_cmdline · b7340422
      Paul Burton authored
      Commit 7784cac6 ("MIPS: cmdline: Clean up boot_command_line
      initialization") made use of builtin_cmdline conditional upon plain C if
      statements rather than preprocessor #ifdef's. This caused build failures
      for configurations with CONFIG_CMDLINE_BOOL=n where builtin_cmdline
      wasn't defined, for example:
      
         arch/mips/kernel/setup.c: In function 'bootcmdline_init':
      >> arch/mips/kernel/setup.c:582:30: error: 'builtin_cmdline' undeclared
          (first use in this function); did you mean 'builtin_driver'?
            strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
                                       ^~~~~~~~~~~~~~~
                                       builtin_driver
         arch/mips/kernel/setup.c:582:30: note: each undeclared identifier is
          reported only once for each function it appears in
      
      Fix this by defining builtin_cmdline as an empty string in the affected
      configurations. All of the paths that use it should be optimized out
      anyway so the data itself gets optimized away too.
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Fixes: 7784cac6 ("MIPS: cmdline: Clean up boot_command_line initialization")
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Reported-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Cc: linux-mips@vger.kernel.org
      b7340422
  5. 10 Oct, 2019 2 commits
    • Nathan Chancellor's avatar
      mips: Fix unroll macro when building with Clang · df3da048
      Nathan Chancellor authored
      Building with Clang errors after commit 6baaeada ("MIPS: Provide
      unroll() macro, use it for cache ops") since the GCC_VERSION macro
      is defined in include/linux/compiler-gcc.h, which is only included
      in compiler.h when using GCC:
      
      In file included from arch/mips/kernel/mips-mt.c:20:
      ./arch/mips/include/asm/r4kcache.h:254:1: error: use of undeclared
      identifier 'GCC_VERSION'; did you mean 'S_VERSION'?
      __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32,
      )
      ^
      ./arch/mips/include/asm/r4kcache.h:219:4: note: expanded from macro
      '__BUILD_BLAST_CACHE'
                              cache_unroll(32, kernel_cache, indexop,
                              ^
      ./arch/mips/include/asm/r4kcache.h:203:2: note: expanded from macro
      'cache_unroll'
              unroll(times, _cache_op, insn, op, (addr) + (i++ * (lsize)));
              ^
      ./arch/mips/include/asm/unroll.h:28:15: note: expanded from macro
      'unroll'
              BUILD_BUG_ON(GCC_VERSION >= 40700 &&                    \
                           ^
      
      Use CONFIG_GCC_VERSION, which will always be set by Kconfig.
      Additionally, Clang 8 had improvements around __builtin_constant_p so
      use that as a lower limit for this check with Clang (although MIPS
      wasn't buildable until Clang 9); building a kernel with Clang 9.0.0
      has no issues after this change.
      
      Fixes: 6baaeada ("MIPS: Provide unroll() macro, use it for cache ops")
      Link: https://github.com/ClangBuiltLinux/linux/issues/736Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: clang-built-linux@googlegroups.com
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      df3da048
    • Paul Burton's avatar
      MIPS: cmdline: Clean up boot_command_line initialization · 7784cac6
      Paul Burton authored
      Our current code to initialize boot_command_line is a mess. Some of this
      is due to the addition of too many options over the years, and some of
      this is due to workarounds for early_init_dt_scan_chosen() performing
      actions specific to options from other architectures that probably
      shouldn't be in generic code.
      
      Clean this up by introducing a new bootcmdline_init() function that
      simplifies the initialization somewhat. The major changes are:
      
      - Because bootcmdline_init() is a function it can return early in the
        CONFIG_CMDLINE_OVERRIDE case.
      
      - We clear boot_command_line rather than inheriting whatever
        early_init_dt_scan_chosen() may have left us. This means we no longer
        need to set boot_command_line to a space character in an attempt to
        prevent early_init_dt_scan_chosen() from copying CONFIG_CMDLINE into
        boot_command_line without us knowing about it.
      
      - Indirection via USE_PROM_CMDLINE, USE_DTB_CMDLINE, EXTEND_WITH_PROM &
        BUILTIN_EXTEND_WITH_PROM macros is removed; they seemingly served only
        to obfuscate the code.
      
      - The logic is cleaner, clearer & commented.
      
      Two minor drawbacks of this approach are:
      
      1) We call of_scan_flat_dt(), which means we scan through the DT again.
         The overhead is fairly minimal & shouldn't be noticeable.
      
      2) cmdline_scan_chosen() duplicates a small amount of the logic from
         early_init_dt_scan_chosen(). Alternatives might be to allow the
         generic FDT code to keep & expose a copy of the arguments taken from
         the /chosen node's bootargs property, or to introduce a function like
         early_init_dt_scan_chosen() that retrieves them without modification
         to handle CONFIG_CMDLINE. Neither of these sounds particularly
         cleaner though, and this way we at least keep the extra work in
         arch/mips.
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: linux-mips@vger.kernel.org
      7784cac6
  6. 09 Oct, 2019 9 commits
  7. 08 Oct, 2019 1 commit
    • Tiezhu Yang's avatar
      MIPS: generic: Use __initconst for const init data · a14bf1dc
      Tiezhu Yang authored
      Fix the following checkpatch errors:
      
      $ ./scripts/checkpatch.pl --no-tree -f arch/mips/generic/init.c
      ERROR: Use of const init definition must use __initconst
      #23: FILE: arch/mips/generic/init.c:23:
      +static __initdata const void *fdt;
      
      ERROR: Use of const init definition must use __initconst
      #24: FILE: arch/mips/generic/init.c:24:
      +static __initdata const struct mips_machine *mach;
      
      ERROR: Use of const init definition must use __initconst
      #25: FILE: arch/mips/generic/init.c:25:
      +static __initdata const void *mach_match_data;
      
      Fixes: eed0eabd ("MIPS: generic: Introduce generic DT-based board support")
      Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Cc: ralf@linux-mips.org
      Cc: jhogan@kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      a14bf1dc
  8. 07 Oct, 2019 10 commits