1. 29 8月, 2017 3 次提交
    • D
      MIPS: NUMA: Remove the unused parent_node() macro · 42f1e641
      Dou Liyang 提交于
      Commit a7be6e5a ("mm: drop useless local parameters of
      __register_one_node()") removes the last user of parent_node().
      
      The parent_node() macros in both IP27 and Loongson64 are unnecessary.
      
      Remove it for cleanup.
      Reported-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NDou Liyang <douly.fnst@cn.fujitsu.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/16873/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      42f1e641
    • P
      MIPS: Remove unused R6000 support · 3b2db173
      Paul Burton 提交于
      The kernel contains a small amount of incomplete code aimed at
      supporting old R6000 CPUs. This is:
      
        - Unused, as no machine selects CONFIG_SYS_HAS_CPU_R6000.
      
        - Broken, since there are glaring errors such as r6000_fpu.S moving
          the FCSR register to t1, then ignoring it & instead saving t0 into
          struct sigcontext...
      
        - A maintenance headache, since it's code that nobody can test which
          nevertheless imposes constraints on code which it shares with other
          machines.
      
      Remove this incomplete & broken R6000 CPU support in order to clean up
      and in preparation for changes which will no longer need to consider
      dragging the pretense of R6000 support along with them.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16236/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      3b2db173
    • M
      MIPS: SMP: Constify smp ops · ff2c8252
      Matt Redfearn 提交于
      smp_ops providers do not modify their ops structures, so they should be
      made const for robustness. Since currently the MIPS kernel is not mapped
      with memory protection, this does not in itself provide any security
      benefit, but it still makes sense to make this change.
      
      There are also slight code size efficincies from the structure being
      made read-only, saving 128 bytes of kernel text on a
      pistachio_defconfig.
      Before:
         text	   data	    bss	    dec	    hex	filename
      7187239	1772752	 470224	9430215	 8fe4c7	vmlinux
      After:
         text	   data	    bss	    dec	    hex	filename
      7187111	1772752	 470224	9430087	 8fe447	vmlinux
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
      Cc: Bart Van Assche <bart.vanassche@sandisk.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Steven J. Hill <steven.hill@cavium.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/16784/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ff2c8252
  2. 08 8月, 2017 1 次提交
  3. 07 8月, 2017 2 次提交
  4. 19 7月, 2017 1 次提交
    • 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
  5. 17 7月, 2017 1 次提交
  6. 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
  7. 11 7月, 2017 3 次提交
  8. 05 7月, 2017 1 次提交
  9. 04 7月, 2017 1 次提交
  10. 29 6月, 2017 16 次提交
    • G
      MIPS: VDSO: Fix conversions in do_monotonic()/do_monotonic_coarse() · 8ec7f15b
      Goran Ferenc 提交于
      Fix incorrect calculation in do_monotonic() and do_monotonic_coarse()
      function that in turn caused incorrect values returned by the vdso
      version of system call clock_gettime() on mips64 if its system clock
      ID parameter was CLOCK_MONOTONIC or CLOCK_MONOTONIC_COARSE.
      
      Consider these variables and their types on mips32 and mips64:
      
      tk->wall_to_monotonic.tv_sec  s64, s64   (kernel/vdso.c)
      vdso_data.wall_to_mono_sec    u32, u32   (kernel/vdso.c)
      to_mono_sec                   u32, u32   (vdso/gettimeofday.c)
      ts->tv_sec                    s32, s64   (vdso/gettimeofday.c)
      
      For mips64 case, u32 vdso_data.wall_to_mono_sec variable is updated
      from the 64-bit signed variable tk->wall_to_monotonic.tv_sec
      (kernel/vdso.c:76) which is a negative number holding the time passed
      from 1970-01-01 to the time boot started. This 64-bit signed value is
      currently around 47+ years, in seconds. For instance, let this value
      be:
      
      -1489757461
      
      or
      
      11111111111111111111111111111111 10100111001101000001101011101011
      
      By updating 32-bit vdso_data.wall_to_mono_sec variable, we lose upper
      32 bits (signed 1's).
      
      to_mono_sec variable is a parameter of do_monotonic() and
      do_monotonic_coarse() functions which holds vdso_data.wall_to_mono_sec
      value. Its value needs to be added (or subtracted considering it holds
      negative value from the tk->wall_to_monotonic.tv_sec) to the current
      time passed from 1970-01-01 (ts->tv_sec), which is again something like
      47+ years, but increased by the time passed from the boot to the
      current time. ts->tv_sec is 32-bit long in case of 32-bit architecture
      and 64-bit long in case of 64-bit architecture. Consider the update of
      ts->tv_sec (vdso/gettimeofday.c:55 & 167):
      
      ts->tv_sec += to_mono_sec;
      
      mips32 case: This update will be performed correctly, since both
      ts->tv_sec and to_mono_sec are 32-bit long and the sign in to_mono_sec
      is preserved. Implicit conversion from u32 to s32 will be done
      correctly.
      
      mips64 case: This update will be wrong, since the implicit conversion
      will not be done correctly. The reason is that the conversion will be
      from u32 to s64. This is because to_mono_sec is 32-bit long for both
      mips32 and mips64 cases and s64..33 bits of converted to_mono_sec
      variable will be zeros.
      
      So, in order to make MIPS64 implementation work properly for
      MONOTONIC and MONOTONIC_COARSE clock ids on mips64, the size of
      wall_to_mono_sec variable in mips_vdso_data union and respective
      parameters in do_monotonic() and do_monotonic_coarse() functions
      should be changed from u32 to u64. Because of consistency, this
      size change from u32 and u64 is also done for wall_to_mono_nsec
      variable and corresponding function parameters.
      
      As far as similar situations for other architectures are concerned,
      let's take a look at arm. Arm has two distinct vdso_data structures
      for 32-bit & 64-bit cases, and arm's wall_to_mono_sec and
      wall_to_mono_nsec are u32 for 32-bit and u64 for 64-bit cases.
      On the other hand, MIPS has only one structure (mips_vdso_data),
      hence the need for changing the size of above mentioned parameters.
      Signed-off-by: NGoran Ferenc <goran.ferenc@imgtec.com>
      Signed-off-by: NMiodrag Dinic <miodrag.dinic@imgtec.com>
      Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com>
      Cc: Douglas Leung <douglas.leung@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Petar Jovanovic <petar.jovanovic@imgtec.com>
      Cc: Raghu Gandham <raghu.gandham@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/16638/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      8ec7f15b
    • P
      MIPS: Add CPU shared FTLB feature detection · e7bc8557
      Paul Burton 提交于
      Some systems share FTLB RAMs or entries between sibling CPUs (ie.
      hardware threads, or VP(E)s, within a core). These properties require
      kernel handling in various places. As a start this patch introduces
      cpu_has_shared_ftlb_ram & cpu_has_shared_ftlb_entries feature macros
      which we set appropriately for I6400 & I6500 CPUs. Further patches will
      make use of these macros as appropriate.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16202/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e7bc8557
    • M
      MIPS: Fix unaligned PC interpretation in `compute_return_epc' · 11a3799d
      Maciej W. Rozycki 提交于
      Fix a regression introduced with commit fb6883e5 ("MIPS: microMIPS:
      Support handling of delay slots.") and defer to `__compute_return_epc'
      if the ISA bit is set in EPC with non-MIPS16, non-microMIPS hardware,
      which will then arrange for a SIGBUS due to an unaligned instruction
      reference.  Returning EPC here is never correct as the API defines this
      function's result to be either a negative error code on failure or one
      of 0 and BRANCH_LIKELY_TAKEN on success.
      
      Fixes: fb6883e5 ("MIPS: microMIPS: Support handling of delay slots.")
      Signed-off-by: NMaciej W. Rozycki <macro@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org # 3.9+
      Patchwork: https://patchwork.linux-mips.org/patch/16395/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      11a3799d
    • P
      MIPS: Use queued spinlocks (qspinlock) · 0b17c967
      Paul Burton 提交于
      This patch switches MIPS to make use of generically implemented queued
      spinlocks, rather than the ticket spinlocks used previously. This allows
      us to drop a whole load of inline assembly, share more generic code, and
      is also a performance win.
      
      Results from running the AIM7 short workload on a MIPS Creator Ci40 (ie.
      2 core 2 thread interAptiv CPU clocked at 546MHz) with v4.12-rc4
      pistachio_defconfig, with ftrace disabled due to a current bug, and both
      with & without use of queued rwlocks & spinlocks:
      
        Forks | v4.12-rc4 | +qlocks  | Change
       -------|-----------|----------|--------
           10 | 52630.32  | 53316.31 | +1.01%
           20 | 51777.80  | 52623.15 | +1.02%
           30 | 51645.92  | 52517.26 | +1.02%
           40 | 51634.88  | 52419.89 | +1.02%
           50 | 51506.75  | 52307.81 | +1.02%
           60 | 51500.74  | 52322.72 | +1.02%
           70 | 51434.81  | 52288.60 | +1.02%
           80 | 51423.22  | 52434.85 | +1.02%
           90 | 51428.65  | 52410.10 | +1.02%
      
      The kernels used for these tests also had my "MIPS: Hardcode cpu_has_*
      where known at compile time due to ISA" patch applied, which allows the
      kernel_uses_llsc checks in cmpxchg() & xchg() to be optimised away at
      compile time.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16358/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      0b17c967
    • P
      MIPS: Use queued read/write locks (qrwlock) · 25da4e9d
      Paul Burton 提交于
      This patch switches MIPS to make use of generically implemented queued
      read/write locks, rather than the custom implementation used previously.
      This allows us to drop a whole load of inline assembly, share more
      generic code, and is also a performance win.
      
      Results from running the AIM7 short workload on a MIPS Creator Ci40 (ie.
      2 core 2 thread interAptiv CPU clocked at 546MHz) with v4.12-rc4
      pistachio_defconfig, with ftrace disabled due to a current bug, and both
      with & without use of queued rwlocks & spinlocks:
      
        Forks | v4.12-rc4 | +qlocks  | Change
       -------|-----------|----------|--------
           10 | 52630.32  | 53316.31 | +1.01%
           20 | 51777.80  | 52623.15 | +1.02%
           30 | 51645.92  | 52517.26 | +1.02%
           40 | 51634.88  | 52419.89 | +1.02%
           50 | 51506.75  | 52307.81 | +1.02%
           60 | 51500.74  | 52322.72 | +1.02%
           70 | 51434.81  | 52288.60 | +1.02%
           80 | 51423.22  | 52434.85 | +1.02%
           90 | 51428.65  | 52410.10 | +1.02%
      
      The kernels used for these tests also had my "MIPS: Hardcode cpu_has_*
      where known at compile time due to ISA" patch applied, which allows the
      kernel_uses_llsc checks in cmpxchg() & xchg() to be optimised away at
      compile time.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16357/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      25da4e9d
    • P
      MIPS: cmpxchg: Rearrange __xchg() arguments to match xchg() · 4843cf8d
      Paul Burton 提交于
      The __xchg() function declares its first 2 arguments in reverse order
      compared to the xchg() macro, which is confusing & serves no purpose.
      Reorder the arguments such that __xchg() & xchg() match.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16356/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      4843cf8d
    • P
      MIPS: cmpxchg: Implement 1 byte & 2 byte cmpxchg() · 3ba7f44d
      Paul Burton 提交于
      Implement support for 1 & 2 byte cmpxchg() using read-modify-write atop
      a 4 byte cmpxchg(). This allows us to support these atomic operations
      despite the MIPS ISA only providing 4 & 8 byte atomic operations.
      
      This is required in order to support queued rwlocks (qrwlock) in a later
      patch, since these make use of a 1 byte cmpxchg() in their slow path.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16355/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      3ba7f44d
    • P
      MIPS: cmpxchg: Implement 1 byte & 2 byte xchg() · b70eb300
      Paul Burton 提交于
      Implement 1 & 2 byte xchg() using read-modify-write atop a 4 byte
      cmpxchg(). This allows us to support these atomic operations despite the
      MIPS ISA only providing for 4 & 8 byte atomic operations.
      
      This is required in order to support queued spinlocks (qspinlock) in a
      later patch, since these make use of a 2 byte xchg() in their slow path.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16354/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b70eb300
    • P
      MIPS: cmpxchg: Implement __cmpxchg() as a function · 8263db4d
      Paul Burton 提交于
      Replace the macro definition of __cmpxchg() with an inline function,
      which is easier to read & modify. The cmpxchg() & cmpxchg_local() macros
      are adjusted to call the new __cmpxchg() function.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16353/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      8263db4d
    • P
      MIPS: cmpxchg: Drop __xchg_u{32,64} functions · 62c6081d
      Paul Burton 提交于
      The __xchg_u32() & __xchg_u64() functions now add very little value.
      This patch therefore removes them, by:
      
        - Moving memory barriers out of them & into xchg(), which also removes
          the duplication & readies us to support xchg_relaxed() if we wish to.
      
        - Calling __xchg_asm() directly from __xchg().
      
        - Performing the check for CONFIG_64BIT being enabled in the size=8
          case of __xchg().
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16352/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      62c6081d
    • P
      MIPS: cmpxchg: Error out on unsupported xchg() calls · d15dc68c
      Paul Burton 提交于
      xchg() has up until now simply returned the x parameter in cases where
      it is called with a pointer to a value of an unsupported size. This will
      often cause the calling code to hit a failure path, presuming that the
      value of x differs from the content of the memory pointed at by ptr, but
      we can do better by producing a compile-time or link-time error such
      that unsupported calls to xchg() are detectable earlier than runtime.
      
      This patch does this in the same was as is already done for cmpxchg(),
      using a call to a missing function annotated with __compiletime_error().
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16351/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d15dc68c
    • P
      MIPS: cmpxchg: Use __compiletime_error() for bad cmpxchg() pointers · 77299db8
      Paul Burton 提交于
      Our cmpxchg() implementation relies upon generating a call to a function
      which doesn't really exist (__cmpxchg_called_with_bad_pointer) to create
      a link failure in cases where cmpxchg() is called with a pointer to a
      value of an unsupported size.
      
      The __compiletime_error macro can be used to decorate a function such
      that a call to it generates a compile-time, rather than a link-time,
      error. This patch uses __compiletime_error to cause bad cmpxchg() calls
      to error out at compile time rather than link time, allowing errors to
      occur more quickly & making it easier to spot where the problem comes
      from.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16350/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      77299db8
    • P
      MIPS: cmpxchg: Pull xchg() asm into a macro · 5154f3b4
      Paul Burton 提交于
      Use a macro to generate the 32 & 64 bit variants of the backing code for
      xchg(), much as is already done for cmpxchg(). This removes the
      duplication that could previously be found in __xchg_u32() &
      __xchg_u64().
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16349/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      5154f3b4
    • P
      MIPS: cmpxchg: Unify R10000_LLSC_WAR & non-R10000_LLSC_WAR cases · 6b1e7629
      Paul Burton 提交于
      Prior to this patch the xchg & cmpxchg functions have duplicated code
      which is for all intents & purposes identical apart from use of a
      branch-likely instruction in the R10000_LLSC_WAR case & a regular branch
      instruction in the non-R10000_LLSC_WAR case.
      
      This patch removes the duplication, declaring a __scbeqz macro to select
      the branch instruction suitable for use when checking the result of an
      sc instruction & making use of it to unify the 2 cases.
      
      In __xchg_u{32,64}() this means writing the branch in asm, where it was
      previously being done in C as a do...while loop for the
      non-R10000_LLSC_WAR case. As this is a single instruction, and adds
      consistency with the R10000_LLSC_WAR cases & the cmpxchg() code, this
      seems worthwhile.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16348/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6b1e7629
    • M
      MIPS: unaligned: Add DSP lwx & lhx missaligned access support · 3f88ec63
      Miodrag Dinic 提交于
      Add handling of missaligned access for DSP load instructions
      lwx & lhx.
      
      Since DSP instructions share SPECIAL3 opcode with other non-DSP
      instructions, necessary logic was inserted for distinguishing
      between instructions with SPECIAL3 opcode. For that purpose,
      the instruction format for DSP instructions is added to
      arch/mips/include/uapi/asm/inst.h.
      Signed-off-by: NMiodrag Dinic <miodrag.dinic@imgtec.com>
      Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtech.com>
      Cc: James.Hogan@imgtec.com
      Cc: Paul.Burton@imgtec.com
      Cc: Raghu.Gandham@imgtec.com
      Cc: Leonid.Yegoshin@imgtec.com
      Cc: Douglas.Leung@imgtec.com
      Cc: Petar.Jovanovic@imgtec.com
      Cc: Goran.Ferenc@imgtec.com
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16511/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      3f88ec63
    • H
      MIPS: Loogson: Make enum loongson_cpu_type more clear · b9c4dc2c
      Huacai Chen 提交于
      Sort enum loongson_cpu_type in a more reasonable manner, this makes the
      CPU names more clear and extensible. Those already defined enum values
      are renamed to Legacy_* for compatibility.
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J . Hill <Steven.Hill@cavium.com>
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16591/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b9c4dc2c
  11. 28 6月, 2017 9 次提交