Merge tag 'mips_5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 29 Apr 2021 18:28:08 +0000 (11:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 29 Apr 2021 18:28:08 +0000 (11:28 -0700)
Pull MIPS updates from Thomas Bogendoerfer:

 - removed get_fs/set_fs

 - removed broken/unmaintained MIPS KVM trap and emulate support

 - added support for Loongson-2K1000

 - fixes and cleanups

* tag 'mips_5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (107 commits)
  MIPS: BCM63XX: Use BUG_ON instead of condition followed by BUG.
  MIPS: select ARCH_KEEP_MEMBLOCK unconditionally
  mips: Do not include hi and lo in clobber list for R6
  MIPS:DTS:Correct the license for Loongson-2K
  MIPS:DTS:Fix label name and interrupt number of ohci for Loongson-2K
  MIPS: Avoid handcoded DIVU in `__div64_32' altogether
  lib/math/test_div64: Correct the spelling of "dividend"
  lib/math/test_div64: Fix error message formatting
  mips/bootinfo:correct some comments of fw_arg
  MIPS: Avoid DIVU in `__div64_32' is result would be zero
  MIPS: Reinstate platform `__div64_32' handler
  div64: Correct inline documentation for `do_div'
  lib/math: Add a `do_div' test module
  MIPS: Makefile: Replace -pg with CC_FLAGS_FTRACE
  MIPS: pci-legacy: revert "use generic pci_enable_resources"
  MIPS: Loongson64: Add kexec/kdump support
  MIPS: pci-legacy: use generic pci_enable_resources
  MIPS: pci-legacy: remove busn_resource field
  MIPS: pci-legacy: remove redundant info messages
  MIPS: pci-legacy: stop using of_pci_range_to_resource
  ...

1  2 
arch/mips/configs/malta_kvm_defconfig
arch/mips/configs/maltaup_xpa_defconfig
arch/mips/ralink/mt7621.c
lib/Kconfig.debug

@@@ -232,15 -232,13 +232,12 @@@ CONFIG_MTD_PHYSMAP_OF=
  CONFIG_MTD_UBI=m
  CONFIG_MTD_UBI_GLUEBI=m
  CONFIG_BLK_DEV_FD=m
 -CONFIG_BLK_DEV_UMEM=m
  CONFIG_BLK_DEV_LOOP=m
  CONFIG_BLK_DEV_CRYPTOLOOP=m
  CONFIG_BLK_DEV_NBD=m
  CONFIG_BLK_DEV_RAM=y
  CONFIG_CDROM_PKTCDVD=m
  CONFIG_ATA_OVER_ETH=m
- CONFIG_IDE=y
- CONFIG_BLK_DEV_IDECD=y
- CONFIG_BLK_DEV_TC86C001=m
  CONFIG_RAID_ATTRS=m
  CONFIG_BLK_DEV_SD=y
  CONFIG_CHR_DEV_ST=m
@@@ -230,15 -230,13 +230,12 @@@ CONFIG_MTD_PHYSMAP_OF=
  CONFIG_MTD_UBI=m
  CONFIG_MTD_UBI_GLUEBI=m
  CONFIG_BLK_DEV_FD=m
 -CONFIG_BLK_DEV_UMEM=m
  CONFIG_BLK_DEV_LOOP=m
  CONFIG_BLK_DEV_CRYPTOLOOP=m
  CONFIG_BLK_DEV_NBD=m
  CONFIG_BLK_DEV_RAM=y
  CONFIG_CDROM_PKTCDVD=m
  CONFIG_ATA_OVER_ETH=m
- CONFIG_IDE=y
- CONFIG_BLK_DEV_IDECD=y
- CONFIG_BLK_DEV_TC86C001=m
  CONFIG_RAID_ATTRS=m
  CONFIG_BLK_DEV_SD=y
  CONFIG_CHR_DEV_ST=m
@@@ -9,7 -9,9 +9,9 @@@
  #include <linux/init.h>
  #include <linux/slab.h>
  #include <linux/sys_soc.h>
+ #include <linux/memblock.h>
  
+ #include <asm/bootinfo.h>
  #include <asm/mipsregs.h>
  #include <asm/smp-ops.h>
  #include <asm/mips-cps.h>
@@@ -49,6 -51,8 +51,8 @@@
  #define MT7621_GPIO_MODE_SDHCI_SHIFT  18
  #define MT7621_GPIO_MODE_SDHCI_GPIO   1
  
+ static void *detect_magic __initdata = detect_memory_region;
  static struct rt2880_pmx_func uart1_grp[] =  { FUNC("uart1", 0, 1, 2) };
  static struct rt2880_pmx_func i2c_grp[] =  { FUNC("i2c", 0, 3, 2) };
  static struct rt2880_pmx_func uart3_grp[] = {
@@@ -110,10 -114,30 +114,30 @@@ phys_addr_t mips_cpc_default_phys_base(
        panic("Cannot detect cpc address");
  }
  
+ static void __init mt7621_memory_detect(void)
+ {
+       void *dm = &detect_magic;
+       phys_addr_t size;
+       for (size = 32 * SZ_1M; size < 256 * SZ_1M; size <<= 1) {
+               if (!__builtin_memcmp(dm, dm + size, sizeof(detect_magic)))
+                       break;
+       }
+       if ((size == 256 * SZ_1M) &&
+           (CPHYSADDR(dm + size) < MT7621_LOWMEM_MAX_SIZE) &&
+           __builtin_memcmp(dm, dm + size, sizeof(detect_magic))) {
+               memblock_add(MT7621_LOWMEM_BASE, MT7621_LOWMEM_MAX_SIZE);
+               memblock_add(MT7621_HIGHMEM_BASE, MT7621_HIGHMEM_SIZE);
+       } else {
+               memblock_add(MT7621_LOWMEM_BASE, size);
+       }
+ }
  void __init ralink_of_remap(void)
  {
 -      rt_sysc_membase = plat_of_remap_node("mtk,mt7621-sysc");
 -      rt_memc_membase = plat_of_remap_node("mtk,mt7621-memc");
 +      rt_sysc_membase = plat_of_remap_node("mediatek,mt7621-sysc");
 +      rt_memc_membase = plat_of_remap_node("mediatek,mt7621-memc");
  
        if (!rt_sysc_membase || !rt_memc_membase)
                panic("Failed to remap core resources");
@@@ -146,7 -170,7 +170,7 @@@ static void soc_dev_init(struct ralink_
        }
  }
  
- void prom_soc_init(struct ralink_soc_info *soc_info)
+ void __init prom_soc_init(struct ralink_soc_info *soc_info)
  {
        void __iomem *sysc = (void __iomem *) KSEG1ADDR(MT7621_SYSC_BASE);
        unsigned char *name = NULL;
  
        if (n0 == MT7621_CHIP_NAME0 && n1 == MT7621_CHIP_NAME1) {
                name = "MT7621";
 -              soc_info->compatible = "mtk,mt7621-soc";
 +              soc_info->compatible = "mediatek,mt7621-soc";
        } else {
                panic("mt7621: unknown SoC, n0:%08x n1:%08x\n", n0, n1);
        }
                (rev >> CHIP_REV_VER_SHIFT) & CHIP_REV_VER_MASK,
                (rev & CHIP_REV_ECO_MASK));
  
-       soc_info->mem_size_min = MT7621_DDR2_SIZE_MIN;
-       soc_info->mem_size_max = MT7621_DDR2_SIZE_MAX;
-       soc_info->mem_base = MT7621_DRAM_BASE;
+       soc_info->mem_detect = mt7621_memory_detect;
        rt2880_pinmux_data = mt7621_pinmux_data;
  
        soc_dev_init(soc_info, rev);
diff --combined lib/Kconfig.debug
@@@ -1363,53 -1363,13 +1363,53 @@@ config LOCKDE
        bool
        depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
        select STACKTRACE
 -      select FRAME_POINTER if !MIPS && !PPC && !ARM && !S390 && !MICROBLAZE && !ARC && !X86
 +      depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86
        select KALLSYMS
        select KALLSYMS_ALL
  
  config LOCKDEP_SMALL
        bool
  
 +config LOCKDEP_BITS
 +      int "Bitsize for MAX_LOCKDEP_ENTRIES"
 +      depends on LOCKDEP && !LOCKDEP_SMALL
 +      range 10 30
 +      default 15
 +      help
 +        Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!" message.
 +
 +config LOCKDEP_CHAINS_BITS
 +      int "Bitsize for MAX_LOCKDEP_CHAINS"
 +      depends on LOCKDEP && !LOCKDEP_SMALL
 +      range 10 30
 +      default 16
 +      help
 +        Try increasing this value if you hit "BUG: MAX_LOCKDEP_CHAINS too low!" message.
 +
 +config LOCKDEP_STACK_TRACE_BITS
 +      int "Bitsize for MAX_STACK_TRACE_ENTRIES"
 +      depends on LOCKDEP && !LOCKDEP_SMALL
 +      range 10 30
 +      default 19
 +      help
 +        Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too low!" message.
 +
 +config LOCKDEP_STACK_TRACE_HASH_BITS
 +      int "Bitsize for STACK_TRACE_HASH_SIZE"
 +      depends on LOCKDEP && !LOCKDEP_SMALL
 +      range 10 30
 +      default 14
 +      help
 +        Try increasing this value if you need large MAX_STACK_TRACE_ENTRIES.
 +
 +config LOCKDEP_CIRCULAR_QUEUE_BITS
 +      int "Bitsize for elements in circular_queue struct"
 +      depends on LOCKDEP
 +      range 10 30
 +      default 12
 +      help
 +        Try increasing this value if you hit "lockdep bfs error:-1" warning due to __cq_enqueue() failure.
 +
  config DEBUG_LOCKDEP
        bool "Lock dependency engine debugging"
        depends on DEBUG_KERNEL && LOCKDEP
@@@ -1705,11 -1665,12 +1705,11 @@@ config LATENCYTO
        depends on DEBUG_KERNEL
        depends on STACKTRACE_SUPPORT
        depends on PROC_FS
 -      select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86
 +      depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86
        select KALLSYMS
        select KALLSYMS_ALL
        select STACKTRACE
        select SCHEDSTATS
 -      select SCHED_DEBUG
        help
          Enable this option if you want to use the LatencyTOP tool
          to find out which userspace is blocking on what kernel operations.
@@@ -1957,7 -1918,7 +1957,7 @@@ config FAULT_INJECTION_STACKTRACE_FILTE
        depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
        depends on !X86_64
        select STACKTRACE
 -      select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86
 +      depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86
        help
          Provide stacktrace filter for fault-injection capabilities
  
@@@ -2066,6 -2027,16 +2066,16 @@@ config TEST_SOR
  
          If unsure, say N.
  
+ config TEST_DIV64
+       tristate "64bit/32bit division and modulo test"
+       depends on DEBUG_KERNEL || m
+       help
+         Enable this to turn on 'do_div()' function test. This test is
+         executed only once during system boot (so affects only boot time),
+         or at module load time.
+         If unsure, say N.
  config KPROBES_SANITY_TEST
        bool "Kprobes sanity tests"
        depends on DEBUG_KERNEL