]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
8 years agoRevert "clk: qcom: Add support for msm8974 RPM-SMD clocks"
Srinivas Kandagatla [Wed, 22 Jun 2016 13:44:39 +0000 (14:44 +0100)]
Revert "clk: qcom: Add support for msm8974 RPM-SMD clocks"

This reverts commit 7d74cab904d0bd65eccbfd4871b4c3b08c91e2c7.

8 years agoRevert "clk: qcom: Add support for apq8084 RPM-SMD clocks"
Srinivas Kandagatla [Wed, 22 Jun 2016 13:44:33 +0000 (14:44 +0100)]
Revert "clk: qcom: Add support for apq8084 RPM-SMD clocks"

This reverts commit 7d8517906b7667e54708b40d1a6483b5bd12313c.

8 years agodrivers: bluetooth: fix btqcomsmd driver compatible name
Nicolas Dechesne [Wed, 22 Jun 2016 16:12:44 +0000 (18:12 +0200)]
drivers: bluetooth: fix btqcomsmd driver compatible name

The binding merged upstream specifies that the compatible should be
qcom,wcnss-bt, so update wherever it's needed.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agoARM: dts: sd-600eval: enable mdp
Srinivas Kandagatla [Wed, 22 Jun 2016 11:29:52 +0000 (12:29 +0100)]
ARM: dts: sd-600eval: enable mdp

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
8 years agoARM: dts: ifc6410: enable q6 dsp node
Srinivas Kandagatla [Wed, 22 Jun 2016 11:29:51 +0000 (12:29 +0100)]
ARM: dts: ifc6410: enable q6 dsp node

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
8 years agoARM: dts: qcom: rename wcn remoteproc node
Nicolas Dechesne [Wed, 22 Jun 2016 07:47:06 +0000 (09:47 +0200)]
ARM: dts: qcom: rename wcn remoteproc node

Use wcnss@ instead, since this is the name name we use on other boards using WCN
, such as DragonBoard 410c.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agoarm: configs: enable BT QCOM SMD
Nicolas Dechesne [Wed, 22 Jun 2016 07:06:40 +0000 (09:06 +0200)]
arm: configs: enable BT QCOM SMD

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agoarm: configs: enable WCN36xx driver in qcom_defconfig
Nicolas Dechesne [Tue, 21 Jun 2016 09:36:08 +0000 (11:36 +0200)]
arm: configs: enable WCN36xx driver in qcom_defconfig

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agoarm: configs: enable QCOM drivers in qcom_defconfig
Nicolas Dechesne [Tue, 21 Jun 2016 08:50:58 +0000 (11:50 +0300)]
arm: configs: enable QCOM drivers in qcom_defconfig

* all remoteproc drivers
* mainline implementation for SMS and SMP2P

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agoremoteproc: set MBA_FIRMWARE_NAME to mba.mbn
Nicolas Dechesne [Thu, 9 Jun 2016 08:57:09 +0000 (10:57 +0200)]
remoteproc: set MBA_FIRMWARE_NAME to mba.mbn

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agoremoteproc: qcom: Merge cleanup and fixup from the future
Bjorn Andersson [Fri, 17 Jun 2016 04:08:17 +0000 (21:08 -0700)]
remoteproc: qcom: Merge cleanup and fixup from the future

This incorporates cleanups done in preparation for mainline submission;
halt regs comes from the tcsr syscon, the mdt loader uses
rproc_da_to_va() to simplify the api, supplies are handled, requesting
stop is implemented and a few minor cleanups of the DT binding.

Also included is a fix for an issue triggered by the latest DB410c
firmware, where using the mpss_region for verification of the mdt header
results in a timeout on verifying the rest of the modem firmware.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agogpio: Drop smp2p and smsm implementations
Bjorn Andersson [Thu, 9 Jun 2016 05:51:04 +0000 (22:51 -0700)]
gpio: Drop smp2p and smsm implementations

The smem state implementations where rejected by the GPIO maintainer and
has been superseeded. Remove these old and rejected implementations.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoRevert "soc: qcom: Stub IPCRTR client driver"
Bjorn Andersson [Tue, 7 Jun 2016 00:01:02 +0000 (17:01 -0700)]
Revert "soc: qcom: Stub IPCRTR client driver"

This reverts commit 38f515b2f0ee21b27bed1fd36f6710c1ef907765.

QRTR has been backported, so we don't need to keep this stub driver.

8 years agoARM64: dts: qcom: msm8916: Drop depricated smem state nodes
Bjorn Andersson [Thu, 9 Jun 2016 05:48:39 +0000 (22:48 -0700)]
ARM64: dts: qcom: msm8916: Drop depricated smem state nodes

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoARM64: dts: qcom: msm8916: Update wcnss nodes
Bjorn Andersson [Thu, 9 Jun 2016 05:47:52 +0000 (22:47 -0700)]
ARM64: dts: qcom: msm8916: Update wcnss nodes

The WCNSS remoteproc and hw blocks have updated bindings, so update the
dts.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoARM64: dts: qcom: msm8916: Clean up Hexagon PIL node
Bjorn Andersson [Thu, 9 Jun 2016 05:47:12 +0000 (22:47 -0700)]
ARM64: dts: qcom: msm8916: Clean up Hexagon PIL node

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoARM64: dts: msm8916: Add smsm and smp2p nodes
Bjorn Andersson [Wed, 24 Feb 2016 23:12:06 +0000 (15:12 -0800)]
ARM64: dts: msm8916: Add smsm and smp2p nodes

This patch adds the smsm and smp2p nodes for the hexagon and wcnss
cores.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoARM: dts: qcom: apq8064: Update to match latest bindings
Bjorn Andersson [Tue, 7 Jun 2016 16:29:29 +0000 (09:29 -0700)]
ARM: dts: qcom: apq8064: Update to match latest bindings

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoARM: dts: qcom: db600c: Enable wcnss
Bjorn Andersson [Tue, 7 Jun 2016 16:29:03 +0000 (09:29 -0700)]
ARM: dts: qcom: db600c: Enable wcnss

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoARM: dts: qcom: db600c: Enable wcnss
Bjorn Andersson [Tue, 7 Jun 2016 04:56:48 +0000 (21:56 -0700)]
ARM: dts: qcom: db600c: Enable wcnss

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoARM: dts: apq8064: Add wcnss wifi and bt nodes
Bjorn Andersson [Mon, 29 Feb 2016 19:40:52 +0000 (11:40 -0800)]
ARM: dts: apq8064: Add wcnss wifi and bt nodes

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoARM: dts: apq8064: Add wcnss memory and remoteproc nodes
Bjorn Andersson [Mon, 29 Feb 2016 19:38:49 +0000 (11:38 -0800)]
ARM: dts: apq8064: Add wcnss memory and remoteproc nodes

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoARM: dts: qcom: apq8064: Add smd node and all edges
Bjorn Andersson [Tue, 29 Mar 2016 03:37:04 +0000 (20:37 -0700)]
ARM: dts: qcom: apq8064: Add smd node and all edges

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
(cherry picked from commit 2afc5287c50e013c46e07413c066920dc7f55a91)

8 years agoARM: dts: qcom: apq8064: Add complete smsm node
Bjorn Andersson [Tue, 29 Mar 2016 03:37:03 +0000 (20:37 -0700)]
ARM: dts: qcom: apq8064: Add complete smsm node

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
(cherry picked from commit b4d4582fa6959ee494b2146522f1edd72ba6218d)

8 years agoARM: dts: qcom: apq8064: Add syscon for sic-non-secure
Bjorn Andersson [Tue, 29 Mar 2016 03:37:02 +0000 (20:37 -0700)]
ARM: dts: qcom: apq8064: Add syscon for sic-non-secure

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
(cherry picked from commit b9e4c5e6ee26a906fa8514467b5abb9655c3ffdc)

8 years agoremoteproc: qcom: Driver for the self-authenticating Hexagon v5
Bjorn Andersson [Mon, 5 Jan 2015 18:10:08 +0000 (10:10 -0800)]
remoteproc: qcom: Driver for the self-authenticating Hexagon v5

This initial hack powers the q6v5, boots and authenticate the mba and
use that to load the mdt and subsequent bXX files.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agofirmware: qcom-scm: Expose mss_restart through a reset-controller
Bjorn Andersson [Thu, 9 Jun 2016 05:24:16 +0000 (22:24 -0700)]
firmware: qcom-scm: Expose mss_restart through a reset-controller

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agomac80211: Make addr const in SET_IEEE80211_PERM_ADDR()
Bjorn Andersson [Thu, 24 Dec 2015 08:33:26 +0000 (00:33 -0800)]
mac80211: Make addr const in SET_IEEE80211_PERM_ADDR()

Make the addr parameter const in SET_IEEE80211_PERM_ADDR() to save
clients from having to cast away a const qualifier.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agowcn36xx: Disable power save
Bjorn Andersson [Mon, 11 Jan 2016 18:33:27 +0000 (10:33 -0800)]
wcn36xx: Disable power save

Enabling power save results in extremely long ping times and stalling
transfers. So disable it for not until we can figure out how to work
around this.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agowcn36xx: Replace with latest development version
Bjorn Andersson [Tue, 7 Jun 2016 04:59:29 +0000 (21:59 -0700)]
wcn36xx: Replace with latest development version

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agosoc: qcom: wcnss_ctrl: Make wcnss_ctrl parent the other components
Bjorn Andersson [Thu, 25 Feb 2016 16:09:15 +0000 (08:09 -0800)]
soc: qcom: wcnss_ctrl: Make wcnss_ctrl parent the other components

We need the signal from wcnss_ctrl indicating that the firmware is up
and running before we can communicate with the other components of the
chip. So make these other components children of the wcnss_ctrl device,
so they can be probed in order.

The process seems to take between 1/2-5 seconds, so this is done in a
worker, instead of holding up the probe.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoqrtr: smd: Return to new SMD api
Bjorn Andersson [Tue, 7 Jun 2016 04:52:46 +0000 (21:52 -0700)]
qrtr: smd: Return to new SMD api

Fixes: d9552842afd7 ("net: Add Qualcomm IPC router")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agosound: qcom: qdsp6: apr: Clean up SMD integration
Bjorn Andersson [Tue, 7 Jun 2016 04:50:54 +0000 (21:50 -0700)]
sound: qcom: qdsp6: apr: Clean up SMD integration

When the SMD driver probes the channel is up, so we don't need to query
the internals of the qcom_smd_channel for this information.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoBluetooth: Introduce Qualcomm WCNSS SMD based HCI driver
Bjorn Andersson [Wed, 30 Sep 2015 22:31:13 +0000 (15:31 -0700)]
Bluetooth: Introduce Qualcomm WCNSS SMD based HCI driver

The Qualcomm WCNSS chip provides two SMD channels to the BT core; one
for command and one for event packets. This driver exposes the two
channels as a hci device.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agosoc: qcom: smd: Squash away the last differences from v4.7-rc1
Bjorn Andersson [Tue, 7 Jun 2016 03:52:09 +0000 (20:52 -0700)]
soc: qcom: smd: Squash away the last differences from v4.7-rc1

This merges awy the last differences between the 4.4 release branch and
v4.7-rc1.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agosoc: qcom: smd: Make callback pass channel reference
Bjorn Andersson [Tue, 29 Mar 2016 04:35:22 +0000 (21:35 -0700)]
soc: qcom: smd: Make callback pass channel reference

By passing the smd channel reference to the callback, rather than the
smd device, we can open additional smd channels from sub-devices of smd
devices.

Also updates the two smd clients today found in mainline.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
(cherry picked from commit b853cb9628bfbcc4017da46d5f5b46e3eba9d8c6)

8 years agoarm64: configs: switch to mainline implementation of QCOM SMSM and SMP2P
Nicolas Dechesne [Fri, 22 Apr 2016 08:34:20 +0000 (10:34 +0200)]
arm64: configs: switch to mainline implementation of QCOM SMSM and SMP2P

The current release branch include both the old and the upstream implementation
of these drivers, let's switch to mainline.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agoarm64: configs: enable QCOM_WCNSS PIL and CRTL
Nicolas Dechesne [Fri, 22 Apr 2016 07:51:51 +0000 (09:51 +0200)]
arm64: configs: enable QCOM_WCNSS PIL and CRTL

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agowcn36xx: Clean up platform integration
Bjorn Andersson [Wed, 20 Apr 2016 03:54:42 +0000 (20:54 -0700)]
wcn36xx: Clean up platform integration

With the introduction of the upstream wcnss remoteproc driver we do iris
xo calibration before we boot the wcnss - as it should have been done
from the beginning.

This patch cleans out the iris xo calibration code and simplifies the
platform integration implementation.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agosoc: qcom: wcnss_ctrl: Expose the cbc status to others
Bjorn Andersson [Wed, 20 Apr 2016 04:04:15 +0000 (21:04 -0700)]
soc: qcom: wcnss_ctrl: Expose the cbc status to others

The prima driver needs a way to wait for the wcnss firmware to become
available, it does this by repeatedly querying the wcnss control driver
if we've reached cbc (cold boot completed).

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoARM64: dts: qcom: Update wcnss nodes
Bjorn Andersson [Wed, 20 Apr 2016 03:51:52 +0000 (20:51 -0700)]
ARM64: dts: qcom: Update wcnss nodes

Update the wcnss nodes to match the new bindings.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoremoteproc: qcom-tz: Use new PAS api
Bjorn Andersson [Wed, 20 Apr 2016 01:44:11 +0000 (18:44 -0700)]
remoteproc: qcom-tz: Use new PAS api

The PAS api should not carry the clients device handle, as the metadata
allocated should be tied to the scm platform_device.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoqcom-scm: Align PAS api with "upstream" implementation
Bjorn Andersson [Wed, 20 Apr 2016 01:42:10 +0000 (18:42 -0700)]
qcom-scm: Align PAS api with "upstream" implementation

This aligns the PAS implementation with the patches heading upstream,
in particular tying the dma allocation in pas_init_image to the scm
platform_device rather then the caller.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agosoc: qcom: wcnss_ctrl: Make wcnss_ctrl parent the other components
Bjorn Andersson [Thu, 25 Feb 2016 16:09:15 +0000 (08:09 -0800)]
soc: qcom: wcnss_ctrl: Make wcnss_ctrl parent the other components

This is a hacked up version of the patch sent to LKML, as I don't want
to change the smd API in the release branch.

We need the signal from wcnss_ctrl indicating that the firmware is up
and running before we can communicate with the other components of the
chip. So make these other components children of the wcnss_ctrl device,
so they can be probed in order.

The process seems to take between 1/2-5 seconds, so this is done in a
worker, instead of holding up the probe.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agosoc: qcom: smem: Use write-combine remap for SMEM
Bjorn Andersson [Wed, 9 Mar 2016 11:23:23 +0000 (18:23 +0700)]
soc: qcom: smem: Use write-combine remap for SMEM

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoremoteproc: qcom: Introduce WCNSS peripheral image loader
Bjorn Andersson [Sun, 13 Sep 2015 00:31:17 +0000 (17:31 -0700)]
remoteproc: qcom: Introduce WCNSS peripheral image loader

This introduces the peripheral image loader, for loading WCNSS firmware
and boot the core on e.g. MSM8974. The firmware is verified and booted
with the help of the Peripheral Authentication System (PAS) in
TrustZone.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agoremoteproc: debugfs: Add ability to boot remote processor using debugfs
Lee Jones [Tue, 12 Jan 2016 12:46:17 +0000 (12:46 +0000)]
remoteproc: debugfs: Add ability to boot remote processor using debugfs

This functionality is especially useful during the testing phase.  When
used in conjunction with Mailbox's Test Framework we can trivially conduct
end-to-end testing i.e. boot co-processor, send and receive messages to
the co-processor, then shut it down again (repeat as required).

Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoARM: dts: sd_600eval: Fix eMMC lockup issue
Parth Pancholi [Fri, 10 Jun 2016 18:19:55 +0000 (19:19 +0100)]
ARM: dts: sd_600eval: Fix eMMC lockup issue

This board locks up if we stress test the eMMC, as the regulator s4 is
unable to supply enough current for all the peripherials attached to it.
As this supply is wired up to most of the peripherials including DDR,
it resulted in such lockup.

This patch fixes this issue by setting s4 regulator correctly with
Auto power mode.

Reported-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
[Srinivas Kandagatla: rewrote the change log]
Tested-by: Girish Sharma <girish.sharma@einfochips.com>
Signed-off-by: Parth Pancholi <parth.pancholi@einfochips.com>
8 years agoARM: dts: apq8064: rename db600c to SD_600eval
Srinivas Kandagatla [Fri, 10 Jun 2016 18:19:54 +0000 (19:19 +0100)]
ARM: dts: apq8064: rename db600c to SD_600eval

This board has been renamed recently and announced at
https://eragon.einfochips.com/products/sd-600eval.html

So rename this board files so that it reflects actual product in market.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
8 years agoarm64: configs: enable QCOM GPS PROXY
Nicolas Dechesne [Fri, 3 Jun 2016 09:46:57 +0000 (11:46 +0200)]
arm64: configs: enable QCOM GPS PROXY

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agoARM64: dts: qcom: Introduce rmtfs memory region
Bjorn Andersson [Wed, 20 Apr 2016 03:58:26 +0000 (20:58 -0700)]
ARM64: dts: qcom: Introduce rmtfs memory region

The rmtfs memory region is used as shared memory for exchanging blocks
of data read and written to persistent flash storage by the modem.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agoAdd GPS Proxy Driver
Anna Hanna Sedlak Grinbaum [Sun, 10 Apr 2016 06:28:15 +0000 (09:28 +0300)]
Add GPS Proxy Driver

The GPS Proxy Driver is a layer connecting between user space application and
GPSD service.

Change-Id: I8e4dd855839a1d9bc0b8f7431063fc200f8c2ebb
Signed-off-by: Anna Hanna Sedlak Grinbaum <asedla@codeaurora.org>
8 years agoarm64: configs: enable QCOM QRTR
Nicolas Dechesne [Wed, 1 Jun 2016 16:52:56 +0000 (18:52 +0200)]
arm64: configs: enable QCOM QRTR

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agonet: qrtr: fix build problems
Arnd Bergmann [Fri, 13 May 2016 13:09:58 +0000 (15:09 +0200)]
net: qrtr: fix build problems

Having multiple loadable modules with the same name cannot work
with modprobe, and having both net/qrtr/smd.ko and drivers/soc/qcom/smd.ko
results in a (somewhat cryptic) build error:

ERROR: "qcom_smd_driver_unregister" [net/qrtr/smd.ko] undefined!
ERROR: "qcom_smd_driver_register" [net/qrtr/smd.ko] undefined!
ERROR: "qcom_smd_set_drvdata" [net/qrtr/smd.ko] undefined!
ERROR: "qcom_smd_send" [net/qrtr/smd.ko] undefined!
ERROR: "qcom_smd_get_drvdata" [net/qrtr/smd.ko] undefined!
ERROR: "qcom_smd_driver_unregister" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
ERROR: "qcom_smd_driver_register" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
ERROR: "qcom_smd_set_drvdata" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
ERROR: "qcom_smd_send" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
ERROR: "qcom_smd_get_drvdata" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!

Also, the qrtr driver uses the SMD interface and has a Kconfig dependency,
but also allows for compile-testing when SMD is disabled. However, if
with QCOM_SMD=m and COMPILE_TEST=y we can end up with QRTR_SMD=y and
that fails with a related link error.

The changes the dependency so we can still compile-test the driver but
not have it built-in if SMD is a module, to avoid running in the broken
configuration, and changes the Makefile to provide the driver under
a different module name.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: bdabad3e363d ("net: Add Qualcomm IPC router")
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: Add Qualcomm IPC router
Courtney Cavin [Fri, 6 May 2016 14:09:08 +0000 (07:09 -0700)]
net: Add Qualcomm IPC router

Add an implementation of Qualcomm's IPC router protocol, used to
communicate with service providing remote processors.

Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
[bjorn: Cope with 0 being a valid node id and implement RTM_NEWADDR]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agokcm: Kernel Connection Multiplexor module
Tom Herbert [Mon, 7 Mar 2016 22:11:06 +0000 (14:11 -0800)]
kcm: Kernel Connection Multiplexor module

This module implements the Kernel Connection Multiplexor.

Kernel Connection Multiplexor (KCM) is a facility that provides a
message based interface over TCP for generic application protocols.
With KCM an application can efficiently send and receive application
protocol messages over TCP using datagram sockets.

For more information see the included Documentation/networking/kcm.txt

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agotty: serial: msm: Don't read off end of tx fifo
Bjorn Andersson [Fri, 3 Jun 2016 00:48:28 +0000 (17:48 -0700)]
tty: serial: msm: Don't read off end of tx fifo

For dm uarts in pio mode tx data is transferred to the fifo register 4
bytes at a time, but care is not taken when these 4 bytes spans the end
of the xmit buffer so the loop might read up to 3 bytes past the buffer
and then skip the actual data at the beginning of the buffer.

Fix this by, analogous to the DMA case, make sure the chunk doesn't
wrap the xmit buffer.

Fixes: 3a878c430fd6 ("tty: serial: msm: Add TX DMA support")
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Ivan Ivanov <iivanov.xz@gmail.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: stable@vger.kernel.org
Reported-by: Frank Rowand <frowand.list@gmail.com>
Reported-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
8 years agodrm/msm/mdp: Add support for more RGBX formats
Rob Herring [Mon, 11 Apr 2016 23:23:51 +0000 (18:23 -0500)]
drm/msm/mdp: Add support for more RGBX formats

Android needs XBGR8888 format. Add all the missing 32-bpp formats
without alpha for completeness.

Cc: Archit Taneja <architt@codeaurora.org>
Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
8 years agoARM: dts: apq8064: Remove duplicate thermal-zones
Georgi Djakov [Thu, 5 May 2016 11:15:36 +0000 (14:15 +0300)]
ARM: dts: apq8064: Remove duplicate thermal-zones

Remove the duplicate thermal-zones.

Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
8 years agoarm: configs: remove USB_GADGET_DEBUG
Nicolas Dechesne [Fri, 27 May 2016 14:51:16 +0000 (16:51 +0200)]
arm: configs: remove USB_GADGET_DEBUG

In the previous commit we moved DEBUG options into a specific debug config file,
this is a left over.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agoconfigs: move DEBUG configs in their own config file
Nicolas Dechesne [Fri, 27 May 2016 13:52:25 +0000 (15:52 +0200)]
configs: move DEBUG configs in their own config file

* remove DEBUG options from distro.config and defconfig since some of them had
  some drastic impact on system performance
* add debug.config which can be convenient to build a debug flavor of the
  kernel:
  make defconfig distro.config debug.config

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
8 years agospi: qup: Fix DMA mode to work correctly
Andy Gross [Tue, 2 Feb 2016 23:00:53 +0000 (17:00 -0600)]
spi: qup: Fix DMA mode to work correctly

This patch fixes a few issues with the DMA mode.  The QUP needs to be
placed in the run mode before the DMA transactions are executed.  The
conditions for being able to DMA vary between revisions of the QUP.
This is due to v1.1.1 using ADM DMA and later revisions using BAM.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
8 years agospi: qup: Fix transaction done signaling
Andy Gross [Sat, 30 Jan 2016 04:06:50 +0000 (22:06 -0600)]
spi: qup: Fix transaction done signaling

Wait to signal done until we get all of the interrupts we are expecting
to get for a transaction.  If we don't wait for the input done flag, we
can be inbetween transactions when the done flag comes in and this can
mess up the next transaction.

CC: Grant Grundler <grundler@chromium.org>
CC: Sarthak Kukreti <skukreti@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
8 years agoMerge tag 'v4.4.9' into release/qcomlt-4.4
Nicolas Dechesne [Tue, 17 May 2016 12:47:16 +0000 (14:47 +0200)]
Merge tag 'v4.4.9' into release/qcomlt-4.4

This is the 4.4.9 stable release

8 years agoLinux 4.4.9
Greg Kroah-Hartman [Wed, 4 May 2016 21:50:15 +0000 (14:50 -0700)]
Linux 4.4.9

8 years agoextcon: max77843: Use correct size for reading the interrupt register
Dan Carpenter [Thu, 4 Feb 2016 11:36:09 +0000 (14:36 +0300)]
extcon: max77843: Use correct size for reading the interrupt register

commit c4924e92442d7218bd725e47fa3988c73aae84c9 upstream.

The info->status[] array has 3 elements.  We are using size
MAX77843_MUIC_IRQ_NUM (16) instead of MAX77843_MUIC_STATUS_NUM (3) as
intended.

Fixes: 135d9f7d135a ('extcon: max77843: Clear IRQ bits state before request IRQ')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jaewon Kim <jaewon02.kim@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
[cw00.choi: Modify the patch title]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostm class: Select CONFIG_SRCU
Arnd Bergmann [Tue, 22 Dec 2015 15:25:17 +0000 (17:25 +0200)]
stm class: Select CONFIG_SRCU

commit 042d4460b5b4379a12f375045ff9065cf6758735 upstream.

The newly added STM code uses SRCU, but does not ensure that
this code is part of the kernel:

drivers/built-in.o: In function `stm_source_link_show':
include/linux/srcu.h:221: undefined reference to `__srcu_read_lock'
include/linux/srcu.h:238: undefined reference to `__srcu_read_unlock'
drivers/built-in.o: In function `stm_source_link_drop':
include/linux/srcu.h:221: undefined reference to `__srcu_read_lock'
include/linux/srcu.h:238: undefined reference to `__srcu_read_unlock'

This adds a Kconfig 'select' statement like all the other SRCU using
drivers have.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 7bd1d4093c2f ("stm class: Introduce an abstraction for System Trace Module devices")
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agomegaraid_sas: add missing curly braces in ioctl handler
Arnd Bergmann [Mon, 14 Mar 2016 14:29:45 +0000 (15:29 +0100)]
megaraid_sas: add missing curly braces in ioctl handler

commit 3deb9438d34a09f6796639b652a01d110aca9f75 upstream.

gcc-6 found a dubious indentation in the megasas_mgmt_fw_ioctl
function:

drivers/scsi/megaraid/megaraid_sas_base.c: In function 'megasas_mgmt_fw_ioctl':
drivers/scsi/megaraid/megaraid_sas_base.c:6658:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
    kbuff_arr[i] = NULL;
    ^~~~~~~~~
drivers/scsi/megaraid/megaraid_sas_base.c:6653:3: note: ...this 'if' clause, but it is not
   if (kbuff_arr[i])
   ^~

The code is actually correct, as there is no downside in clearing a NULL
pointer again.

This clarifies the code and avoids the warning by adding extra curly
braces.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 90dc9d98f01b ("megaraid_sas : MFI MPT linked list corruption fix")
Reviewed-by: Hannes Reinecke <hare@suse.com>
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agosunrpc/cache: drop reference when sunrpc_cache_pipe_upcall() detects a race
NeilBrown [Fri, 4 Mar 2016 06:20:13 +0000 (17:20 +1100)]
sunrpc/cache: drop reference when sunrpc_cache_pipe_upcall() detects a race

commit a6ab1e8126d205238defbb55d23661a3a5c6a0d8 upstream.

sunrpc_cache_pipe_upcall() can detect a race if CACHE_PENDING is no longer
set.  In this case it aborts the queuing of the upcall.
However it has already taken a new counted reference on "h" and
doesn't "put" it, even though it frees the data structure holding the reference.

So let's delay the "cache_get" until we know we need it.

Fixes: f9e1aedc6c79 ("sunrpc/cache: remove races with queuing an upcall.")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agothermal: rockchip: fix a impossible condition caused by the warning
Caesar Wang [Mon, 15 Feb 2016 07:33:28 +0000 (15:33 +0800)]
thermal: rockchip: fix a impossible condition caused by the warning

commit 43b4eb9fe719b107c8e5d49d1edbff0c135a42cb upstream.

As the Dan report the smatch check the thermal driver warning:
drivers/thermal/rockchip_thermal.c:551 rockchip_configure_from_dt()
warn: impossible condition '(thermal->tshut_temp > ((~0 >> 1))) =>
(s32min-s32max > s32max)'

Although The shut_temp read from DT is u32,the temperature is currently
represented as int not long in the thermal driver.
Let's change to make shut_temp instead of the thermal->tshut_temp for
the condition.

Fixes: commit 437df2172e8d
("thermal: rockchip: consistently use int for temperatures")

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agounbreak allmodconfig KCONFIG_ALLCONFIG=...
Al Viro [Thu, 14 Jan 2016 18:13:49 +0000 (18:13 +0000)]
unbreak allmodconfig KCONFIG_ALLCONFIG=...

commit 6b87b70c5339f30e3c5b32085e69625906513dc2 upstream.

Prior to 3.13 make allmodconfig KCONFIG_ALLCONFIG=/dev/null used
to be equivalent to make allmodconfig; these days it hardwires MODULES to n.
In fact, any KCONFIG_ALLCONFIG that doesn't set MODULES explicitly is
treated as if it set it to n.

Regression had been introduced by commit cfa98f ("kconfig: do not
override symbols already set"); what happens is that conf_read_simple()
does sym_calc_value(modules_sym) on exit, which leaves SYMBOL_VALID set and
has conf_set_all_new_symbols() skip modules_sym.

It's pretty easy to fix - simply move that call of sym_calc_value()
into the callers, except for the ones in KCONFIG_ALLCONFIG handling.
Objections?

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Fixes: cfa98f2e0ae9 ("kconfig: do not override symbols already set")
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agojme: Fix device PM wakeup API usage
Guo-Fu Tseng [Sat, 5 Mar 2016 00:11:56 +0000 (08:11 +0800)]
jme: Fix device PM wakeup API usage

commit 81422e672f8181d7ad1ee6c60c723aac649f538f upstream.

According to Documentation/power/devices.txt

The driver should not use device_set_wakeup_enable() which is the policy
for user to decide.

Using device_init_wakeup() to initialize dev->power.should_wakeup and
dev->power.can_wakeup on driver initialization.

And use device_may_wakeup() on suspend to decide if WoL function should
be enabled on NIC.

Reported-by: Diego Viola <diego.viola@gmail.com>
Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agojme: Do not enable NIC WoL functions on S0
Guo-Fu Tseng [Sat, 5 Mar 2016 00:11:55 +0000 (08:11 +0800)]
jme: Do not enable NIC WoL functions on S0

commit 0772a99b818079e628a1da122ac7ee023faed83e upstream.

Otherwise it might be back on resume right after going to suspend in
some hardware.

Reported-by: Diego Viola <diego.viola@gmail.com>
Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agobus: imx-weim: Take the 'status' property value into account
Fabio Estevam [Mon, 22 Feb 2016 12:01:53 +0000 (09:01 -0300)]
bus: imx-weim: Take the 'status' property value into account

commit 33b96d2c9579213cf3f36d7b29841b1e464750c4 upstream.

Currently we have an incorrect behaviour when multiple devices
are present under the weim node. For example:

&weim {
...
status = "okay";

sram@0,0 {
...
         status = "okay";
};

mram@0,0 {
...
         status = "disabled";
     };
};

In this case only the 'sram' device should be probed and not 'mram'.

However what happens currently is that the status variable is ignored,
causing the 'sram' device to be disabled and 'mram' to be enabled.

Change the weim_parse_dt() function to use
for_each_available_child_of_node()so that the devices marked with
'status = disabled' are not probed.

Suggested-by: Wolfgang Netbal <wolfgang.netbal@sigmatek.at>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoARM: dts: pxa: fix dma engine node to pxa3xx-nand
Robert Jarzmik [Fri, 12 Feb 2016 23:49:20 +0000 (00:49 +0100)]
ARM: dts: pxa: fix dma engine node to pxa3xx-nand

commit 07c6b2d01d351f0512ed7145625265e435ab3240 upstream.

Since the switch from mmp_pdma to pxa_dma driver for pxa architectures,
the pxa_dma requires 2 arguments, namely the requestor line and the
requested priority.

Fix the only left device node which was still passing only one argument,
making the pxa3xx-nand driver misbehave in a device-tree configuration,
ie. failing all data transfers.

Fixes: c943646d1f49 ("ARM: dts: pxa: add dma engine node to pxa3xx-nand")
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoARM: dts: armada-375: use armada-370-sata for SATA
Lior Amsalem [Wed, 10 Feb 2016 16:29:15 +0000 (17:29 +0100)]
ARM: dts: armada-375: use armada-370-sata for SATA

commit b3a7f31eb7375633cd6a742f19488fc5a4208b36 upstream.

The Armada 375 has the same SATA IP as Armada 370 and Armada XP, which
requires the PHY speed to be set in the LP_PHY_CTL register for SATA
hotplug to work.

Therefore, this commit updates the compatible string used to describe
the SATA IP in Armada 375 from marvell,orion-sata to
marvell,armada-370-sata.

Fixes: 4de59085091f753d08c8429d756b46756ab94665 ("ARM: mvebu: add Device Tree description of the Armada 375 SoC")
Signed-off-by: Lior Amsalem <alior@marvell.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoARM: EXYNOS: select THERMAL_OF
Arnd Bergmann [Fri, 29 Jan 2016 14:50:38 +0000 (15:50 +0100)]
ARM: EXYNOS: select THERMAL_OF

commit dc7eb9d589e595954792cc192bcbb92932e5c2ff upstream.

We cannot select a symbol that has disabled dependencies, so
we get a warning if we ever enable EXYNOS_THERMAL without
also turning on THERMAL_OF:

warning: (ARCH_EXYNOS) selects EXYNOS_THERMAL which has unmet direct dependencies (THERMAL && (ARCH_EXYNOS || COMPILE_TEST) && THERMAL_OF)

This adds another 'select' in the platform code to avoid that
case. Alternatively, we could decide to not select EXYNOS_THERMAL
here and instead make it a user option.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: f87e6bd3f740 ("thermal: exynos: Add the dependency of CONFIG_THERMAL_OF instead of CONFIG_OF")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoARM: prima2: always enable reset controller
Arnd Bergmann [Sat, 28 Nov 2015 22:56:47 +0000 (23:56 +0100)]
ARM: prima2: always enable reset controller

commit ef2b1d777d643af227a22309d8b79898b90b123c upstream.

The atlas7 clock controller driver registers a reset controller
for itself, which causes a link error when the subsystem is
disabled:

drivers/built-in.o: In function `atlas7_clk_init':
drivers/clk/sirf/clk-atlas7.c:1681: undefined reference to `reset_controller_register'

As the clk driver does not have a Kconfig symbol for itself
but it always built-in when the platform is enabled, we have
to ensure that the reset controller subsystem is also built-in
in this case.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Fixes: 301c5d29402e ("clk: sirf: add CSR atlas7 clk and reset support")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoARM: OMAP3: Add cpuidle parameters table for omap3430
Pali Rohár [Fri, 19 Feb 2016 18:35:39 +0000 (10:35 -0800)]
ARM: OMAP3: Add cpuidle parameters table for omap3430

commit 98f42221501353067251fbf11e732707dbb68ce3 upstream.

Based on CPU type choose generic omap3 or omap3430 specific cpuidle
parameters. Parameters for omap3430 were measured on Nokia N900 device and
added by commit 5a1b1d3a9efa ("OMAP3: RX-51: Pass cpu idle parameters")
which were later removed by commit 231900afba52 ("ARM: OMAP3: cpuidle -
remove rx51 cpuidle parameters table") due to huge code complexity.

This patch brings cpuidle parameters for omap3430 devices again, but uses
simple condition based on CPU type.

Fixes: 231900afba52 ("ARM: OMAP3: cpuidle - remove rx51 cpuidle
parameters table")
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoext4: fix races of writeback with punch hole and zero range
Jan Kara [Mon, 7 Dec 2015 19:34:49 +0000 (14:34 -0500)]
ext4: fix races of writeback with punch hole and zero range

commit 011278485ecc3cd2a3954b5d4c73101d919bf1fa upstream.

When doing delayed allocation, update of on-disk inode size is postponed
until IO submission time. However hole punch or zero range fallocate
calls can end up discarding the tail page cache page and thus on-disk
inode size would never be properly updated.

Make sure the on-disk inode size is updated before truncating page
cache.

Signed-off-by: Jan Kara <jack@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoext4: fix races between buffered IO and collapse / insert range
Jan Kara [Mon, 7 Dec 2015 19:31:11 +0000 (14:31 -0500)]
ext4: fix races between buffered IO and collapse / insert range

commit 32ebffd3bbb4162da5ff88f9a35dd32d0a28ea70 upstream.

Current code implementing FALLOC_FL_COLLAPSE_RANGE and
FALLOC_FL_INSERT_RANGE is prone to races with buffered writes and page
faults. If buffered write or write via mmap manages to squeeze between
filemap_write_and_wait_range() and truncate_pagecache() in the fallocate
implementations, the written data is simply discarded by
truncate_pagecache() although it should have been shifted.

Fix the problem by moving filemap_write_and_wait_range() call inside
i_mutex and i_mmap_sem. That way we are protected against races with
both buffered writes and page faults.

Signed-off-by: Jan Kara <jack@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoext4: move unlocked dio protection from ext4_alloc_file_blocks()
Jan Kara [Mon, 7 Dec 2015 19:29:17 +0000 (14:29 -0500)]
ext4: move unlocked dio protection from ext4_alloc_file_blocks()

commit 17048e8a083fec7ad841d88ef0812707fbc7e39f upstream.

Currently ext4_alloc_file_blocks() was handling protection against
unlocked DIO. However we now need to sometimes call it under i_mmap_sem
and sometimes not and DIO protection ranks above it (although strictly
speaking this cannot currently create any deadlocks). Also
ext4_zero_range() was actually getting & releasing unlocked DIO
protection twice in some cases. Luckily it didn't introduce any real bug
but it was a land mine waiting to be stepped on.  So move DIO protection
out from ext4_alloc_file_blocks() into the two callsites.

Signed-off-by: Jan Kara <jack@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoext4: fix races between page faults and hole punching
Jan Kara [Mon, 7 Dec 2015 19:28:03 +0000 (14:28 -0500)]
ext4: fix races between page faults and hole punching

commit ea3d7209ca01da209cda6f0dea8be9cc4b7a933b upstream.

Currently, page faults and hole punching are completely unsynchronized.
This can result in page fault faulting in a page into a range that we
are punching after truncate_pagecache_range() has been called and thus
we can end up with a page mapped to disk blocks that will be shortly
freed. Filesystem corruption will shortly follow. Note that the same
race is avoided for truncate by checking page fault offset against
i_size but there isn't similar mechanism available for punching holes.

Fix the problem by creating new rw semaphore i_mmap_sem in inode and
grab it for writing over truncate, hole punching, and other functions
removing blocks from extent tree and for read over page faults. We
cannot easily use i_data_sem for this since that ranks below transaction
start and we need something ranking above it so that it can be held over
the whole truncate / hole punching operation. Also remove various
workarounds we had in the code to reduce race window when page fault
could have created pages with stale mapping information.

Signed-off-by: Jan Kara <jack@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoperf stat: Document --detailed option
Borislav Petkov [Mon, 7 Mar 2016 19:44:44 +0000 (16:44 -0300)]
perf stat: Document --detailed option

commit f594bae08183fb6b57db55387794ece3e1edf6f6 upstream.

I'm surprised this remained undocumented since at least 2011. And it is
actually a very useful switch, as Steve and I came to realize recently.

Add the text from

  2cba3ffb9a9d ("perf stat: Add -d -d and -d -d -d options to show more CPU events")

which added the incrementing aspect to -d.

Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Davidlohr Bueso <dbueso@suse.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mel Gorman <mgorman@suse.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 2cba3ffb9a9d ("perf stat: Add -d -d and -d -d -d options to show more CPU events")
Link: http://lkml.kernel.org/r/1457347294-32546-1-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoperf tools: handle spaces in file names obtained from /proc/pid/maps
Marcin Ślusarz [Tue, 19 Jan 2016 19:03:03 +0000 (20:03 +0100)]
perf tools: handle spaces in file names obtained from /proc/pid/maps

commit 89fee59b504f86925894fcc9ba79d5c933842f93 upstream.

Steam frequently puts game binaries in folders with spaces.

Note: "(deleted)" markers are now treated as part of the file name.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Fixes: 6064803313ba ("perf tools: Use sscanf for parsing /proc/pid/maps")
Link: http://lkml.kernel.org/r/20160119190303.GA17579@marcin-Inspiron-7720
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoperf hists browser: Only offer symbol scripting when a symbol is under the cursor
Namhyung Kim [Thu, 21 Jan 2016 22:50:09 +0000 (19:50 -0300)]
perf hists browser: Only offer symbol scripting when a symbol is under the cursor

commit c221acb0f970d3b80d72c812cda19c121acf5d52 upstream.

When this feature was introduced a check was made if there was a
resolved symbol under the cursor, it got lost in commit ea7cd5923309
("perf hists browser: Split popup menu actions - part 2"), reinstate it.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: ea7cd5923309 ("perf hists browser: Split popup menu actions - part 2")
Link: http://lkml.kernel.org/r/1452960197-5323-9-git-send-email-namhyung@kernel.org
[ Carved out from a  larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agomtd: nand: Drop mtd.owner requirement in nand_scan
Ezequiel García [Fri, 1 Apr 2016 21:29:23 +0000 (18:29 -0300)]
mtd: nand: Drop mtd.owner requirement in nand_scan

commit 20c07a5bf094198ff2382aa5e7c930b3c9807792 upstream.

Since commit 807f16d4db95 ("mtd: core: set some defaults
when dev.parent is set"), it's now legal for drivers
to call nand_scan and nand_scan_ident without setting
mtd.owner.

Drop the check and while at it remove the BUG() abuse.

Fixes: 807f16d4db95 ("mtd: core: set some defaults when dev.parent is set")
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
[Brian: editorial note - while commit 807f16d4db95 wasn't explicitly
    broken, some follow-up commits in the v4.4 release broke a few
    drivers, since they would hit this BUG() if they used nand_scan()
    and were built as modules]
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agomtd: brcmnand: Fix v7.1 register offsets
Florian Fainelli [Thu, 25 Feb 2016 00:07:23 +0000 (16:07 -0800)]
mtd: brcmnand: Fix v7.1 register offsets

commit d267aefc54a28efc5bda7f009598dc83b5f98734 upstream.

The BRCMNAND controller revision 7.1 is almost 100% compatible with the
previous v6.0 register offset layout, except for the Correctable Error
Reporting Threshold registers. Fix this by adding another table with the
correct offsets for CORR_THRESHOLD and CORR_THRESHOLD_EXT.

Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agomtd: spi-nor: remove micron_quad_enable()
Cyrille Pitchen [Wed, 3 Feb 2016 13:26:46 +0000 (14:26 +0100)]
mtd: spi-nor: remove micron_quad_enable()

commit 3b5394a3ccffbfa1d1d448d48742853a862822c4 upstream.

This patch remove the micron_quad_enable() function which force the Quad
SPI mode. However, once this mode is enabled, the Micron memory expect ALL
commands to use the SPI 4-4-4 protocol. Hence a failure does occur when
calling spi_nor_wait_till_ready() right after the update of the Enhanced
Volatile Configuration Register (EVCR) in the micron_quad_enable() as
the SPI controller driver is not aware about the protocol change.

Since there is almost no performance increase using Fast Read 4-4-4
commands instead of Fast Read 1-1-4 commands, we rather keep on using the
Extended SPI mode than enabling the Quad SPI mode.

Let's take the example of the pretty standard use of 8 dummy cycles during
Fast Read operations on 64KB erase sectors:

Fast Read 1-1-4 requires 8 cycles for the command, then 24 cycles for the
3byte address followed by 8 dummy clock cycles and finally 65536*2 cycles
for the read data; so 131112 clock cycles.

On the other hand the Fast Read 4-4-4 would require 2 cycles for the
command, then 6 cycles for the 3byte address followed by 8 dummy clock
cycles and finally 65536*2 cycles for the read data. So 131088 clock
cycles. The theorical bandwidth increase is 0.0%.

Now using Fast Read operations on 512byte pages:
Fast Read 1-1-4 needs 8+24+8+(512*2) = 1064 clock cycles whereas Fast
Read 4-4-4 would requires 2+6+8+(512*2) = 1040 clock cycles. Hence the
theorical bandwidth increase is 2.3%.
Consecutive reads for non sequential pages is not a relevant use case so
The Quad SPI mode is not worth it.

mtd_speedtest seems to confirm these figures.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Fixes: 548cd3ab54da ("mtd: spi-nor: Add quad I/O support for Micron SPI NOR")
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoserial: sh-sci: Remove cpufreq notifier to fix crash/deadlock
Geert Uytterhoeven [Tue, 5 Jan 2016 18:36:37 +0000 (19:36 +0100)]
serial: sh-sci: Remove cpufreq notifier to fix crash/deadlock

commit ff1cab374ad98f4b9f408525ca9c08992b4ed784 upstream.

The BSP team noticed that there is spin/mutex lock issue on sh-sci when
CPUFREQ is used.  The issue is that the notifier function may call
mutex_lock() while the spinlock is held, which can lead to a BUG().
This may happen if CPUFREQ is changed while another CPU calls
clk_get_rate().

Taking the spinlock was added to the notifier function in commit
e552de2413edad1a ("sh-sci: add platform device private data"), to
protect the list of serial ports against modification during traversal.
At that time the Common Clock Framework didn't exist yet, and
clk_get_rate() just returned clk->rate without taking a mutex.
Note that since commit d535a2305facf9b4 ("serial: sh-sci: Require a
device per port mapping."), there's no longer a list of serial ports to
traverse, and taking the spinlock became superfluous.

To fix the issue, just remove the cpufreq notifier:
  1. The notifier doesn't work correctly: all it does is update stored
     clock rates; it does not update the divider in the hardware.
     The divider will only be updated when calling sci_set_termios().
     I believe this was broken back in 2004, when the old
     drivers/char/sh-sci.c driver (where the notifier did update the
     divider) was replaced by drivers/serial/sh-sci.c (where the
     notifier just updated port->uartclk).
     Cfr. full-history-linux commits 6f8deaef2e9675d9 ("[PATCH] sh: port
     sh-sci driver to the new API") and 3f73fe878dc9210a ("[PATCH]
     Remove old sh-sci driver").
  2. On modern SoCs, the sh-sci parent clock rate is no longer related
     to the CPU clock rate anyway, so using a cpufreq notifier is
     futile.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoext4: fix NULL pointer dereference in ext4_mark_inode_dirty()
Eryu Guan [Sun, 13 Mar 2016 02:40:32 +0000 (21:40 -0500)]
ext4: fix NULL pointer dereference in ext4_mark_inode_dirty()

commit 5e1021f2b6dff1a86a468a1424d59faae2bc63c1 upstream.

ext4_reserve_inode_write() in ext4_mark_inode_dirty() could fail on
error (e.g. EIO) and iloc.bh can be NULL in this case. But the error is
ignored in the following "if" condition and ext4_expand_extra_isize()
might be called with NULL iloc.bh set, which triggers NULL pointer
dereference.

This is uncovered by commit 8b4953e13f4c ("ext4: reserve code points for
the project quota feature"), which enlarges the ext4_inode size, and
run the following script on new kernel but with old mke2fs:

  #/bin/bash
  mnt=/mnt/ext4
  devname=ext4-error
  dev=/dev/mapper/$devname
  fsimg=/home/fs.img

  trap cleanup 0 1 2 3 9 15

  cleanup()
  {
          umount $mnt >/dev/null 2>&1
          dmsetup remove $devname
          losetup -d $backend_dev
          rm -f $fsimg
          exit 0
  }

  rm -f $fsimg
  fallocate -l 1g $fsimg
  backend_dev=`losetup -f --show $fsimg`
  devsize=`blockdev --getsz $backend_dev`

  good_tab="0 $devsize linear $backend_dev 0"
  error_tab="0 $devsize error $backend_dev 0"

  dmsetup create $devname --table "$good_tab"

  mkfs -t ext4 $dev
  mount -t ext4 -o errors=continue,strictatime $dev $mnt

  dmsetup load $devname --table "$error_tab" && dmsetup resume $devname
  echo 3 > /proc/sys/vm/drop_caches
  ls -l $mnt
  exit 0

[ Patch changed to simplify the function a tiny bit. -- Ted ]

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agox86/mm/kmmio: Fix mmiotrace for hugepages
Karol Herbst [Thu, 3 Mar 2016 01:03:11 +0000 (02:03 +0100)]
x86/mm/kmmio: Fix mmiotrace for hugepages

commit cfa52c0cfa4d727aa3e457bf29aeff296c528a08 upstream.

Because Linux might use bigger pages than the 4K pages to handle those mmio
ioremaps, the kmmio code shouldn't rely on the pade id as it currently does.

Using the memory address instead of the page id lets us look up how big the
page is and what its base address is, so that we won't get a page fault
within the same page twice anymore.

Tested-by: Pierre Moreau <pierre.morrow@free.fr>
Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luis R. Rodriguez <mcgrof@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: linux-mm@kvack.org
Cc: linux-x86_64@vger.kernel.org
Cc: nouveau@lists.freedesktop.org
Cc: pq@iki.fi
Cc: rostedt@goodmis.org
Link: http://lkml.kernel.org/r/1456966991-6861-1-git-send-email-nouveau@karolherbst.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoperf evlist: Reference count the cpu and thread maps at set_maps()
Arnaldo Carvalho de Melo [Wed, 17 Feb 2016 13:57:19 +0000 (10:57 -0300)]
perf evlist: Reference count the cpu and thread maps at set_maps()

commit a55e5663761366fb883f6f25375dd68bc958b9db upstream.

We were dropping the reference we possibly held but not obtaining one
for the new maps, which we will drop at perf_evlist__delete(), fix it.

This was caught by Steven Noonan in some of the machines which would
produce this output when caught by glibc debug mechanisms:

  $ sudo perf test 21
  21: Test object code reading                                 :***
  Error in `perf': corrupted double-linked list: 0x00000000023ffcd0 ***
  ======= Backtrace: =========
  /usr/lib/libc.so.6(+0x72055)[0x7f25be0f3055]
  /usr/lib/libc.so.6(+0x779b6)[0x7f25be0f89b6]
  /usr/lib/libc.so.6(+0x7a0ed)[0x7f25be0fb0ed]
  /usr/lib/libc.so.6(__libc_calloc+0xba)[0x7f25be0fceda]
  perf(parse_events_lex_init_extra+0x38)[0x4cfff8]
  perf(parse_events+0x55)[0x4a0615]
  perf(perf_evlist__config+0xcf)[0x4eeb2f]
  perf[0x479f82]
  perf(test__code_reading+0x1e)[0x47ad4e]
  perf(cmd_test+0x5dd)[0x46452d]
  perf[0x47f4e3]
  perf(main+0x603)[0x42c723]
  /usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7f25be0a1610]
  perf(_start+0x29)[0x42c859]

Further investigation using valgrind led to the reference count imbalance fixed
in this patch.

Reported-and-Tested-by: Steven Noonan <steven@uplinklabs.net>
Link: http://lkml.kernel.org/r/CAKbGBLjC2Dx5vshxyGmQkcD+VwiAQLbHoXA9i7kvRB2-2opHZQ@mail.gmail.com
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: f30a79b012e5 ("perf tools: Add reference counting for cpu_map object")
Link: http://lkml.kernel.org/n/tip-j0u1bdhr47sa511sgg76kb8h@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agodrivers/misc/ad525x_dpot: AD5274 fix RDAC read back errors
Michael Hennerich [Mon, 22 Feb 2016 09:20:24 +0000 (10:20 +0100)]
drivers/misc/ad525x_dpot: AD5274 fix RDAC read back errors

commit f3df53e4d70b5736368a8fe8aa1bb70c1cb1f577 upstream.

Fix RDAC read back errors caused by a typo. Value must shift by 2.

Fixes: a4bd394956f2 ("drivers/misc/ad525x_dpot.c: new features")
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agortc: max77686: Properly handle regmap_irq_get_virq() error code
Krzysztof Kozlowski [Thu, 4 Feb 2016 00:26:35 +0000 (09:26 +0900)]
rtc: max77686: Properly handle regmap_irq_get_virq() error code

commit fb166ba1d7f0a662f7332f4ff660a0d6f4d76915 upstream.

The regmap_irq_get_virq() can return 0 or -EINVAL in error conditions
but driver checked only for value of 0.

This could lead to a cast of -EINVAL to an unsigned int used as a
interrupt number for devm_request_threaded_irq(). Although this is not
yet fatal (devm_request_threaded_irq() will just fail with -EINVAL) but
might be a misleading when diagnosing errors.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: 6f1c1e71d933 ("mfd: max77686: Convert to use regmap_irq")
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agortc: rx8025: remove rv8803 id
Alexandre Belloni [Thu, 21 Jan 2016 12:24:21 +0000 (13:24 +0100)]
rtc: rx8025: remove rv8803 id

commit aaa3cee5deffa28415a6e1852c5afae0f5d210e2 upstream.

The rv8803 has its own driver that should be used. Remove its id from
the rx8025 driver.

Fixes: b1f9d790b59dc04f8813a49a92ddd8651770ffee
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agortc: ds1685: passing bogus values to irq_restore
Dan Carpenter [Wed, 2 Mar 2016 10:07:45 +0000 (13:07 +0300)]
rtc: ds1685: passing bogus values to irq_restore

commit 8c09b9fdecab1f4a289f07b46e2ad174b6641928 upstream.

We call spin_lock_irqrestore with "flags" set to zero instead of to the
value from spin_lock_irqsave().

Fixes: aaaf5fbf56f1 ('rtc: add driver for DS1685 family of real time clocks')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agortc: vr41xx: Wire up alarm_irq_enable
Geert Uytterhoeven [Tue, 1 Mar 2016 08:50:01 +0000 (09:50 +0100)]
rtc: vr41xx: Wire up alarm_irq_enable

commit a25f4a95ec3cded34c1250364eba704c5e4fdac4 upstream.

drivers/rtc/rtc-vr41xx.c:229: warning: ‘vr41xx_rtc_alarm_irq_enable’ defined but not used

Apparently the conversion to alarm_irq_enable forgot to wire up the
callback.

Fixes: 16380c153a69c378 ("RTC: Convert rtc drivers to use the alarm_irq_enable method")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agortc: hym8563: fix invalid year calculation
Alexander Kochetkov [Sun, 6 Mar 2016 09:43:57 +0000 (12:43 +0300)]
rtc: hym8563: fix invalid year calculation

commit d5861262210067fc01b2fb4f7af2fd85a3453f15 upstream.

Year field must be in BCD format, according to
hym8563 datasheet.

Due to the bug year 2016 became 2010.

Fixes: dcaf03849352 ("rtc: add hym8563 rtc-driver")
Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoPM / Domains: Fix removal of a subdomain
Jon Hunter [Fri, 4 Mar 2016 10:55:14 +0000 (10:55 +0000)]
PM / Domains: Fix removal of a subdomain

commit beda5fc1ff9b527059290a97b672d2ee0eb7b92f upstream.

Commit 30e7a65b3fdb (PM / Domains: Ensure subdomain is not in use
before removing) added a test to ensure that a subdomain is not a
master to another subdomain or if any devices are using the subdomain
before removing. This change incorrectly used the "slave_links" list to
determine if the subdomain is a master to another subdomain, where it
should have been using the "master_links" list instead. The
"slave_links" list will never be empty for a subdomain and so a
subdomain can never be removed. Fix this by testing if the
"master_links" list is empty instead.

Fixes: 30e7a65b3fdb (PM / Domains: Ensure subdomain is not in use before removing)
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>