platform/kernel/linux-exynos.git
7 years agoLOCAL / ASoC: samsung: Add Samsung Low Power Audio Subsystem driver
Inha Song [Wed, 14 Jan 2015 02:48:48 +0000 (11:48 +0900)]
LOCAL / ASoC: samsung: Add Samsung Low Power Audio Subsystem driver

This patch adds LPASS driver. The LPASS (Low Power Audio Subsystem)
is a special subsystem that supports audio playback with low power
consumption.

Signed-off-by: Inha Song <ideal.song@samsung.com>
7 years agoLOCAL / ASoC: samsung: Add machine driver for Exynos5433-based TM2 board
Inha Song [Mon, 9 Mar 2015 04:35:32 +0000 (13:35 +0900)]
LOCAL / ASoC: samsung: Add machine driver for Exynos5433-based TM2 board

This patch add the sound machine driver for TM2 board.
The codec operate in master mode. So, Reference to the
codec master clock must be set.

This machine driver support SPK playback and Main Mic capture.

Signed-off-by: Inha Song <ideal.song@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agoLOCAL / ASoC: max98504A: Add max98504A Speaker amplifier driver
Inha Song [Mon, 10 Nov 2014 04:40:23 +0000 (13:40 +0900)]
LOCAL / ASoC: max98504A: Add max98504A Speaker amplifier driver

This patch add MAX98504A Class D Speaker Amplifier driver.
The MAX98504A is a high efficiency mono Class D audio amplifier
that features an integrated boost converter with voltage and current
sensing ADCs for dynamic speaker management solutions.

Signed-off-by: Inha Song <ideal.song@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agophy: exynos5-usbdrd: Add to support for Exynos5433 SoC
Jaewon Kim [Mon, 12 Jan 2015 06:33:21 +0000 (15:33 +0900)]
phy: exynos5-usbdrd: Add to support for Exynos5433 SoC

This patch adds driver data to support for Exynos5433 SoC.
The Exynos5433 has one USB2.0 Host and two USB3.0 DRD(Dual Role Device).
Exynos5433 is simplar to Eyxnos7. But Eyxnos5433 has USB2.0 Host.

Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agopower: charger-manager: Support to change polling rate in runtime.
Jonghwa Lee [Fri, 19 Dec 2014 08:55:23 +0000 (17:55 +0900)]
power: charger-manager: Support to change polling rate in runtime.

Add 'polling_ms' sysfs node to change charger-manager's monitoring rate
in runtime. It can set only bigger than 2 jiffies (for 200 HZ system it
is 10 msecs.) as it's allowed for minimum poling rate in previous.
It resets poller and re-configure polling rate based on new input if next
polling time is far enough. Otherwise, it just waits expiration of timer
and new polling rate will affects the next scheduling.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agopower: charger-manager: Support different polling mode for sleep state.
Jonghwa Lee [Fri, 19 Dec 2014 08:55:22 +0000 (17:55 +0900)]
power: charger-manager: Support different polling mode for sleep state.

Add additional polling mode for sleep state to define different mode with
normal state. With this change, charger-manager can work differently in
normal state or sleep state. e.g, polling aways for normal and polling
only when charing for sleep. If there is no defined polling mode for
sleep state it just follows the normal state's.
In addition to, polling rate is still same in sleep.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agopower: charger-manager: Not to start charging directly in cable nofitication.
Jonghwa Lee [Fri, 19 Dec 2014 08:55:21 +0000 (17:55 +0900)]
power: charger-manager: Not to start charging directly in cable nofitication.

This patch prevents direct charging control in cable notification.
It sets only input current limit according to cable type and yields charging
control to be done by cm_monitor() where charging management proceeds.
It may loose few ms to enable charging compared to before, even though it's
more important that charging is enabled always in safe context.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agopower: charger-manager: Make chraging decision focusing on battery status.
Jonghwa Lee [Fri, 19 Dec 2014 08:55:20 +0000 (17:55 +0900)]
power: charger-manager: Make chraging decision focusing on battery status.

In cm_monitor() where charging management starts, it checks various charging
condition sequentially to decide next charging operation. However, as it
follows sequential process, cascaded IF statements, it does some duplicated
jobs which is already done in previous stage. It results delay in decision
making. And moreover, starting point of charing is spreaded all around, so
it makes maintain codes and debugging difficult.

Both of problems mentioned above becomes clean if it manages battery charging
focusing on battery status not following sequential condition checking.
Now, cm_monitor() moves battery state diagram and does optimal operation for
current state. As a result, it reduces whole monitoring time almost in half.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agopower: charger-manager: Get external power souce information only from EXTCON.
Jonghwa Lee [Fri, 19 Dec 2014 08:55:19 +0000 (17:55 +0900)]
power: charger-manager: Get external power souce information only from EXTCON.

When charger-manager checks whether external power source is available,
it gets information from charger IC driver. However, it's not correct source,
charger IC doesn't have responsibilty to give cable connection status.
The charger-manager already gets cable information from EXTCON susbsystem,
so it can re-use it.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agopower: charger-manager: Concentrate scattered power_supply_changed() calls.
Jonghwa Lee [Fri, 19 Dec 2014 08:55:18 +0000 (17:55 +0900)]
power: charger-manager: Concentrate scattered power_supply_changed() calls.

Current charger-manager calls power_suuply_changed() whenever charging
status is changed. This patch removes seperated power_supply_changed()
use and let it be called at end of try_charger_enable() function which
is called to set charging/discharging.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agopower: charger-manager: Fix to use CHARGE_NOW/FULL property correctly.
Jonghwa Lee [Fri, 19 Dec 2014 08:55:17 +0000 (17:55 +0900)]
power: charger-manager: Fix to use CHARGE_NOW/FULL property correctly.

The POWER_SUPPLY_CHARGE_NOW/FULL property reflects battery's charges
in uAh unit, but charger-manager has been used it wrongly. This patch
makes it to use those propeties correctly and change to be optional.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agopower: charger-manager: Remove deprecated function, cm_notify_event().
Jonghwa Lee [Fri, 19 Dec 2014 08:55:16 +0000 (17:55 +0900)]
power: charger-manager: Remove deprecated function, cm_notify_event().

cm_notify_event() is introduced to get event associated with battery status
externally, but no one had been used. Moreover it makes charger manager
driver more complicated. This patch tries to drop the function and all data
related to simplify the driver.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agopower: charger-manager: Use power_supply_changed() not private uevent.
Jonghwa Lee [Fri, 19 Dec 2014 08:55:15 +0000 (17:55 +0900)]
power: charger-manager: Use power_supply_changed() not private uevent.

Whenever battery status is changed, charger manager tries to trigger uevent
through private interface. This patch modifies it to use power_supply_changed()
since it belongs to power supply subsystem.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agopower: charger-manager: Use thermal subsystem interface only to get temperature.
Jonghwa Lee [Fri, 19 Dec 2014 08:55:14 +0000 (17:55 +0900)]
power: charger-manager: Use thermal subsystem interface only to get temperature.

It drops the way of using power_supply interface to reference battery's
temperature. Then it tries to use thermal subsystem's only. This makes driver
more simple and also can remove ifdeferies.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agoDocumentation: Add device tree bindings document for max77843
Jaewon Kim [Mon, 23 Feb 2015 02:54:29 +0000 (11:54 +0900)]
Documentation: Add device tree bindings document for max77843

Add document describing device tree bindings for max77843 MFD.
Drivers: MFD core, regulator, extcon, charger and fuelgauge.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
7 years agopower: max77843_battery: Add Max77843 fuel gauge device driver
Beomho Seo [Mon, 23 Feb 2015 10:36:42 +0000 (19:36 +0900)]
power: max77843_battery: Add Max77843 fuel gauge device driver

This patch adds device driver of max77843 fuel gauge.
The driver support for battery fuel gauge in Maxim Max77843.
It is fuel-gauge systems for lithuum-ion batteries in handled and
portable devices.

Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
7 years agopower: max77843_charger: Add Max77843 charger device driver
Beomho Seo [Mon, 23 Feb 2015 10:35:30 +0000 (19:35 +0900)]
power: max77843_charger: Add Max77843 charger device driver

This patch adds device driver of max77843 charger. This driver provide
initialize each charging mode(e.g. fast charge, top-off mode and constant
charging mode so on.). Additionally, control charging paramters to use
i2c interface.

Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
7 years agoLOCAL / input: keyboard: Add support for cypress touchkey
Beomho Seo [Fri, 9 Jan 2015 02:17:39 +0000 (11:17 +0900)]
LOCAL / input: keyboard: Add support for cypress touchkey

This patch add cypress touchkey device driver.

Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agoLOCAL / input: touchscreen: Add STM FTS touchscreen
Beomho Seo [Tue, 25 Nov 2014 10:24:16 +0000 (19:24 +0900)]
LOCAL / input: touchscreen: Add STM FTS touchscreen

This patch add STMicroelectronics FTS touchscreen controller.

Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
7 years agoLOCAL / ARM: dts: Changes safeout regulator state for rinato
Jaewon Kim [Tue, 3 Feb 2015 06:24:24 +0000 (15:24 +0900)]
LOCAL / ARM: dts: Changes safeout regulator state for rinato

This patch changes safeout regualtor state to always on to use USB device

Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
7 years agoLOCAL / usb: gadget: Add slp composite gadget
Jaewon Kim [Tue, 2 Dec 2014 12:34:54 +0000 (21:34 +0900)]
LOCAL / usb: gadget: Add slp composite gadget

This patch adds slp composite gadget for tizen platform.
slp composite gadget code comes from android.c

Verified Gadget List
 - SDB
 - RNDIS

Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
7 years agoLOCAL / extcon: max14577: Change default h/w path from SW_OPEN to SW_UART
Chanwoo Choi [Fri, 20 Jun 2014 04:40:33 +0000 (13:40 +0900)]
LOCAL / extcon: max14577: Change default h/w path from SW_OPEN to SW_UART

This patch changes default h/w patch from SW_OPEN to SW_UART without connected
cables.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoLOCAL / arm: configs: Add tm2/rinato/trats2/odroidu3 defconfig
Chanwoo Choi [Mon, 23 Feb 2015 04:25:27 +0000 (13:25 +0900)]
LOCAL / arm: configs: Add tm2/rinato/trats2/odroidu3 defconfig

- arch/arm64/configs/defconfig : Exynos5433-based TM2 board

- arch/arm/configs/tizen_odroidu3_defconfig : Exynos4412-based Odroid-U3 board
- arch/arm/configs/tizen_trats2_defconfig   : Exynos4412-based TRATS2 board
- arch/arm/configs/tizen_rinato_defconfig   : Exynos3250-based Rinato board

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 years agoLOCAL / arm64: dts: Add Exynos5433-based TM2 board
Chanwoo Choi [Fri, 31 Oct 2014 08:25:46 +0000 (17:25 +0900)]
LOCAL / arm64: dts: Add Exynos5433-based TM2 board

This patch adds Exynos5433-based TM2 board which is third tizen reference
board for mobile profile.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inha Song <ideal.song@samsung.com>
Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
7 years agoLOCAL / cpufreq: Add the dt support for arm_big_little driver
Chanwoo Choi [Mon, 29 Dec 2014 09:52:38 +0000 (18:52 +0900)]
LOCAL / cpufreq: Add the dt support for arm_big_little driver

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoLOCAL / cpufreq: Enable big.LITTLE cpufreq driver on arm64
Mark Brown [Mon, 8 Dec 2014 07:59:46 +0000 (16:59 +0900)]
LOCAL / cpufreq: Enable big.LITTLE cpufreq driver on arm64

There are arm64 big.LITTLE systems so enable the big.LITTLE cpufreq driver.
While IKS is not available for these systems the driver is still useful
since it manages clusters with shared frequencies which is the common case
for these systems.

Long term combining the cpufreq-cpu0 and big.LITTLE drivers may be a
more sensible option but that is substantially more complex especially
in the case of IKS.

Signed-off-by: Mark Brown <broonie@kernel.org>
[cw00.choi: Fix the dependency on big.LITTLE configuration]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoLOCAL / arm64: Add big.LITTLE switcher stub
Mark Brown [Fri, 9 May 2014 16:40:30 +0000 (17:40 +0100)]
LOCAL / arm64: Add big.LITTLE switcher stub

The big.LITTLE cpufreq driver is useful on arm64 big.LITTLE systems even
without IKS support since it implements support for clusters with shared
clocks (a common big.LITTLE configuration). In order to allow it to be
built provide the non-IKS stubs for arm64, enabling cpufreq with all the
cores available.

It may make sense to make an asm-generic version of these stubs instead but
given that there's only likely to be these two architectures using the code
and asm-generic stubs also need per architecture updates it's probably more
trouble than it's worth.

Signed-off-by: Mark Brown <broonie@linaro.org>
7 years agoLOCAL / arm64: Enable OPP
Mark Brown [Mon, 29 Dec 2014 09:49:01 +0000 (18:49 +0900)]
LOCAL / arm64: Enable OPP

Some of the generic drivers used on ARM class systems use OPP so allow it
to be selected in Kconfig. No code is required for this, it is not clear
to me why there is config for this option.

Signed-off-by: Mark Brown <broonie@linaro.org>
7 years agoLOCAL / arm64: Add CONFIG_BIG_LITTLE dummy configuration
Chanwoo Choi [Mon, 8 Dec 2014 08:24:14 +0000 (17:24 +0900)]
LOCAL / arm64: Add CONFIG_BIG_LITTLE dummy configuration

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoLOCAL / arm64: dts: exynos5433: Add OPP entries for CPUFREQ of Exynos5433
Chanwoo Choi [Mon, 8 Dec 2014 07:33:10 +0000 (16:33 +0900)]
LOCAL / arm64: dts: exynos5433: Add OPP entries for CPUFREQ of Exynos5433

This patch adds the OPP entries for CPUFREQ of Exynos5433 SoC. Exynos5433 is
big.LITTLE architecture so each core has different OPP entries (CPU frequency
and voltage).

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoLOCAL / tools: Add build script for Exynos5433 SoC
Chanwoo Choi [Fri, 31 Oct 2014 11:33:26 +0000 (20:33 +0900)]
LOCAL / tools: Add build script for Exynos5433 SoC

This patch adds build script to build the kernel for Exynos5433-based board.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoLOCAL / ARM: dts: Modify hw revision to jump kernel image from bootloader
Chanwoo Choi [Mon, 22 Dec 2014 03:16:50 +0000 (12:16 +0900)]
LOCAL / ARM: dts: Modify hw revision to jump kernel image from bootloader

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoLOCAL / arm64: dts: exynos: Fix ARCH timer boot error for Exynos5433
Chanwoo Choi [Fri, 16 Jan 2015 11:21:43 +0000 (20:21 +0900)]
LOCAL / arm64: dts: exynos: Fix ARCH timer boot error for Exynos5433

This patch fix ARCH timer boot error for Exynos5433 as following:

[    0.000010] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
[    0.008436] Architected timer frequency not available
[    0.013416] ------------[ cut here ]------------
[    0.018016] WARNING: CPU: 0 PID: 0 at kernel/time/clockevents.c:44 cev_delta2ns.isra.1+0xc4/0xd4()
[    0.026943] Modules linked in:
[    0.029986] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.19.0-rc4-00072-g65baa5f #3
[    0.037531] Hardware name: Samsung TM2 board (DT)
[    0.042393] Call trace:
[    0.044830] [<ffffffc0000891c8>] dump_backtrace+0x0/0x124
[    0.050208] [<ffffffc0000892fc>] show_stack+0x10/0x1c
[    0.055246] [<ffffffc00072ef28>] dump_stack+0x74/0xb8
[    0.060278] [<ffffffc000097520>] warn_slowpath_common+0x98/0xd0
[    0.066178] [<ffffffc000097618>] warn_slowpath_null+0x14/0x20
[    0.071909] [<ffffffc0000f1d8c>] cev_delta2ns.isra.1+0xc0/0xd4
[    0.077722] [<ffffffc0000f1e30>] clockevents_config.part.3+0x70/0xa8
[    0.084059] [<ffffffc0000f1e88>] clockevents_config_and_register+0x20/0x38
[    0.090918] [<ffffffc00049843c>] arch_timer_setup+0xc4/0x1f0
[    0.096561] [<ffffffc0009fdc4c>] arch_timer_init+0x1fc/0x274
[    0.102199] [<ffffffc0009fd490>] clocksource_of_init+0x54/0x98
[    0.108018] [<ffffffc0009e07fc>] time_init+0x10/0x44
[    0.112963] [<ffffffc0009dd838>] start_kernel+0x260/0x394
[    0.118358] ---[ end trace cb88537fdc8fa200 ]---
[    0.123495] Architected cp15 timer(s) running at 0.00MHz (virt).
[    0.129439] Kernel panic - not syncing: Unable to initialise architected timer.
[    0.129439]
[    0.138182] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W 3.19.0-rc4-00072-g65baa5f #3
[    0.146855] Hardware name: Samsung TM2 board (DT)
[    0.151717] Call trace:
[    0.154156] [<ffffffc0000891c8>] dump_backtrace+0x0/0x124
[    0.159532] [<ffffffc0000892fc>] show_stack+0x10/0x1c
[    0.164569] [<ffffffc00072ef28>] dump_stack+0x74/0xb8
[    0.169600] [<ffffffc00072e224>] panic+0xec/0x228
[    0.174290] [<ffffffc0009e0814>] time_init+0x28/0x44
[    0.179237] [<ffffffc0009dd838>] start_kernel+0x260/0x394
[    0.184620] ---[ end Kernel panic - not syncing: Unable to initialise architected timer.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoLOCAL / pinctrl: samsung: Add GPFx support of Exynos5433
Joonyoung Shim [Fri, 16 Jan 2015 09:59:22 +0000 (18:59 +0900)]
LOCAL / pinctrl: samsung: Add GPFx support of Exynos5433

This patch add the support of GPFx pin of Exynos5433 SoC. Exynos5433 has
different memory map of GPFx from previous Exynos SoC. Exynos GPIO has
following register to control gpio funciton. Usually, all registers of GPIO
are included in same domain.
- CON / DAT / PUD / DRV / CONPDN / PUDPDN
- EINT_CON/ EINT_FLTCON0, EINT_FLTCON1 / EINT_MASK / EINT_PEND

But, GPFx are included in two domain as following. So, this patch add
workaround patch to support GPFx.
- ALIVE domain : CON / DAT / PUD / DRV / CONPDN / PUDPDN
- IMEM domain : EINT_CON/ EINT_FLTCON0, EINT_FLTCON1 / EINT_MASK / EINT_PEND

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Add patch description and fix merge conflict]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoLOCAL / arm64: dts: exynos5433: Add LPASS dt node for Exynos5433 SoC
Inha Song [Tue, 17 Feb 2015 00:13:54 +0000 (09:13 +0900)]
LOCAL / arm64: dts: exynos5433: Add LPASS dt node for Exynos5433 SoC

This patch adds LPASS dt node for Exynos5433 SoC. The LPASS
(Low Power Audio Subsystem) is a special subsystem that
supports audio playback with low power consumption.

Signed-off-by: Inha Song <ideal.song@samsung.com>
7 years agoLOCAL / mmc: dw_mmc: exynos: enable mmc-erase capability
Jaehoon Chung [Thu, 26 Feb 2015 07:20:46 +0000 (16:20 +0900)]
LOCAL / mmc: dw_mmc: exynos: enable mmc-erase capability

To use erase feature(DISCARD or SANITIZE or ERASE, etc..), set MMC_CAP_ERASE.
(In future, this feature should be enabled by default. But before enable
 by default, it needs to fix the some erase issue - discussing at
 Mailing-list.)

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agoLOCAL / clocksource: exynos_mct: Add the support for Exynos 64bit SoC
Chanwoo Choi [Fri, 31 Oct 2014 09:16:15 +0000 (18:16 +0900)]
LOCAL / clocksource: exynos_mct: Add the support for Exynos 64bit SoC

This patch adds the support for Exynos 64bit SoC. The delay_timer is only used
for Exynos 32bit SoC.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agomfd: sec-core: Modify RTC compatible name of S2MPS13
Chanwoo Choi [Fri, 6 Mar 2015 11:42:17 +0000 (20:42 +0900)]
mfd: sec-core: Modify RTC compatible name of S2MPS13

This patch modify the RTC compatible name of S2MPS13 because S2MPS13's RTC is
equal to S2MPS14's RTC.

Cc: Lee Jones <lee.jones@linaro.org>
Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoREVIEW / drm/panel: add s6e63j0x03 LCD panel driver
Inki Dae [Tue, 9 Dec 2014 09:29:05 +0000 (18:29 +0900)]
REVIEW / drm/panel: add s6e63j0x03 LCD panel driver

This patch adds MIPI-DSI based S6E63J0X03 AMOLED LCD panel driver
which uses mipi_dsi bus to communicate with panel. The panel has
320×320 resolution in 1.63-inch physical panel. This panel is used in
Samsung Galaxy Gear 2.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
7 years agoARM: dts: Add CPU OPP and regulator supply property for Exynos3250
Chanwoo Choi [Mon, 20 Oct 2014 12:08:42 +0000 (21:08 +0900)]
ARM: dts: Add CPU OPP and regulator supply property for Exynos3250

This patch add CPU operating points which include CPU frequency and regulator
voltage to use generic cpufreq-dt drivers.

Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
7 years agoARM: dts: Add CPU OPP and regulator supply property for Exynos4415
Chanwoo Choi [Fri, 16 Jan 2015 06:23:06 +0000 (15:23 +0900)]
ARM: dts: Add CPU OPP and regulator supply property for Exynos4415

This patch add CPU operating points which include CPU frequency and regulator
voltage to use generic cpufreq-dt driver.

Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoLOCAL / arm64: dts: exynos: Add mali node for Exynos5433 SoC
Joonyoung Shim [Tue, 31 Mar 2015 01:09:41 +0000 (10:09 +0900)]
LOCAL / arm64: dts: exynos: Add mali node for Exynos5433 SoC

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoarm64: dts: exynos: Add mic node for Exynos5433 Soc
Hyungwon Hwang [Tue, 17 Feb 2015 04:21:59 +0000 (13:21 +0900)]
arm64: dts: exynos: Add mic node for Exynos5433 Soc

This patch adds mic device tree node for Exynos5433. After syscon is
implemented the register information about it must be removed.

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoarm64: dts: exynos: Add dsi node for Exynos5433 SoC
Hyungwon Hwang [Tue, 17 Feb 2015 04:21:27 +0000 (13:21 +0900)]
arm64: dts: exynos: Add dsi node for Exynos5433 SoC

This patch adds MIPI dsi device tree node for Exynos5433. The endpoint
node represent the connection between dsi and mic, and is used
practically in the MIC driver.

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoarm64: dts: exynos: Add mic node for Exynos5433 SoC
Hyungwon Hwang [Tue, 17 Feb 2015 04:20:22 +0000 (13:20 +0900)]
arm64: dts: exynos: Add mic node for Exynos5433 SoC

This patch adds mic device tree node for Exynos5433. After syscon is
implemented the register information about it must be removed.

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com
7 years agoarm64: dts: exynos: Add UART3 dt node for Exynos5433 SoC
Beomho Seo [Tue, 17 Feb 2015 02:41:35 +0000 (11:41 +0900)]
arm64: dts: exynos: Add UART3 dt node for Exynos5433 SoC

This patch adds the UART3 devicetree node for Exynos5433 SoC. The UART3 device
is included in AUD_DOMAIN.

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoarm64: dts: exynos: Add PWM dt node and pinctrl for Exynos5433 SoC
Jaewon Kim [Wed, 4 Feb 2015 11:51:38 +0000 (20:51 +0900)]
arm64: dts: exynos: Add PWM dt node and pinctrl for Exynos5433 SoC

This patch adds PWM(Pulsle Width Modulation) device tree node
to support for PWM Timer on Exynos5433 SoC.

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoarm64: dts: exynos: Add USB3.0 Host dt node for Exynos5433
Jaewon Kim [Thu, 15 Jan 2015 05:22:17 +0000 (14:22 +0900)]
arm64: dts: exynos: Add USB3.0 Host dt node for Exynos5433

This patch adds PHY and USB3.0 Host device tree node
using DWC3 chip and set USB3.0 Host related clock parent
for Exynos5433.

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoarm64: dts: exynos: Add USB Device dt node for Exynos5433
Jaewon Kim [Wed, 7 Jan 2015 11:41:19 +0000 (20:41 +0900)]
arm64: dts: exynos: Add USB Device dt node for Exynos5433

This patch adds USB DRD(Dual Role Device) and PHY
device tree node to use USB Device.

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoarm64: dts: exynos: Add EHCI and OHCI dt node for Exynos5433
Jaewon Kim [Thu, 15 Jan 2015 05:16:38 +0000 (14:16 +0900)]
arm64: dts: exynos: Add EHCI and OHCI dt node for Exynos5433

This patch adds EHCI and OHCI device tree node
to usb USB2.0 Host and HSCI(High Speed Inter-Chip) function.

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoLOCAL / clk: samsung: exynos5433: enable ignore unused flag
Beomho Seo [Tue, 24 Feb 2015 11:20:28 +0000 (20:20 +0900)]
LOCAL / clk: samsung: exynos5433: enable ignore unused flag

This patch enable ignore unused flags for properly working of aud uart.

Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
7 years agoclk: samsung: exynos5433: add CLK_IGNORE_UNUSED for g3d clock
Joonyoung Shim [Thu, 5 Mar 2015 07:14:04 +0000 (16:14 +0900)]
clk: samsung: exynos5433: add CLK_IGNORE_UNUSED for g3d clock

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoLINUX-SAMSUNG / thermal: exynos: Add the support for Exynos5433 TMU
Chanwoo Choi [Thu, 12 Feb 2015 06:05:44 +0000 (15:05 +0900)]
LINUX-SAMSUNG / thermal: exynos: Add the support for Exynos5433 TMU

This patch adds the support for Exynos5433's TMU (Thermal Management Unit).
Exynos5433 has a little different register bit fields as following description:
- Support the eight trip points for rising/falling interrupt by using two registers
- Read the calibration type (1-point or 2-point) and sensor id from TRIMINFO register
- Use a little different register address

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoLINUX-SAMSUNG / arm64: dts: exynos: Add thermal-zones dt node for Exynos5433 SoC
Chanwoo Choi [Thu, 26 Feb 2015 05:15:14 +0000 (14:15 +0900)]
LINUX-SAMSUNG / arm64: dts: exynos: Add thermal-zones dt node for Exynos5433 SoC

This patch adds the thermal-zones devicetree node for Exynos5433 SoC.
The thermal-zones has five thermal-zones and then each thermal-zone contains
each thermal-sensor to monitor the temperature of own IP. The {atlas0|apollo}_
thermal zone have the eight trip-points for interrupt method to detect the
over-temperature.

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
7 years agoLINUX-SAMSUNG / arm64: dts: exynos: Add TMU sensor dt node for Exynos5433 SoC
Chanwoo Choi [Mon, 16 Feb 2015 09:42:39 +0000 (18:42 +0900)]
LINUX-SAMSUNG / arm64: dts: exynos: Add TMU sensor dt node for Exynos5433 SoC

This patch adds the TMU (Thermal Management Unit) sensor devicetree node for
Exynos5433. The Exynos5433 includes the five temperature sensors as following:
- two temperature sensor for Cortex-A57 (ATLAS)
- one temperature sensor for Cortex-A53 (APOLLO)
- one temperature sensor for G3D IP
- one temperature sensor for ISP IP

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
7 years agoLINUX-SAMSUNG / arm64: dts: exynos: Add I2S dt node for Exynos5433 SoC
Inha Song [Fri, 16 Jan 2015 07:30:22 +0000 (16:30 +0900)]
LINUX-SAMSUNG / arm64: dts: exynos: Add I2S dt node for Exynos5433 SoC

This patch adds I2S device tree node for Exynos5433 SoC.
In Exynos5433 SoC, I2S0 is used for audio interface.

Signed-off-by: Inha Song <ideal.song@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoLINUX-SAMSUNG / arm64: dts: exynos: Add ADMA dt node for Exynos5433 SoC
Inha Song [Mon, 15 Dec 2014 05:31:00 +0000 (14:31 +0900)]
LINUX-SAMSUNG / arm64: dts: exynos: Add ADMA dt node for Exynos5433 SoC

This patch adds ADMA (Advanced DMA) device tree node for Exynos5433 SoC.
In Exynos5433 SoC, ADMA is used for I2S audio interface.

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Inha Song <ideal.song@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoLINUX-SAMSUNG / arm64: dts: exynos: Add RTC and ADC dt node for Exynos5433 SoC
Chanwoo Choi [Mon, 1 Dec 2014 05:14:31 +0000 (14:14 +0900)]
LINUX-SAMSUNG / arm64: dts: exynos: Add RTC and ADC dt node for Exynos5433 SoC

This patch adds RTC (Real Time Clock) dt node for Exynos5433 SoC and adds
ADC dt node for Exynos5433 SoC. The c1b501564c98a94b4(iio: adc: exynos_adc:
Add support for exynos7) commit supports the ADC for Exynos7. Exynos5433's ADC
IP is the same with Exynos7's ADC IP. Exynos5433 has a little different from
ADCv2 on ADC_CON2 register. Exynos5433 don't contain OSEL/ESEL /HIGHF of ADC_CON2.

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoLINUX-SAMSUNG / arm64: dts: exynos: Add PMU dt node for Exynos5433
Chanwoo Choi [Mon, 1 Dec 2014 05:02:03 +0000 (14:02 +0900)]
LINUX-SAMSUNG / arm64: dts: exynos: Add PMU dt node for Exynos5433

This patch adds PMU (Power Management Unit) dt node for Exynos5433 SoC and
set the source clock for CLKOUT register as xxti .

Cc: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
[ideal.song: Add the setting of CLKOUT register]
Signed-off-by: Inha Song <ideal.song@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoLINUX-SAMSUNG / arm64: dts: exynos: Add SPI/PDMA dt node for Exynos5433
Chanwoo Choi [Thu, 27 Nov 2014 06:13:33 +0000 (15:13 +0900)]
LINUX-SAMSUNG / arm64: dts: exynos: Add SPI/PDMA dt node for Exynos5433

This patch adds SPI (Serial Peripheral Interface) dt node for Exynos5433 SoC.
SPI transfers serial data by using various peripherals. SPI includes
8-bit/16-bit/32-bit shift registers to transmit and receive data. PDMA is used
for SPI communication.

Cc: Kukjin Kim <kgene@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Olof Johansson <olof@lixom.net>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoLINUX-SAMSUNG / arm64: dts: exynos: Add MSHC dt node for Exynos5433
Jaehoon Chung [Thu, 27 Nov 2014 06:06:21 +0000 (15:06 +0900)]
LINUX-SAMSUNG / arm64: dts: exynos: Add MSHC dt node for Exynos5433

This patch adds MSHC (Mobile Storage Host Controller) dt node for Exynos5433
SoC. MSHC is an interface between the system the SD/MMC card.

Cc: Kukjin Kim <kgene@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Olof Johansson <olof@lixom.net>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoLINUX-SAMSUNG / arm64: dts: exynos: Add dts files for 64-bit Exynos5433 SoC
Chanwoo Choi [Fri, 24 Oct 2014 06:04:43 +0000 (15:04 +0900)]
LINUX-SAMSUNG / arm64: dts: exynos: Add dts files for 64-bit Exynos5433 SoC

This patch adds new Exynos5433 dtsi to support 64-bit Exynos5433 SoC based on
Octal core CPUs (quad Cortex-A57 and quad Cortex-A53). And Exynos5433 supports
PSCI (Power State Coordination Interface) v0.1.

This patch includes following dt node to support Exynos5433 SoC:
1. Octa core for big.LITTLE architecture
- Cortex-A53 LITTLE Quad-core
- Cortex-A57 big Quad-core
- Support PSCI v0.1

2. clock controller node:
- CMU_TOP   : clocks for IMEM/FSYS/G3D/GSCL/HEVC/MSCL/G2D/MFC/PERIC/PERIS
- CMU_CPIF  : clocks for LLI (Low Latency Interface)
- CMU_MIF   : clocks for DRAM Memory Controller
- CMU_PERIC : clocks for UART/I2C/SPI/I2S/PCM/SPDIF/PWM/SLIMBUS
- CMU_PERIS : clocks for PMU/TMU/MCT/WDT/RTC/SECKEY/TZPC
- CMU_FSYS  : clocks for USB/UFS/SDMMC/TSI/PDMA
- CMU_G2D   : clocks for G2D/MDMA
- CMU_DISP  : clocks for DECON/HDMI/DSIM/MIXER
- CMU_AUD   : clocks for Cortex-A5/BUS/AUDIO
- CMU_BUS{0|1|2} : clocks for global data buses and global peripheral buses
- CMU_G3D   : clocks for 3D Graphics Engine
- CMU_GSCL  : clocks for GSCALER
- CMU_APOLLO: clocks for Cortex-A53 Quad-core processor.
- CMU_ATLAS : clocks for Cortex-A57 Quad-core processor,
              CoreSight and L2 cache controller.
- CMU_MSCL  : clocks for M2M (Memory to Memory) scaler and JPEG IPs.
- CMU_MFC   : clocks for MFC (Multi-Format Codec) IP.
- CMU_HEVC  : clocks for HEVC(High Efficiency Video Codec) decoder IP.
- CMU_ISP   : clocks for FIMC-ISP/DRC/SCLC/DIS/3DNR IPs.
- CMU_CAM0  : clocks for MIPI_CSIS{0|1}/FIMC_LITE_{A|B|D}/FIMC_3AA{0|1} IPs.
- CMU_CAM1  : clocks for COrtex-A5/MIPI_CSIS2/FIMC_LITE_C/FIMC-FD IPs.

3. pinctrl node for GPIO:
- alive/aud/cpif/ese/finger/fsys/imem/nfc/peric/touch pad

4. HS (High-Speed) I2C device
5. Serial device
6. ARCH timer (arm,armv8-timer)
7. Interrupt controller (arm,gic-400)

Cc: Kukjin Kim <kgene@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Olof Johansson <olof@lixom.net>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
7 years agoclocksource: exynos_mct: clear irq at stop local mct to fix suspend
Joonyoung Shim [Thu, 1 Dec 2016 05:49:10 +0000 (14:49 +0900)]
clocksource: exynos_mct: clear irq at stop local mct to fix suspend

This patch adds clear interrupt to exynos4_mct_tick_stop(). Without
clearing, after turning on non boot cpu at wakeup from suspend to
ram, not cleared tick interrupt occurs and it causes following null
deference for MCT_INT_SPI type mct.

   Unable to handle kernel NULL pointer dereference at virtual address 00000108
   pgd = ffffffc001309000
   [00000108] *pgd=00000000c402d003, *pud=00000000c402d003, *pmd=00000000c402e003, *pte=0060000011001707
   Internal error: Oops: 96000005 [#1] PREEMPT SMP
   Modules linked in:
   CPU: 1 PID: 12 Comm: ksoftirqd/1 Not tainted 4.1.35-01409-gf0c4b20 #16
   Hardware name: Samsung TM2 board (DT)
   Task: ffffffc0a41dcec0 ti: ffffffc0a4204000 task.ti: ffffffc0a4204000
   PC is at tick_periodic+0x38/0xc4
   LR is at tick_periodic+0x28/0xc4
   pc : [<ffffffc000108234>] lr : [<ffffffc000108224>] pstate: 800000c5
   sp : ffffffc0a4207b60
   x29: ffffffc0a4207b60 x28: ffffffc000eab000
   x27: ffffffc000eab000 x26: ffffffc001249f10
   x25: ffffffc0a4005a00 x24: ffffffc00124a000
   x23: ffffffc00124a000 x22: 0000000000000001
   x21: 0000000000000000 x20: ffffffc0bf5c64c0
   x19: 0000010a2ad67b00 x18: 0000000000000000
   x17: 0000000000000000 x16: 0000000000000000
   x15: 0000000000000000 x14: 0ffffffffffffffe
   x13: 0000000000000020 x12: 0000000000000001
   x11: 7f7f7f7f7f7f7f7f x10: fefefeff534f484f
   x9 : ffffffc0a4207cc0 x8 : ffffffc0a41dd430
   x7 : 0000000000000008 x6 : ffffff8000048440
   x5 : 0000000000005dc0 x4 : 0000000000000100
   x3 : ffffffc0a4204000 x2 : ffffffc0a4207b20
   x1 : 00000000be51f000 x0 : 0000000000000000

   Process ksoftirqd/1 (pid: 12, stack limit = 0xffffffc0a4204020)
   Stack: (0xffffffc0a4207b60 to 0xffffffc0a4208000)
   7b60: a4207b80 ffffffc0 001084ac ffffffc0 2ad67b00 0000010a bf5c64c0 ffffffc0
   7b80: a4207bb0 ffffffc0 0073d084 ffffffc0 bf5c64c0 ffffffc0 00000003 00000000
   7ba0: 00000000 00000000 00000000 00000000 a4207bd0 ffffffc0 000e9fe0 ffffffc0
   7bc0: a40ddc00 ffffffc0 000d49e8 ffffffc0 a4207c40 ffffffc0 000ea254 ffffffc0
   7be0: a4005a00 ffffffc0 a4005a98 ffffffc0 01120460 ffffffc0 00ea7008 ffffffc0
   7c00: 00f52630 ffffffc0 00f72648 ffffffc0 00000100 00000000 010ba000 ffffffc0
   7c20: 010a1000 ffffffc0 00ea7008 ffffffc0 00eabdc0 ffffffc0 00eabda8 ffffffc0
   7c40: a4207c80 ffffffc0 000ecf90 ffffffc0 a4005a00 ffffffc0 a4005a98 ffffffc0
   7c60: 01120460 ffffffc0 00ea7008 ffffffc0 a4207c80 ffffffc0 a40ddc00 ffffffc0
   7c80: a4207cb0 ffffffc0 000ec92c ffffffc0 00000003 00000000 0127a6a0 ffffffc0
   7ca0: 010da348 ffffffc0 010a1a98 ffffffc0 a4207ce0 ffffffc0 0009fa90 ffffffc0
   7cc0: 010da390 ffffffc0 010da398 ffffffc0 00000000 00000000 0009fa58 ffffffc0
   7ce0: a4207d20 ffffffc0 0009edfc ffffffc0 00000006 00000000 00000007 00000000
   7d00: 0124a300 ffffffc0 010ba130 ffffffc0 00000006 00000000 00000040 00000000
   7d20: a4207da0 ffffffc0 0009f10c ffffffc0 a4204000 ffffffc0 a4119d00 ffffffc0
   7d40: 00000001 00000000 010d1ce0 ffffffc0 00000001 00000000 00000002 00000000
   7d60: 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000
   7d80: 0001495e 00000001 00ea75a8 ffffffc0 04208040 0000000a 010a1b38 ffffffc0
   7da0: a4207db0 ffffffc0 000bb520 ffffffc0 a4207e00 ffffffc0 000b7d34 ffffffc0
   7dc0: a4119d40 ffffffc0 01257658 ffffffc0 00ea7010 ffffffc0 a4119d00 ffffffc0
   7de0: 000bb304 ffffffc0 00000000 00000000 00000000 00000000 a4119d00 ffffffc0
   7e00: 00000000 00000000 00085d80 ffffffc0 000b7c58 ffffffc0 a4119d40 ffffffc0
   7e20: 00000000 00000000 00000000 00000000 00000000 00000000 00a810b4 ffffffc0
   7e40: a4207e50 ffffffc0 00000001 00000000 00000001 ffffffc0 a4119d00 ffffffc0
   7e60: 00000000 ffffffc0 01f501f5 dead4ead ffffffff 00000000 ffffffff ffffffff
   7e80: a4207e80 ffffffc0 a4207e80 ffffffc0 00000000 00000000 00000000 dead4ead
   7ea0: ffffffff ffffffc0 ffffffff ffffffff a4207eb0 ffffffc0 a4207eb0 ffffffc0
   7ec0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
   7ee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
   7f00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
   7f20: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
   7f40: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
   7f60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
   7f80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
   7fa0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
   7fc0: 00000000 00000000 00000005 00000000 00000000 00000000 00000000 00000000
   7fe0: 00000000 00000000 00000000 00000000 ffffffff ffffffff ffffffff ffffffff

   Call trace:
   [<ffffffc000108234>] tick_periodic+0x38/0xc4
   [<ffffffc0001084ac>] tick_handle_periodic+0x24/0x78
   [<ffffffc00073d084>] exynos4_mct_tick_isr+0x54/0x64
   [<ffffffc0000e9fe0>] handle_irq_event_percpu+0x6c/0x294
   [<ffffffc0000ea254>] handle_irq_event+0x4c/0x78
   [<ffffffc0000ecf90>] handle_fasteoi_irq+0xe4/0x1a4
   [<ffffffc0000ec92c>] resend_irqs+0x54/0x8c
   [<ffffffc00009fa90>] tasklet_action+0xa4/0x170
   [<ffffffc00009edfc>] __do_softirq+0xcc/0x3a8
   [<ffffffc00009f10c>] run_ksoftirqd+0x34/0x48
   [<ffffffc0000bb520>] smpboot_thread_fn+0x21c/0x2b4
   [<ffffffc0000b7d34>] kthread+0xdc/0xf0
   Code: b0007ce0 d538d081 913c6000 f8606820 (f9408400)
   ---[ end trace 7232a23031ea6a74 ]---

Change-Id: I20b7d867d9894df1c81a30e91bca0233cf3b173e
Fixes: 56a94f13919c ("clocksource: exynos_mct: Avoid blocking calls in the cpu hotplug notifier")
Cc: stable@vger.kernel.org #v4.2+ #v4.1.4+ #3.18.18+ #v3.16.18+ #v3.12.46+
Reported-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Adjust commit-msg]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoLinux 4.1.36 v4.1.36
Sasha Levin [Tue, 29 Nov 2016 16:34:50 +0000 (11:34 -0500)]
Linux 4.1.36

Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agokbuild: add -fno-PIE
Sebastian Andrzej Siewior [Fri, 4 Nov 2016 18:39:38 +0000 (19:39 +0100)]
kbuild: add -fno-PIE

[ Upstream commit 8ae94224c9d72fc4d9aaac93b2d7833cf46d7141 ]

Debian started to build the gcc with -fPIE by default so the kernel
build ends before it starts properly with:
|kernel/bounds.c:1:0: error: code model kernel does not support PIC mode

Also add to KBUILD_AFLAGS due to:

|gcc -Wp,-MD,arch/x86/entry/vdso/vdso32/.note.o.d … -mfentry -DCC_USING_FENTRY … vdso/vdso32/note.S
|arch/x86/entry/vdso/vdso32/note.S:1:0: sorry, unimplemented: -mfentry isn’t supported for 32-bit in combination with -fpic

Tagging it stable so it is possible to compile recent stable kernels as
well.

Cc: stable@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agofirewire: net: fix fragmented datagram_size off-by-one
Stefan Richter [Sun, 30 Oct 2016 16:32:01 +0000 (17:32 +0100)]
firewire: net: fix fragmented datagram_size off-by-one

[ Upstream commit e9300a4b7bbae83af1f7703938c94cf6dc6d308f ]

RFC 2734 defines the datagram_size field in fragment encapsulation
headers thus:

    datagram_size:  The encoded size of the entire IP datagram.  The
    value of datagram_size [...] SHALL be one less than the value of
    Total Length in the datagram's IP header (see STD 5, RFC 791).

Accordingly, the eth1394 driver of Linux 2.6.36 and older set and got
this field with a -/+1 offset:

    ether1394_tx() /* transmit */
        ether1394_encapsulate_prep()
            hdr->ff.dg_size = dg_size - 1;

    ether1394_data_handler() /* receive */
        if (hdr->common.lf == ETH1394_HDR_LF_FF)
            dg_size = hdr->ff.dg_size + 1;
        else
            dg_size = hdr->sf.dg_size + 1;

Likewise, I observe OS X 10.4 and Windows XP Pro SP3 to transmit 1500
byte sized datagrams in fragments with datagram_size=1499 if link
fragmentation is required.

Only firewire-net sets and gets datagram_size without this offset.  The
result is lacking interoperability of firewire-net with OS X, Windows
XP, and presumably Linux' eth1394.  (I did not test with the latter.)
For example, FTP data transfers to a Linux firewire-net box with max_rec
smaller than the 1500 bytes MTU
  - from OS X fail entirely,
  - from Win XP start out with a bunch of fragmented datagrams which
    time out, then continue with unfragmented datagrams because Win XP
    temporarily reduces the MTU to 576 bytes.

So let's fix firewire-net's datagram_size accessors.

Note that firewire-net thereby loses interoperability with unpatched
firewire-net, but only if link fragmentation is employed.  (This happens
with large broadcast datagrams, and with large datagrams on several
FireWire CardBus cards with smaller max_rec than equivalent PCI cards,
and it can be worked around by setting a small enough MTU.)

Cc: stable@vger.kernel.org
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agofirewire: net: guard against rx buffer overflows
Stefan Richter [Sat, 29 Oct 2016 19:28:18 +0000 (21:28 +0200)]
firewire: net: guard against rx buffer overflows

[ Upstream commit 667121ace9dbafb368618dbabcf07901c962ddac ]

The IP-over-1394 driver firewire-net lacked input validation when
handling incoming fragmented datagrams.  A maliciously formed fragment
with a respectively large datagram_offset would cause a memcpy past the
datagram buffer.

So, drop any packets carrying a fragment with offset + length larger
than datagram_size.

In addition, ensure that
  - GASP header, unfragmented encapsulation header, or fragment
    encapsulation header actually exists before we access it,
  - the encapsulated datagram or fragment is of nonzero size.

Reported-by: Eyal Itkin <eyal.itkin@gmail.com>
Reviewed-by: Eyal Itkin <eyal.itkin@gmail.com>
Fixes: CVE 2016-8633
Cc: stable@vger.kernel.org
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoparisc: Ensure consistent state when switching to kernel stack at syscall entry
John David Anglin [Sat, 29 Oct 2016 03:00:34 +0000 (23:00 -0400)]
parisc: Ensure consistent state when switching to kernel stack at syscall entry

[ Upstream commit 6ed518328d0189e0fdf1bb7c73290d546143ea66 ]

We have one critical section in the syscall entry path in which we switch from
the userspace stack to kernel stack. In the event of an external interrupt, the
interrupt code distinguishes between those two states by analyzing the value of
sr7. If sr7 is zero, it uses the kernel stack. Therefore it's important, that
the value of sr7 is in sync with the currently enabled stack.

This patch now disables interrupts while executing the critical section.  This
prevents the interrupt handler to possibly see an inconsistent state which in
the worst case can lead to crashes.

Interestingly, in the syscall exit path interrupts were already disabled in the
critical section which switches back to the userspace stack.

Cc: <stable@vger.kernel.org>
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoovl: fsync after copy-up
Miklos Szeredi [Mon, 31 Oct 2016 13:42:14 +0000 (14:42 +0100)]
ovl: fsync after copy-up

[ Upstream commit 641089c1549d8d3df0b047b5de7e9a111362cdce ]

Make sure the copied up file hits the disk before renaming to the final
destination.  If this is not done then the copy-up may corrupt the data in
the file in case of a crash.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agovirtio: console: Unlock vqs while freeing buffers
Matt Redfearn [Tue, 11 Oct 2016 11:05:15 +0000 (12:05 +0100)]
virtio: console: Unlock vqs while freeing buffers

[ Upstream commit 34563769e438d2881f62cf4d9badc4e589ac0ec0 ]

Commit c6017e793b93 ("virtio: console: add locks around buffer removal
in port unplug path") added locking around the freeing of buffers in the
vq. However, when free_buf() is called with can_sleep = true and rproc
is enabled, it calls dma_free_coherent() directly, requiring interrupts
to be enabled. Currently a WARNING is triggered due to the spin locking
around free_buf, with a call stack like this:

WARNING: CPU: 3 PID: 121 at ./include/linux/dma-mapping.h:433
free_buf+0x1a8/0x288
Call Trace:
[<8040c538>] show_stack+0x74/0xc0
[<80757240>] dump_stack+0xd0/0x110
[<80430d98>] __warn+0xfc/0x130
[<80430ee0>] warn_slowpath_null+0x2c/0x3c
[<807e7c6c>] free_buf+0x1a8/0x288
[<807ea590>] remove_port_data+0x50/0xac
[<807ea6a0>] unplug_port+0xb4/0x1bc
[<807ea858>] virtcons_remove+0xb0/0xfc
[<807b6734>] virtio_dev_remove+0x58/0xc0
[<807f918c>] __device_release_driver+0xac/0x134
[<807f924c>] device_release_driver+0x38/0x50
[<807f7edc>] bus_remove_device+0xfc/0x130
[<807f4b74>] device_del+0x17c/0x21c
[<807f4c38>] device_unregister+0x24/0x38
[<807b6b50>] unregister_virtio_device+0x28/0x44

Fix this by restructuring the loops to allow the locks to only be taken
where it is necessary to protect the vqs, and release it while the
buffer is being freed.

Fixes: c6017e793b93 ("virtio: console: add locks around buffer removal in port unplug path")
Cc: stable@vger.kernel.org
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agomd: be careful not lot leak internal curr_resync value into metadata. -- (all)
NeilBrown [Fri, 28 Oct 2016 04:59:41 +0000 (15:59 +1100)]
md: be careful not lot leak internal curr_resync value into metadata. -- (all)

[ Upstream commit 1217e1d1999ed6c9c1e1b1acae0a74ab70464ae2 ]

mddev->curr_resync usually records where the current resync is up to,
but during the starting phase it has some "magic" values.

 1 - means that the array is trying to start a resync, but has yielded
     to another array which shares physical devices, and also needs to
     start a resync
 2 - means the array is trying to start resync, but has found another
     array which shares physical devices and has already started resync.

 3 - means that resync has commensed, but it is possible that nothing
     has actually been resynced yet.

It is important that this value not be visible to user-space and
particularly that it doesn't get written to the metadata, as the
resync or recovery checkpoint.  In part, this is because it may be
slightly higher than the correct value, though this is very rare.
In part, because it is not a multiple of 4K, and some devices only
support 4K aligned accesses.

There are two places where this value is propagates into either
->curr_resync_completed or ->recovery_cp or ->recovery_offset.
These currently avoid the propagation of values 1 and 3, but will
allow 3 to leak through.

Change them to only propagate the value if it is > 3.

As this can cause an array to fail, the patch is suitable for -stable.

Cc: stable@vger.kernel.org (v3.7+)
Reported-by: Viswesh <viswesh.vichu@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agomd: sync sync_completed has correct value as recovery finishes.
NeilBrown [Fri, 24 Jul 2015 03:27:08 +0000 (13:27 +1000)]
md: sync sync_completed has correct value as recovery finishes.

[ Upstream commit 5ed1df2eacc0ba92c8c7e2499c97594b5ef928a8 ]

There can be a small window between the moment that recovery
actually writes the last block and the time when various sysfs
and /proc/mdstat attributes report that it has finished.
During this time, 'sync_completed' can have the wrong value.
This can confuse monitoring software.

So:
 - don't set curr_resync_completed beyond the end of the devices,
 - set it correctly when resync/recovery has completed.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoscsi: arcmsr: Send SYNCHRONIZE_CACHE command to firmware
Ching Huang [Wed, 19 Oct 2016 09:50:26 +0000 (17:50 +0800)]
scsi: arcmsr: Send SYNCHRONIZE_CACHE command to firmware

[ Upstream commit 2bf7dc8443e113844d078fd6541b7f4aa544f92f ]

The arcmsr driver failed to pass SYNCHRONIZE CACHE to controller
firmware. Depending on how drive caches are handled internally by
controller firmware this could potentially lead to data integrity
problems.

Ensure that cache flushes are passed to the controller.

[mkp: applied by hand and removed unused vars]

Cc: <stable@vger.kernel.org>
Signed-off-by: Ching Huang <ching2048@areca.com.tw>
Reported-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoscsi: scsi_debug: Fix memory leak if LBP enabled and module is unloaded
Ewan D. Milne [Wed, 26 Oct 2016 15:22:53 +0000 (11:22 -0400)]
scsi: scsi_debug: Fix memory leak if LBP enabled and module is unloaded

[ Upstream commit 4d2b496f19f3c2cfaca1e8fa0710688b5ff3811d ]

map_storep was not being vfree()'d in the module_exit call.

Cc: <stable@vger.kernel.org>
Signed-off-by: Ewan D. Milne <emilne@redhat.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agodrm/radeon/si_dpm: workaround for SI kickers
Alex Deucher [Fri, 14 Oct 2016 20:38:02 +0000 (16:38 -0400)]
drm/radeon/si_dpm: workaround for SI kickers

[ Upstream commit 7dc86ef5ac91642dfc3eb93ee0f0458e702a343e ]

Consolidate existing quirks. Fixes stability issues
on some kickers.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agodrm/dp/mst: Check peer device type before attempting EDID read
Ville Syrjälä [Wed, 26 Oct 2016 09:05:55 +0000 (12:05 +0300)]
drm/dp/mst: Check peer device type before attempting EDID read

[ Upstream commit 4da5caa6a6f82cda3193bca855235b87debf78bd ]

Only certain types of pdts have the DDC bus registered, so check for
that before we attempt the EDID read. Othwewise we risk playing around
with an i2c adapter that doesn't actually exist.

Cc: stable@vger.kernel.org
Cc: Carlos Santa <carlos.santa@intel.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Tested-by: Carlos Santa <carlos.santa@intel.com>
Tested-by: Kirill A. Shutemov <kirill@shutemov.name>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97666
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1477472755-15288-5-git-send-email-ville.syrjala@linux.intel.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agodrm/dp/mst: add some defines for logical/physical ports
Dave Airlie [Thu, 1 Oct 2015 06:28:25 +0000 (16:28 +1000)]
drm/dp/mst: add some defines for logical/physical ports

[ Upstream commit ccf03d6995fa4b784f5b987726ba98f4859bf326 ]

This just removes the magic number.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agodrm/dp/mst: Clear port->pdt when tearing down the i2c adapter
Ville Syrjälä [Wed, 26 Oct 2016 13:30:33 +0000 (16:30 +0300)]
drm/dp/mst: Clear port->pdt when tearing down the i2c adapter

[ Upstream commit 36e3fa6a38e135e9478a2f75dec9bf6ff1e6480e ]

The i2c adapter is only relevant for some peer device types, so
let's clear the pdt if it's still the same as the old_pdt when we
tear down the i2c adapter.

I don't really like this design pattern of updating port->whatever
before doing the accompanying changes and passing around old_whatever
to figure stuff out. Would make much more sense to me to the pass the
new value around and only update the port->whatever when things are
consistent. But let's try to work with what we have right now.

Quoting a follow-up from Ville:

"And naturally I forgot to amend the commit message w.r.t. this guy
[the change in drm_dp_destroy_port].  We don't really need to do this
here, but I figured I'd try to be a bit more consistent by having it,
just to avoid accidental mistakes if/when someone changes this stuff
again later."

v2: Clear port->pdt in the caller, if needed (Daniel)

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: stable@vger.kernel.org
Cc: Carlos Santa <carlos.santa@intel.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Tested-by: Carlos Santa <carlos.santa@intel.com> (v1)
Tested-by: Kirill A. Shutemov <kirill@shutemov.name> (v1)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97666
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1477488633-16544-1-git-send-email-ville.syrjala@linux.intel.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoKVM: MIPS: Precalculate MMIO load resume PC
James Hogan [Tue, 25 Oct 2016 15:11:12 +0000 (16:11 +0100)]
KVM: MIPS: Precalculate MMIO load resume PC

[ Upstream commit e1e575f6b026734be3b1f075e780e91ab08ca541 ]

The advancing of the PC when completing an MMIO load is done before
re-entering the guest, i.e. before restoring the guest ASID. However if
the load is in a branch delay slot it may need to access guest code to
read the prior branch instruction. This isn't safe in TLB mapped code at
the moment, nor in the future when we'll access unmapped guest segments
using direct user accessors too, as it could read the branch from host
user memory instead.

Therefore calculate the resume PC in advance while we're still in the
right context and save it in the new vcpu->arch.io_pc (replacing the no
longer needed vcpu->arch.pending_load_cause), and restore it on MMIO
completion.

Fixes: e685c689f3a8 ("KVM/MIPS32: Privileged instruction/target branch emulation.")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Cc: <stable@vger.kernel.org> # 3.10.x-
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoKVM: MIPS: Make ERET handle ERL before EXL
James Hogan [Tue, 25 Oct 2016 15:11:11 +0000 (16:11 +0100)]
KVM: MIPS: Make ERET handle ERL before EXL

[ Upstream commit ede5f3e7b54a4347be4d8525269eae50902bd7cd ]

The ERET instruction to return from exception is used for returning from
exception level (Status.EXL) and error level (Status.ERL). If both bits
are set however we should be returning from ERL first, as ERL can
interrupt EXL, for example when an NMI is taken. KVM however checks EXL
first.

Fix the order of the checks to match the pseudocode in the instruction
set manual.

Fixes: e685c689f3a8 ("KVM/MIPS32: Privileged instruction/target branch emulation.")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Cc: <stable@vger.kernel.org> # 3.10.x-
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agodrm/radeon: drop register readback in cayman_cp_int_cntl_setup
Lucas Stach [Mon, 24 Oct 2016 21:32:04 +0000 (23:32 +0200)]
drm/radeon: drop register readback in cayman_cp_int_cntl_setup

[ Upstream commit 537b4b462caa8bfb9726d9695b8e56e2d5e6b41e ]

The read is taking a considerable amount of time (about 50us on this
machine). The register does not ever hold anything other than the ring
ID that is updated in this exact function, so there is no need for
the read modify write cycle.

This chops off a big chunk of the time spent in hardirq disabled
context, as this function is called multiple times in the interrupt
handler. With this change applied radeon won't show up in the list
of the worst IRQ latency offenders anymore, where it was a regular
before.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoscsi: megaraid_sas: Fix data integrity failure for JBOD (passthrough) devices
Kashyap Desai [Fri, 21 Oct 2016 13:33:32 +0000 (06:33 -0700)]
scsi: megaraid_sas: Fix data integrity failure for JBOD (passthrough) devices

[ Upstream commit 1e793f6fc0db920400574211c48f9157a37e3945 ]

Commit 02b01e010afe ("megaraid_sas: return sync cache call with
success") modified the driver to successfully complete SYNCHRONIZE_CACHE
commands without passing them to the controller. Disk drive caches are
only explicitly managed by controller firmware when operating in RAID
mode. So this commit effectively disabled writeback cache flushing for
any drives used in JBOD mode, leading to data integrity failures.

[mkp: clarified patch description]

Fixes: 02b01e010afeeb49328d35650d70721d2ca3fd59
CC: stable@vger.kernel.org
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoRevert "drm/radeon: fix DP link training issue with second 4K monitor"
Michel Dänzer [Mon, 24 Oct 2016 07:52:20 +0000 (16:52 +0900)]
Revert "drm/radeon: fix DP link training issue with second 4K monitor"

[ Upstream commit 9dc79965b21967caebde575f5f5d8bf1aa2c23ab ]

This reverts commit 1a738347df2ee4977459a8776fe2c62196bdcb1b.

It caused at least some Kaveri laptops to incorrectly report DisplayPort
connectors as connected.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97857
Cc: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agopowerpc: Convert cmp to cmpd in idle enter sequence
Sasha Levin [Sun, 20 Nov 2016 15:05:28 +0000 (10:05 -0500)]
powerpc: Convert cmp to cmpd in idle enter sequence

[ Upstream commit 80f23935cadb1c654e81951f5a8b7ceae0acc1b4 ]

PowerPC's "cmp" instruction has four operands. Normally people write
"cmpw" or "cmpd" for the second cmp operand 0 or 1. But, frequently
people forget, and write "cmp" with just three operands.

With older binutils this is silently accepted as if this was "cmpw",
while often "cmpd" is wanted. With newer binutils GAS will complain
about this for 64-bit code. For 32-bit code it still silently assumes
"cmpw" is what is meant.

In this instance the code comes directly from ISA v2.07, including the
cmp, but cmpd is correct. Backport to stable so that new toolchains can
build old kernels.

Fixes: 948cf67c4726 ("powerpc: Add NAP mode support on Power7 in HV mode")
Cc: stable@vger.kernel.org # v3.0
Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agodrm/radeon/si_dpm: Limit clocks on HD86xx part
Tom St Denis [Thu, 13 Oct 2016 16:38:07 +0000 (12:38 -0400)]
drm/radeon/si_dpm: Limit clocks on HD86xx part

[ Upstream commit fb9a5b0c1c9893db2e0d18544fd49e19d784a87d ]

Limit clocks on a specific HD86xx part to avoid
crashes (while awaiting an appropriate PP fix).

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agodrm/radeon/si/dpm: add workaround for for Jet parts
Alex Deucher [Mon, 26 Sep 2016 19:32:50 +0000 (15:32 -0400)]
drm/radeon/si/dpm: add workaround for for Jet parts

[ Upstream commit 670bb4fd21c966d0d2a59ad4a99bb4889f9a2987 ]

Add clock quirks for Jet parts.

Reviewed-by: Sonny Jiang <sonny.jiang@amd.com>
Tested-by: Sonny Jiang <sonny.jiang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoUSB: serial: cp210x: fix tiocmget error handling
Johan Hovold [Wed, 19 Oct 2016 13:45:07 +0000 (15:45 +0200)]
USB: serial: cp210x: fix tiocmget error handling

[ Upstream commit de24e0a108bc48062e1c7acaa97014bce32a919f ]

The current tiocmget implementation would fail to report errors up the
stack and instead leaked a few bits from the stack as a mask of
modem-status flags.

Fixes: 39a66b8d22a3 ("[PATCH] USB: CP2101 Add support for flow control")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoInput: i8042 - add XMG C504 to keyboard reset table
Patrick Scheuring [Wed, 19 Oct 2016 19:04:02 +0000 (12:04 -0700)]
Input: i8042 - add XMG C504 to keyboard reset table

[ Upstream commit da25311c7ca8b0254a686fc0d597075b9aa3b683 ]

The Schenker XMG C504 is a rebranded Gigabyte P35 v2 laptop.
Therefore it also needs a keyboard reset to detect the Elantech touchpad.
Otherwise the touchpad appears to be dead.

With this patch the touchpad is detected:

$ dmesg | grep -E "(i8042|Elantech|elantech)"

[    2.675399] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
[    2.680372] i8042: Attempting to reset device connected to KBD port
[    2.789037] serio: i8042 KBD port at 0x60,0x64 irq 1
[    2.791586] serio: i8042 AUX port at 0x60,0x64 irq 12
[    2.813840] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
[    3.811431] psmouse serio1: elantech: assuming hardware version 4 (with firmware version 0x361f0e)
[    3.825424] psmouse serio1: elantech: Synaptics capabilities query result 0x00, 0x15, 0x0f.
[    3.839424] psmouse serio1: elantech: Elan sample query result 03, 58, 74
[    3.911349] input: ETPS/2 Elantech Touchpad as /devices/platform/i8042/serio1/input/input6

Signed-off-by: Patrick Scheuring <patrick.scheuring.dev@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoALSA: hda - Merge RIRB_PRE_DELAY into CTX_WORKAROUND caps
Takashi Iwai [Thu, 17 Dec 2015 07:12:37 +0000 (08:12 +0100)]
ALSA: hda - Merge RIRB_PRE_DELAY into CTX_WORKAROUND caps

[ Upstream commit ef85f299c74e6c5dd98ec0230183be33f4c2813d ]

AZX_DCAPS_RIRB_PRE_DELAY is always tied with AZX_DCAPS_CTX_WORKAROUND,
which is Creative's XFi specific.  So, we can replace it and reduce
one more bit free for DCAPS.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agomac80211: discard multicast and 4-addr A-MSDUs
Johannes Berg [Wed, 5 Oct 2016 08:14:42 +0000 (10:14 +0200)]
mac80211: discard multicast and 4-addr A-MSDUs

[ Upstream commit ea720935cf6686f72def9d322298bf7e9bd53377 ]

In mac80211, multicast A-MSDUs are accepted in many cases that
they shouldn't be accepted in:
 * drop A-MSDUs with a multicast A1 (RA), as required by the
   spec in 9.11 (802.11-2012 version)
 * drop A-MSDUs with a 4-addr header, since the fourth address
   can't actually be useful for them; unless 4-address frame
   format is actually requested, even though the fourth address
   is still not useful in this case, but ignored

Accepting the first case, in particular, is very problematic
since it allows anyone else with possession of a GTK to send
unicast frames encapsulated in a multicast A-MSDU, even when
the AP has client isolation enabled.

Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoubifs: Fix regression in ubifs_readdir()
Richard Weinberger [Fri, 28 Oct 2016 09:49:03 +0000 (11:49 +0200)]
ubifs: Fix regression in ubifs_readdir()

[ Upstream commit a00052a296e54205cf238c75bd98d17d5d02a6db ]

Commit c83ed4c9dbb35 ("ubifs: Abort readdir upon error") broke
overlayfs support because the fix exposed an internal error
code to VFS.

Reported-by: Peter Rosin <peda@axentia.se>
Tested-by: Peter Rosin <peda@axentia.se>
Reported-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Tested-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Fixes: c83ed4c9dbb35 ("ubifs: Abort readdir upon error")
Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoGenWQE: Fix bad page access during abort of resource allocation
Gerald Schaefer [Wed, 19 Oct 2016 10:29:41 +0000 (12:29 +0200)]
GenWQE: Fix bad page access during abort of resource allocation

[ Upstream commit a7a7aeefbca2982586ba2c9fd7739b96416a6d1d ]

When interrupting an application which was allocating DMAable
memory, it was possible, that the DMA memory was deallocated
twice, leading to the error symptoms below.

Thanks to Gerald, who analyzed the problem and provided this
patch.

I agree with his analysis of the problem: ddcb_cmd_fixups() ->
genwqe_alloc_sync_sgl() (fails in f/lpage, but sgl->sgl != NULL
and f/lpage maybe also != NULL) -> ddcb_cmd_cleanup() ->
genwqe_free_sync_sgl() (double free, because sgl->sgl != NULL and
f/lpage maybe also != NULL)

In this scenario we would have exactly the kind of double free that
would explain the WARNING / Bad page state, and as expected it is
caused by broken error handling (cleanup).

Using the Ubuntu git source, tag Ubuntu-4.4.0-33.52, he was able to reproduce
the "Bad page state" issue, and with the patch on top he could not reproduce
it any more.

------------[ cut here ]------------
WARNING: at /build/linux-o03cxz/linux-4.4.0/arch/s390/include/asm/pci_dma.h:141
Modules linked in: qeth_l2 ghash_s390 prng aes_s390 des_s390 des_generic sha512_s390 sha256_s390 sha1_s390 sha_common genwqe_card qeth crc_itu_t qdio ccwgroup vmur dm_multipath dasd_eckd_mod dasd_mod
CPU: 2 PID: 3293 Comm: genwqe_gunzip Not tainted 4.4.0-33-generic #52-Ubuntu
task: 0000000032c7e270 ti: 00000000324e4000 task.ti: 00000000324e4000
Krnl PSW : 0404c00180000000 0000000000156346 (dma_update_cpu_trans+0x9e/0xa8)
           R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 EA:3
Krnl GPRS: 00000000324e7bcd 0000000000c3c34a 0000000027628298 000000003215b400
           0000000000000400 0000000000001fff 0000000000000400 0000000116853000
           07000000324e7b1e 0000000000000001 0000000000000001 0000000000000001
           0000000000001000 0000000116854000 0000000000156402 00000000324e7a38
Krnl Code: 000000000015633a95001000           cli     0(%r1),0
           000000000015633ea774ffc3           brc     7,1562c4
          #0000000000156342a7f40001           brc     15,156344
          >000000000015634692011000           mvi     0(%r1),1
           000000000015634aa7f4ffbd           brc     15,1562c4
           000000000015634e: 0707               bcr     0,%r7
           0000000000156350c00400000000       brcl    0,156350
           0000000000156356eb7ff0500024       stmg    %r7,%r15,80(%r15)
Call Trace:
([<00000000001563e0>] dma_update_trans+0x90/0x228)
 [<00000000001565dc>] s390_dma_unmap_pages+0x64/0x160
 [<00000000001567c2>] s390_dma_free+0x62/0x98
 [<000003ff801310ce>] __genwqe_free_consistent+0x56/0x70 [genwqe_card]
 [<000003ff801316d0>] genwqe_free_sync_sgl+0xf8/0x160 [genwqe_card]
 [<000003ff8012bd6e>] ddcb_cmd_cleanup+0x86/0xa8 [genwqe_card]
 [<000003ff8012c1c0>] do_execute_ddcb+0x110/0x348 [genwqe_card]
 [<000003ff8012c914>] genwqe_ioctl+0x51c/0xc20 [genwqe_card]
 [<000000000032513a>] do_vfs_ioctl+0x3b2/0x518
 [<0000000000325344>] SyS_ioctl+0xa4/0xb8
 [<00000000007b86c6>] system_call+0xd6/0x264
 [<000003ff9e8e520a>] 0x3ff9e8e520a
Last Breaking-Event-Address:
 [<0000000000156342>] dma_update_cpu_trans+0x9a/0xa8
---[ end trace 35996336235145c8 ]---
BUG: Bad page state in process jbd2/dasdb1-8  pfn:3215b
page:000003d100c856c0 count:-1 mapcount:0 mapping:          (null) index:0x0
flags: 0x3fffc0000000000()
page dumped because: nonzero _count

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Frank Haverkamp <haver@linux.vnet.ibm.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agomm/list_lru.c: avoid error-path NULL pointer deref
Alexander Polakov [Fri, 28 Oct 2016 00:46:27 +0000 (17:46 -0700)]
mm/list_lru.c: avoid error-path NULL pointer deref

[ Upstream commit 1bc11d70b5db7c6bb1414b283d7f09b1fe1ac0d0 ]

As described in https://bugzilla.kernel.org/show_bug.cgi?id=177821:

After some analysis it seems to be that the problem is in alloc_super().
In case list_lru_init_memcg() fails it goes into destroy_super(), which
calls list_lru_destroy().

And in list_lru_init() we see that in case memcg_init_list_lru() fails,
lru->node is freed, but not set NULL, which then leads list_lru_destroy()
to believe it is initialized and call memcg_destroy_list_lru().
memcg_destroy_list_lru() in turn can access lru->node[i].memcg_lrus,
which is NULL.

[akpm@linux-foundation.org: add comment]
Signed-off-by: Alexander Polakov <apolyakov@beget.ru>
Acked-by: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agobtrfs: fix races on root_log_ctx lists
Chris Mason [Thu, 27 Oct 2016 17:42:20 +0000 (10:42 -0700)]
btrfs: fix races on root_log_ctx lists

[ Upstream commit 570dd45042a7c8a7aba1ee029c5dd0f5ccf41b9b ]

btrfs_remove_all_log_ctxs takes a shortcut where it avoids walking the
list because it knows all of the waiters are patiently waiting for the
commit to finish.

But, there's a small race where btrfs_sync_log can remove itself from
the list if it finds a log commit is already done.  Also, it uses
list_del_init() to remove itself from the list, but there's no way to
know if btrfs_remove_all_log_ctxs has already run, so we don't know for
sure if it is safe to call list_del_init().

This gets rid of all the shortcuts for btrfs_remove_all_log_ctxs(), and
just calls it with the proper locking.

This is part two of the corruption fixed by cbd60aa7cd1.  I should have
done this in the first place, but convinced myself the optimizations were
safe.  A 12 hour run of dbench 2048 will eventually trigger a list debug
WARN_ON for the list_del_init() in btrfs_sync_log().

Fixes: d1433debe7f4346cf9fc0dafc71c3137d2a97bc4
Reported-by: Dave Jones <davej@codemonkey.org.uk>
cc: stable@vger.kernel.org # 3.15+
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agovt: clear selection before resizing
Scot Doyle [Thu, 13 Oct 2016 17:12:43 +0000 (12:12 -0500)]
vt: clear selection before resizing

[ Upstream commit 009e39ae44f4191188aeb6dfbf661b771dbbe515 ]

When resizing a vt its selection may exceed the new size, resulting in
an invalid memory access [1]. Clear the selection before resizing.

[1] http://lkml.kernel.org/r/CACT4Y+acDTwy4umEvf5ROBGiRJNrxHN4Cn5szCXE5Jw-d1B=Xw@mail.gmail.com

Reported-and-tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agotty: limit terminal size to 4M chars
Dmitry Vyukov [Fri, 14 Oct 2016 13:18:28 +0000 (15:18 +0200)]
tty: limit terminal size to 4M chars

[ Upstream commit 32b2921e6a7461fe63b71217067a6cf4bddb132f ]

Size of kmalloc() in vc_do_resize() is controlled by user.
Too large kmalloc() size triggers WARNING message on console.
Put a reasonable upper bound on terminal size to prevent WARNINGs.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
CC: David Rientjes <rientjes@google.com>
Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: linux-kernel@vger.kernel.org
Cc: syzkaller@googlegroups.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoALSA: usb-audio: Add quirk for Syntek STK1160
Marcel Hasler [Wed, 26 Oct 2016 22:42:27 +0000 (00:42 +0200)]
ALSA: usb-audio: Add quirk for Syntek STK1160

[ Upstream commit bdc3478f90cd4d2928197f36629d5cf93b64dbe9 ]

The stk1160 chip needs QUIRK_AUDIO_ALIGN_TRANSFER. This patch resolves
the issue reported on the mailing list
(http://marc.info/?l=linux-sound&m=139223599126215&w=2) and also fixes
bug 180071 (https://bugzilla.kernel.org/show_bug.cgi?id=180071).

Signed-off-by: Marcel Hasler <mahasler@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agoKEYS: Fix short sprintf buffer in /proc/keys show function
David Howells [Wed, 26 Oct 2016 14:01:54 +0000 (15:01 +0100)]
KEYS: Fix short sprintf buffer in /proc/keys show function

[ Upstream commit 03dab869b7b239c4e013ec82aea22e181e441cfc ]

This fixes CVE-2016-7042.

Fix a short sprintf buffer in proc_keys_show().  If the gcc stack protector
is turned on, this can cause a panic due to stack corruption.

The problem is that xbuf[] is not big enough to hold a 64-bit timeout
rendered as weeks:

(gdb) p 0xffffffffffffffffULL/(60*60*24*7)
$2 = 30500568904943

That's 14 chars plus NUL, not 11 chars plus NUL.

Expand the buffer to 16 chars.

I think the unpatched code apparently works if the stack-protector is not
enabled because on a 32-bit machine the buffer won't be overflowed and on a
64-bit machine there's a 64-bit aligned pointer at one side and an int that
isn't checked again on the other side.

The panic incurred looks something like:

Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: ffffffff81352ebe
CPU: 0 PID: 1692 Comm: reproducer Not tainted 4.7.2-201.fc24.x86_64 #1
Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
 0000000000000086 00000000fbbd2679 ffff8800a044bc00 ffffffff813d941f
 ffffffff81a28d58 ffff8800a044bc98 ffff8800a044bc88 ffffffff811b2cb6
 ffff880000000010 ffff8800a044bc98 ffff8800a044bc30 00000000fbbd2679
Call Trace:
 [<ffffffff813d941f>] dump_stack+0x63/0x84
 [<ffffffff811b2cb6>] panic+0xde/0x22a
 [<ffffffff81352ebe>] ? proc_keys_show+0x3ce/0x3d0
 [<ffffffff8109f7f9>] __stack_chk_fail+0x19/0x30
 [<ffffffff81352ebe>] proc_keys_show+0x3ce/0x3d0
 [<ffffffff81350410>] ? key_validate+0x50/0x50
 [<ffffffff8134db30>] ? key_default_cmp+0x20/0x20
 [<ffffffff8126b31c>] seq_read+0x2cc/0x390
 [<ffffffff812b6b12>] proc_reg_read+0x42/0x70
 [<ffffffff81244fc7>] __vfs_read+0x37/0x150
 [<ffffffff81357020>] ? security_file_permission+0xa0/0xc0
 [<ffffffff81246156>] vfs_read+0x96/0x130
 [<ffffffff81247635>] SyS_read+0x55/0xc0
 [<ffffffff817eb872>] entry_SYSCALL_64_fastpath+0x1a/0xa4

Reported-by: Ondrej Kozina <okozina@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Ondrej Kozina <okozina@redhat.com>
cc: stable@vger.kernel.org
Signed-off-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agohv: do not lose pending heartbeat vmbus packets
Long Li [Wed, 5 Oct 2016 23:57:46 +0000 (16:57 -0700)]
hv: do not lose pending heartbeat vmbus packets

[ Upstream commit 407a3aee6ee2d2cb46d9ba3fc380bc29f35d020c ]

The host keeps sending heartbeat packets independent of the
guest responding to them.  Even though we respond to the heartbeat messages at
interrupt level, we can have situations where there maybe multiple heartbeat
messages pending that have not been responded to. For instance this occurs when the
VM is paused and the host continues to send the heartbeat messages.
Address this issue by draining and responding to all
the heartbeat messages that maybe pending.

Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
7 years agomei: txe: don't clean an unprocessed interrupt cause.
Alexander Usyskin [Tue, 18 Oct 2016 22:34:48 +0000 (01:34 +0300)]
mei: txe: don't clean an unprocessed interrupt cause.

[ Upstream commit 43605e293eb13c07acb546c14f407a271837af17 ]

SEC registers are not accessible when the TXE device is in low power
state, hence the SEC interrupt cannot be processed if device is not
awake.

In some rare cases entrance to low power state (aliveness off) and input
ready bits can be signaled at the same time, resulting in communication
stall as input ready won't be signaled again after waking up. To resolve
this IPC_HHIER_SEC bit in HHISR_REG should not be cleaned if the
interrupt is not processed.

Cc: stable@vger.kernel.org
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>