1. 09 Oct, 2018 6 commits
    • Maciej W. Rozycki's avatar
      MIPS: Correct `mmiowb' barrier for `wbflush' platforms · a711d43c
      Maciej W. Rozycki authored
      Redefine `mmiowb' in terms of `iobarrier_w' so that it works correctly
      for MIPS I platforms, which have no SYNC machine instruction and use a
      call to `wbflush' instead.
      
      This doesn't change the semantics for CONFIG_CPU_CAVIUM_OCTEON, because
      `iobarrier_w' expands to `wmb', which is ultimately the same as the
      current arrangement.  For MIPS I platforms this not only makes any code
      that would happen to use `mmiowb' build and run, but it actually
      enforces the ordering required as well, as `iobarrier_w' has it already
      covered with the use of `wmb'.
      Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/20863/
      Cc: Ralf Baechle <ralf@linux-mips.org>
      a711d43c
    • Maciej W. Rozycki's avatar
      MIPS: Define MMIO ordering barriers · 4ae0452b
      Maciej W. Rozycki authored
      Define MMIO ordering barriers as separate operations so as to allow
      making places where such a barrier is required distinct from places
      where a memory or a DMA barrier is needed.
      
      Architecturally MIPS does not specify ordering requirements for uncached
      bus accesses such as MMIO operations normally use and therefore explicit
      barriers have to be inserted between MMIO accesses where unspecified
      ordering of operations would cause unpredictable results.
      
      MIPS MMIO ordering barriers are implemented using the same underlying
      mechanism that memory or a DMA barrier ordering barriers use, that is
      either a suitable SYNC instruction or a platform-specific `wbflush'
      call.  However platforms may implement different ordering rules for
      different kinds of bus activity, so having a separate API makes it
      possible to remove unnecessary barriers and avoid a performance hit they
      may cause due to unrelated bus activity by making their implementation
      expand to nil while keeping the necessary ones.
      
      Also having distinct barriers for each kind of use makes it easier for
      the reader to understand what code has been intended to do.
      Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/20862/
      Cc: Ralf Baechle <ralf@linux-mips.org>
      4ae0452b
    • Quentin Schulz's avatar
      MIPS: mscc: add PCB120 to the ocelot fitImage · 39249d77
      Quentin Schulz authored
      PCB120 and PCB123 are both development boards based on Microsemi Ocelot
      so let's use the same fitImage for both.
      Reviewed-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Signed-off-by: default avatarQuentin Schulz <quentin.schulz@bootlin.com>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/20871/
      Cc: ralf@linux-mips.org
      Cc: jhogan@kernel.org
      Cc: robh+dt@kernel.org
      Cc: mark.rutland@arm.com
      Cc: davem@davemloft.net
      Cc: andrew@lunn.ch
      Cc: f.fainelli@gmail.com
      Cc: allan.nielsen@microchip.com
      Cc: linux-mips@linux-mips.org
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: thomas.petazzoni@bootlin.com
      Cc: antoine.tenart@bootlin.com
      39249d77
    • Quentin Schulz's avatar
      MIPS: mscc: add DT for Ocelot PCB120 · 116edf6e
      Quentin Schulz authored
      The Ocelot PCB120 evaluation board is different from the PCB123 in that
      it has 4 external VSC8584 (or VSC8574) PHYs.
      
      It uses the SoC's second MDIO bus for external PHYs which have a
      reversed address on the bus (i.e. PHY4 is on address 3, PHY5 is on
      address 2, PHY6 on 1 and PHY7 on 0).
      
      Here is how the PHYs are connected to the switch ports:
      port 0: phy0 (internal)
      port 1: phy1 (internal)
      port 2: phy2 (internal)
      port 3: phy3 (internal)
      port 4: phy7
      port 5: phy4
      port 6: phy6
      port 9: phy5
      Reviewed-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Signed-off-by: default avatarQuentin Schulz <quentin.schulz@bootlin.com>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/20869/
      Cc: ralf@linux-mips.org
      Cc: jhogan@kernel.org
      Cc: robh+dt@kernel.org
      Cc: mark.rutland@arm.com
      Cc: davem@davemloft.net
      Cc: andrew@lunn.ch
      Cc: f.fainelli@gmail.com
      Cc: allan.nielsen@microchip.com
      Cc: linux-mips@linux-mips.org
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: thomas.petazzoni@bootlin.com
      Cc: antoine.tenart@bootlin.com
      116edf6e
    • Maciej W. Rozycki's avatar
      MIPS: memset: Limit excessive `noreorder' assembly mode use · 68dec269
      Maciej W. Rozycki authored
      Rewrite to use the `reorder' assembly mode and remove manually scheduled
      delay slots except where GAS cannot schedule a delay-slot instruction
      due to a data dependency or a section switch (as is the case with the EX
      macro).  No change in machine code produced.
      Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      [paul.burton@mips.com:
        Fix conflict with commit 932afdee ("MIPS: Add Kconfig variable for
        CPUs with unaligned load/store instructions")]
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/20834/
      Cc: Ralf Baechle <ralf@linux-mips.org>
      68dec269
    • Maciej W. Rozycki's avatar
      MIPS: memset: Fix CPU_DADDI_WORKAROUNDS `small_fixup' regression · 2f7619ae
      Maciej W. Rozycki authored
      Fix a commit 8a8158c8 ("MIPS: memset.S: EVA & fault support for
      small_memset") regression and remove assembly warnings:
      
      arch/mips/lib/memset.S: Assembler messages:
      arch/mips/lib/memset.S:243: Warning: Macro instruction expanded into multiple instructions in a branch delay slot
      
      triggering with the CPU_DADDI_WORKAROUNDS option set and this code:
      
      	PTR_SUBU	a2, t1, a0
      	jr		ra
      	 PTR_ADDIU	a2, 1
      
      This is because with that option in place the DADDIU instruction, which
      the PTR_ADDIU CPP macro expands to, becomes a GAS macro, which in turn
      expands to an LI/DADDU (or actually ADDIU/DADDU) sequence:
      
       13c:	01a4302f 	dsubu	a2,t1,a0
       140:	03e00008 	jr	ra
       144:	24010001 	li	at,1
       148:	00c1302d 	daddu	a2,a2,at
      	...
      
      Correct this by switching off the `noreorder' assembly mode and letting
      GAS schedule this jump's delay slot, as there is nothing special about
      it that would require manual scheduling.  With this change in place
      correct code is produced:
      
       13c:	01a4302f 	dsubu	a2,t1,a0
       140:	24010001 	li	at,1
       144:	03e00008 	jr	ra
       148:	00c1302d 	daddu	a2,a2,at
      	...
      Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Fixes: 8a8158c8 ("MIPS: memset.S: EVA & fault support for small_memset")
      Patchwork: https://patchwork.linux-mips.org/patch/20833/
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: stable@vger.kernel.org # 4.17+
      2f7619ae
  2. 28 Sep, 2018 2 commits
  3. 26 Sep, 2018 5 commits
  4. 25 Sep, 2018 2 commits
  5. 22 Sep, 2018 4 commits
  6. 21 Sep, 2018 1 commit
  7. 20 Sep, 2018 1 commit
  8. 18 Sep, 2018 2 commits
    • Huacai Chen's avatar
      MIPS: Loongson-3: Enable Store Fill Buffer at runtime · c824ad16
      Huacai Chen authored
      New Loongson-3 (Loongson-3A R2, Loongson-3A R3, and newer) has SFB
      (Store Fill Buffer) which can improve the performance of memory access.
      Now, SFB enablement is controlled by CONFIG_LOONGSON3_ENHANCEMENT, and
      the generic kernel has no benefit from SFB (even it is running on a new
      Loongson-3 machine). With this patch, we can enable SFB at runtime by
      detecting the CPU type (the expense is war_io_reorder_wmb() will always
      be a 'sync', which will hurt the performance of old Loongson-3).
      
      [paul.burton@mips.com: Further info from Huacai:
        In practise, I found that sometimes there are boot failures if I
        enable SFB/LPA in cpu_probe(). I don't know why because processor
        designers also haven't give me an explaination, but I think this may
        have some relationships to speculative execution.]
      Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/20426/
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Cc: Huacai Chen <chenhuacai@gmail.com>
      c824ad16
    • Huacai Chen's avatar
      MIPS/PCI: Call pcie_bus_configure_settings() to set MPS/MRRS · 2794f688
      Huacai Chen authored
      Call pcie_bus_configure_settings() on MIPS, like for other platforms.
      The function pcie_bus_configure_settings() makes sure the MPS (Max
      Payload Size) across the bus is uniform and provides the ability to
      tune the MRSS (Max Read Request Size) and MPS (Max Payload Size) to
      higher performance values. Some devices will not operate properly if
      these aren't set correctly because the firmware doesn't always do it.
      Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/20649/
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Cc: Huacai Chen <chenhuacai@gmail.com>
      2794f688
  9. 14 Sep, 2018 1 commit
    • Mike Rapoport's avatar
      mips: switch to NO_BOOTMEM · bcec54bf
      Mike Rapoport authored
      MIPS already has memblock support and all the memory is already registered
      with it.
      
      This patch replaces bootmem memory reservations with memblock ones and
      removes the bootmem initialization.
      
      Since memblock allocates memory in top-down mode, we ensure that memblock
      limit is max_low_pfn to prevent allocations from the high memory.
      
      To have the exceptions base in the lower 512M of the physical memory, its
      allocation in arch/mips/kernel/traps.c::traps_init() is using bottom-up
      mode.
      Signed-off-by: default avatarMike Rapoport <rppt@linux.vnet.ibm.com>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/20560/
      Cc: Serge Semin <fancer.lancer@gmail.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-mm@kvack.org
      Cc: linux-kernel@vger.kernel.org
      bcec54bf
  10. 06 Sep, 2018 2 commits
  11. 05 Sep, 2018 2 commits
  12. 31 Aug, 2018 2 commits
  13. 30 Aug, 2018 4 commits
    • Mathias Kresin's avatar
      MIPS: ralink: Add rt3352 SPI_CS1 pinmux · 35d01794
      Mathias Kresin authored
      The rt3352 has a pin that can be used as second spi chip select,
      watchdog reset or GPIO. The pinmux setup was missing the definition of
      said pin.
      
      The pin is configured via the same bit on rt5350, so reuse the existing
      macro.
      Signed-off-by: default avatarMathias Kresin <dev@kresin.me>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/20301/
      Cc: John Crispin <john@phrozen.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      35d01794
    • Paul Burton's avatar
      MIPS: Remove SLOW_DOWN_IO · e966d308
      Paul Burton authored
      arch/mips appears to have inherited SLOW_DOWN_IO from arch/x86 in
      antiquity, but we never define CONF_SLOWDOWN_IO so this is unused code.
      
      Perhaps it was once useful to keep the MIPS header close to the x86
      version to ease comparisons or porting changes, but they've diverged
      significantly at this point & x86 does this differently now anyway.
      
      Delete the dead code.
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/20343/
      Cc: linux-mips@linux-mips.org
      e966d308
    • Paul Burton's avatar
      MIPS: Use GENERIC_IOMAP · b962aeb0
      Paul Burton authored
      MIPS has a copy of lib/iomap.c with minor alterations, none of which are
      necessary given appropriate definitions of PIO_OFFSET, PIO_MASK &
      PIO_RESERVED. Provide such definitions, select GENERIC_IOMAP & remove
      arch/mips/lib/iomap.c to cut back on the needless duplication.
      
      The one change this does make is to our mmio_{in,out}s[bwl] functions,
      which began to deviate from their generic counterparts with commit
      0845bb72 ("MIPS: iomap: Use __mem_{read,write}{b,w,l} for MMIO"). I
      suspect that this commit was incorrect, and that the SEAD-3 platform
      should have instead selected CONFIG_SWAP_IO_SPACE. Since the SEAD-3
      platform code is now gone & the board is instead supported by the
      generic platform (CONFIG_MIPS_GENERIC) which selects
      CONFIG_SWAP_IO_SPACE anyway, this shouldn't be a problem any more.
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/20342/
      Cc: linux-mips@linux-mips.org
      b962aeb0
    • Paul Burton's avatar
      MIPS: Use a custom elf-entry program to find kernel entry point · e245767a
      Paul Burton authored
      For a long time arch/mips/Makefile used nm to discover the kernel entry
      point by looking for the address of the kernel_entry symbol. This
      doesn't work for systems which make use of bit 0 of the PC to reflect
      the ISA mode - ie. microMIPS (and MIPS16, but we don't support building
      kernels that target MIPS16 anyway).
      
      So for a while with commit 5fc9484f ("MIPS: Set ISA bit in entry-y
      for microMIPS kernels") we manually modified the last nibble of the
      output from nm, which worked but wasn't particularly pretty.
      
      Commit 27c524d1 ("MIPS: Use the entry point from the ELF file
      header") then cleaned this up by using objdump to print the ELF entry
      point which includes the ISA bit, rather than using nm to print the
      address of the kernel_entry symbol which doesn't. That removed the ugly
      replacement of the last nibble, but added its own ugliness by needing to
      manually sign extend in the 32 bit case.
      
      Unfortunately it has been pointed out that objdump's output is
      localised, and therefore grepping for its "start address" output doesn't
      work when the user's language settings are such that objdump doesn't
      print in English.
      
      We could simply revert commit 27c524d1 ("MIPS: Use the entry point
      from the ELF file header") and return to the manual replacement of the
      last nibble of entry-y, but it seems that was found sufficiently
      unpalatable to avoid. We could attempt to force the language used by
      objdump by setting an environment variable such as LC_ALL, but that
      seems fragile. Instead we add a small tool named elf-entry which simply
      prints out the entry point of the kernel in the format we require.
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Reported-by: default avatarPhilippe Reynes <philippe.reynes@softathome.com>
      Tested-by: default avatarPhilippe Reynes <philippe.reynes@softathome.com>
      Fixes: 27c524d1 ("MIPS: Use the entry point from the ELF file header")
      Patchwork: https://patchwork.linux-mips.org/patch/20322/
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      e245767a
  14. 29 Aug, 2018 1 commit
  15. 28 Aug, 2018 2 commits
  16. 26 Aug, 2018 3 commits
    • Linus Torvalds's avatar
      Linux 4.19-rc1 · 5b394b2d
      Linus Torvalds authored
      5b394b2d
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b933d6eb
      Linus Torvalds authored
      Pull timer update from Thomas Gleixner:
       "New defines for the compat time* types so they can be shared between
        32bit and 64bit builds. Not used yet, but merging them now allows the
        actual conversions to be merged through different maintainer trees
        without dependencies
      
        We still have compat interfaces for 32bit on 64bit even with the new
        2038 safe timespec/val variants because pointer size is different. And
        for the old style timespec/val interfaces we need yet another 'compat'
        interface for both 32bit native and 32bit on 64bit"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        y2038: Provide aliases for compat helpers
      b933d6eb
    • Linus Torvalds's avatar
      Merge branch 'ida-4.19' of git://git.infradead.org/users/willy/linux-dax · aba16dc5
      Linus Torvalds authored
      Pull IDA updates from Matthew Wilcox:
       "A better IDA API:
      
            id = ida_alloc(ida, GFP_xxx);
            ida_free(ida, id);
      
        rather than the cumbersome ida_simple_get(), ida_simple_remove().
      
        The new IDA API is similar to ida_simple_get() but better named.  The
        internal restructuring of the IDA code removes the bitmap
        preallocation nonsense.
      
        I hope the net -200 lines of code is convincing"
      
      * 'ida-4.19' of git://git.infradead.org/users/willy/linux-dax: (29 commits)
        ida: Change ida_get_new_above to return the id
        ida: Remove old API
        test_ida: check_ida_destroy and check_ida_alloc
        test_ida: Convert check_ida_conv to new API
        test_ida: Move ida_check_max
        test_ida: Move ida_check_leaf
        idr-test: Convert ida_check_nomem to new API
        ida: Start new test_ida module
        target/iscsi: Allocate session IDs from an IDA
        iscsi target: fix session creation failure handling
        drm/vmwgfx: Convert to new IDA API
        dmaengine: Convert to new IDA API
        ppc: Convert vas ID allocation to new IDA API
        media: Convert entity ID allocation to new IDA API
        ppc: Convert mmu context allocation to new IDA API
        Convert net_namespace to new IDA API
        cb710: Convert to new IDA API
        rsxx: Convert to new IDA API
        osd: Convert to new IDA API
        sd: Convert to new IDA API
        ...
      aba16dc5