1. 29 8月, 2017 10 次提交
  2. 08 8月, 2017 4 次提交
    • P
      MIPS: Set ISA bit in entry-y for microMIPS kernels · 5fc9484f
      Paul Burton 提交于
      When building a kernel for the microMIPS ISA, ensure that the ISA bit
      (ie. bit 0) in the entry address is set. Otherwise we may include an
      entry address in images which bootloaders will jump to as MIPS32 code.
      
      I originally tried using "objdump -f" to obtain the entry address, which
      works for microMIPS but it always outputs a 32 bit address for a 32 bit
      ELF whilst nm will sign extend to 64 bit. That matters for systems where
      we might want to run a MIPS32 kernel on a MIPS64 CPU & load it with a
      MIPS64 bootloader, which would then jump to a non-canonical
      (non-sign-extended) address.
      
      This works in all cases as it only changes the behaviour for microMIPS
      kernels, but isn't the prettiest solution. A possible alternative would
      be to write a custom tool to just extract, sign extend & print the entry
      point of an ELF executable. I'm open to feedback if that would be
      preferred.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16950/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      5fc9484f
    • P
      MIPS: Prevent building MT support for microMIPS kernels · 527f1028
      Paul Burton 提交于
      We don't currently support the MT ASE for microMIPS kernels, and there
      are no CPUs currently in existence that use both. They can however both
      be enabled in Kconfig, resulting in build failures such as:
      
        AS      arch/mips/kernel/cps-vec.o
      arch/mips/kernel/cps-vec.S: Assembler messages:
      arch/mips/kernel/cps-vec.S:242: Warning: the 32-bit microMIPS architecture does not support the `mt' extension
      arch/mips/kernel/cps-vec.S:276: Error: unrecognized opcode `mttc0 $13,$2,2'
      arch/mips/kernel/cps-vec.S:282: Error: unrecognized opcode `mttc0 $8,$1,2'
      arch/mips/kernel/cps-vec.S:285: Error: unrecognized opcode `mttc0 $0,$2,1'
      ...
      
      Fix this by preventing MT from being enabled when targeting microMIPS.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16951/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      527f1028
    • M
      MIPS: PCI: Fix smp_processor_id() in preemptible · 73530266
      Matt Redfearn 提交于
      Commit 1c3c5eab ("sched/core: Enable might_sleep() and
      smp_processor_id() checks early") enables checks for might_sleep() and
      smp_processor_id() being used in preemptible code earlier in the boot
      than before. This results in a new BUG from
      pcibios_set_cache_line_size().
      
      BUG: using smp_processor_id() in preemptible [00000000] code:
      swapper/0/1 caller is pcibios_set_cache_line_size+0x10/0x70
      CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.13.0-rc1-00007-g3ce3e4ba4275 #615
      Stack: 0000000000000000 ffffffff81189694 0000000000000000 ffffffff81822318
             000000000000004e 0000000000000001 800000000e20bd08 20c49ba5e3540000
             0000000000000000 0000000000000000 ffffffff818d0000 0000000000000000
             0000000000000000 ffffffff81189328 ffffffff818ce692 0000000000000000
             0000000000000000 ffffffff81189bc8 ffffffff818d0000 0000000000000000
             ffffffff81828907 ffffffff81769970 800000020ec78d80 ffffffff818c7b48
             0000000000000001 0000000000000001 ffffffff818652b0 ffffffff81896268
             ffffffff818c0000 800000020ec7fb40 800000020ec7fc58 ffffffff81684cac
             0000000000000000 ffffffff8118ab50 0000000000000030 ffffffff81769970
             0000000000000001 ffffffff81122a58 0000000000000000 0000000000000000 ...
      Call Trace:
      [<ffffffff81122a58>] show_stack+0x90/0xb0
      [<ffffffff81684cac>] dump_stack+0xac/0xf0
      [<ffffffff813f7050>] check_preemption_disabled+0x120/0x128
      [<ffffffff818855e8>] pcibios_set_cache_line_size+0x10/0x70
      [<ffffffff81100578>] do_one_initcall+0x48/0x140
      [<ffffffff81865dc4>] kernel_init_freeable+0x194/0x24c
      [<ffffffff8169c534>] kernel_init+0x14/0x118
      [<ffffffff8111ca84>] ret_from_kernel_thread+0x14/0x1c
      
      Fix this by using the cpu_*cache_line_size() macros instead. These
      macros are the "proper" way to determine the CPU cache sizes.
      This makes use of the newly added cpu_tcache_line_size.
      
      Fixes: 1c3c5eab ("sched/core: Enable might_sleep() and smp_processor_id() checks early")
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Suggested-by: NJames Hogan <james.hogan@imgtec.com>
      Reviewed-by: NJames Hogan <james.hogan@imgtec.com>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      73530266
    • M
      MIPS: Introduce cpu_tcache_line_size · 21da5332
      Matt Redfearn 提交于
      There exist macros to return the cache line size of the L1 dcache and L2
      scache but there is currently no macro for the L3 tcache. Add this macro
      which will be used by the following patch "MIPS: PCI: Fix
      smp_processor_id() in preemptible"
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Maciej W. Rozycki <macro@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/16871/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      21da5332
  3. 07 8月, 2017 8 次提交
  4. 05 8月, 2017 1 次提交
  5. 20 7月, 2017 1 次提交
  6. 19 7月, 2017 2 次提交
    • H
      MIPS: ralink: mt7620: Add missing header · f13343e8
      Harvey Hunt 提交于
      Fix a build error caused by not including <linux/bug.h>.
      
      The following compilation errors are caused by the missing header:
      
      arch/mips/ralink/mt7620.c: In function ‘mt7620_get_cpu_pll_rate’:
      arch/mips/ralink/mt7620.c:431:2: error: implicit declaration of function ‘WARN_ON’ [-Werror=implicit-function-declaration]
        WARN_ON(div >= ARRAY_SIZE(mt7620_clk_divider));
        ^
      arch/mips/ralink/mt7620.c: In function ‘mt7620_get_sys_rate’:
      arch/mips/ralink/mt7620.c:500:2: error: implicit declaration of function ‘WARN’ [-Werror=implicit-function-declaration]
        if (WARN(!div, "invalid divider for OCP ratio %u", ocp_ratio))
        ^
      arch/mips/ralink/mt7620.c: In function ‘mt7620_dram_init’:
      arch/mips/ralink/mt7620.c:619:3: error: implicit declaration of function ‘BUG’ [-Werror=implicit-function-declaration]
         BUG();
         ^
      cc1: some warnings being treated as errors
      scripts/Makefile.build:302: recipe for target 'arch/mips/ralink/mt7620.o' failed
      Signed-off-by: NHarvey Hunt <harvey.hunt@imgtec.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/16781/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      f13343e8
    • H
      MIPS: ralink: Fix build error due to missing header · e3ccf1d1
      Harvey Hunt 提交于
      Previously, <linux/module.h> was included before ralink_regs.h in all
      ralink files - leading to <linux/io.h> being implicitly included.
      
      After commit 26dd3e4f ("MIPS: Audit and remove any unnecessary
      uses of module.h") removed the inclusion of module.h from multiple
      places, some ralink platforms failed to build with the following error:
      
      In file included from arch/mips/ralink/mt7620.c:17:0:
      ./arch/mips/include/asm/mach-ralink/ralink_regs.h: In function ‘rt_sysc_w32’:
      ./arch/mips/include/asm/mach-ralink/ralink_regs.h:38:2: error: implicit declaration of function ‘__raw_writel’ [-Werror=implicit-function-declaration]
        __raw_writel(val, rt_sysc_membase + reg);
        ^
      ./arch/mips/include/asm/mach-ralink/ralink_regs.h: In function ‘rt_sysc_r32’:
      ./arch/mips/include/asm/mach-ralink/ralink_regs.h:43:2: error: implicit declaration of function ‘__raw_readl’ [-Werror=implicit-function-declaration]
        return __raw_readl(rt_sysc_membase + reg);
      
      Fix this by including <linux/io.h>.
      Signed-off-by: NHarvey Hunt <harvey.hunt@imgtec.com>
      Fixes: 26dd3e4f ("MIPS: Audit and remove any unnecessary uses of module.h")
      Cc: John Crispin <john@phrozen.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: <stable@vger.kernel.org> #4.11+
      Patchwork: https://patchwork.linux-mips.org/patch/16780/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e3ccf1d1
  7. 17 7月, 2017 1 次提交
  8. 13 7月, 2017 2 次提交
    • J
      MIPS: SMP: move asmlinkage before return type · b745fcb9
      Joe Perches 提交于
      Make the code like the rest of the kernel.
      
      Link: http://lkml.kernel.org/r/756d3fb543e981b9284e756fa27616725a354b28.1499284835.git.joe@perches.comSigned-off-by: NJoe Perches <joe@perches.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b745fcb9
    • M
      MIPS: do not use __GFP_REPEAT for order-0 request · 473738eb
      Michal Hocko 提交于
      Patch series "mm: give __GFP_REPEAT a better semantic".
      
      The main motivation for the change is that the current implementation of
      __GFP_REPEAT is not very much useful.
      
      The documentation says:
       * __GFP_REPEAT: Try hard to allocate the memory, but the allocation attempt
       *   _might_ fail.  This depends upon the particular VM implementation.
      
      It just fails to mention that this is true only for large (costly) high
      order which has been the case since the flag was introduced.  A similar
      semantic would be really helpful for smal orders as well, though,
      because we have places where a failure with a specific fallback error
      handling is preferred to a potential endless loop inside the page
      allocator.
      
      The earlier cleanup dropped __GFP_REPEAT usage for low (!costly) order
      users so only those which might use larger orders have stayed.  One new
      user added in the meantime is addressed in patch 1.
      
      Let's rename the flag to something more verbose and use it for existing
      users.  Semantic for those will not change.  Then implement low
      (!costly) orders failure path which is hit after the page allocator is
      about to invoke the oom killer.  With that we have a good counterpart
      for __GFP_NORETRY and finally can tell try as hard as possible without
      the OOM killer.
      
      Xfs code already has an existing annotation for allocations which are
      allowed to fail and we can trivially map them to the new gfp flag
      because it will provide the semantic KM_MAYFAIL wants.  Christoph didn't
      consider the new flag really necessary but didn't respond to the OOM
      killer aspect of the change so I have kept the patch.  If this is still
      seen as not really needed I can drop the patch.
      
      kvmalloc will allow also !costly high order allocations to retry hard
      before falling back to the vmalloc.
      
      drm/i915 asked for the new semantic explicitly.
      
      Memory migration code, especially for the memory hotplug, should back
      off rather than invoking the OOM killer as well.
      
      This patch (of 6):
      
      Commit 3377e227 ("MIPS: Add 48-bit VA space (and 4-level page
      tables) for 4K pages.") has added a new __GFP_REPEAT user but using this
      flag doesn't really make any sense for order-0 request which is the case
      here because PUD_ORDER is 0.  __GFP_REPEAT has historically effect only
      on allocation requests with order > PAGE_ALLOC_COSTLY_ORDER.
      
      This doesn't introduce any functional change.  This is a preparatory
      patch for later work which renames the flag and redefines its semantic.
      
      Link: http://lkml.kernel.org/r/20170623085345.11304-2-mhocko@kernel.orgSigned-off-by: NMichal Hocko <mhocko@suse.com>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Cc: Alex Belits <alex.belits@cavium.com>
      Cc: David Daney <david.daney@cavium.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: NeilBrown <neilb@suse.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Darrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      473738eb
  9. 11 7月, 2017 11 次提交