aboutsummaryrefslogtreecommitdiff
path: root/arch
AgeCommit message (Collapse)Author
2015-05-19Merge branch 'v3.18/topic/coresight' into linux-linaro-lsk-v3.18Kevin Hilman
* v3.18/topic/coresight: Revert "ARM: removing support for etb/etm in "arch/arm/kernel/""
2015-05-19Revert "ARM: removing support for etb/etm in "arch/arm/kernel/""Kevin Hilman
This reverts commit 912822468977962f8d510b170de61809ccb3d5e5. Leave the legacy driver in for LSK because Android uses it.
2015-05-15Merge branch 'v3.18/topic/for-stable' into linux-linaro-lsk-v3.18Kevin Hilman
* v3.18/topic/for-stable: arm64: psci: move psci firmware calls out of line ARM: 8307/1: psci: move psci firmware calls out of line Conflicts: arch/arm64/kernel/Makefile
2015-05-15arm64: psci: move psci firmware calls out of lineWill Deacon
An arm64 allmodconfig fails to build with GCC 5 due to __asmeq assertions in the PSCI firmware calling code firing due to mcount preambles breaking our assumptions about register allocation of function arguments: /tmp/ccDqJsJ6.s: Assembler messages: /tmp/ccDqJsJ6.s:60: Error: .err encountered /tmp/ccDqJsJ6.s:61: Error: .err encountered /tmp/ccDqJsJ6.s:62: Error: .err encountered /tmp/ccDqJsJ6.s:99: Error: .err encountered /tmp/ccDqJsJ6.s:100: Error: .err encountered /tmp/ccDqJsJ6.s:101: Error: .err encountered This patch fixes the issue by moving the PSCI calls out-of-line into their own assembly files, which are safe from the compiler's meddling fingers. Reported-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> (cherry picked from commit f5e0a12ca2d939e47995f73428d9bf1ad372b289) Cc: <stable@vger.kernel.org> # v3.18 Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-15ARM: 8307/1: psci: move psci firmware calls out of lineMark Rutland
arm64 builds with GCC 5 have caused the __asmeq assertions in the PSCI calling code to fire, so move the ARM PSCI calls out of line into their own assembly file for consistency and to safeguard against the same issue occuring with the 32-bit toolchain. [will: brought into line with arm64 implementation] Reported-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> (cherry picked from commit c097877319ab61dd045b6497953b4e3df8f2bb44) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-13Merge branch 'v3.18/topic/juno-dt' into linux-linaro-lsk-v3.18Kevin Hilman
* v3.18/topic/juno-dt: arm64: dts: add interrupt-affinity property to pmu node for juno arm64: juno: Fix misleading name of UART reference clock arm64: Add L2 cache topology to ARM Ltd boards/models arm64: dts: add baud rate to Juno stdout-path arm64: ARM: Fix the Generic Timers interrupt active level description arm64: Add Juno board device tree.
2015-05-13Merge branch 'v3.18/topic/arm64-dt' into linux-linaro-lsk-v3.18Kevin Hilman
* v3.18/topic/arm64-dt: arm64: Create link to include/dt-bindings to enable C preprocessor use. dts, arm64: Move dts files to vendor subdirs dts, kbuild: Implement support for dtb vendor subdirs dts, arm/arm64: Remove dtbs build rules in sub-makes dts, kbuild: Factor out dtbs install rules to Makefile.dtbinst dts, arm64: Add dtbs_install make target
2015-05-13arm64: dts: add interrupt-affinity property to pmu node for junoWill Deacon
Make the Juno .dts robust against potential reordering of the CPU nodes by adding an explicit interrupt-affinity property to the PMU node. While we're at it, fix the PMU interrupts numbers too. Cc: Mark Rutland <mark.rutland@arm.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Olof Johansson <olof@lixom.net> (cherry picked from commit 2b01311afc120ffb0ce5ec94721a77f05c84763f) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-13arm64: juno: Fix misleading name of UART reference clockDave Martin
The UART reference clock speed is 7273.8 kHz, not 72738 kHz. Dots aren't usually used in node names even though ePAPR permits them. However, this can easily be avoided by expressing the frequency in Hz, not kHz. This patch changes the name to refclk7273800hz, reflecting the actual clock speed. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Acked-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Olof Johansson <olof@lixom.net> (cherry picked from commit 78d84bc3734c2566dbba09baae2414734661ed6a) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-13arm64: Add L2 cache topology to ARM Ltd boards/modelsSudeep Holla
Commit 5d425c18653731af6 ("arm64: kernel: add support for cpu cache information") adds cacheinfo support for ARM64. Since there's no architectural way of detecting the cpus that share particular cache, device tree can be used and the core cacheinfo already supports the same. This patch adds the L2 cache topology on Juno board, FVP/RTSM and foundation models. Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Liviu Dudau <Liviu.Dudau@arm.com> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> (cherry picked from commit 7934d69abfa98392433c03136025b71972851733) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-13arm64: dts: add baud rate to Juno stdout-pathRobin Murphy
Without explicit command-line parameters, the Juno UART ends up running at 57600 baud in the kernel, which is at odds with the 115200 baud used by the rest of the firmware. Since commit 7914a7c5651a5161 now lets us fix this by specifying default options in stdout-path, do so. Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Olof Johansson <olof@lixom.net> (cherry picked from commit e0b21800107edbf73385a48275c1fd5a9ecaa4db) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-13arm64: ARM: Fix the Generic Timers interrupt active level descriptionLiviu Dudau
The Cortex-A5x TRM states in paragraph "9.2 Generic Timer functional description" that generic timers provide an active-LOW interrupt output. Fix the device trees to correctly describe this. While doing this update the CPU mask to match the number of described CPUs as well. Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> (cherry picked from commit 6bc474de366155c19d69966b45a7c06b8e2a9837) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-13arm64: Add Juno board device tree.Liviu Dudau
This adds support for ARM's Juno development board (rev 0). It enables most of the board peripherals: UART, I2C, USB, MMC and 100Mb ethernet. There is no support at the moment for clock setting and HDLCD driver which depends on it. Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> (cherry picked from commit 71f867ec130e3cc8e692366fdf8941ded27c727e) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-13arm64: Create link to include/dt-bindings to enable C preprocessor use.Liviu Dudau
DT files used in the compilation phase can be preprocessed by the C preprocessor. This requires an include/dt-bindings directory to be present in the arch/arm64/boot/dts directory. Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> (cherry picked from commit e9d4ac655b8305488b2baf8dc0f0a46918acb7d0) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-13dts, arm64: Move dts files to vendor subdirsRobert Richter
Moving dts files to vendor subdirs. Acked-by: Rob Herring <robh@kernel.org> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Robert Richter <rrichter@cavium.com> (cherry picked from commit ca5b34100c571658e605c5554aac374649593327) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-13dts, kbuild: Implement support for dtb vendor subdirsRobert Richter
This patch adds support of vendor sub directories for dtb files. Subdirectories can be specified in $(dts-dirs). Kbuild traverses over all directories while building and installing dtb files. The directory tree is also reflected in the install path. Tested-by: Andrew Bresticker <abrestic@chromium.org> Signed-off-by: Robert Richter <rrichter@cavium.com> (cherry picked from commit 323a028d39cd8df37b1c6a62ac04987647ae4b67) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-13dts, arm/arm64: Remove dtbs build rules in sub-makesRobert Richter
Add dtb files to build targets and let kbuild handle them. Thus, special dtbs rules can be removed. This eases Makefiles and the implementation of the support of vendor dtb subdirectories. Signed-off-by: Robert Richter <rrichter@cavium.com> (cherry picked from commit d38726c485d3fd6e9f2ebd1adaef0c3ead48a5ac) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-13dts, kbuild: Factor out dtbs install rules to Makefile.dtbinstRobert Richter
Move dtbs install rules to Makefile.dtbinst. This change is needed to implement support for dts vendor subdirs. The change makes Makefiles easier and smaller as no longer the dtbs_install rule needs to be defined. Another advantage is that install goals are not encoded in targets anymore (%.dtb_dtbinst_). Signed-off-by: Robert Richter <rrichter@cavium.com> (cherry picked from commit 9fb5e5372208973984a23ee6f5f025c05d364633) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-13dts, arm64: Add dtbs_install make targetRobert Richter
This adds the dtbs_install make target to arm64. The target has been introduced already to arch/arm with the following commit: f4d4ffc03efc kbuild: dtbs_install: new make target Implementation for arm64 is the same as for arm. With 'dtbs_install' all config enabled dtb files are installed to either the INSTALL_DTBS_PATH directory or the default location: $INSTALL_PATH/dtbs/$KERNELRELEASE Signed-off-by: Robert Richter <rrichter@cavium.com> (cherry picked from commit 862f464a540554a28273b761b4ce72541dc75914) Signed-off-by: Kevin Hilman <khilman@linaro.org>
2015-05-12Merge branch 'v3.18/topic/coresight' into linux-linaro-lsk-v3.18Kevin Hilman
* v3.18/topic/coresight: (42 commits) coresight: moving to new "hwtracing" directory coresight-tmc: Adding a status interface to sysfs coresight: remove the unnecessary configuration coresight-default-sink coresight: adding the LINKSINK block as a sink type coresight: Correcting documentation typographical error coresight: Adding coresight support for arm64 architecture coresight: fixing compilation warnings picked up by 64bit compiler coresight: making cpu index lookup arm64 compliant coresight: fix function etm_writel_cp14() parameter order coresight-etm: remove check for unknown Kconfig macro coresight: fixing CPU hwid lookup in device tree coresight: remove the unnecessary function coresight_is_bit_set() coresight: fix the debug AMBA bus name coresight: remove the extra spaces coresight: fix the link between orphan connection and newly added device coresight: remove the unnecessary replicator property coresight: fix the replicator subtype value coresight: fixing validity check on remote device coresight: fix comment in of_coresight.c coresight: Fixing wrong #ifdef/#endif placement ...
2015-05-07coresight: moving to new "hwtracing" directoryMathieu Poirier
Keeping drivers related to HW tracing on ARM, i.e coresight, under "drivers/coresight" doesn't make sense when other architectures start rolling out technologies of the same nature. As such creating a new "drivers/hwtracing" directory where all drivers of the same kind can reside, reducing namespace pollution under "drivers/". Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 01081f5ab9916603555f236b11f76bb00e4e01e9) Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Conflicts: arch/arm64/Kconfig.debug drivers/Makefile
2015-05-07coresight: remove the unnecessary configuration coresight-default-sinkKaixu Xia
The coresight-default-sink configuration option has been removed from the framework. As such remove it from DT and bindings. Signed-off-by: Kaixu Xia <xiakaixu@huawei.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 223437c72ae008094e43199dea93c3a144c4e153) Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Conflicts: arch/arm/boot/dts/omap3-beagle-xm.dts arch/arm/boot/dts/omap3-beagle.dts
2015-05-07coresight: Adding coresight support for arm64 architectureMathieu Poirier
Most CoreSight blocks are 64-bit ready. As such move configuration entries from "arch/arm/Kconfig.config" to the driver's subdirectory and source the newly created Kconfig from architecture specific Kconfig.debug files. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 3288731e628e0269c20d86e43b647d0b92f2b3fc) Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Conflicts: arch/arm64/Kconfig.debug
2015-05-07ARM: removing support for etb/etm in "arch/arm/kernel/"Mathieu Poirier
Removing minimal support for etb/etm to favour an implementation that is more flexible, extensible and capable of handling more platforms. Also removing the only client of the old driver. That code can easily be replaced by entries for etb/etm in the device tree. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 184901a06a366d40386e07307bcadc9eeaabbd39) Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Conflicts: arch/arm/include/asm/hardware/coresight.h arch/arm/kernel/Makefile arch/arm/kernel/etm.c arch/arm/mach-omap2/Kconfig
2015-05-07coresight: adding basic support for D01 boardXia Kaixu
Support for 16 PTMs, funnel, TPIU and replicator connected to the ETB are included. Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 4d5616ca59350c47e4b00d17c1480d8b44d3c535) Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Conflicts: arch/arm/boot/dts/hip04.dtsi
2015-05-07coresight: adding basic support for Vexpress TC2Mathieu Poirier
Support for the 2 PTMs, 3 ETMs, funnel, TPIU and replicator connected to the ETB are included. Proper handling of the ITM and the replicator linked to it along with the CTIs and SWO are not included. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 0bec8d82bd112f6aa0e16cab5d840bd7f5d3a7ce) Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2015-05-07coresight-etm: add CoreSight ETM/PTM driverPratik Patel
This driver manages CoreSight ETM (Embedded Trace Macrocell) that supports processor tracing. Currently supported version are ARM ETMv3.x and PTM1.x. Signed-off-by: Pratik Patel <pratikp@codeaurora.org> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> coresight-etm3x: adding missing error checking Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit a939fc5a71ad531633610242400c262e78731532) Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2015-05-07coresight-etb: add CoreSight ETB driverPratik Patel
This driver manages CoreSight ETB (Embedded Trace Buffer) which acts as a circular buffer sink collecting generated trace data. Signed-off-by: Pratik Patel <pratikp@codeaurora.org> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit fdfc0d8a06b56c3ca8fc3d7d271b3c8e99e6d55c) Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2015-05-07coresight-tpiu: add CoreSight TPIU driverPratik Patel
This driver manages CoreSight TPIU (Trace Port Interface Unit) which acts as a sink. TPIU is typically connected to some offchip hardware hosting a storage buffer. Signed-off-by: Pratik Patel <pratikp@codeaurora.org> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit dc161b9f01142c6b2c985290b7aa3e58e2408036) Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2015-05-07coresight-tmc: add CoreSight TMC driverPratik Patel
This driver manages CoreSight TMC (Trace Memory Controller) which can act as a link or a sink depending upon its configuration. It can present itself as an ETF (Embedded Trace FIFO) or ETR (Embedded Trace Router). ETF when configured in circular buffer mode acts as a trace collection sink. When configured in HW fifo mode it acts as link. ETR always acts as a sink and can be used to route data to memory allocated in RAM. Signed-off-by: Pratik Patel <pratikp@codeaurora.org> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit bc4bf7fe98daf4e64cc5ffc6cdc0e820f4d99c14) Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2015-05-07coresight: add CoreSight core layer frameworkPratik Patel
CoreSight components are compliant with the ARM CoreSight architecture specification and can be connected in various topologies to suit a particular SoC tracing needs. These trace components can generally be classified as sources, links and sinks. Trace data produced by one or more sources flows through the intermediate links connecting the source to the currently selected sink. The CoreSight framework provides an interface for the CoreSight trace drivers to register themselves with. It's intended to build up a topological view of the CoreSight components and configure the correct serie of components on user input via sysfs. For eg., when enabling a source, the framework builds up a path consisting of all the components connecting the source to the currently selected sink(s) and enables all of them. The framework also supports switching between available sinks and provides status information to user space applications through the debugfs interface. Signed-off-by: Pratik Patel <pratikp@codeaurora.org> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit a06ae8609b3dd06b957a6e4e965772a8a14d3af5) Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Conflicts: arch/arm/Kconfig.debug drivers/Makefile
2015-04-27arm64: fix midr range for Cortex-A57 erratum 832075Bo Yan
Register MIDR_EL1 is masked to get variant and revision fields, then compared against midr_range_min and midr_range_max when checking whether CPU is affected by any particular erratum. However, variant and revision fields in MIDR_EL1 are separated by 16 bits, so the min and max of midr range should be constructed accordingly, otherwise the patch will not be applied when variant field is non-0. Acked-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Bo Yan <byan@nvidia.com> [will: use MIDR_VARIANT_SHIFT to construct upper bound] Signed-off-by: Will Deacon <will.deacon@arm.com> Cc: <stable@vger.kernel.org> # v3.18.y (cherry picked from commit 6d1966dfd6e0ad2f8aa4b664ae1a62e33abe1998) Signed-off-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-27arm64: errata: add workaround for cortex-a53 erratum #845719Will Deacon
When running a compat (AArch32) userspace on Cortex-A53, a load at EL0 from a virtual address that matches the bottom 32 bits of the virtual address used by a recent load at (AArch64) EL1 might return incorrect data. This patch works around the issue by writing to the contextidr_el1 register on the exception return path when returning to a 32-bit task. This workaround is patched in at runtime based on the MIDR value of the processor. Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Tested-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Cc: <stable@vger.kernel.org> # v3.18.y (cherry picked from commit 905e8c5dcaa147163672b06fe9dcb5abaacbc711) Signed-off-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-27arm64: protect alternatives workarounds with Kconfig optionsAndre Przywara
Not all of the errata we have workarounds for apply necessarily to all SoCs, so people compiling a kernel for one very specific SoC may not need to patch the kernel. Introduce a new submenu in the "Platform selection" menu to allow people to turn off certain bugs if they are not affected. By default all of them are enabled. Normal users or distribution kernels shouldn't bother to deselect any bugs here, since the alternatives framework will take care of patching them in only if needed. Signed-off-by: Andre Przywara <andre.przywara@arm.com> [will: moved kconfig menu under `Kernel Features'] Signed-off-by: Will Deacon <will.deacon@arm.com> Cc: <stable@vger.kernel.org> # v3.18.y (cherry picked from commit c0a01b84b1fdbd98bff5bca5b201fe73fda7e9d9) Signed-off-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-27arm64: add Cortex-A57 erratum 832075 workaroundAndre Przywara
The ARM erratum 832075 applies to certain revisions of Cortex-A57, one of the workarounds is to change device loads into using load-aquire semantics. This is achieved using the alternatives framework. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Cc: <stable@vger.kernel.org> # v3.18.y (cherry picked from commit 5afaa1fc1b320cec48affa7e6949f2493f875c12) Signed-off-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-27arm64: add Cortex-A53 cache errata workaroundAndre Przywara
The ARM errata 819472, 826319, 827319 and 824069 define the same workaround for these hardware issues in certain Cortex-A53 parts. Use the new alternatives framework and the CPU MIDR detection to patch "cache clean" into "cache clean and invalidate" instructions if an affected CPU is detected at runtime. Signed-off-by: Andre Przywara <andre.przywara@arm.com> [will: add __maybe_unused to squash gcc warning] Signed-off-by: Will Deacon <will.deacon@arm.com> Cc: <stable@vger.kernel.org> # v3.18.y (cherry picked from commit 301bcfac42897dbd1b0b3c1be49f24654a1bc49e) Signed-off-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-27arm64: detect silicon revisions and set cap bits accordinglyAndre Przywara
After each CPU has been started, we iterate through a list of CPU features or bugs to detect CPUs which need (or could benefit from) kernel code patches. For each feature/bug there is a function which checks if that particular CPU is affected. We will later provide some more generic functions for common things like testing for certain MIDR ranges. We do this for every CPU to cover big.LITTLE systems properly as well. If a certain feature/bug has been detected, the capability bit will be set, so that later the call to apply_alternatives() will trigger the actual code patching. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Cc: <stable@vger.kernel.org> # v3.18.y (cherry picked from commit e116a375423393cdb94714e90a96857005d58428) Signed-off-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-27arm64: add alternative runtime patchingAndre Przywara
With a blatant copy of some x86 bits we introduce the alternative runtime patching "framework" to arm64. This is quite basic for now and we only provide the functions we need at this time. This is connected to the newly introduced feature bits. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Cc: <stable@vger.kernel.org> # v3.18.y (cherry picked from commit e039ee4ee3fcf174736f2cb0a2eed6cb908348a6) Signed-off-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-27arm64: add cpu_capabilities bitmapAndre Przywara
For taking note if at least one CPU in the system needs a bug workaround or would benefit from a code optimization, we create a new bitmap to hold (artificial) feature bits. Since elf_hwcap is part of the userland ABI, we keep it alone and introduce a new data structure for that (along with some accessors). Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Cc: <stable@vger.kernel.org> # v3.18.y (cherry picked from commit 930da09f5e50dd22fb0a8600388da8677d62d671) Signed-off-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-24x86/reboot: Add ASRock Q1900DC-ITX mainboard reboot quirkStefan Lippers-Hollmann
[ Upstream commit 80313b3078fcd2ca51970880d90757f05879a193 ] The ASRock Q1900DC-ITX mainboard (Baytrail-D) hangs randomly in both BIOS and UEFI mode while rebooting unless reboot=pci is used. Add a quirk to reboot via the pci method. The problem is very intermittent and hard to debug, it might succeed rebooting just fine 40 times in a row - but fails half a dozen times the next day. It seems to be slightly less common in BIOS CSM mode than native UEFI (with the CSM disabled), but it does happen in either mode. Since I've started testing this patch in late january, rebooting has been 100% reliable. Most of the time it already hangs during POST, but occasionally it might even make it through the bootloader and the kernel might even start booting, but then hangs before the mode switch. The same symptoms occur with grub-efi, gummiboot and grub-pc, just as well as (at least) kernel 3.16-3.19 and 4.0-rc6 (I haven't tried older kernels than 3.16). Upgrading to the most current mainboard firmware of the ASRock Q1900DC-ITX, version 1.20, does not improve the situation. ( Searching the web seems to suggest that other Bay Trail-D mainboards might be affected as well. ) -- Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> Cc: <stable@vger.kernel.org> Cc: Matt Fleming <matt.fleming@intel.com> Link: http://lkml.kernel.org/r/20150330224427.0fb58e42@mir Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-23powerpc: Re-enable dynticksPaul Clarke
[ Upstream commit fea559f303567e558bfab9c8ba4a2af5b309205a ] Implement arch_irq_work_has_interrupt() for powerpc Commit 9b01f5bf3 introduced a dependency on "IRQ work self-IPIs" for full dynamic ticks to be enabled, by expecting architectures to implement a suitable arch_irq_work_has_interrupt() routine. Several arches have implemented this routine, including x86 (3010279f) and arm (09f6edd4), but powerpc was omitted. This patch implements this routine for powerpc. The symptom, at boot (on powerpc systems) with "nohz_full=<CPU list>" is displayed: NO_HZ: Can't run full dynticks because arch doesn't support irq work self-IPIs after this patch: NO_HZ: Full dynticks CPUs: <CPU list>. Tested against 3.19. powerpc implements "IRQ work self-IPIs" by setting the decrementer to 1 in arch_irq_work_raise(), which causes a decrementer exception on the next timebase tick. We then handle the work in __timer_interrupt(). CC: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Paul A. Clarke <pc@us.ibm.com> Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> [mpe: Flesh out change log, fix ws & include guards, remove include of processor.h] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-23powerpc: fix memory corruption by pnv_alloc_idle_core_statesJan Stancek
[ Upstream commit d52356e7f48e400ca258c6763a232a92fa82ff68 ] Space allocated for paca is based off nr_cpu_ids, but pnv_alloc_idle_core_states() iterates paca with cpu_nr_cores()*threads_per_core, which is using NR_CPUS. This causes pnv_alloc_idle_core_states() to write over memory, which is outside of paca array and may later lead to various panics. Fixes: 7cba160ad789 (powernv/cpuidle: Redesign idle states management) Signed-off-by: Jan Stancek <jstancek@redhat.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-22ARM: sunxi: Have ARCH_SUNXI select RESET_CONTROLLER for clock driver usageChen-Yu Tsai
[ Upstream commit fdc0074c5fc8c7adb8186cbb123fe2082d9bd05f ] As the sunxi usb clocks all contain a reset controller, it is not possible to build the sunxi clock driver without RESET_CONTROLLER enabled. Doing so results in an undefined symbol error: drivers/built-in.o: In function `sunxi_gates_clk_setup': linux/drivers/clk/sunxi/clk-sunxi.c:1071: undefined reference to `reset_controller_register' This is possible if building a minimal kernel without PHY_SUN4I_USB. The dependency issue is made visible at compile time instead of link time by the new A80 mmc clocks, which also use a reset control itself. This patch makes ARCH_SUNXI select ARCH_HAS_RESET_CONTROLLER and RESET_CONTROLLER. Fixes: 559482d1f950 ARM: sunxi: Split the various SoCs support in Kconfig Cc: <stable@vger.kernel.org> # 3.16+ Reported-by: Lourens Rozema <ik@lourensrozema.nl> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-22ARC: signal handling robustifyVineet Gupta
[ Upstream commit e4140819dadc3624accac8294881bca8a3cba4ed ] A malicious signal handler / restorer can DOS the system by fudging the user regs saved on stack, causing weird things such as sigreturn returning to user mode PC but cpu state still being kernel mode.... Ensure that in sigreturn path status32 always has U bit; any other bogosity (gargbage PC etc) will be taken care of by normal user mode exceptions mechanisms. Reproducer signal handler: void handle_sig(int signo, siginfo_t *info, void *context) { ucontext_t *uc = context; struct user_regs_struct *regs = &(uc->uc_mcontext.regs); regs->scratch.status32 = 0; } Before the fix, kernel would go off to weeds like below: --------->8----------- [ARCLinux]$ ./signal-test Path: /signal-test CPU: 0 PID: 61 Comm: signal-test Not tainted 4.0.0-rc5+ #65 task: 8f177880 ti: 5ffe6000 task.ti: 8f15c000 [ECR ]: 0x00220200 => Invalid Write @ 0x00000010 by insn @ 0x00010698 [EFA ]: 0x00000010 [BLINK ]: 0x2007c1ee [ERET ]: 0x10698 [STAT32]: 0x00000000 : <-------- BTA: 0x00010680 SP: 0x5ffe7e48 FP: 0x00000000 LPS: 0x20003c6c LPE: 0x20003c70 LPC: 0x00000000 ... --------->8----------- Reported-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: <stable@vger.kernel.org> Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-22ARC: SA_SIGINFO ucontext regs off-by-oneVineet Gupta
[ Upstream commit 6914e1e3f63caa829431160f0f7093292daef2d5 ] The regfile provided to SA_SIGINFO signal handler as ucontext was off by one due to pt_regs gutter cleanups in 2013. Before handling signal, user pt_regs are copied onto user_regs_struct and copied back later. Both structs are binary compatible. This was all fine until commit 2fa919045b72 (ARC: pt_regs update #2) which removed the empty stack slot at top of pt_regs (corresponding to first pad) and made the corresponding fixup in struct user_regs_struct (the pad in there was moved out of @scratch - not removed altogether as it is part of ptrace ABI) struct user_regs_struct { + long pad; struct { - long pad; long bta, lp_start, lp_end,.... } scratch; ... } This meant that now user_regs_struct was off by 1 reg w.r.t pt_regs and signal code needs to user_regs_struct.scratch to reflect it as pt_regs, which is what this commit does. This problem was hidden for 2 years, because both save/restore, despite using wrong location, were using the same location. Only an interim inspection (reproducer below) exposed the issue. void handle_segv(int signo, siginfo_t *info, void *context) { ucontext_t *uc = context; struct user_regs_struct *regs = &(uc->uc_mcontext.regs); printf("regs %x %x\n", <=== prints 7 8 (vs. 8 9) regs->scratch.r8, regs->scratch.r9); } int main() { struct sigaction sa; sa.sa_sigaction = handle_segv; sa.sa_flags = SA_SIGINFO; sigemptyset(&sa.sa_mask); sigaction(SIGSEGV, &sa, NULL); asm volatile( "mov r7, 7 \n" "mov r8, 8 \n" "mov r9, 9 \n" "mov r10, 10 \n" :::"r7","r8","r9","r10"); *((unsigned int*)0x10) = 0; } Fixes: 2fa919045b72ec892e "ARC: pt_regs update #2: Remove unused gutter at start of pt_regs" CC: <stable@vger.kernel.org> Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-16powerpc/mpc85xx: Add ranges to etsec2 nodesScott Wood
[ Upstream commit bb344ca5b90df62b1a3b7a35c6a9d00b306a170d ] Commit 746c9e9f92dd "of/base: Fix PowerPC address parsing hack" limited the applicability of the workaround whereby a missing ranges is treated as an empty ranges. This workaround was hiding a bug in the etsec2 device tree nodes, which have children with reg, but did not have ranges. Signed-off-by: Scott Wood <scottwood@freescale.com> Reported-by: Alexander Graf <agraf@suse.de> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-16powerpc/pseries: Little endian fixes for post mobility device tree updateTyrel Datwyler
[ Upstream commit f6ff04149637723261aa4738958b0098b929ee9e ] We currently use the device tree update code in the kernel after resuming from a suspend operation to re-sync the kernels view of the device tree with that of the hypervisor. The code as it stands is not endian safe as it relies on parsing buffers returned by RTAS calls that thusly contains data in big endian format. This patch annotates variables and structure members with __be types as well as performing necessary byte swaps to cpu endian for data that needs to be parsed. Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com> Cc: Cyril Bur <cyrilbur@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-16arm64: Use the reserved TTBR0 if context switching to the init_mmCatalin Marinas
[ Upstream commit e53f21bce4d35a93b23d8fa1a840860f6c74f59e ] The idle_task_exit() function may call switch_mm() with next == &init_mm. On arm64, init_mm.pgd cannot be used for user mappings, so this patch simply sets the reserved TTBR0. Cc: <stable@vger.kernel.org> Reported-by: Jon Medhurst (Tixy) <tixy@linaro.org> Tested-by: Jon Medhurst (Tixy) <tixy@linaro.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-16powerpc/book3s: Fix the MCE code to use CONFIG_KVM_BOOK3S_64_HANDLERMahesh Salgaonkar
[ Upstream commit 44d5f6f5901e996744858c175baee320ccf1eda3 ] commit id 2ba9f0d has changed CONFIG_KVM_BOOK3S_64_HV to tristate to allow HV/PR bits to be built as modules. But the MCE code still depends on CONFIG_KVM_BOOK3S_64_HV which is wrong. When user selects CONFIG_KVM_BOOK3S_64_HV=m to build HV/PR bits as a separate module the relevant MCE code gets excluded. This patch fixes the MCE code to use CONFIG_KVM_BOOK3S_64_HANDLER. This makes sure that the relevant MCE code is included when HV/PR bits are built as a separate modules. Fixes: 2ba9f0d88750 ("kvm: powerpc: book3s: Support building HV and PR KVM as module") Cc: stable@vger.kernel.org # v3.14+ Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Acked-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-03-28ARM: dts: am43xx-clocks: Fix ehrpwm tbclk data on am43xxVignesh R
[ Upstream commit 7d53d25578486d65bd7cd242bc7816b40e55e62b ] ehrpwm tbclk is wrongly modelled as deriving from dpll_per_m2_ck. The TRM says tbclk is derived from SYSCLKOUT. SYSCLKOUT nothing but the functional clock of pwmss (l4ls_gclk). Fix this by changing source of ehrpwmx_tbclk to l4ls_gclk. Fixes: 4da1c67719f61 ("add tbclk data for ehrpwm") Signed-off-by: Vignesh R <vigneshr@ti.com> Acked-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>