aboutsummaryrefslogtreecommitdiffstats
path: root/drivers (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-08-05random: introduce getrandom(2) system callTheodore Ts'o1-3/+37
The getrandom(2) system call was requested by the LibreSSL Portable developers. It is analoguous to the getentropy(2) system call in OpenBSD. The rationale of this system call is to provide resiliance against file descriptor exhaustion attacks, where the attacker consumes all available file descriptors, forcing the use of the fallback code where /dev/[u]random is not available. Since the fallback code is often not well-tested, it is better to eliminate this potential failure mode entirely. The other feature provided by this new system call is the ability to request randomness from the /dev/urandom entropy pool, but to block until at least 128 bits of entropy has been accumulated in the /dev/urandom entropy pool. Historically, the emphasis in the /dev/urandom development has been to ensure that urandom pool is initialized as quickly as possible after system boot, and preferably before the init scripts start execution. This is because changing /dev/urandom reads to block represents an interface change that could potentially break userspace which is not acceptable. In practice, on most x86 desktop and server systems, in general the entropy pool can be initialized before it is needed (and in modern kernels, we will printk a warning message if not). However, on an embedded system, this may not be the case. And so with this new interface, we can provide the functionality of blocking until the urandom pool has been initialized. Any userspace program which uses this new functionality must take care to assure that if it is used during the boot process, that it will not cause the init scripts or other portions of the system startup to hang indefinitely. SYNOPSIS #include <linux/random.h> int getrandom(void *buf, size_t buflen, unsigned int flags); DESCRIPTION The system call getrandom() fills the buffer pointed to by buf with up to buflen random bytes which can be used to seed user space random number generators (i.e., DRBG's) or for other cryptographic uses. It should not be used for Monte Carlo simulations or other programs/algorithms which are doing probabilistic sampling. If the GRND_RANDOM flags bit is set, then draw from the /dev/random pool instead of the /dev/urandom pool. The /dev/random pool is limited based on the entropy that can be obtained from environmental noise, so if there is insufficient entropy, the requested number of bytes may not be returned. If there is no entropy available at all, getrandom(2) will either block, or return an error with errno set to EAGAIN if the GRND_NONBLOCK bit is set in flags. If the GRND_RANDOM bit is not set, then the /dev/urandom pool will be used. Unlike using read(2) to fetch data from /dev/urandom, if the urandom pool has not been sufficiently initialized, getrandom(2) will block (or return -1 with the errno set to EAGAIN if the GRND_NONBLOCK bit is set in flags). The getentropy(2) system call in OpenBSD can be emulated using the following function: int getentropy(void *buf, size_t buflen) { int ret; if (buflen > 256) goto failure; ret = getrandom(buf, buflen, 0); if (ret < 0) return ret; if (ret == buflen) return 0; failure: errno = EIO; return -1; } RETURN VALUE On success, the number of bytes that was filled in the buf is returned. This may not be all the bytes requested by the caller via buflen if insufficient entropy was present in the /dev/random pool, or if the system call was interrupted by a signal. On error, -1 is returned, and errno is set appropriately. ERRORS EINVAL An invalid flag was passed to getrandom(2) EFAULT buf is outside the accessible address space. EAGAIN The requested entropy was not available, and getentropy(2) would have blocked if the GRND_NONBLOCK flag was not set. EINTR While blocked waiting for entropy, the call was interrupted by a signal handler; see the description of how interrupted read(2) calls on "slow" devices are handled with and without the SA_RESTART flag in the signal(7) man page. NOTES For small requests (buflen <= 256) getrandom(2) will not return EINTR when reading from the urandom pool once the entropy pool has been initialized, and it will return all of the bytes that have been requested. This is the recommended way to use getrandom(2), and is designed for compatibility with OpenBSD's getentropy() system call. However, if you are using GRND_RANDOM, then getrandom(2) may block until the entropy accounting determines that sufficient environmental noise has been gathered such that getrandom(2) will be operating as a NRBG instead of a DRBG for those people who are working in the NIST SP 800-90 regime. Since it may block for a long time, these guarantees do *not* apply. The user may want to interrupt a hanging process using a signal, so blocking until all of the requested bytes are returned would be unfriendly. For this reason, the user of getrandom(2) MUST always check the return value, in case it returns some error, or if fewer bytes than requested was returned. In the case of !GRND_RANDOM and small request, the latter should never happen, but the careful userspace code (and all crypto code should be careful) should check for this anyway! Finally, unless you are doing long-term key generation (and perhaps not even then), you probably shouldn't be using GRND_RANDOM. The cryptographic algorithms used for /dev/urandom are quite conservative, and so should be sufficient for all purposes. The disadvantage of GRND_RANDOM is that it can block, and the increased complexity required to deal with partially fulfilled getrandom(2) requests. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Zach Brown <zab@zabbo.net>
2014-07-15hw_random: fix sparse warning (NULL vs 0 for pointer)Torsten Duwe1-1/+1
Signed-off-by: Torsten Duwe <duwe@suse.de> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-07-15random: use registers from interrupted code for CPU's w/o a cycle counterTheodore Ts'o1-25/+22
For CPU's that don't have a cycle counter, or something equivalent which can be used for random_get_entropy(), random_get_entropy() will always return 0. In that case, substitute with the saved interrupt registers to add a bit more unpredictability. Some folks have suggested hashing all of the registers unconditionally, but this would increase the overhead of add_interrupt_randomness() by at least an order of magnitude, and this would very likely be unacceptable. The changes in this commit have been benchmarked as mostly unaffecting the overhead of add_interrupt_randomness() if the entropy counter is present, and doubling the overhead if it is not present. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: Jörn Engel <joern@logfs.org>
2014-07-15hwrng: add per-device entropy deratingTorsten Duwe1-1/+10
This patch introduces a derating factor to struct hwrng for the random bits going into the kernel input pool, and a common default derating for drivers which do not specify one. Signed-off-by: Torsten Duwe <duwe@suse.de> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Acked-by: H. Peter Anvin <hpa@zytor.com>
2014-07-15hwrng: create filler threadTorsten Duwe1-5/+64
This can be viewed as the in-kernel equivalent of hwrngd; like FUSE it is a good thing to have a mechanism in user land, but for some reasons (simplicity, secrecy, integrity, speed) it may be better to have it in kernel space. This patch creates a thread once a hwrng registers, and uses the previously established add_hwgenerator_randomness() to feed its data to the input pool as long as needed. A derating factor is used to bias the entropy estimation and to disable this mechanism entirely when set to zero. Signed-off-by: Torsten Duwe <duwe@suse.de> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Acked-by: H. Peter Anvin <hpa@zytor.com>
2014-07-15random: add_hwgenerator_randomness() for feeding entropy from devicesTorsten Duwe1-0/+21
This patch adds an interface to the random pool for feeding entropy in-kernel. Signed-off-by: Torsten Duwe <duwe@suse.de> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Acked-by: H. Peter Anvin <hpa@zytor.com>
2014-07-15random: use an improved fast_mix() functionTheodore Ts'o1-24/+68
Use more efficient fast_mix() function. Thanks to George Spelvin for doing the leg work to find a more efficient mixing function. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: George Spelvin <linux@horizon.com>
2014-07-15random: clean up interrupt entropy accounting for archs w/o cycle countersTheodore Ts'o1-19/+23
For architectures that don't have cycle counters, the algorithm for deciding when to avoid giving entropy credit due to back-to-back timer interrupts didn't make any sense, since we were checking every 64 interrupts. Change it so that we only give an entropy credit if the majority of the interrupts are not based on the timer. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: George Spelvin <linux@horizon.com>
2014-07-15random: only update the last_pulled time if we actually transferred entropyTheodore Ts'o1-4/+7
In xfer_secondary_pull(), check to make sure we need to pull from the secondary pool before checking and potentially updating the last_pulled time. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: George Spelvin <linux@horizon.com>
2014-07-15random: remove unneeded hash of a portion of the entropy poolTheodore Ts'o1-31/+20
We previously extracted a portion of the entropy pool in mix_pool_bytes() and hashed it in to avoid racing CPU's from returning duplicate random values. Now that we are using a spinlock to prevent this from happening, this is no longer necessary. So remove it, to simplify the code a bit. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: George Spelvin <linux@horizon.com>
2014-07-15random: always update the entropy pool under the spinlockTheodore Ts'o1-21/+23
Instead of using lockless techniques introduced in commit 902c098a3663, use spin_trylock to try to grab entropy pool's lock. If we can't get the lock, then just try again on the next interrupt. Based on discussions with George Spelvin. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: George Spelvin <linux@horizon.com>
2014-07-13Merge tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linuxLinus Torvalds12-67/+93
Pull clock driver fixes from Mike Turquette: "This batch of fixes is for a handful of clock drivers from Allwinner, Samsung, ST & TI. Most of them are of the "this hardware won't work without this fix" variety, including patches that fix platforms that did not boot under certain configurations. Other fixes are the result of changes to the clock core introduced in 3.15 that had subtle impacts on the clock drivers. There are no fixes to the clock framework core in this pull request" * tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linux: clk: spear3xx: Set proper clock parent of uart1/2 clk: spear3xx: Use proper control register offset clk: qcom: HDMI source sel is 3 not 2 clk: sunxi: fix devm_ioremap_resource error detection code clk: s2mps11: Fix double free corruption during driver unbind clk: ti: am43x: Fix boot with CONFIG_SOC_AM33XX disabled clk: exynos5420: Remove aclk66_peric from the clock tree description clk/exynos5250: fix bit number for tv sysmmu clock clk: s3c64xx: Hookup SPI clocks correctly clk: samsung: exynos4: Remove SRC_MASK_ISP gates clk: samsung: add more aliases for s3c24xx clk: samsung: fix several typos to fix boot on s3c2410 clk: ti: set CLK_SET_RATE_NO_REPARENT for ti,mux-clock clk: ti: am43x: Fix boot with CONFIG_SOC_AM33XX disabled clk: ti: dra7: return error code in failure case clk: ti: apll: not allocating enough data
2014-07-13Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds2-4/+22
Pull ARM SoC fixes from Olof Johansson: "This week's arm-soc fixes: - Another set of OMAP fixes * Clock fixes * Restart handling * PHY regulators * SATA hwmod data for DRA7 + Some trivial fixes and removal of a bit of dead code - Exynos fixes * A bunch of clock fixes * Some SMP fixes * Exynos multi-core timer: register as clocksource and fix ftrace. + a few other minor fixes There's also a couple more patches, and at91 fix for USB caused by common clock conversion, and more MAINTAINERS entries for shmobile. We're definitely switching to only regression fixes from here on out, we've been a little less strict than usual up until now" * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (26 commits) ARM: at91: at91sam9x5: add clocks for usb device ARM: EXYNOS: Register cpuidle device only on exynos4210 and 5250 ARM: dts: Add clock property for mfc_pd in exynos5420 clk: exynos5420: Add IDs for clocks used in PD mfc ARM: EXYNOS: Add support for clock handling in power domain ARM: OMAP2+: Remove non working OMAP HDMI audio initialization ARM: imx: fix shared gate clock ARM: dts: Update the parent for Audss clocks in Exynos5420 ARM: EXYNOS: Update secondary boot addr for secure mode ARM: dts: Fix TI CPSW Phy mode selection on IGEP COM AQUILA. ARM: dts: am335x-evmsk: Enable the McASP FIFO for audio ARM: dts: am335x-evm: Enable the McASP FIFO for audio ARM: OMAP2+: Make GPMC skip disabled devices ARM: OMAP2+: create dsp device only on OMAP3 SoCs ARM: dts: dra7-evm: Make VDDA_1V8_PHY supply always on ARM: DRA7/AM43XX: fix header definition for omap44xx_restart ARM: OMAP2+: clock/dpll: fix _dpll_test_fint arithmetics overflow ARM: DRA7: hwmod: Add SYSCONFIG for usb_otg_ss ARM: DRA7: hwmod: Fixup SATA hwmod ARM: OMAP3: PRM/CM: Add back macros used by TI DSP/Bridge driver ...
2014-07-13clk: spear3xx: Set proper clock parent of uart1/2Thomas Gleixner1-4/+10
The uarts only work when the parent is ras_ahb_clk. The stale 3.5 based ST tree does this in the board file. Add it to the clk init function. Not pretty, but the mess there is amazing anyway. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-07-13clk: spear3xx: Use proper control register offsetThomas Gleixner1-1/+1
The control register is at offset 0x10, not 0x0. This is wreckaged since commit 5df33a62c (SPEAr: Switch to common clock framework). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-07-12Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dmaLinus Torvalds2-7/+28
Pull slave-dmaengine fixes from Vinod Koul: "We have two small fixes. First one from Daniel to handle 0-length packets for usb cppi dma. Second by Russell for imx-sdam cyclic residue reporting" * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma: Update imx-sdma cyclic handling to report residue dma: cppi41: handle 0-length packets
2014-07-12Merge tag 'samsung-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into fixesOlof Johansson1-2/+4
Merge "Samsung fixes-3 for 3.16" from Kukjin Kim: Samsung fixes-3 for v3.16 - update the parent for Auudss clock because kernel will be hang during late boot if the parent clock is disabled in bootloader. - enable clk handing in power domain because while power domain on/off, its regarding clock source will be reset and it causes a problem so need to handle it. - add mux clocks to be used by power domain for exynos5420-mfc during power domain on/off and property in device tree also. - register cpuidle only for exynos4210 and exynos5250 because a system failure will be happened on other exynos SoCs. * tag 'samsung-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung: ARM: EXYNOS: Register cpuidle device only on exynos4210 and 5250 ARM: dts: Add clock property for mfc_pd in exynos5420 clk: exynos5420: Add IDs for clocks used in PD mfc ARM: EXYNOS: Add support for clock handling in power domain ARM: dts: Update the parent for Audss clocks in Exynos5420 Signed-off-by: Olof Johansson <olof@lixom.net>
2014-07-12Merge tag 'usb-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbLinus Torvalds8-9/+28
Pull USB fixes from Greg KH: "Here are some small USB fixes, PHY driver fixes (they ended up in this tree for lack of somewhere else to put them), and some new USB device ids" * tag 'usb-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: phy: omap-usb2: Balance pm_runtime_enable() on probe failure and remove phy: core: Fix error path in phy_create() drivers: phy: phy-samsung-usb2.c: Add missing MODULE_DEVICE_TABLE phy: omap-usb2: fix devm_ioremap_resource error detection code phy: sun4i: depend on RESET_CONTROLLER USB: serial: ftdi_sio: Add Infineon Triboard USB: ftdi_sio: Add extra PID. usb: option: Add ID for Telewell TW-LTE 4G v2 USB: cp210x: add support for Corsair usb dongle
2014-07-12Merge tag 'tty-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/ttyLinus Torvalds7-4/+19
Pull tty/serial fixes from Greg KH: "Here are some small serial fixes that resolve some reported problems that started in 3.15 with some serial drivers. And there's a new dt binding for a serial driver, which was all that was needed for the renesas serial driver" * tag 'tty-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: sh-sci: Add device tree support for r8a7{778,740,3a4} and sh73a0 serial: imx: Fix build breakage serial: arc_uart: Use uart_circ_empty() for open-coded comparison serial: Test for no tx data on tx restart
2014-07-12Merge tag 'char-misc-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-miscLinus Torvalds4-7/+24
Pull char/misc driver fixes from Greg KH: "Here are two hyperv driver fixes, and one i8k driver fix for 3.16" * tag 'char-misc-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: i8k: Fix non-SMP operation Drivers: hv: util: Fix a bug in the KVP code Drivers: hv: vmbus: Fix a bug in the channel callback dispatch code
2014-07-12Merge tag 'staging-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/stagingLinus Torvalds8-32/+23
Pull IIO fixes from Greg KH: "Here are some IIO driver fixes for 3.16-rc5. Nothing major, just resolves some minor issues that have been reported" * tag 'staging-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: iio: ti_am335x_adc: Fix: Use same step id at FIFOs both ends iio:tcs3472: Check for buffer enabled and locking iio: hid-sensor-prox: Fix return values iio: hid-sensor-gyro-3d: Fix return values iio: hid-sensor-als: Fix return values iio: hid-sensor-magn-3d: Fix return values iio: hid-sensor-accel-3d: Fix return values iio: hid-sensor-press: Fix return values
2014-07-11phy: omap-usb2: Balance pm_runtime_enable() on probe failure and removeRoger Quadros1-2/+5
If probe fails then we need to call pm_runtime_disable() to balance out the previous pm_runtime_enable() call. Else it will cause unbalanced pm_runtime_enable() call in the succeding probe call. This anomaly was observed when the call to devm_phy_create() failed with -EPROBE_DEFER. Balance out the pm_runtime_enable() call in .remove() as well. Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11phy: core: Fix error path in phy_create()Roger Quadros1-3/+4
Prevent resources from being freed twice in case device_add() call fails within phy_create(). Also use ida_simple_remove() instead of ida_remove() as we had used ida_simple_get() to allocate the ida. Cc: 3.13+ <stable@vger.kernel.org> # 3.13+ Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11drivers: phy: phy-samsung-usb2.c: Add missing MODULE_DEVICE_TABLESjoerd Simons1-0/+1
Allow phy-exynos-usb2 to be autoloaded based on devicetree information. Tested on Odroid X2 with its USB subsystem build as modules. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11phy: omap-usb2: fix devm_ioremap_resource error detection codeHimangi Saraogi1-2/+2
devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure. A simplified version of the semantic match that finds this problem is as follows: // <smpl> @@ expression e,e1; statement S; @@ *e = devm_ioremap_resource(...); if (!e1) S // </smpl> Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11phy: sun4i: depend on RESET_CONTROLLERMaxime Ripard1-0/+1
The driver depend on the reset framework in a mandatory way. Make sure reset_control_get is defined by adding this dependency in Kconfig Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11USB: serial: ftdi_sio: Add Infineon TriboardMichal Sojka2-0/+8
This adds support for Infineon TriBoard TC1798 [1]. Only interface 1 is used as serial line (see [2], Figure 8-6). [1] http://www.infineon.com/cms/de/product/microcontroller/development-tools-software-and-kits/tricore-tm-development-tools-software-and-kits/starterkits-and-evaluation-boards/starter-kit-tc1798/channel.html?channel=db3a304333b8a7ca0133cfa3d73e4268 [2] http://www.infineon.com/dgdl/TriBoardManual-TC1798-V10.pdf?folderId=db3a304412b407950112b409ae7c0343&fileId=db3a304333b8a7ca0133cfae99fe426a Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz> Cc: Johan Hovold <johan@kernel.org> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11serial: imx: Fix build breakagePeter Hurley1-1/+1
Fix breakage introduced by commit c557d392fbf5badd693ea1946a4317c87a26a716, 'serial: Test for no tx data on tx restart'. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11Merge tag 'dm-3.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dmLinus Torvalds5-22/+28
Pull device mapper fixes from Mike Snitzer: - Fix DM multipath IO hang regression from 3.15 due to logic bug in multipath_busy. This impacted cable-pull testing and also the ability to boot with IPR SCSI on a POWER8 box. - Fix possible deadlock with deferred device removal by using a new dedicated workqueue rather than using the system workqueue. - Fix NULL pointer crash due to race condition in dm-io's wake up code for sync_io by using a completion. - Update dm-crypt and dm-zero author name following legal name change; this is important to Jana so I didn't see any reason to hold it back. * tag 'dm-3.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm mpath: fix IO hang due to logic bug in multipath_busy dm io: fix a race condition in the wake up code for sync_io dm crypt, dm zero: update author name following legal name change dm: allocate a special workqueue for deferred device removal
2014-07-10Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds26-73/+177
Pull drm fixes from Dave Airlie: "Nothing too scary, we have one outstanding i915 regression but Daniel has promised the fix as soon as he's finished testing it a bit. Fixes for the main x86 drivers: - radeon: dpm fixes, displayport regression fix - i915: quirks for backlight regression, edp reboot fix, valleyview black screen fixes - nouveau: display port regression fixes, fix for memory reclocking" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: drm/radeon/dpm: Reenabling SS on Cayman drm/radeon: fix typo in ci_stop_dpm() drm/radeon: fix typo in golden register setup on evergreen drm/radeon: only print meaningful VM faults drm/radeon/dp: return -EIO for flags not zero case drm/i915/vlv: T12 eDP panel timing enforcement during reboot drm/i915: Only unbind vgacon, not other console drivers drm/i915: Don't clobber the GTT when it's within stolen memory drm/i915/vlv: Update the DSI ULPS entry/exit sequence drm/i915/vlv: DPI FIFO empty check is not needed drm/i915: Toshiba CB35 has a controllable backlight drm/i915: Acer C720 and C720P have controllable backlights drm/i915: quirk asserts controllable backlight presence, overriding VBT drm/nouveau/ram: fix test for gpio presence drm/nouveau/dp: workaround broken display drm/nouveau/dp: fix required link bandwidth calculations drm/nouveau/kms: restore fbcon after display has been resumed drm/nv50-/kms: pass a non-zero value for head to sor dpms methods drm/nouveau/fb: Prevent inlining of ramfuc_reg drm/gk104/ram: bash mpll bit 31 on
2014-07-10Merge tag 'pm+acpi-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pmLinus Torvalds10-102/+310
Pull ACPI and power management fixes from Rafael Wysocki: "These are a few regression fixes for ACPI device enumeration and resources management, intel_pstate and cpufreq, a revert of an ACPI commit removing user space interfaces in /proc that we incorrectly thought were not used any more, fixes for some long-standing concurrency issues in the ACPI EC driver, two ACPI battery driver fixes, stable-candidate fixes for intel_pstate, an ACPI-related fix for i915 and two new ACPI video blacklist entries for Win8-oriented BIOSes. Specifics: - Missing device ID for ACPI enumeration of PNP devices that we overlooked during the recent rework of that code from Zhang Rui. - Fix for a problem introduced during the 3.14 cycle in the ACPI device resources management code and causing it to reject all resources of length 0 although some of them are actually valid which affects serial ports detection on a number of systems. From Andy Whitcroft. - intel_pstate fix for a boot problem on some BayTrail-based systems introduced by a previous fix related to that platform during the 3.13 cycle from Dirk Brandewie. - Revert of a 3.13 commit that removed the ACPI AC /proc interface which turns out to be still needed by some old utilities (kpowersave from kde 3.5.10 in particular) from Lan Tianyu. - cpufreq build fix for the davinci ARM platform from Prabhakar Lad (the breakage was introduced during the 3.10 cycle). - ACPI-related i915 fix preventing firmware on some Thinkpad laptops from setting backlight levels incorrectly during AC plug/unplug. From Aaron Lu. - Fixes for two nasty race conditions in the ACPI embedded controller driver that may be responsible for a number of past bug reports related to the EC from Lv Zhang and a fix for two memory leaks in error code paths in that driver from Colin Ian King. - Fixes for a couple of corner-case issues in the intel_pstate driver (all candidates for -stable) from Dirk Brandewie and Vincent Minet. - Fixes for two corner-case issues in the ACPI battery driver from Josef Gajdusek and Lan Tianyu. - Two new ACPI video blacklist entries for Acer TravelMate B113 and Dell Inspiron 5737 from Edward Lin and Martin Kepplinger" * tag 'pm+acpi-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / PNP: add soc_button_array device ID to PNP IDs list cpufreq: Makefile: fix compilation for davinci platform ACPI / video: Add Acer TravelMate B113 to native backlight blacklist ACPI / video: Add Dell Inspiron 5737 to the blacklist ACPI / i915: ignore firmware requests for backlight change ACPI / battery: fix wrong value of capacity_now reported when fully charged ACPI / resources: only reject zero length resources based at address zero ACPI / battery: Retry to get battery information if failed during probing ACPI / EC: Free saved_ec on error exit path ACPI / EC: Add detailed fields debugging support of EC_SC(R). ACPI / EC: Update revision due to recent changes ACPI / EC: Fix race condition in ec_transaction_completed() ACPI / EC: Remove duplicated ec_wait_ibf0() waiter ACPI / EC: Add asynchronous command byte write support ACPI / EC: Avoid race condition related to advance_transaction() intel_pstate: Set CPU number before accessing MSRs intel_pstate: Update documentation of {max,min}_perf_pct sysfs files intel_pstate: don't touch turbo bit if turbo disabled or unavailable. intel_pstate: Fix setting VID Revert "ACPI / AC: Remove AC's proc directory."
2014-07-10serial: arc_uart: Use uart_circ_empty() for open-coded comparisonPeter Hurley1-1/+1
Replace open-coded test for empty tx ring buffer with equivalent helper function, uart_circ_empty(). No functional change. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-10serial: Test for no tx data on tx restartPeter Hurley6-3/+18
Commit 717f3bbab3c7628736ef738fdbf3d9a28578c26c, 'serial_core: Fix conditional start_tx on ring buffer not empty' exposes an incorrect assumption in several drivers' start_tx methods; the tx ring buffer can, in fact, be empty when restarting tx while performing flow control. Affected drivers: sunsab.c ip22zilog.c pmac_zilog.c sunzilog.c m32r_sio.c imx.c Other in-tree serial drivers either are not affected or already test for empty tx ring buffer before transmitting. Test for empty tx ring buffer in start_tx() method, after transmitting x_char (if applicable). Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: Seth Bollinger <sethb@digi.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Cc: stable <stable@vger.kernel.org> # 3.15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11clk: exynos5420: Add IDs for clocks used in PD mfcArun Kumar K1-2/+4
Adds IDs for MUX clocks to be used by power domain for MFC for doing re-parenting while pd on/off. Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com> Acked-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2014-07-10drm/radeon/dpm: Reenabling SS on CaymanAlexandre Demers1-6/+0
It reverts commit c745fe611ca42295c9d91d8e305d27983e9132ef now that Cayman is stable since VDDCI fix. Spread spectrum was not the culprit. This depends on b0880e87c1fd038b84498944f52e52c3e86ebe59 (drm/radeon/dpm: fix vddci setup typo on cayman). Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2014-07-10drm/radeon: fix typo in ci_stop_dpm()Alex Deucher1-1/+1
Need to use the RREG32_SMC() accessor since the register is an smc indirect index. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2014-07-10drm/radeon: fix typo in golden register setup on evergreenAlex Deucher1-4/+4
Fixes hangs on driver load on some cards. bug: https://bugs.freedesktop.org/show_bug.cgi?id=76998 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2014-07-10drm/radeon: only print meaningful VM faultsChristian König3-6/+12
Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-10drm/radeon/dp: return -EIO for flags not zero caseAlex Deucher1-1/+1
If there are error flags in the aux transaction return -EIO rather than -EBUSY. -EIO restarts the whole transaction while -EBUSY jus retries. Fixes problematic aux transfers. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80684 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2014-07-10dm mpath: fix IO hang due to logic bug in multipath_busyJun'ichi Nomura1-2/+3
Commit e80991773 ("dm mpath: push back requests instead of queueing") modified multipath_busy() to return true if !pg_ready(). pg_ready() checks the current state of the multipath device and may return false even if a new IO is needed to change the state. Bart Van Assche reported that he had multipath IO lockup when he was performing cable pull tests. Analysis showed that the multipath device had a single path group with both paths active, but that the path group itself was not active. During the multipath device state transitions 'queue_io' got set but nothing could clear it. Clearing 'queue_io' only happens in __choose_pgpath(), but it won't be called if multipath_busy() returns true due to pg_ready() returning false when 'queue_io' is set. As such the !pg_ready() check in multipath_busy() is wrong because new IO will not be sent to multipath target and the multipath state change won't happen. That results in multipath IO lockup. The intent of multipath_busy() is to avoid unnecessary cycles of dequeue + request_fn + requeue if it is known that the multipath device will requeue. Such "busy" situations would be: - path group is being activated - there is no path and the multipath is setup to requeue if no path Fix multipath_busy() to return "busy" early only for these specific situations. Reported-by: Bart Van Assche <bvanassche@acm.org> Tested-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Cc: stable@vger.kernel.org # v3.15
2014-07-10dm io: fix a race condition in the wake up code for sync_ioJoe Thornber1-14/+8
There's a race condition between the atomic_dec_and_test(&io->count) in dec_count() and the waking of the sync_io() thread. If the thread is spuriously woken immediately after the decrement it may exit, making the on stack io struct invalid, yet the dec_count could still be using it. Fix this race by using a completion in sync_io() and dec_count(). Reported-by: Minfei Huang <huangminfei@ucloud.cn> Signed-off-by: Joe Thornber <thornber@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Acked-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org
2014-07-10dm crypt, dm zero: update author name following legal name changeJana Saout2-4/+4
Signed-off-by: Jana Saout <jana@saout.de> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2014-07-10dm: allocate a special workqueue for deferred device removalMikulas Patocka1-2/+13
The commit 2c140a246dc ("dm: allow remove to be deferred") introduced a deferred removal feature for the device mapper. When this feature is used (by passing a flag DM_DEFERRED_REMOVE to DM_DEV_REMOVE_CMD ioctl) and the user tries to remove a device that is currently in use, the device will be removed automatically in the future when the last user closes it. Device mapper used the system workqueue to perform deferred removals. However, some targets (dm-raid1, dm-mpath, dm-stripe) flush work items scheduled for the system workqueue from their destructor. If the destructor itself is called from the system workqueue during deferred removal, it introduces a possible deadlock - the workqueue tries to flush itself. Fix this possible deadlock by introducing a new workqueue for deferred removals. We allocate just one workqueue for all dm targets. The ability of dm targets to process IOs isn't dependent on deferred removal of unused targets, so a deadlock due to shared workqueue isn't possible. Also, cleanup local_init() to eliminate potential for returning success on failure. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Cc: stable@vger.kernel.org # 3.13+
2014-07-10Merge branch 'pm-cpufreq'Rafael J. Wysocki2-14/+23
* pm-cpufreq: cpufreq: Makefile: fix compilation for davinci platform intel_pstate: Set CPU number before accessing MSRs intel_pstate: Update documentation of {max,min}_perf_pct sysfs files intel_pstate: don't touch turbo bit if turbo disabled or unavailable. intel_pstate: Fix setting VID
2014-07-10Merge branch 'acpi-video'Rafael J. Wysocki3-1/+27
* acpi-video: ACPI / video: Add Acer TravelMate B113 to native backlight blacklist ACPI / video: Add Dell Inspiron 5737 to the blacklist ACPI / i915: ignore firmware requests for backlight change
2014-07-10Merge branch 'acpi-ec'Rafael J. Wysocki1-79/+85
* acpi-ec: ACPI / EC: Free saved_ec on error exit path ACPI / EC: Add detailed fields debugging support of EC_SC(R). ACPI / EC: Update revision due to recent changes ACPI / EC: Fix race condition in ec_transaction_completed() ACPI / EC: Remove duplicated ec_wait_ibf0() waiter ACPI / EC: Add asynchronous command byte write support ACPI / EC: Avoid race condition related to advance_transaction()
2014-07-10Merge branches 'acpi-resources', 'acpi-ac', 'acpi-scan' and 'acpi-battery'Rafael J. Wysocki3-3/+170
* acpi-resources: ACPI / resources: only reject zero length resources based at address zero * acpi-ac: Revert "ACPI / AC: Remove AC's proc directory." * acpi-scan: ACPI / PNP: add soc_button_array device ID to PNP IDs list * acpi-battery: ACPI / battery: fix wrong value of capacity_now reported when fully charged ACPI / battery: Retry to get battery information if failed during probing
2014-07-10Merge branch 'for-3.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libataLinus Torvalds6-22/+94
Pull libata fixes from Tejun Heo: "Nothing too interesting. All fixes are ahci_platform related" * 'for-3.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: ahci_xgene: fix the dma state machine lockup for the IDENTIFY DEVICE PIO mode command. libahci: export ahci_qc_issue() and ahci_start_fix_rx() ata: ahci_imx: warn when disabling ahci link ahci: disable ncq feature for hisilicon sata ahci: imx: manage only sata_ref_clk in imx_sata_enable[disable] libahci_platform: Fail when PHY required but PHY support disabled
2014-07-10Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linuxLinus Torvalds2-1/+1
Pull i2c build fix and cleanup from Wolfram Sang: "One buildfix for the i2c subsystem. While here, I decided to add the header cleanup as well" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: sun6i-p2wi: Remove duplicate inclusion of module.h i2c: mux: pca954x: fix dependencies
2014-07-10Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6Linus Torvalds1-5/+3
Pull crypto fixes from Herbert Xu: "This push fixes an error in sha512_ssse3 that leads to incorrect output as well as a memory leak in caam_jr when the module is unloaded" * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: caam - fix memleak in caam_jr module crypto: sha512_ssse3 - fix byte count to bit count conversion