黄涛 [Mon, 13 Jan 2014 02:59:13 +0000 (10:59 +0800)]
ARM: rockchip: rk3188 add DDR init
黄涛 [Mon, 13 Jan 2014 02:51:01 +0000 (10:51 +0800)]
ARM: rockchip: rk3188 add pie init
黄涛 [Mon, 13 Jan 2014 02:43:41 +0000 (10:43 +0800)]
rk: fix PIE support multi cpu
dkl [Thu, 9 Jan 2014 07:59:18 +0000 (15:59 +0800)]
rk_clk: add common pll and gpll set_rate support
dkl [Wed, 8 Jan 2014 12:22:28 +0000 (20:22 +0800)]
rk_clk: add clk-pll.c support
support pll recalc_rate/round_rate except apll
James Hogan [Mon, 29 Jul 2013 11:25:01 +0000 (12:25 +0100)]
clk: add CLK_SET_RATE_NO_REPARENT flag
Add a CLK_SET_RATE_NO_REPARENT clock flag, which will prevent muxes
being reparented during clk_set_rate.
To avoid breaking existing platforms, all callers of clk_register_mux()
are adjusted to pass the new flag. Platform maintainers are encouraged
to remove the flag if they wish to allow mux reparenting on set_rate.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Viresh Kumar <viresh.linux@gmail.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
Cc: Chao Xie <xiechao.mail@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Emilio López" <emilio@elopez.com.ar>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Andrew Chew <achew@nvidia.com>
Cc: Doug Anderson <dianders@chromium.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Paul Walmsley <pwalmsley@nvidia.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Thomas Abraham <thomas.abraham@linaro.org>
Cc: Tomasz Figa <t.figa@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: spear-devel@list.st.com
Cc: linux-tegra@vger.kernel.org
Tested-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Acked-by: Stephen Warren <swarren@nvidia.com> [tegra]
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> [sunxi]
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com> [Zynq]
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Mike Turquette [Tue, 8 Oct 2013 06:12:13 +0000 (23:12 -0700)]
clk: of: helper for determining number of parent clocks
Walks the "clocks" array of parent clock phandles and returns the
number.
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Tomasz Figa [Sun, 29 Sep 2013 00:37:16 +0000 (02:37 +0200)]
clk: Correct lookup logic in clk_fetch_parent_index()
This function is supposed to iterate over all parents of given child
clock to find the index of given parent clock in its parent list,
using parent cache if possible and falling back to string compare
otherwise. However currently the logic falls back to string compare in
every iteration in which clock cache entry does not match given parent,
due to wrong check conditions.
This patch corrects the logic to continue the loop if parent cache entry
is present and does not match requested parent clock. In addition,
redundant checks for parent cache array presence are removed, because it
is always allocated in the beginning of the function.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Tomasz Figa [Sun, 29 Sep 2013 00:37:15 +0000 (02:37 +0200)]
clk: Use kcalloc() to allocate arrays
Instead of calculating sizes of arrays manually, kcalloc() can be used
to allocate arrays of elements with defined size. This is just a cleanup
patch without any functional changes.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Tomasz Figa [Sun, 29 Sep 2013 00:37:14 +0000 (02:37 +0200)]
clk: Add error handling to clk_fetch_parent_index()
There are at least two different error cases that can happen in
clk_fetch_parent_index() function:
- allocation failure,
- parent clock lookup failure,
however it returns only an u8, which is supposed to contain parent clock
index.
This patch modified the function to return full int instead allowing
positive clock indices and negative error codes to be returned. All
users of this function are adjusted as well to handle the return value
correctly.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Alex Elder [Thu, 5 Sep 2013 13:33:24 +0000 (08:33 -0500)]
clk: only call get_parent if there is one
In __clk_init(), after a clock is mostly initialized, a scan is done
of the orphan clocks to see if the clock being registered is the
parent of any of them.
This code assumes that any clock that provides a get_parent method
actually has at least one parent, and that's not a valid assumption.
As a result, an orphan clock with no parent can return *something*
as the parent index, and that value is blindly used to dereference
the orphan's parent_names[] array (which will be ZERO_SIZE_PTR or
NULL).
Fix this by ensuring get_parent is only called for orphans with at
least one parent.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Thierry Reding [Tue, 3 Sep 2013 07:43:51 +0000 (09:43 +0200)]
clk: Move symbol export to proper location
The __clk_get_flags() symbol is exported immediately following the
clk_unprepare_unused_subtree() function. This is unusual, since a symbol
export typically follows body of the function that it exports.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
James Hogan [Thu, 29 Aug 2013 11:10:51 +0000 (12:10 +0100)]
clk: fix new_parent dereference before null check
Commit
71472c0 (clk: add support for clock reparent on set_rate) added a
dereference of the new_parent pointer in clk_reparent(), but as detected
by smatch clk_reparent() later checks whether new_parent is NULL.
The dereference was in order to clear the new parent's new_child pointer
to avoid duplicate POST_RATE_CHANGE notifications, so clearly isn't
necessary if the new parent is NULL, so move it inside the "if
(new_parent)" block.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Alex Elder [Thu, 22 Aug 2013 16:31:31 +0000 (11:31 -0500)]
clk: get matching entry under lock in of_clk_init()
Currently of_clk_init() finds a matching device node while holding
the device tree spinlock. When a matching device node is found, the
lock is dropped and then re-acquired in order to get a reference
to the matching device id structure.
Acquiring the spinlock twice is unnecessary (and it opens a
vulnerable window that could conceivably lead to errors).
There already exists an interface for both finding and taking a
reference to a device id under lock, so use it.
Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Christian Daudt <csd@broadcom.com>
Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
Reviewed-by: Matt Porter <matt.porter@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Mike Turquette [Thu, 22 Aug 2013 06:58:09 +0000 (23:58 -0700)]
clk: handle NULL struct clk gracefully
At some point changes to clk_set_rate and clk_set_parent introduced a
bug whereby NULL struct clk pointers were treated as an error. This is
in violation of the API in include/linux/clk.h. Reintroduce graceful
handling of NULL clk's by bailing from clk_set_rate and clk_set_parent
with return codes of zero.
Signed-off-by: Mike Turquette <mturquette@linaro.org>
James Hogan [Mon, 29 Jul 2013 11:25:02 +0000 (12:25 +0100)]
clk: clk-mux: implement remuxing on set_rate
Implement clk-mux remuxing if the CLK_SET_RATE_NO_REPARENT flag isn't
set. This implements determine_rate for clk-mux to propagate to each
parent and to choose the best one (like clk-divider this chooses the
parent which provides the fastest rate <= the requested rate).
The determine_rate op is implemented as a core helper function so that
it can be easily used by more complex clocks which incorporate muxes.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Mike Turquette <mturquette@linaro.org>
James Hogan [Mon, 29 Jul 2013 11:25:00 +0000 (12:25 +0100)]
clk: add support for clock reparent on set_rate
Add core support to allow clock implementations to select the best
parent clock when rounding a rate, e.g. the one which can provide the
closest clock rate to that requested. This is by way of adding a new
clock op, determine_rate(), which is like round_rate() but has an extra
parameter to allow the clock implementation to optionally select a
different parent clock. The core then takes care of reparenting the
clock when setting the rate.
The parent change takes place with the help of some new private data
members. struct clk::new_parent specifies a clock's new parent (NULL
indicates no change), and struct clk::new_child specifies a clock's new
child (whose new_parent member points back to it). The purpose of these
are to allow correct walking of the future tree for notifications prior
to actually reparenting any clocks, specifically to skip child clocks
who are being reparented to another clock (they will be notified via the
new parent), and to include any new child clock. These pointers are set
by clk_calc_subtree(), and the new_child pointer gets cleared when a
child is actually reparented to avoid duplicate POST_RATE_CHANGE
notifications.
Each place where round_rate() is called, determine_rate() is checked
first and called in preference. This restructures a few of the call
sites to simplify the logic into if/else blocks.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Mike Turquette <mturquette@linaro.org>
James Hogan [Mon, 29 Jul 2013 11:24:59 +0000 (12:24 +0100)]
clk: move some parent related functions upwards
Move some parent related functions up in clk.c so they can be used by
the modifications in the following patch which enables clock reparenting
during set_rate. No other changes are made so this patch makes no
functional difference in isolation. This is separate from the following
patch primarily to ease readability of that patch.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Mike Turquette <mturquette@linaro.org>
James Hogan [Mon, 29 Jul 2013 11:24:58 +0000 (12:24 +0100)]
clk: abstract parent cache
Abstract access to the clock parent cache by defining
clk_get_parent_by_index(clk, index). This allows access to parent
clocks from clock drivers.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Peter Meerwald [Sat, 29 Jun 2013 13:14:19 +0000 (15:14 +0200)]
clk: fix typos
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Soren Brinkmann [Tue, 16 Apr 2013 17:06:50 +0000 (10:06 -0700)]
clk: Always notify whole subtree when reparenting
A clock's notifier count only reflects notifiers which are registered
directly for that clock. A reparent operation though affects the whole
subtree because of a potential rate change.
When issuing the pre rate change notifications only the notifier count
for the clock to be changed is considered and notifiers for subclocks
may never be called. Resulting in clocks in the subtree which have
registered notifiers, may receive a POST_- or ABORT_RATE_CHANGE
notification, without a PRE_RATE_CHANGE_NOTIFICATION.
Therefore always traverse the whole subtree when issueing pre rate
change notifications during a reparent operation.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Peter De Schrijver [Wed, 5 Jun 2013 15:06:36 +0000 (18:06 +0300)]
clk: honor CLK_GET_RATE_NOCACHE in clk_set_rate
clk_set_rate() uses clk->rate directly. This causes problems if the clock
is marked as CLK_GET_RATE_NOCACHE. Hence call clk_get_rate() to get the
current rate.
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Peter De Schrijver [Wed, 5 Jun 2013 15:06:35 +0000 (18:06 +0300)]
clk: use clk_get_rate() for debugfs
debugfs uses the rate field directly. However this ignores the
CLK_GET_RATE_NOCACHE flag. Call clk_get_rate() instead.
Tested-by: Mark Zhang <markz@nvidia.com>
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Saravana Kannan [Thu, 9 May 2013 18:35:01 +0000 (11:35 -0700)]
clk: Disable unused clocks after deferred probing is done
With deferred probing, late_initcall() is too soon to declare a clock as
unused. Wait for deferred probing to finish before declaring a clock as
unused. Since deferred probing is done in late_initcall(), do the unused
check to late_initcall_sync.
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
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]
黄涛 [Mon, 6 Jan 2014 04:45:00 +0000 (12:45 +0800)]
i2c: rockchip: support check idle
黄涛 [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
黄涛 [Mon, 6 Jan 2014 02:43:36 +0000 (10:43 +0800)]
rk: l2c: only init when chip is rockchip
黄涛 [Mon, 6 Jan 2014 02:36:57 +0000 (10:36 +0800)]
rk: support make kernel.img and board_kernel.img
黄涛 [Mon, 6 Jan 2014 02:35:20 +0000 (10:35 +0800)]
rk: fix PIE support, libpie_stage2.o depends on pie_rename.syms
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>
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>
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>
xxx [Fri, 3 Jan 2014 06:28:11 +0000 (14:28 +0800)]
add clock init
luowei [Mon, 30 Dec 2013 01:39:15 +0000 (09:39 +0800)]
pinctrl:fix irq operation bug
hhb [Thu, 26 Dec 2013 02:32:04 +0000 (10:32 +0800)]
fiq debugger: modify switch_cpu()
chenxing [Mon, 23 Dec 2013 04:06:09 +0000 (12:06 +0800)]
rk3188: set mux/divider/gate flags && fix some bugs
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>
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>
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>
chenxing [Mon, 23 Dec 2013 02:48:57 +0000 (10:48 +0800)]
rk3188: revert clk-divider.c and clk-mux.c in drivers/clk/
chenxing [Fri, 20 Dec 2013 11:07:23 +0000 (19:07 +0800)]
rk3188: add clock support
luowei [Thu, 19 Dec 2013 10:38:22 +0000 (18:38 +0800)]
pinctrl:delete unused code
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
黄涛 [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
黄涛 [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
黄涛 [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
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>
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>
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>
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>
Mark Brown [Mon, 16 Dec 2013 16:28:09 +0000 (16:28 +0000)]
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
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
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>
luowei [Mon, 16 Dec 2013 14:23:44 +0000 (22:23 +0800)]
pinctrl:add vol_domain dts support
黄涛 [Mon, 16 Dec 2013 11:34:04 +0000 (19:34 +0800)]
rk: fix PIE support, better support clean
黄涛 [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
luowei [Sat, 14 Dec 2013 11:14:15 +0000 (19:14 +0800)]
pinctrl:add interface for drive and vol setting
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>
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)
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
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
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
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>
Mark Brown [Fri, 13 Dec 2013 17:25:16 +0000 (17:25 +0000)]
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
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
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>
Mark Brown [Fri, 13 Dec 2013 12:31:39 +0000 (12:31 +0000)]
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
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
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)
黄涛 [Fri, 13 Dec 2013 11:53:50 +0000 (19:53 +0800)]
ARM: rockchip: add grf.h
黄涛 [Fri, 13 Dec 2013 11:49:51 +0000 (19:49 +0800)]
ARM: rockchip: update rockchip_defconfig to support module and i2c, etc
黄涛 [Fri, 13 Dec 2013 11:44:36 +0000 (19:44 +0800)]
i2c: rockchip: i2c_msg add scl_rate for compat support old driver
黄涛 [Fri, 13 Dec 2013 11:42:23 +0000 (19:42 +0800)]
ARM: rockchip: rk3188-tb enable i2c
黄涛 [Fri, 13 Dec 2013 11:41:11 +0000 (19:41 +0800)]
i2c: add rockchip i2c driver
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
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>
黄涛 [Fri, 13 Dec 2013 09:19:07 +0000 (17:19 +0800)]
ARM: rockchip: l2 and cpu_axi_bus DT add rockchip prefix
黄涛 [Fri, 13 Dec 2013 08:52:39 +0000 (16:52 +0800)]
ARM: rockchip: rk_fiq_debugger DT add rockchip prefix
黄涛 [Fri, 13 Dec 2013 08:40:30 +0000 (16:40 +0800)]
rk_serial: use of_alias_get_id to get serial id
luowei [Fri, 13 Dec 2013 06:52:28 +0000 (14:52 +0800)]
improve pinctrl dts format and add rk3188-pinctrl.dtsi file
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>
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>
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)
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>