Merge tag 'for-linus' of git://github.com/openrisc/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 Nov 2017 20:12:00 +0000 (12:12 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 Nov 2017 20:12:00 +0000 (12:12 -0800)
Pull OpenRISC updates from Stafford Horne:
 "The OpenRISC work is a bit more interesting this time, adding SMP
  support and a few general cleanups.

  Small Things:

   - Move OpenRISC docs into Documentation and clean them up

   - Document previously undocumented devicetree bindings

   - Update the or1ksim dts to use stdout-path

  OpenRISC SMP support details:

   - First the "use shadow registers" and "define CPU_BIG_ENDIAN as
     true" get the architecture ready for SMP.

   - The "add 1 and 2 byte cmpxchg support" and "use qspinlocks and
     qrwlocks" add the SMP locking infrastructure as needed. Using the
     qspinlocks and qrwlocks as suggested by Peter Z while reviewing the
     original spinlocks implementation.

   - The "support for ompic" adds a new irqchip device which is used for
     IPI communication to support SMP.

   - The "initial SMP support" adds smp.c and makes changes to all of
     the necessary data-structures to be per-cpu.

  The remaining patches are bug fixes and debug helpers which I wanted
  to keep separate from the "initial SMP support" in order to allow them
  to be reviewed on their own. This includes:

   - add cacheflush support to fix icache aliasing

   - fix initial preempt state for secondary cpu tasks

   - sleep instead of spin on secondary wait

   - support framepointers and STACKTRACE_SUPPORT

   - enable LOCKDEP_SUPPORT and irqflags tracing

   - timer sync: Add tick timer sync logic

   - fix possible deadlock in timer sync, pointed out by mips guys

  Note: the irqchip patch was reviewed with Marc and we agreed to push
  it together with these patches"

* tag 'for-linus' of git://github.com/openrisc/linux:
  openrisc: fix possible deadlock scenario during timer sync
  openrisc: pass endianness info to sparse
  openrisc: add tick timer multi-core sync logic
  openrisc: enable LOCKDEP_SUPPORT and irqflags tracing
  openrisc: support framepointers and STACKTRACE_SUPPORT
  openrisc: add simple_smp dts and defconfig for simulators
  openrisc: add cacheflush support to fix icache aliasing
  openrisc: sleep instead of spin on secondary wait
  openrisc: fix initial preempt state for secondary cpu tasks
  openrisc: initial SMP support
  irqchip: add initial support for ompic
  dt-bindings: add openrisc to vendor prefixes list
  openrisc: use qspinlocks and qrwlocks
  openrisc: add 1 and 2 byte cmpxchg support
  openrisc: use shadow registers to save regs on exception
  dt-bindings: openrisc: Add OpenRISC platform SoC
  Documentation: openrisc: Updates to README
  Documentation: Move OpenRISC docs out of arch/
  MAINTAINERS: Add OpenRISC pic maintainer
  openrisc: dts: or1ksim: Add stdout-path

1  2 
MAINTAINERS
arch/openrisc/Kconfig
arch/openrisc/boot/dts/or1ksim.dts
arch/openrisc/kernel/Makefile
drivers/irqchip/Makefile

diff --combined MAINTAINERS
@@@ -873,7 -873,7 +873,7 @@@ F: drivers/android
  F:    drivers/staging/android/
  
  ANDROID GOLDFISH RTC DRIVER
 -M:    Miodrag Dinic <miodrag.dinic@imgtec.com>
 +M:    Miodrag Dinic <miodrag.dinic@mips.com>
  S:    Supported
  F:    Documentation/devicetree/bindings/rtc/google,goldfish-rtc.txt
  F:    drivers/rtc/rtc-goldfish.c
@@@ -4234,7 -4234,7 +4234,7 @@@ S:      Maintaine
  F:    drivers/dma/
  F:    include/linux/dmaengine.h
  F:    Documentation/devicetree/bindings/dma/
 -F:    Documentation/dmaengine/
 +F:    Documentation/driver-api/dmaengine/
  T:    git git://git.infradead.org/users/vkoul/slave-dma.git
  
  DMA MAPPING HELPERS
@@@ -4906,19 -4906,13 +4906,19 @@@ L:   linux-edac@vger.kernel.or
  S:    Maintained
  F:    drivers/edac/highbank*
  
 -EDAC-CAVIUM
 +EDAC-CAVIUM OCTEON
  M:    Ralf Baechle <ralf@linux-mips.org>
  M:    David Daney <david.daney@cavium.com>
  L:    linux-edac@vger.kernel.org
  L:    linux-mips@linux-mips.org
  S:    Supported
  F:    drivers/edac/octeon_edac*
 +
 +EDAC-CAVIUM THUNDERX
 +M:    David Daney <david.daney@cavium.com>
 +M:    Jan Glauber <jglauber@cavium.com>
 +L:    linux-edac@vger.kernel.org
 +S:    Supported
  F:    drivers/edac/thunderx_edac*
  
  EDAC-CORE
@@@ -5219,7 -5213,8 +5219,7 @@@ F:      fs/ext4
  
  Extended Verification Module (EVM)
  M:    Mimi Zohar <zohar@linux.vnet.ibm.com>
 -L:    linux-ima-devel@lists.sourceforge.net
 -L:    linux-security-module@vger.kernel.org
 +L:    linux-integrity@vger.kernel.org
  S:    Supported
  F:    security/integrity/evm/
  
@@@ -6676,7 -6671,7 +6676,7 @@@ F:      include/net/ieee802154_netdev.
  F:    Documentation/networking/ieee802154.txt
  
  IFE PROTOCOL
 -M:    Yotam Gigi <yotamg@mellanox.com>
 +M:    Yotam Gigi <yotam.gi@gmail.com>
  M:    Jamal Hadi Salim <jhs@mojatatu.com>
  F:    net/ife
  F:    include/net/ife.h
@@@ -6738,7 -6733,7 +6738,7 @@@ S:      Maintaine
  F:    drivers/usb/atm/ueagle-atm.c
  
  IMGTEC ASCII LCD DRIVER
 -M:    Paul Burton <paul.burton@imgtec.com>
 +M:    Paul Burton <paul.burton@mips.com>
  S:    Maintained
  F:    Documentation/devicetree/bindings/auxdisplay/img-ascii-lcd.txt
  F:    drivers/auxdisplay/img-ascii-lcd.c
@@@ -6846,7 -6841,9 +6846,7 @@@ L:      linux-crypto@vger.kernel.or
  INTEGRITY MEASUREMENT ARCHITECTURE (IMA)
  M:    Mimi Zohar <zohar@linux.vnet.ibm.com>
  M:    Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
 -L:    linux-ima-devel@lists.sourceforge.net
 -L:    linux-ima-user@lists.sourceforge.net
 -L:    linux-security-module@vger.kernel.org
 +L:    linux-integrity@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git
  S:    Supported
  F:    security/integrity/ima/
@@@ -7629,7 -7626,8 +7629,7 @@@ F:      kernel/kexec
  
  KEYS-ENCRYPTED
  M:    Mimi Zohar <zohar@linux.vnet.ibm.com>
 -M:    David Safford <safford@us.ibm.com>
 -L:    linux-security-module@vger.kernel.org
 +L:    linux-integrity@vger.kernel.org
  L:    keyrings@vger.kernel.org
  S:    Supported
  F:    Documentation/security/keys/trusted-encrypted.rst
@@@ -7637,8 -7635,9 +7637,8 @@@ F:      include/keys/encrypted-type.
  F:    security/keys/encrypted-keys/
  
  KEYS-TRUSTED
 -M:    David Safford <safford@us.ibm.com>
  M:    Mimi Zohar <zohar@linux.vnet.ibm.com>
 -L:    linux-security-module@vger.kernel.org
 +L:    linux-integrity@vger.kernel.org
  L:    keyrings@vger.kernel.org
  S:    Supported
  F:    Documentation/security/keys/trusted-encrypted.rst
@@@ -7746,11 -7745,6 +7746,11 @@@ S:    Maintaine
  F:    Documentation/scsi/53c700.txt
  F:    drivers/scsi/53c700*
  
 +LEAKING_ADDRESSES
 +M:    Tobin C. Harding <me@tobin.cc>
 +S:    Maintained
 +F:    scripts/leaking_addresses.pl
 +
  LED SUBSYSTEM
  M:    Richard Purdie <rpurdie@rpsys.net>
  M:    Jacek Anaszewski <jacek.anaszewski@gmail.com>
@@@ -8749,7 -8743,7 +8749,7 @@@ Q:      http://patchwork.ozlabs.org/project/
  F:    drivers/net/ethernet/mellanox/mlxsw/
  
  MELLANOX FIRMWARE FLASH LIBRARY (mlxfw)
 -M:    Yotam Gigi <yotamg@mellanox.com>
 +M:    mlxsw@mellanox.com
  L:    netdev@vger.kernel.org
  S:    Supported
  W:    http://www.mellanox.com
@@@ -8999,7 -8993,7 +8999,7 @@@ F:      Documentation/mips
  F:    arch/mips/
  
  MIPS BOSTON DEVELOPMENT BOARD
 -M:    Paul Burton <paul.burton@imgtec.com>
 +M:    Paul Burton <paul.burton@mips.com>
  L:    linux-mips@linux-mips.org
  S:    Maintained
  F:    Documentation/devicetree/bindings/clock/img,boston-clock.txt
@@@ -9009,7 -9003,7 +9009,7 @@@ F:      drivers/clk/imgtec/clk-boston.
  F:    include/dt-bindings/clock/boston-clock.h
  
  MIPS GENERIC PLATFORM
 -M:    Paul Burton <paul.burton@imgtec.com>
 +M:    Paul Burton <paul.burton@mips.com>
  L:    linux-mips@linux-mips.org
  S:    Supported
  F:    arch/mips/generic/
@@@ -9025,7 -9019,7 +9025,7 @@@ F:      drivers/*/*loongson1
  F:    drivers/*/*/*loongson1*
  
  MIPS RINT INSTRUCTION EMULATION
 -M:    Aleksandar Markovic <aleksandar.markovic@imgtec.com>
 +M:    Aleksandar Markovic <aleksandar.markovic@mips.com>
  L:    linux-mips@linux-mips.org
  S:    Supported
  F:    arch/mips/math-emu/sp_rint.c
@@@ -10037,7 -10031,11 +10037,11 @@@ T: git git://github.com/openrisc/linux.
  L:    openrisc@lists.librecores.org
  W:    http://openrisc.io
  S:    Maintained
+ F:    Documentation/devicetree/bindings/openrisc/
+ F:    Documentation/openrisc/
  F:    arch/openrisc/
+ F:    drivers/irqchip/irq-ompic.c
+ F:    drivers/irqchip/irq-or1k-*
  
  OPENVSWITCH
  M:    Pravin Shelar <pshelar@nicira.com>
@@@ -10185,6 -10183,7 +10189,6 @@@ F:   Documentation/parport*.tx
  
  PARAVIRT_OPS INTERFACE
  M:    Juergen Gross <jgross@suse.com>
 -M:    Chris Wright <chrisw@sous-sol.org>
  M:    Alok Kataria <akataria@vmware.com>
  M:    Rusty Russell <rusty@rustcorp.com.au>
  L:    virtualization@lists.linux-foundation.org
@@@ -10342,6 -10341,7 +10346,6 @@@ F:   drivers/pci/host/vmd.
  
  PCI DRIVER FOR MICROSEMI SWITCHTEC
  M:    Kurt Schwemmer <kurt.schwemmer@microsemi.com>
 -M:    Stephen Bates <stephen.bates@microsemi.com>
  M:    Logan Gunthorpe <logang@deltatee.com>
  L:    linux-pci@vger.kernel.org
  S:    Maintained
@@@ -10406,7 -10406,6 +10410,7 @@@ F:   drivers/pci/dwc/*keystone
  
  PCI ENDPOINT SUBSYSTEM
  M:    Kishon Vijay Abraham I <kishon@ti.com>
 +M:    Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
  L:    linux-pci@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kishon/pci-endpoint.git
  S:    Supported
@@@ -10458,15 -10457,6 +10462,15 @@@ F: include/linux/pci
  F:    arch/x86/pci/
  F:    arch/x86/kernel/quirks.c
  
 +PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS
 +M:    Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
 +L:    linux-pci@vger.kernel.org
 +Q:    http://patchwork.ozlabs.org/project/linux-pci/list/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/
 +S:    Supported
 +F:    drivers/pci/host/
 +F:    drivers/pci/dwc/
 +
  PCIE DRIVER FOR AXIS ARTPEC
  M:    Niklas Cassel <niklas.cassel@axis.com>
  M:    Jesper Nilsson <jesper.nilsson@axis.com>
@@@ -10486,6 -10476,7 +10490,6 @@@ F:   drivers/pci/host/pci-thunder-
  
  PCIE DRIVER FOR HISILICON
  M:    Zhou Wang <wangzhou1@hisilicon.com>
 -M:    Gabriele Paoloni <gabriele.paoloni@huawei.com>
  L:    linux-pci@vger.kernel.org
  S:    Maintained
  F:    Documentation/devicetree/bindings/pci/hisilicon-pcie.txt
@@@ -10697,9 -10688,10 +10701,9 @@@ S:  Maintaine
  F:    drivers/pinctrl/spear/
  
  PISTACHIO SOC SUPPORT
 -M:    James Hartley <james.hartley@imgtec.com>
 -M:    Ionela Voinescu <ionela.voinescu@imgtec.com>
 +M:    James Hartley <james.hartley@sondrel.com>
  L:    linux-mips@linux-mips.org
 -S:    Maintained
 +S:    Odd Fixes
  F:    arch/mips/pistachio/
  F:    arch/mips/include/asm/mach-pistachio/
  F:    arch/mips/boot/dts/img/pistachio*
@@@ -10903,7 -10895,7 +10907,7 @@@ S:   Maintaine
  F:    drivers/block/ps3vram.c
  
  PSAMPLE PACKET SAMPLING SUPPORT:
 -M:    Yotam Gigi <yotamg@mellanox.com>
 +M:    Yotam Gigi <yotam.gi@gmail.com>
  S:    Maintained
  F:    net/psample
  F:    include/net/psample.h
@@@ -12062,12 -12054,6 +12066,12 @@@ L: linux-mmc@vger.kernel.or
  S:    Maintained
  F:    drivers/mmc/host/sdhci-spear.c
  
 +SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) TI OMAP DRIVER
 +M:    Kishon Vijay Abraham I <kishon@ti.com>
 +L:    linux-mmc@vger.kernel.org
 +S:    Maintained
 +F:    drivers/mmc/host/sdhci-omap.c
 +
  SECURE ENCRYPTING DEVICE (SED) OPAL DRIVER
  M:    Scott Bauer <scott.bauer@intel.com>
  M:    Jonathan Derrick <jonathan.derrick@intel.com>
@@@ -13618,14 -13604,23 +13622,14 @@@ F:        drivers/platform/x86/toshiba-wmi.
  
  TPM DEVICE DRIVER
  M:    Peter Huewe <peterhuewe@gmx.de>
 -M:    Marcel Selhorst <tpmdd@selhorst.net>
  M:    Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
  R:    Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
 -W:    http://tpmdd.sourceforge.net
 -L:    tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers)
 -Q:    https://patchwork.kernel.org/project/tpmdd-devel/list/
 +L:    linux-integrity@vger.kernel.org
 +Q:    https://patchwork.kernel.org/project/linux-integrity/list/
  T:    git git://git.infradead.org/users/jjs/linux-tpmdd.git
  S:    Maintained
  F:    drivers/char/tpm/
  
 -TPM IBM_VTPM DEVICE DRIVER
 -M:    Ashley Lai <ashleydlai@gmail.com>
 -W:    http://tpmdd.sourceforge.net
 -L:    tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers)
 -S:    Maintained
 -F:    drivers/char/tpm/tpm_ibmvtpm*
 -
  TRACING
  M:    Steven Rostedt <rostedt@goodmis.org>
  M:    Ingo Molnar <mingo@redhat.com>
@@@ -14335,7 -14330,6 +14339,7 @@@ L:   virtualization@lists.linux-foundatio
  L:    kvm@vger.kernel.org
  S:    Supported
  F:    drivers/s390/virtio/
 +F:    arch/s390/include/uapi/asm/virtio-ccw.h
  
  VIRTIO GPU DRIVER
  M:    David Airlie <airlied@linux.ie>
diff --combined arch/openrisc/Kconfig
@@@ -1,4 -1,3 +1,4 @@@
 +# SPDX-License-Identifier: GPL-2.0
  #
  # For a description of the syntax of this configuration file,
  # see Documentation/kbuild/kconfig-language.txt.
@@@ -22,13 -21,19 +22,19 @@@ config OPENRIS
        select HAVE_UID16
        select GENERIC_ATOMIC64
        select GENERIC_CLOCKEVENTS
+       select GENERIC_CLOCKEVENTS_BROADCAST
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
+       select GENERIC_SMP_IDLE_THREAD
        select MODULES_USE_ELF_RELA
        select HAVE_DEBUG_STACKOVERFLOW
        select OR1K_PIC
        select CPU_NO_EFFICIENT_FFS if !OPENRISC_HAVE_INST_FF1
        select NO_BOOTMEM
+       select ARCH_USE_QUEUED_SPINLOCKS
+       select ARCH_USE_QUEUED_RWLOCKS
+       select OMPIC if SMP
+       select ARCH_WANT_FRAME_POINTERS
  
  config CPU_BIG_ENDIAN
        def_bool y
@@@ -56,6 -61,12 +62,12 @@@ config TRACE_IRQFLAGS_SUPPOR
  config GENERIC_CSUM
          def_bool y
  
+ config STACKTRACE_SUPPORT
+       def_bool y
+ config LOCKDEP_SUPPORT
+       def_bool  y
  source "init/Kconfig"
  
  source "kernel/Kconfig.freezer"
@@@ -73,6 -84,17 +85,17 @@@ config OR1K_120
  
  endchoice
  
+ config DCACHE_WRITETHROUGH
+       bool "Have write through data caches"
+       default n
+       help
+         Select this if your implementation features write through data caches.
+         Selecting 'N' here will allow the kernel to force flushing of data
+         caches at relevant times. Most OpenRISC implementations support write-
+         through data caches.
+         If unsure say N here
  config OPENRISC_BUILTIN_DTB
          string "Builtin DTB"
          default ""
@@@ -105,8 -127,19 +128,19 @@@ config OPENRISC_HAVE_INST_DI
  endmenu
  
  config NR_CPUS
-       int
-       default "1"
+       int "Maximum number of CPUs (2-32)"
+       range 2 32
+       depends on SMP
+       default "2"
+ config SMP
+       bool "Symmetric Multi-Processing support"
+       help
+         This enables support for systems with more than one CPU. If you have
+         a system with only one CPU, say N. If you have a system with more
+         than one CPU, say Y.
+         If you don't know what to do here, say N.
  
  source kernel/Kconfig.hz
  source kernel/Kconfig.preempt
@@@ -125,6 -158,17 +159,17 @@@ config OPENRISC_NO_SPR_SR_DS
          Say N here if you know that your OpenRISC processor has
          SPR_SR_DSX bit implemented. Say Y if you are unsure.
  
+ config OPENRISC_HAVE_SHADOW_GPRS
+       bool "Support for shadow gpr files" if !SMP
+       default y if SMP
+       help
+         Say Y here if your OpenRISC processor features shadowed
+         register files. They will in such case be used as a
+         scratch reg storage on exception entry.
+         On SMP systems, this feature is mandatory.
+         On a unicore system it's safe to say N here if you are unsure.
  config CMDLINE
          string "Default kernel command string"
          default ""
@@@ -1,4 -1,3 +1,4 @@@
 +// SPDX-License-Identifier: GPL-2.0
  /dts-v1/;
  / {
        compatible = "opencores,or1ksim";
@@@ -6,8 -5,13 +6,13 @@@
        #size-cells = <1>;
        interrupt-parent = <&pic>;
  
+       aliases {
+               uart0 = &serial0;
+       };
        chosen {
-               bootargs = "console=uart,mmio,0x90000000,115200";
+               bootargs = "earlycon";
+               stdout-path = "uart0:115200";
        };
  
        memory@0 {
@@@ -1,4 -1,3 +1,4 @@@
 +# SPDX-License-Identifier: GPL-2.0
  #
  # Makefile for the linux kernel.
  #
@@@ -7,8 -6,10 +7,10 @@@ extra-y        := head.o vmlinux.ld
  
  obj-y := setup.o or32_ksyms.o process.o dma.o \
           traps.o time.o irq.o entry.o ptrace.o signal.o \
-          sys_call_table.o
+          sys_call_table.o unwinder.o
  
+ obj-$(CONFIG_SMP)             += smp.o sync-timer.o
+ obj-$(CONFIG_STACKTRACE)      += stacktrace.o
  obj-$(CONFIG_MODULES)         += module.o
  obj-$(CONFIG_OF)              += prom.o
  
diff --combined drivers/irqchip/Makefile
@@@ -1,4 -1,3 +1,4 @@@
 +# SPDX-License-Identifier: GPL-2.0
  obj-$(CONFIG_IRQCHIP)                 += irqchip.o
  
  obj-$(CONFIG_ALPINE_MSI)              += irq-alpine-msi.o
@@@ -18,6 -17,7 +18,7 @@@ obj-$(CONFIG_DW_APB_ICTL)             += irq-dw-ap
  obj-$(CONFIG_METAG)                   += irq-metag-ext.o
  obj-$(CONFIG_METAG_PERFCOUNTER_IRQS)  += irq-metag.o
  obj-$(CONFIG_CLPS711X_IRQCHIP)                += irq-clps711x.o
+ obj-$(CONFIG_OMPIC)                   += irq-ompic.o
  obj-$(CONFIG_OR1K_PIC)                        += irq-or1k-pic.o
  obj-$(CONFIG_ORION_IRQCHIP)           += irq-orion.o
  obj-$(CONFIG_OMAP_IRQCHIP)            += irq-omap-intc.o