firefly-linux-kernel-4.4.55.git
10 years agoclk: Fix race condition between clk_set_parent and clk_enable()
Saravana Kannan [Thu, 16 May 2013 04:07:24 +0000 (21:07 -0700)]
clk: Fix race condition between clk_set_parent and clk_enable()

Without this patch, the following race condition is possible.
* clk-A has two parents - clk-X and clk-Y.
* All three are disabled and clk-X is current parent.
* Thread A: clk_set_parent(clk-A, clk-Y).
* Thread A: <snip execution flow>
* Thread A: Grabs enable lock.
* Thread A: Sees enable count of clk-A is 0, so doesn't enable clk-Y.
* Thread A: Updates clk-A SW parent to clk-Y
* Thread A: Releases enable lock.
* Thread B: clk_enable(clk-A).
* Thread B: clk_enable() enables clk-Y, then enabled clk-A and returns.

clk-A is now enabled in software, but not clocking in hardware since the
hardware parent is still clk-X.

The only way to avoid race conditions between clk_set_parent() and
clk_enable/disable() is to ensure that clk_enable/disable() calls don't
require changes to hardware enable state between changes to software clock
topology and hardware clock topology.

The options to achieve the above are:
1. Grab the enable lock before changing software/hardware topology and
   release it afterwards.
2. Keep the clock enabled for the duration of software/hardware topology
   change so that any additional enable/disable calls don't try to change
   the hardware state. Once the topology change is complete, the clock can
   be put back in its original enable state.

Option (1) is not an acceptable solution since the set_parent() ops might
need to sleep.

Therefore, this patch implements option (2).

This patch doesn't violate any API semantics. clk_disable() doesn't
guarantee that the clock is actually disabled. So, no clients of a clock
can assume that a clock is disabled after their last call to clk_disable().
So, enabling the clock during a parent change is not a violation of any API
semantics.

This also has the nice side effect of simplifying the error handling code.

Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
[mturquette@linaro.org: fixed up whitespace issue]

10 years agoi2c: rockchip: support check idle
黄涛 [Mon, 6 Jan 2014 04:45:00 +0000 (12:45 +0800)]
i2c: rockchip: support check idle

10 years agopinctrl: rockchip: enable clock support, disable pinmux disable and RK30_PIN_PXX...
黄涛 [Mon, 6 Jan 2014 04:43:08 +0000 (12:43 +0800)]
pinctrl: rockchip: enable clock support, disable pinmux disable and RK30_PIN_PXX to GPIO_XX

10 years agork: l2c: only init when chip is rockchip
黄涛 [Mon, 6 Jan 2014 02:43:36 +0000 (10:43 +0800)]
rk: l2c: only init when chip is rockchip

10 years agork: support make kernel.img and board_kernel.img
黄涛 [Mon, 6 Jan 2014 02:36:57 +0000 (10:36 +0800)]
rk: support make kernel.img and board_kernel.img

10 years agork: fix PIE support, libpie_stage2.o depends on pie_rename.syms
黄涛 [Mon, 6 Jan 2014 02:35:20 +0000 (10:35 +0800)]
rk: fix PIE support, libpie_stage2.o depends on pie_rename.syms

10 years agopinctrl: Remove duplicate code in pinctrl_pm_select_state functions
Tony Lindgren [Thu, 18 Jul 2013 15:15:04 +0000 (08:15 -0700)]
pinctrl: Remove duplicate code in pinctrl_pm_select_state functions

There's no need to duplicate essentially the same functions. Let's
introduce static int pinctrl_pm_select_state() and make the other
related functions call that.

This allows us to add support later on for multiple active states,
and more optimized dynamic remuxing.

Note that we still need to export the various pinctrl_pm_select
functions as we want to keep struct pinctrl_state private to the
pinctrl code, and cannot replace those with inline functions.

Cc: Felipe Balbi <balbi@ti.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agopinctrl: export pinctrl_pm_select_*_state
Arnd Bergmann [Mon, 17 Jun 2013 15:12:28 +0000 (17:12 +0200)]
pinctrl: export pinctrl_pm_select_*_state

The three functions pinctrl_pm_select_default_state,
pinctrl_pm_select_sleep_state, and pinctrl_pm_select_idle_state
are used in drivers that can be loadable modules, and should
be exported.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agodrivers: pinctrl sleep and idle states in the core
Linus Walleij [Wed, 5 Jun 2013 13:30:33 +0000 (15:30 +0200)]
drivers: pinctrl sleep and idle states in the core

If a device have sleep and idle states in addition to the
default state, look up these in the core and stash them in
the pinctrl state container.

Add accessor functions for pinctrl consumers to put the pins
into "default", "sleep" and "idle" states passing nothing but
the struct device * affected.

Solution suggested by Kevin Hilman, Mark Brown and Dmitry
Torokhov in response to a patch series from Hebbar
Gururaja.

Cc: Hebbar Gururaja <gururaja.hebbar@ti.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoadd clock init
xxx [Fri, 3 Jan 2014 06:28:11 +0000 (14:28 +0800)]
add clock init

10 years agopinctrl:fix irq operation bug
luowei [Mon, 30 Dec 2013 01:39:15 +0000 (09:39 +0800)]
pinctrl:fix irq operation bug

10 years agofiq debugger: modify switch_cpu()
hhb [Thu, 26 Dec 2013 02:32:04 +0000 (10:32 +0800)]
fiq debugger: modify switch_cpu()

10 years agork3188: set mux/divider/gate flags && fix some bugs
chenxing [Mon, 23 Dec 2013 04:06:09 +0000 (12:06 +0800)]
rk3188: set mux/divider/gate flags && fix some bugs

10 years agoclk: gate: add CLK_GATE_HIWORD_MASK
Haojian Zhuang [Sat, 8 Jun 2013 14:47:19 +0000 (22:47 +0800)]
clk: gate: add CLK_GATE_HIWORD_MASK

In Rockchip Cortex-A9 based chips, they don't use paradigm of
reading-changing-writing the register contents.  Instead they
use a hiword mask to indicate the changed bits.

When b1 should be set as gate, it also needs to indicate the change
by setting hiword mask (b1 << 16).

The patch adds gate flag for this usage.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
10 years agoclk: divider: add CLK_DIVIDER_HIWORD_MASK flag
Haojian Zhuang [Sat, 8 Jun 2013 14:47:18 +0000 (22:47 +0800)]
clk: divider: add CLK_DIVIDER_HIWORD_MASK flag

In both Hisilicon & Rockchip Cortex-A9 based chips, they don't use the
paradigm of reading-changing-writing the register contents.
Instead they use a hiword mask to indicate the changed bits.

When b01 should be set as setting divider, it also needs to indicate
the change by setting hiword mask (b11 << 16).

The patch adds divider flag for this usage.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
10 years agoclk: mux: add CLK_MUX_HIWORD_MASK
Haojian Zhuang [Sat, 8 Jun 2013 14:47:17 +0000 (22:47 +0800)]
clk: mux: add CLK_MUX_HIWORD_MASK

In both Hisilicon & Rockchip Cortex-A9 based chips, they don't use the
paradigm of reading-changing-writing the register contents.
Instead they use a hiword mask to indicate the changed bits.

When b01 should be set as switching mux, it also needs to indicate
the change by setting hiword mask (b11 << 16).

The patch adds mux flag for this usage.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
10 years agork3188: revert clk-divider.c and clk-mux.c in drivers/clk/
chenxing [Mon, 23 Dec 2013 02:48:57 +0000 (10:48 +0800)]
rk3188: revert clk-divider.c and clk-mux.c in drivers/clk/

10 years agork3188: add clock support
chenxing [Fri, 20 Dec 2013 11:07:23 +0000 (19:07 +0800)]
rk3188: add clock support

10 years agopinctrl:delete unused code
luowei [Thu, 19 Dec 2013 10:38:22 +0000 (18:38 +0800)]
pinctrl:delete unused code

10 years agoARM: Fix "Make low-level printk work" to use a separate config option
Arve Hjønnevåg [Sat, 15 Jun 2013 02:54:40 +0000 (19:54 -0700)]
ARM: Fix "Make low-level printk work" to use a separate config option

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Conflicts:
kernel/printk.c

10 years agoMerge remote-tracking branch 'origin/upstream/linux-linaro-lsk-v3.10-android+android...
黄涛 [Tue, 17 Dec 2013 06:48:54 +0000 (14:48 +0800)]
Merge remote-tracking branch 'origin/upstream/linux-linaro-lsk-v3.10-android+android-common-3.10' into develop-3.10

10 years agoMerge remote-tracking branch 'origin/upstream/android-common-3.10' into linux-linaro...
黄涛 [Tue, 17 Dec 2013 06:41:39 +0000 (14:41 +0800)]
Merge remote-tracking branch 'origin/upstream/android-common-3.10' into linux-linaro-lsk-v3.10-android+android-common-3.10

10 years agoMerge remote-tracking branch 'origin/upstream/linux-linaro-lsk-v3.10-android' into...
黄涛 [Tue, 17 Dec 2013 06:41:09 +0000 (14:41 +0800)]
Merge remote-tracking branch 'origin/upstream/linux-linaro-lsk-v3.10-android' into linux-linaro-lsk-v3.10-android+android-common-3.10

Conflicts:
kernel/printk.c

10 years agogpiolib: safer implementation of desc_to_gpio()
Alexandre Courbot [Fri, 4 Oct 2013 17:59:57 +0000 (10:59 -0700)]
gpiolib: safer implementation of desc_to_gpio()

The current implementation of desc_to_gpio() relies on the chip pointer
to be set to a valid value in order to compute the GPIO number. This
was done in the hope that we can get rid of the gpio_desc global array,
but this is not happening anytime soon.

This patch reimplements desc_to_gpio() in a fashion similar to that of
gpio_to_desc(). As a result, desc_to_gpio(gpio_to_desc(gpio)) == gpio is
now always true. This allows to call desc_to_gpio() on non-initialized
descriptors as some error-handling code currently does.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reported-by: Dr. H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoion: Fix build warning
John Stultz [Fri, 13 Dec 2013 03:09:47 +0000 (19:09 -0800)]
ion: Fix build warning

Add #include <linux/device.h> to fix the following warning seen
with gcc 4.7.3:

In file included from drivers/staging/android/ion/ion_heap.c:26:0:
drivers/staging/android/ion/ion_priv.h:358:21: warning: ‘struct device’ declared inside parameter list [enabled by default]
drivers/staging/android/ion/ion_priv.h:358:21: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]

Change-Id: Icc249b32d877a5b76b1669c99bef2b05d9e322da
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoion: remove ion_user_handle_t from ion_test.h
Colin Cross [Tue, 17 Dec 2013 00:33:00 +0000 (16:33 -0800)]
ion: remove ion_user_handle_t from ion_test.h

ion_test.h should not define ion_user_handle_t, and defining it
causes a warning:
In file included from drivers/staging/android/ion/ion_test.c:31:
drivers/staging/android/ion/../uapi/ion_test.h:23: error: redefinition of typedef 'ion_user_handle_t'
drivers/staging/android/ion/../uapi/ion.h:23: note: previous declaration of 'ion_user_handle_t' was here

Change-Id: I541897745a5ff128790a7e51b23f3034f5d3d6d9
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: Don't allow building ION as a module.
John Stultz [Sat, 14 Dec 2013 20:06:45 +0000 (12:06 -0800)]
ion: Don't allow building ION as a module.

ION doesn't export the proper symbols for it to be a module. This
causes build issues when ION is configured as a module.

Since Andorid kernels rarely use modules (I think recent policy
requires no modules?), go ahead and set the ION config to a bool
from the tristate option.

If folks decide ION as a module is important, we will have to go
through and export the various needed symbols.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoMerge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
Mark Brown [Mon, 16 Dec 2013 16:28:09 +0000 (16:28 +0000)]
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android

10 years agoMerge remote-tracking branch 'lsk/v3.10/topic/arm64-fvp' into linux-linaro-lsk
Mark Brown [Mon, 16 Dec 2013 16:27:59 +0000 (16:27 +0000)]
Merge remote-tracking branch 'lsk/v3.10/topic/arm64-fvp' into linux-linaro-lsk

10 years agoarm64: dts: Add properties required for CLCD enumeration
Mark Brown [Mon, 16 Dec 2013 16:26:36 +0000 (16:26 +0000)]
arm64: dts: Add properties required for CLCD enumeration

Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agopinctrl:add vol_domain dts support
luowei [Mon, 16 Dec 2013 14:23:44 +0000 (22:23 +0800)]
pinctrl:add vol_domain dts support

10 years agork: fix PIE support, better support clean
黄涛 [Mon, 16 Dec 2013 11:34:04 +0000 (19:34 +0800)]
rk: fix PIE support, better support clean

10 years agoMerge remote-tracking branch 'origin/upstream/linux-linaro-lsk-v3.10-android' into...
黄涛 [Mon, 16 Dec 2013 06:23:41 +0000 (14:23 +0800)]
Merge remote-tracking branch 'origin/upstream/linux-linaro-lsk-v3.10-android' into develop-3.10

10 years agopinctrl:add interface for drive and vol setting
luowei [Sat, 14 Dec 2013 11:14:15 +0000 (19:14 +0800)]
pinctrl:add interface for drive and vol setting

10 years agotimerfd: support CLOCK_BOOTTIME clock
Greg Hackmann [Fri, 13 Dec 2013 21:02:31 +0000 (13:02 -0800)]
timerfd: support CLOCK_BOOTTIME clock

Add CLOCK_BOOTTIME support to timerfd

Change-Id: I14dee6d1104f15a05f463a632268ac4564753faf
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agoandroid: configs: require TCPMSS, remove SCHED_TRACER and TIMER_STATS
JP Abgrall [Sat, 23 Nov 2013 01:29:57 +0000 (17:29 -0800)]
android: configs: require TCPMSS, remove SCHED_TRACER and TIMER_STATS

TCPMSS is required for the Android Vpn service to correctly
handle the MTU on tun/ppp devices.  Bug: 11579326
We don't really need SCHED_TRACER and the TIMER_STATS.

Change-Id: I10c5767a6324a496713752d4fe9eff361dc8e06a
(cherry picked from commit 23f01e8e81f3c53985958fa291b39c84293ad047)

10 years agoMerge remote-tracking branch 'lsk/v3.10/topic/aosp-warnings' into linux-linaro-lsk...
Mark Brown [Fri, 13 Dec 2013 18:53:19 +0000 (18:53 +0000)]
Merge remote-tracking branch 'lsk/v3.10/topic/aosp-warnings' into linux-linaro-lsk-android

10 years agoMerge remote-tracking branch 'lsk/v3.10/topic/aosp' into linux-linaro-lsk-android
Mark Brown [Fri, 13 Dec 2013 18:52:59 +0000 (18:52 +0000)]
Merge remote-tracking branch 'lsk/v3.10/topic/aosp' into linux-linaro-lsk-android

Conflicts:
drivers/staging/android/ion/ion_chunk_heap.c
kernel/printk.c

10 years agoMerge branch 'android-3.10' of https://android.googlesource.com/kernel/common into...
Mark Brown [Fri, 13 Dec 2013 18:50:12 +0000 (18:50 +0000)]
Merge branch 'android-3.10' of https://android.googlesource.com/kernel/common into lsk-v3.10-aosp

10 years agonetfilter: fix function return types for 64bit
Mark Hambleton [Fri, 29 Nov 2013 13:44:53 +0000 (13:44 +0000)]
netfilter: fix function return types for 64bit

Fix functions to return ssize_t instead of int to match
prototypes.

Signed-off-by: Mark Hambleton <mahamble@broadcom.com>
Reviewed-by: Edwin Chan <echan@broadcom.com>
Reviewed-by: James King <jamesk@broadcom.com>
Reviewed-by: John Garry <jgarry@broadcom.com>
Reviewed-by: Mark Hambleton <mark.hambleton@broadcom.com>
Reviewed-by: Joyjit Nath <joyjit@broadcom.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoMerge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
Mark Brown [Fri, 13 Dec 2013 17:25:16 +0000 (17:25 +0000)]
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android

10 years agoMerge remote-tracking branch 'lsk/v3.10/topic/arm64-hmp' into linux-linaro-lsk
Mark Brown [Fri, 13 Dec 2013 17:24:35 +0000 (17:24 +0000)]
Merge remote-tracking branch 'lsk/v3.10/topic/arm64-hmp' into linux-linaro-lsk

10 years agoarm64: Enable HMP for ARMv8
Mark Hambleton [Wed, 27 Nov 2013 13:30:29 +0000 (13:30 +0000)]
arm64: Enable HMP for ARMv8

Signed-off-by: Mark Hambleton <mahamble@broadcom.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoMerge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
Mark Brown [Fri, 13 Dec 2013 12:31:39 +0000 (12:31 +0000)]
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android

10 years agoMerge remote-tracking branch 'lsk/v3.10/topic/arm64-cpu' into linux-linaro-lsk
Mark Brown [Fri, 13 Dec 2013 12:28:13 +0000 (12:28 +0000)]
Merge remote-tracking branch 'lsk/v3.10/topic/arm64-cpu' into linux-linaro-lsk

10 years agoARM64: DT: define ARM64 specific arch_match_cpu_phys_id
Sudeep KarkadaNagesha [Mon, 21 Oct 2013 12:29:42 +0000 (13:29 +0100)]
ARM64: DT: define ARM64 specific arch_match_cpu_phys_id

OF/DT core library provides architecture specific hook to match the
logical cpu index with the corresponding physical identifier.

On ARM64, the MPIDR_EL1 contains specific bitfields(MPIDR_EL1.Aff{3..0})
which uniquely identify a CPU, in addition to some non-identifying
information and reserved bits. The ARM cpu binding defines the 'reg'
property to only contain the affinity bits, and any cpu nodes with other
bits set in their 'reg' entry are skipped.

This patch overrides the weak definition of arch_match_cpu_phys_id
with ARM64 specific version using MPIDR_EL1.Aff{3..0} as cpu physical
identifiers.

Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 6e15d0e04bfeaa5662a289ee915273307326e45a)

10 years agoARM: rockchip: add grf.h
黄涛 [Fri, 13 Dec 2013 11:53:50 +0000 (19:53 +0800)]
ARM: rockchip: add grf.h

10 years agoARM: rockchip: update rockchip_defconfig to support module and i2c, etc
黄涛 [Fri, 13 Dec 2013 11:49:51 +0000 (19:49 +0800)]
ARM: rockchip: update rockchip_defconfig to support module and i2c, etc

10 years agoi2c: rockchip: i2c_msg add scl_rate for compat support old driver
黄涛 [Fri, 13 Dec 2013 11:44:36 +0000 (19:44 +0800)]
i2c: rockchip: i2c_msg add scl_rate for compat support old driver

10 years agoARM: rockchip: rk3188-tb enable i2c
黄涛 [Fri, 13 Dec 2013 11:42:23 +0000 (19:42 +0800)]
ARM: rockchip: rk3188-tb enable i2c

10 years agoi2c: add rockchip i2c driver
黄涛 [Fri, 13 Dec 2013 11:41:11 +0000 (19:41 +0800)]
i2c: add rockchip i2c driver

10 years agoMerge remote-tracking branch 'lsk/v3.10/topic/arm64-topology' into linux-linaro-lsk
Mark Brown [Fri, 13 Dec 2013 10:56:15 +0000 (10:56 +0000)]
Merge remote-tracking branch 'lsk/v3.10/topic/arm64-topology' into linux-linaro-lsk

10 years agoarm64: Add scheduler multicore and SMT Kconfig options
Mark Brown [Fri, 13 Dec 2013 10:52:45 +0000 (10:52 +0000)]
arm64: Add scheduler multicore and SMT Kconfig options

Enable additional use of additional scheduler features with the topology
information.

Reported-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoARM: rockchip: l2 and cpu_axi_bus DT add rockchip prefix
黄涛 [Fri, 13 Dec 2013 09:19:07 +0000 (17:19 +0800)]
ARM: rockchip: l2 and cpu_axi_bus DT add rockchip prefix

10 years agoARM: rockchip: rk_fiq_debugger DT add rockchip prefix
黄涛 [Fri, 13 Dec 2013 08:52:39 +0000 (16:52 +0800)]
ARM: rockchip: rk_fiq_debugger DT add rockchip prefix

10 years agork_serial: use of_alias_get_id to get serial id
黄涛 [Fri, 13 Dec 2013 08:40:30 +0000 (16:40 +0800)]
rk_serial: use of_alias_get_id to get serial id

10 years agoimprove pinctrl dts format and add rk3188-pinctrl.dtsi file
luowei [Fri, 13 Dec 2013 06:52:28 +0000 (14:52 +0800)]
improve pinctrl dts format and add rk3188-pinctrl.dtsi file

10 years agoion: Improve ION config description
John Stultz [Fri, 8 Nov 2013 03:58:41 +0000 (19:58 -0800)]
ion: Improve ION config description

Mostly just to quiet checkpatch warnings, be more verbose
in describing the ION config option.

Change-Id: I194235f1a68623dca15ae6e658fc99d00943a827
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoion: Cleanup whitespace issues and other checkpatch problems
John Stultz [Fri, 8 Nov 2013 03:51:09 +0000 (19:51 -0800)]
ion: Cleanup whitespace issues and other checkpatch problems

Just some simple cleanups to address whitespace issues and
other issues found w/ checkpatch.

Change-Id: I181444505627894b8f3bbf59192703b0f65736ee
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoandroid: configs: Reorder config fragments, update README
JP Abgrall [Fri, 22 Nov 2013 22:07:03 +0000 (14:07 -0800)]
android: configs: Reorder config fragments, update README

Change-Id: I5ee4b794dcc00f74f26562e49a406ea292af63ee
(cherry picked from commit 9ebedefd06142c9bc812bfa23401031525002a76)

10 years agoion: fix bugs in cma heap
Colin Cross [Wed, 27 Nov 2013 23:53:21 +0000 (15:53 -0800)]
ion: fix bugs in cma heap

Implement ion_cma_unmap_kernel, ion will call it unconditionally.
Use correct gfp flags when calling dma_alloc_coherent so it doesn't
try to use atomic DMA memory.
Check for invalid alignment when allocating.
Reject cached allocations - the cpu address returned by
dma_alloc_coherent is always going to be an uncached mapping, so
map_kernel will not see data written by a cached userspace mapping.

Change-Id: I2ea03f28fae3749f6de0b89700b69da3845926ea
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: add alignment check to chunk heap
Colin Cross [Wed, 27 Nov 2013 23:53:01 +0000 (15:53 -0800)]
ion: add alignment check to chunk heap

Change-Id: I4be12b9545a81f9b46339a905f00e1e64896b3ed
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: add helper to zero contiguous region of pages
Colin Cross [Wed, 27 Nov 2013 23:51:02 +0000 (15:51 -0800)]
ion: add helper to zero contiguous region of pages

Add ion_heap_pages_zero for ion heaps to use to zero pages
during initialization or allocation, when a struct ion_buffer
may not be available.  Use it from the chunk heap and carveout
heaps.

Change-Id: Ic6c921943a8820cf9896da5164f2d9794d0fe91f
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: carveout heap: zero buffers on free, fix memory leak
Colin Cross [Wed, 27 Nov 2013 05:36:54 +0000 (21:36 -0800)]
ion: carveout heap: zero buffers on free, fix memory leak

The carveout heap wasn't zeroing its buffers after use.
Create the sg_table during allocate instead of map_dma, to allow
using the sg_table during free, and call ion_heap_buffer_zero
during free.  Also fixes a missing kfree when destroying the
table.

Change-Id: I318a8493cce32580250884cae336dd2e2c28e73b
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: fix sparse warnings
Colin Cross [Wed, 27 Nov 2013 05:25:47 +0000 (21:25 -0800)]
ion: fix sparse warnings

Fix sparse warnings in ion.

Change-Id: Icbadf2ca53bea20914f608f619568629c178eae3
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: use alloc_pages in system contig heap
Colin Cross [Tue, 26 Nov 2013 23:35:29 +0000 (15:35 -0800)]
ion: use alloc_pages in system contig heap

There is no reason to use kzalloc, just call alloc_pages directly.
Change the GFP from GFP_KERNEL to include __GFP_HIGH, to allow it
to return contiguous pages from highmem.  virt_to_* functions
aren't valid on highmem pages, so store the struct page * in an
sg_table in buffer->priv_virt like most other heaps, and replace
virt_to_* with page_to_*.

Change-Id: Ida78888b101f080883716e1fa5038dfc4dbabd16
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: allow cached mappings of chunk and system heap buffers
Colin Cross [Tue, 26 Nov 2013 23:33:33 +0000 (15:33 -0800)]
ion: allow cached mappings of chunk and system heap buffers

Now that ion_vm_fault uses vm_insert_pfn instead of vm_insert_page
cached buffers can be supported in any heap.  Remove the checks
in the chunk and system heaps.

Change-Id: I371a44c400ed8a342c3b0eed90d0fb7060537697
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: remove ion_heap_alloc_pages
Colin Cross [Tue, 26 Nov 2013 23:25:59 +0000 (15:25 -0800)]
ion: remove ion_heap_alloc_pages

Now that ion_vm_fault doesn't need a struct page with a nonzero
refcount, there is no need allocate heap memory for cached pages using
split_page.  Remove the ion_heap_alloc_pages and ion_heap_free_pages
helpers in favor of direct calls to alloc_pages and __free_pages,
and remove the special handling in the system heap.

Change-Id: I5966a798f48df2d56642e662a69c1495944f6509
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: use vm_insert_pfn for faulted pages
Colin Cross [Tue, 26 Nov 2013 23:05:46 +0000 (15:05 -0800)]
ion: use vm_insert_pfn for faulted pages

Most ion userspace mappings are created with remap_pfn_range.  Use
vm_insert_pfn instead of vm_insert_page to make faulted cached
mappings look more like uncached mappings.

Change-Id: I9ec5cad3fef54f3b80be8b306d7ff2f1fe3f0e66
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: check return value from remap_pfn_range
Colin Cross [Tue, 26 Nov 2013 23:34:50 +0000 (15:34 -0800)]
ion: check return value from remap_pfn_range

Check the return value of remap_pfn_range and return an error if
it fails.

Change-Id: I206cf95a24607ebe1c80274e3ed15cc7c076d007
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: free low memory from page pools first
Colin Cross [Fri, 22 Nov 2013 02:56:37 +0000 (18:56 -0800)]
ion: free low memory from page pools first

When the shrinkers are called with GFP_HIGH free low memory first,
it is more important to have free than high memory.

Change-Id: I7ad8a9c133830f04d429c3d87b781b3e862ccedb
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: optimize ion_heap_buffer_zero
Colin Cross [Mon, 25 Nov 2013 21:32:51 +0000 (13:32 -0800)]
ion: optimize ion_heap_buffer_zero

ion_heap_buffer_zero can spend a long time in unmap_kernel_range
if it has to broadcast a tlb flush to every cpu for every page.
Modify it to batch pages into a larger region to clear using a
single mapping.  This may cause the mapping size to change if
the buffer size is not a multiple of the mapping size, so
switch to allocating the address space for each chunk.  This
allows us to use vm_map_ram to handle the allocation and mapping
together.

The number of pages to zero using a single mapping is set to 32
to hit the fastpath in vm_map_ram.

Change-Id: I1accfe67b285cbc9e95e387bea4246864197827d
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: add alignment check to carveout heap
Colin Cross [Tue, 26 Nov 2013 21:43:29 +0000 (13:43 -0800)]
ion: add alignment check to carveout heap

Change-Id: I25c752b3eacb48cccea5be2df319634b3affd331
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: drop dependency on ARM
Colin Cross [Sat, 23 Nov 2013 06:48:42 +0000 (22:48 -0800)]
ion: drop dependency on ARM

Ion will compile and run on other platforms now, remove the
dependency on ARM.

Change-Id: I9da0ab686708bdab575a021031392b4402cce090
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: Fix two small issues in system_heap allocation
John Stultz [Fri, 22 Nov 2013 23:36:27 +0000 (15:36 -0800)]
ion: Fix two small issues in system_heap allocation

In testing ion system heap allocations, I ran across two issues:

1) Not k*z*allocing the sg table. This can cause trouble if
we end up trying call sg_alloc_table() with too many entries,
then sg_alloc_table() internally fails and tries to free what it
thinks is internal table structure, which causes bad pointer
traversals.

2) The second list_for_each_entry probably should be _safe,
since I was seeing  strange lock warnings and oopses on occasion.
This seems to resolve it, but could use some extra checking.

Change-Id: I59d4c90104a8cf23dc4ae814d0b17348f1b68ac0
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agogpu: ion: fix use-after-free in ion_heap_freelist_drain
Mitchel Humpherys [Tue, 6 Aug 2013 18:19:42 +0000 (11:19 -0700)]
gpu: ion: fix use-after-free in ion_heap_freelist_drain

The `buffer' variable is being used after being freed. Fix this.

Change-Id: Iea3471fa7dc7535bbf0620c1639fea2008d7cf19
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
10 years agoion: clean up ioctls
Colin Cross [Sat, 9 Nov 2013 00:55:35 +0000 (16:55 -0800)]
ion: clean up ioctls

Convert the ion ioctls to use _IOW instead of _IOWR where
appropriate, and factor out the copy_from_user and copy_to_user
based on the _IOC_DIR bits.  For the existing incorrect ioctls,
add a function to wrap _IOC_DIR to return the corrected value.

Change-Id: I3cc34c84b9c52305bdbec27a9224447b102fadcd
Signed-off-by: Colin Cross <ccross@android.com>
10 years agogpu: ion: remove unnecessary function from system heap
Colin Cross [Thu, 7 Nov 2013 20:18:57 +0000 (12:18 -0800)]
gpu: ion: remove unnecessary function from system heap

ion_system_contig_heap buffers have an sglist, just call
ion_heap_map_user to map it.

Change-Id: I6dea383955834613fa8833659b31533c957c2b0b
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: fix printk warnings
Colin Cross [Thu, 19 Sep 2013 14:20:23 +0000 (09:20 -0500)]
ion: fix printk warnings

Use %z for size_t and %pa for dma_addr_t to avoid warnings in printks.

Change-Id: I2c72874acd0b69cb35fca691928783817deb9394
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: don't use phys_to_page or __phys_to_pfn
Colin Cross [Thu, 19 Sep 2013 15:13:53 +0000 (10:13 -0500)]
ion: don't use phys_to_page or __phys_to_pfn

phys_to_page and __phys_to_pfn don't exist on all platforms.
Use a combination of pfn_to_page, PFN_DOWN, page_to_pfn, and
virt_to_page to get the same results.

Change-Id: I53cef26059800bc8b7fb85ae458741574c97c257
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: don't use __arm_ioremap to map pages
Colin Cross [Thu, 19 Sep 2013 15:12:05 +0000 (10:12 -0500)]
ion: don't use __arm_ioremap to map pages

ion_heap_map_kernel already implements mapping a scatterlist of
pages into the kernel, and all heaps are required to have struct
pages associated with them, so delete the functions that use
__arm_ioremap and use ion_heap_map_kernel instead.

Change-Id: Ia2dfd8d8c6e719d7d2f68dd4c458826fdb938260
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: update idr to avoid deprecated apis
Colin Cross [Thu, 19 Sep 2013 19:54:56 +0000 (14:54 -0500)]
ion: update idr to avoid deprecated apis

Use idr_alloc instead if idr_pre_get/idr_get_new_above, and
remove idr_remove_all.

Change-Id: I675b789879549bd3767ed3ef2016cf108eb622d2
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: add test device for unit tests to interact with dma_bufs
Colin Cross [Sat, 9 Nov 2013 00:32:47 +0000 (16:32 -0800)]
ion: add test device for unit tests to interact with dma_bufs

Add a /dev/ion-test device that will be created if CONFIG_ION_TEST
is set.  The device accepts a dma_buf fd and allows reading and
writing to the backing memory using DMA-like apis or kernel mapping
apis.  Can be used to test the dma_buf mapping ops, including
the ion implementations, from userspace.

Change-Id: I30703ba69cd75bdfe7767ac642e5f0cacd8d0478
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoMerge remote-tracking branch 'lsk/v3.10/topic/arm64-fvp' into linux-linaro-lsk
Mark Brown [Thu, 12 Dec 2013 17:16:17 +0000 (17:16 +0000)]
Merge remote-tracking branch 'lsk/v3.10/topic/arm64-fvp' into linux-linaro-lsk

10 years agovideo: amba-clcd: Make CLCD driver available on more platforms
Mark Brown [Thu, 12 Dec 2013 17:02:57 +0000 (17:02 +0000)]
video: amba-clcd: Make CLCD driver available on more platforms

The CLCD driver is used on ARM reference models for ARMv8 so add ARM64
to the list of dependencies. The driver also has no build time dependencies
on ARM (stubs are provided for ARM-specific DMA functions in the code) so
make it available with COMPILE_TEST in order to maximise build coverage.

Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoMerge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
Mark Brown [Thu, 12 Dec 2013 10:22:32 +0000 (10:22 +0000)]
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android

10 years agoMerge tag 'v3.10.24' into linux-linaro-lsk
Mark Brown [Thu, 12 Dec 2013 10:22:21 +0000 (10:22 +0000)]
Merge tag 'v3.10.24' into linux-linaro-lsk

This is the 3.10.24 stable release

10 years agoLinux 3.10.24
Greg Kroah-Hartman [Thu, 12 Dec 2013 06:36:44 +0000 (22:36 -0800)]
Linux 3.10.24

10 years agocrypto: scatterwalk - Use sg_chain_ptr on chain entries
Tom Lendacky [Thu, 5 Dec 2013 19:09:53 +0000 (13:09 -0600)]
crypto: scatterwalk - Use sg_chain_ptr on chain entries

commit 389a5390583a18e45bc4abd4439291abec5e7a63 upstream.

Now that scatterwalk_sg_chain sets the chain pointer bit the sg_page
call in scatterwalk_sg_next hits a BUG_ON when CONFIG_DEBUG_SG is
enabled. Use sg_chain_ptr instead of sg_page on a chain entry.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoARM: mvebu: second PCIe unit of Armada XP mv78230 is only x1 capable
Arnaud Ebalard [Tue, 5 Nov 2013 20:45:48 +0000 (21:45 +0100)]
ARM: mvebu: second PCIe unit of Armada XP mv78230 is only x1 capable

commit 12b69a599745fc9e203f61fbb7160b2cc5f479dd upstream.

Various Marvell datasheets advertise second PCIe unit of mv78230
flavour of Armada XP as x4/quad x1 capable. This second unit is in
fact only x1 capable. This patch fixes current mv78230 .dtsi to
reflect that, i.e. makes 1.0 the second interface (instead of 2.0
at the moment). This was successfully tested on a mv78230-based
ReadyNAS 2120 platform with a x1 device (FL1009 XHCI controller)
connected to this second interface.

Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoARM: mvebu: fix second and third PCIe unit of Armada XP mv78260
Arnaud Ebalard [Tue, 5 Nov 2013 20:46:02 +0000 (21:46 +0100)]
ARM: mvebu: fix second and third PCIe unit of Armada XP mv78260

commit 2163e61c92d9337e721a0d067d88ae62b52e0d3e upstream.

mv78260 flavour of Marvell Armada XP SoC has 3 PCIe units. The
two first units are both x4 and quad x1 capable. The third unit
is only x4 capable. This patch fixes mv78260 .dtsi to reflect
those capabilities.

Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agodrivers/char/i8k.c: add Dell XPLS L421X
Alan Cox [Tue, 3 Dec 2013 21:56:56 +0000 (13:56 -0800)]
drivers/char/i8k.c: add Dell XPLS L421X

commit 9aa5b0181bdf335f0b731d8502e128a862884bcd upstream.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=60772

Signed-off-by: Alan Cox <alan@linux.intel.com>
Reported-by: Leho Kraav <leho@kraav.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: cdc-acm: Added support for the Lenovo RD02-D400 USB Modem
David Cluytens [Tue, 3 Dec 2013 13:18:57 +0000 (14:18 +0100)]
USB: cdc-acm: Added support for the Lenovo RD02-D400 USB Modem

commit 3b59d16c513da258ec8f6a0b4db85f257a0380d6 upstream.

Signed-off-by: David Cluytens <david.cluytens@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: spcp8x5: correct handling of CS5 setting
Colin Leitner [Fri, 8 Nov 2013 21:53:11 +0000 (22:53 +0100)]
USB: spcp8x5: correct handling of CS5 setting

commit 711fbdfbf2bc4827214a650afe3f64767a1aba16 upstream.

This patch removes an erroneous check of CSIZE, which made it impossible to set
CS5.

Compiles clean, but couldn't test against hardware.

Signed-off-by: Colin Leitner <colin.leitner@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: mos7840: correct handling of CS5 setting
Colin Leitner [Fri, 8 Nov 2013 21:52:34 +0000 (22:52 +0100)]
USB: mos7840: correct handling of CS5 setting

commit 78692cc3382e0603a47e1f2aaeffe0d99891994d upstream.

This patch removes an erroneous check of CSIZE, which made it impossible to set
CS5.

Compiles clean, but couldn't test against hardware.

Signed-off-by: Colin Leitner <colin.leitner@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: ftdi_sio: fixed handling of unsupported CSIZE setting
Colin Leitner [Tue, 5 Nov 2013 17:02:34 +0000 (18:02 +0100)]
USB: ftdi_sio: fixed handling of unsupported CSIZE setting

commit 8704211f65a2106ba01b6ac9727cdaf9ca11594c upstream.

FTDI UARTs support only 7 or 8 data bits. Until now the ftdi_sio driver would
only report this limitation for CS6 to dmesg and fail to reflect this fact to
tcgetattr.

This patch reverts the unsupported CSIZE setting and reports the fact with less
severance to dmesg for both CS5 and CS6.

To test the patch it's sufficient to call

    stty -F /dev/ttyUSB0 cs5

which will succeed without the patch and report an error with the patch
applied.

As an additional fix this patch ensures that the control request will always
include a data bit size.

Signed-off-by: Colin Leitner <colin.leitner@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: pl2303: fixed handling of CS5 setting
Colin Leitner [Mon, 4 Nov 2013 18:40:43 +0000 (19:40 +0100)]
USB: pl2303: fixed handling of CS5 setting

commit a313249937820f8b1996133fc285efbd6aad2c5b upstream.

This patch fixes the CS5 setting on the PL2303 USB-to-serial devices. CS5 has a
value of 0 and the CSIZE setting has been skipped altogether by the enclosing
if. Tested on 3.11.6 and the scope shows the correct output after the fix has
been applied.

Tagged to be added to stable, because it fixes a user visible driver bug and is
simple enough to backport easily.

Signed-off-by: Colin Leitner <colin.leitner@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agomei: add 9 series PCH mei device ids
Tomas Winkler [Thu, 5 Dec 2013 07:34:44 +0000 (09:34 +0200)]
mei: add 9 series PCH mei device ids

commit 76a9635979e543f04a5885198e68ff28e3311b67 upstream.

And Lynx Point H Refresh and Wildcat Point LP
device ids.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agomei: me: add Lynx Point Wellsburg work station device id
Tomas Winkler [Wed, 16 Oct 2013 09:09:43 +0000 (12:09 +0300)]
mei: me: add Lynx Point Wellsburg work station device id

commit 838b3a6d62413b336f3dde15ecff161070358957 upstream.

add missing device id for LPT based work station

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoInput: mousedev - allow disabling even without CONFIG_EXPERT
Tom Gundersen [Thu, 31 Oct 2013 07:44:49 +0000 (00:44 -0700)]
Input: mousedev - allow disabling even without CONFIG_EXPERT

commit dfaaed08ecc01bd513248ba7999daf50ce028352 upstream.

Moust (if not all) modern software, including X, uses /dev/eventX rather than
the legacy /dev/mouseX devices. It therefore makes sense for general-purpose
(distro) kernels to use MOUSEDV=m (or even n), so let's drop the EXPERT=y
requirement.

Signed-off-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>