Commit graph

400503 commits

Author SHA1 Message Date
Manfred Spraul 5e9d527591 ipc/sem.c: fix race in sem_lock()
The exclusion of complex operations in sem_lock() is insufficient: after
acquiring the per-semaphore lock, a simple op must first check that
sem_perm.lock is not locked and only after that test check
complex_count.  The current code does it the other way around - and that
creates a race.  Details are below.

The patch is a complete rewrite of sem_lock(), based in part on the code
from Mike Galbraith.  It removes all gotos and all loops and thus the
risk of livelocks.

I have tested the patch (together with the next one) on my i3 laptop and
it didn't cause any problems.

The bug is probably also present in 3.10 and 3.11, but for these kernels
it might be simpler just to move the test of sma->complex_count after
the spin_is_locked() test.

Details of the bug:

Assume:
 - sma->complex_count = 0.
 - Thread 1: semtimedop(complex op that must sleep)
 - Thread 2: semtimedop(simple op).

Pseudo-Trace:

Thread 1: sem_lock(): acquire sem_perm.lock
Thread 1: sem_lock(): check for ongoing simple ops
			Nothing ongoing, thread 2 is still before sem_lock().
Thread 1: try_atomic_semop()
	<<< preempted.

Thread 2: sem_lock():
        static inline int sem_lock(struct sem_array *sma, struct sembuf *sops,
                                      int nsops)
        {
                int locknum;
         again:
                if (nsops == 1 && !sma->complex_count) {
                        struct sem *sem = sma->sem_base + sops->sem_num;

                        /* Lock just the semaphore we are interested in. */
                        spin_lock(&sem->lock);

                        /*
                         * If sma->complex_count was set while we were spinning,
                         * we may need to look at things we did not lock here.
                         */
                        if (unlikely(sma->complex_count)) {
                                spin_unlock(&sem->lock);
                                goto lock_array;
                        }
        <<<<<<<<<
	<<< complex_count is still 0.
	<<<
        <<< Here it is preempted
        <<<<<<<<<

Thread 1: try_atomic_semop() returns, notices that it must sleep.
Thread 1: increases sma->complex_count.
Thread 1: drops sem_perm.lock
Thread 2:
                /*
                 * Another process is holding the global lock on the
                 * sem_array; we cannot enter our critical section,
                 * but have to wait for the global lock to be released.
                 */
                if (unlikely(spin_is_locked(&sma->sem_perm.lock))) {
                        spin_unlock(&sem->lock);
                        spin_unlock_wait(&sma->sem_perm.lock);
                        goto again;
                }
	<<< sem_perm.lock already dropped, thus no "goto again;"

                locknum = sops->sem_num;

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Cc: Mike Galbraith <bitbucket@online.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
Cc: <stable@vger.kernel.org>	[3.10+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-09-30 14:31:01 -07:00
David Rientjes f6ea3adb70 mm/compaction.c: periodically schedule when freeing pages
We've been getting warnings about an excessive amount of time spent
allocating pages for migration during memory compaction without
scheduling.  isolate_freepages_block() already periodically checks for
contended locks or the need to schedule, but isolate_freepages() never
does.

When a zone is massively long and no suitable targets can be found, this
iteration can be quite expensive without ever doing cond_resched().

Check periodically for the need to reschedule while the compaction free
scanner iterates.

Signed-off-by: David Rientjes <rientjes@google.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-09-30 14:31:01 -07:00
Dan Aloni 7202365696 fs/binfmt_elf.c: prevent a coredump with a large vm_map_count from Oopsing
A high setting of max_map_count, and a process core-dumping with a large
enough vm_map_count could result in an NT_FILE note not being written,
and the kernel crashing immediately later because it has assumed
otherwise.

Reproduction of the oops-causing bug described here:

    https://lkml.org/lkml/2013/8/30/50

Rge ussue originated in commit 2aa362c49c ("coredump: extend core dump
note section to contain file names of mapped file") from Oct 4, 2012.

This patch make that section optional in that case.  fill_files_note()
should signify the error, and also let the info struct in
elf_core_dump() be zero-initialized so that we can check for the
optionally written note.

[akpm@linux-foundation.org: avoid abusing E2BIG, remove a couple of not-really-needed local variables]
[akpm@linux-foundation.org: fix sparse warning]
Signed-off-by: Dan Aloni <alonid@stratoscale.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Reported-by: Martin MOKREJS <mmokrejs@gmail.com>
Tested-by: Martin MOKREJS <mmokrejs@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-09-30 14:31:01 -07:00
Joonyoung Shim 7393dc45f6 revert "mm/memory-hotplug: fix lowmem count overflow when offline pages"
This reverts commit cea27eb2a2 ("mm/memory-hotplug: fix lowmem count
overflow when offline pages").

The fixed bug by commit cea27eb was fixed to another way by commit
3dcc0571cd ("mm: correctly update zone->managed_pages").  That commit
enhances memory_hotplug.c to adjust totalhigh_pages when hot-removing
memory, for details please refer to:

  http://marc.info/?l=linux-mm&m=136957578620221&w=2

As a result, commit cea27eb2a2 currently causes duplicated decreasing
of totalhigh_pages, thus the revert.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Jiang Liu <liuj97@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-09-30 14:31:01 -07:00
Denis CIOCCA 512690daa6 iio:magnetometer: Bugfix magnetometer default output registers
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-30 21:46:11 +01:00
Lars-Peter Clausen bc4c961292 iio: Remove debugfs entries in iio_device_unregister()
Remove the the debugfs entries in iio_device_unregister(). Otherwise the debugfs
entries might still be accessible even though the device used in the debugfs
callback has already been freed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-30 21:46:10 +01:00
Eric Dumazet 8d34ce10c5 pkt_sched: fq: qdisc dismantle fixes
fq_reset() should drops all packets in queue, including
throttled flows.

This patch moves code from fq_destroy() to fq_reset()
to do the cleaning.

fq_change() must stop calling fq_dequeue() if all remaining
packets are from throttled flows.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-30 15:51:23 -04:00
Eric Dumazet b86783587b net: flow_dissector: fix thoff for IPPROTO_AH
In commit 8ed781668d ("flow_keys: include thoff into flow_keys for
later usage"), we missed that existing code was using nhoff as a
temporary variable that could not always contain transport header
offset.

This is not a problem for TCP/UDP because port offset (@poff)
is 0 for these protocols.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Daniel Borkmann <dborkman@redhat.com>
Cc: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-30 15:32:05 -04:00
Wei Liu 8386040b76 MAINTAINERS: add myself as maintainer of xen-netback
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-30 15:16:02 -04:00
Paul Durrant ea732dff5c xen-netback: Handle backend state transitions in a more robust way
When the frontend state changes netback now specifies its desired state to
a new function, set_backend_state(), which transitions through any
necessary intermediate states.
This fixes an issue observed with some old Windows frontend drivers where
they failed to transition through the Closing state and netback would not
behave correctly.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-30 15:13:28 -04:00
Paul Marks c9d55d5bff ipv6: Fix preferred_lft not updating in some cases
Consider the scenario where an IPv6 router is advertising a fixed
preferred_lft of 1800 seconds, while the valid_lft begins at 3600
seconds and counts down in realtime.

A client should reset its preferred_lft to 1800 every time the RA is
received, but a bug is causing Linux to ignore the update.

The core problem is here:
  if (prefered_lft != ifp->prefered_lft) {

Note that ifp->prefered_lft is an offset, so it doesn't decrease over
time.  Thus, the comparison is always (1800 != 1800), which fails to
trigger an update.

The most direct solution would be to compute a "stored_prefered_lft",
and use that value in the comparison.  But I think that trying to filter
out unnecessary updates here is a premature optimization.  In order for
the filter to apply, both of these would need to hold:

  - The advertised valid_lft and preferred_lft are both declining in
    real time.
  - No clock skew exists between the router & client.

So in this patch, I've set "update_lft = 1" unconditionally, which
allows the surrounding code to be greatly simplified.

Signed-off-by: Paul Marks <pmarks@google.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-30 15:06:19 -04:00
Pravin B Shelar d4a71b155c ip_tunnel: Do not use stale inner_iph pointer.
While sending packet skb_cow_head() can change skb header which
invalidates inner_iph pointer to skb header. Following patch
avoid using it. Found by code inspection.

This bug was introduced by commit 0e6fbc5b6c (ip_tunnels: extend
iptunnel_xmit()).

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-30 15:05:07 -04:00
Aleksander Morgado 2d77f34334 net: qmi_wwan: fix Cinterion PLXX product ID
Cinterion PLXX LTE devices have a 0x0060 product ID, not 0x12d1.

The blacklisting in the serial/option driver does actually use the correct PID,
as per commit 8ff10bdb14 ('USB: Blacklisted
Cinterion's PLxx WWAN Interface').

CC: Hans-Christoph Schemmel <hans-christoph.schemmel@gemalto.com>
CC: Christian Schmiedl <christian.schmiedl@gemalto.com>
CC: Nicolaus Colberg <nicolaus.colberg@gemalto.com>
Signed-off-by: Aleksander Morgado <aleksander@lanedo.com>
Acked-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Christian Schmiedl <christian.schmiedl@gemalto.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-30 15:04:07 -04:00
Aida Mynzhasova 894116bd0e powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file
Currently IEEE 1588 timer reference clock source is determined through
hard-coded value in gianfar_ptp driver. This patch allows to select ptp
clock source by means of device tree file node.

For instance:

	fsl,cksel = <0>;

for using external (TSEC_TMR_CLK input) high precision timer
reference clock.

Other acceptable values:

	<1> : eTSEC system clock
	<2> : eTSEC1 transmit clock
	<3> : RTC clock input

When this attribute isn't used, eTSEC system clock will serve as
IEEE 1588 timer reference clock.

Signed-off-by: Aida Mynzhasova <aida.mynzhasova@skitlab.ru>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-30 14:49:47 -04:00
Pravin B Shelar 559835ea72 vxlan: Use RCU apis to access sk_user_data.
Use of RCU api makes vxlan code easier to understand.  It also
fixes bug due to missing ACCESS_ONCE() on sk_user_data dereference.
In rare case without ACCESS_ONCE() compiler might omit vs on
sk_user_data dereference.
Compiler can use vs as alias for sk->sk_user_data, resulting in
multiple sk_user_data dereference in rcu read context which
could change.

CC: Jesse Gross <jesse@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-30 14:22:59 -04:00
Linus Torvalds df532d54d0 regulator: Fixes for v3.12
Quite a few fixes here, mostly small driver specific ones.  The stand
 out thing is a fix for errors generating the documentation from Randy
 Dunlap, otherwise unless you're using the driver in question there
 should be no impact.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSSWHSAAoJELSic+t+oim9L1kQAIBHO2v4ufi2jD73msj6sWq/
 g2RV9OtIxFZpulx0nYxthYVet3kViWT91D/hHpVjkEfeZiNxty99OvE1xBEPFDOU
 8mzyTdBSejqs3NTsSIfV26Jrq7jrdUwnVdraxkqu9uhTw5+cNynVMQmyVzUzJLGf
 nXOrE+2HStvWMS/PcSXoR1ujl2eAaBY8gATC12L+//qWNM9GHJMqgq8XQuD+6mUb
 T5JlbUJuODGZghcWYjput5t0lrWYd6UNFkCDjKxB11Yh99VwEqHXbQ5H02G0inRf
 m2stAOiJ7hoy5/ptQmSRGKhs8z4pU0likIpkvtlCkr/XNixQTA+E66k2bXYYbIes
 LZXJvPkwYsbZZU6trLZX8ZsKHtvWqVAMNSNnx4M7y9VpG6aDjNjhNEtO82TLGHu+
 N3+dfqXHGMlP6ozQGHPvzG0kJ79EUhM28n2ISmn7irDL3HNppnI3+AZIsuWT8u1q
 x4M7cvxUJNn1FrDlwu6sfzX/sPLY3pgUj9KUjdEi2n9yTf7Ln2R4jClB5ty93R7e
 C+Edoz7YHx9MqcN4KEkpY2rYAtpvz92P3r0h3u2B0O0ov4uqfXEwDQAH6iUbh6yO
 2e1O+vC/FQMsR6xPCXe/MTOhNoAbSFOMMbRNy7mnqkY+MHSmqtXoEfvsMxurM546
 TtyppUkpJ1TUFF6xFT5K
 =g543
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "Quite a few fixes here, mostly small driver specific ones.

  The stand out thing is a fix for errors generating the documentation
  from Randy Dunlap, otherwise unless you're using the driver in
  question there should be no impact"

* tag 'regulator-v3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: ti-abb: Fix bias voltage glitch in transition to bypass mode
  regulator: wm831x-ldo: Fix max_uV for gp_ldo and aldo linear range settings
  regulator: wm8350: correct the max_uV of LDO
  regulator: fix fatal kernel-doc error
  regulator: palmas: Remove wrong comment for the equation calculating num_voltages
  regulator: da9063: Fix PTR_ERR/ERR_PTR mismatch
  regulator: palmas: configure enable time for LDOs
  regulator: palmas: fix the n_voltages for smps to 122
2013-09-30 11:13:33 -07:00
Linus Torvalds b822cb187d Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull apparmor fixes from James Morris:
 "Bugfixes for the Apparmor code for regressions introduced in the 3.12
  pull request"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  apparmor: fix suspicious RCU usage warning in policy.c/policy.h
  apparmor: Use shash crypto API interface for profile hashes
2013-09-30 11:12:20 -07:00
Linus Torvalds cbb16bec2d Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull assorted vfs fixes from Al Viro:
 "A couple of bug fixes + removal of dead code in afs ->d_revalidate()"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  afs: dget_parent() can't return a negative dentry
  ocfs2: needs ->d_lock to poke in ->d_parent->d_inode from ->d_revalidate()
  sysv: Add forgotten superblock lock init for v7 fs
2013-09-30 11:11:28 -07:00
Philipp Zabel 43c638e3dd cpufreq: cpufreq-cpu0: NULL is a valid regulator, part 2
Since the patch "cpufreq: cpufreq-cpu0: NULL is a valid regulator", cpu_reg
contains an error value if the regulator is not set, instead of NULL.
Accordingly, fix the remaining check for non-NULL cpu_reg.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-09-30 20:08:59 +02:00
Sachin Kamat bb25f13aed cpufreq: SPEAr: Fix incorrect variable type
'clk_round_rate' returns a negative error code upon failure. This
will never get detected by unsigned 'newfreq'. Make it signed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-09-30 20:05:43 +02:00
Rafael J. Wysocki aab1728915 PM / hibernate: Fix user space driven resume regression
Recent commit 8fd37a4 (PM / hibernate: Create memory bitmaps after
freezing user space) broke the resume part of the user space driven
hibernation (s2disk), because I forgot that the resume utility
loaded the image into memory without freezing user space (it still
freezes tasks after loading the image).  This means that during user
space driven resume we need to create the memory bitmaps at the
"device open" time rather than at the "freeze tasks" time, so make
that happen (that's a special case anyway, so it needs to be treated
in a special way).

Reported-and-tested-by: Ronald <ronald645@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-09-30 19:40:56 +02:00
Linus Torvalds 5c282e858f Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32
Pull AVR32 fixes from Hans-Christian Egtvedt.

Fix build warnings and use the Kbuild infrastructure for generic headers
rather than doing it by hand.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32:
  avr32: cast syscall_return to silence compiler warning
  avr32: fix clockevents kernel warning
  avr32: use Kbuild infrastructure to handle the asm-generic headers
2013-09-30 10:40:20 -07:00
Linus Torvalds 8945546d90 Merge tag 'for-linus-20130929' of git://github.com/sctscore/official-linux
Pull S+core fixes from Lennox Wu:
 "These updates include updating information of maintainers, fix some
  trivial errors, and add a necessary function for supporting ipv6"

* tag 'for-linus-20130929' of git://github.com/sctscore/official-linux:
  Score: Update the information of Score maintaners
  Score: Modify the Makefile of Score, remove -mlong-calls for compiling
  Score: Implement the function csum_ipv6_magic
  Score: The commit is for compiling successfully
2013-09-30 10:38:46 -07:00
Linus Torvalds 815a4bb18b ARC Fixes for 3.12
* Handling unaligned access in zero delay loops
 * spinlock livelock fix for SMP systemC model
 * fixing 32bit overflow in access_ok
 * better setup of clockevents
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJSSP42AAoJEGnX8d3iisJeH1wP/RJMY8sJBSipS0vg8YVO/0YJ
 gryBNNljppc8H+SFBrgzq//+YvO3KyEibNTm17ZfDijahCfEBzXpdjoXQCW3gOt9
 8MlWhvLTNHbcCwwCroKAMfXkXu1DIcwgbw7FeOWmYYkgK/GhU5TTFyQBtoUvMMDM
 G/nEik1rdKi9tzXMi333c43YGCxn7ezwQbNZk3vNzpFTa/CuKUobiW0ohjyiWeEw
 RdENsnwtxtCE9HuPqTaf0/YQnpP5EkoMZw6USHJ81/QseEgLbAst6Vh4E/g6EpLM
 nC/73f9VouVr3ozKxa0FgcNaF5/fJf8NaqrnbbBLuy6/kb0u0PSt061vF02gUTkA
 F40bqB3hD7mzvt8YjMHDMm70WT1+5q7I/qlKzxxjDtdEjLNGJt/JAMgpocV3CTww
 Br5x6Sq8GT1GEvM5kMm/+eUh/BZBvvLscKOmzCoI5+/PZZgttuv4Lzm29unFsgor
 1axQndW4vBh49OsltJTs/mI6mRpYL5IH8J7Umy4MhENzeqBUhQLtfZmDhl7RdxpA
 XHDtSXEotsaoVZCsHOncleTnenv4Yc0MqyYUhQdff+tXemHGIyBH012ohbrvKP28
 fJKDubTz3FzzH2CMZ4q2HyeNTQRNwG+3PpER+gKXYm38WXBgmKNzj602kaCeiadX
 aC7DgC+cCiD3F6mtQEak
 =wN+V
 -----END PGP SIGNATURE-----

Merge tag 'arc-fixes-for-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

Pull ARC Fixes from Vineet Gupta:
 - Handle unaligned access in zero delay loops
 - spinlock livelock fix for SMP systemC model
 - fix 32bit overflow in access_ok
 - better setup of clockevents

* tag 'arc-fixes-for-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
  ARC: Use clockevents_config_and_register over clockevents_register_device
  ARC: Workaround spinlock livelock in SMP SystemC simulation
  ARC: Fix 32-bit wrap around in access_ok()
  ARC: Handle zero-overhead-loop in unaligned access handler
2013-09-30 10:37:05 -07:00
Jean-Christophe PLAGNIOL-VILLARD bd737fea4e ARM: at91: sam9g45: shutdown ddr1 too when rebooting
Like we are doing on DDR0 we need to cleanly shutdown DDR1 if it is
used before rebooting.
If DDR1 is not initialized, we check it and avoid dereferencing its address.
Even by adding two more instructions, we are able to complete the procedure
within a single cache line.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2013-09-30 09:58:44 -07:00
Barry Song 5abf58bf4c MAINTAINERS: ARM: SIRF: use kernel.org mail box
Change my email to kernel.org which is easier for me to catch.

Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2013-09-30 09:32:52 -07:00
Barry Song 05f30e8dfa MAINTAINERS: ARM: SIRF: add missed drivers into maintain list
Take more drivers into maintain list of CSR SiRF SoC machines.

Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2013-09-30 09:32:39 -07:00
Joel Fernandes 6cdaca481f ARM: edma: Fix clearing of unused list for DT DMA resources
HWMOD removal for MMC is breaking edma_start as the events are being manually
triggered due to unused channel list not being clear.

The above issue is fixed by reading the "dmas" property from the DT node if it
exists and clearing the bits in the unused channel list if the dma controller
used by any device is EDMA. For this purpose we use the of_* helpers to parse
the arguments in the dmas phandle list.

Also introduced is a minor clean up of a checkpatch error in old code.

Reviewed-by: Sekhar Nori <nsekhar@ti.com>
Reported-by: Balaji T K <balajitk@ti.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Olof Johansson <olof@lixom.net>
Cc: Nishanth Menon <nm@ti.com>
Cc: Pantel Antoniou <panto@antoniou-consulting.com>
Cc: Jason Kridner <jkridner@beagleboard.org>
Cc: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Joel Fernandes <joelf@ti.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2013-09-30 09:30:13 -07:00
Lorenzo Pieralisi 64270d82d4 ARM: vexpress: tc2: fix hotplug/idle/kexec race on cluster power down
On the TC2 testchip, when all CPUs in a cluster enter standbywfi
and commit a power down request, the power controller will wait
for standbywfil2 coming from L2 cache controller to shut the
cluster down.
By the time all CPUs in a cluster commit a power down request
and enter wfi, the power controller cannot backtrack, or put it
another way, a CPU must not be allowed to complete execution
independently of the power controller, the only way for it to
resume properly must be upon wake-up IRQ pending and subsequent
reset triggered from the power controller.

Current MCPM back-end for TC2 disables the GIC CPU IF only when
power down is committed through the tc2_pm_suspend() method, that
makes sense since a suspended CPU is still online and can receive
interrupts whereas a hotplugged CPU, since it is offline,
migrated all IRQs and shutdown the per-CPU peripherals, hence
their PPIs.

The flaw with this reasoning is the following. If all CPUs in
a clusters are entering a power down state either through CPU
idle or CPU hotplug, when the last man successfully completes
the MCPM power down sequence (and executes wfi), power controller
waits for L2 wfi signal to quiesce the cluster and shut it down.
If, when all CPUs are sitting in wfi, an online CPU hotplugs back
in one of the CPUs in the cluster being shutdown, that CPU
receives an IPI that causes wfi to complete (since tc2_pm_down()
method does not disable the GIC CPU IF in that case - CPU being
hotplugged out, not idle) and the power controller will never see
the stanbywfil2 signal coming from L2 that is required for
shutdown to happen and the system deadlocks.

Further to this issue, kexec hotplugs secondary CPUs out during
kernel reload/restart.
Because kexec may (deliberately) trash the old kernel text, it is
not OK for CPUs to follow the MCPM soft reboot path, since
instructions after the WFI may have been replaced by kexec.

If tc2_pm_down() does not disable the GIC cpu interface, there is a
race between CPU powerdown in the old kernel and the IPI from the
new kernel that triggers secondary boot, particularly if the
powerdown is slow (due to L2 cache cleaning for example).  If the
new kernel wins the race, the affected CPU(s) will not really be
reset and may execute garbage after the WFI.

The only solution to this problem consists in disabling the GIC
CPU IF on a CPU committed to power down regardless of the power
down entry method (CPU hotplug or CPU idle). This way, CPU wake-up
is under power controller control, which prevents unexpected wfi
exit caused by a pending IRQ.

This patch moves the GIC CPU IF disable call in the TC2 MCPM
implementation from the tc2_pm_suspend() method to the
tc2_pm_down() method to fix the mentioned race condition(s).

Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Tested-by: Dave Martin <Dave.Martin@arm.com> (for kexec)
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2013-09-30 09:27:36 -07:00
Olof Johansson f1bb7cd5a1 Fourth Round of Renesas ARM based SoC fixes for v3.12
* Remove unused #gpio-ranges-cells DT property
 
 * Remove usage of deprecated #gpio-range-cells DT property
   from GPIO R-Car
 
   Property was deprecated in v3.11-rc2
 
 * Correct ether pinctl naming for armadillo800eva board
 
   Regression introduced in v3.10-rc5
 
 * Add Micrel KSZ8041 PHY fixup to lager board
 
   This resolves a problem that has been present since 3.11-rc2
 
 * Update SDHI DT compatibility string to the <unit>-<soc> format
 
   This makes compatibility strings consistent across all renesas
   hardware which currently supports DT.
 
   The bindings which are being updated where intorodiced on
   a per-SoC basis starting in v3.8-rc7. They may have
   been internally consistent when originally added.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSSPX/AAoJENfPZGlqN0++OYkP/28MR5D2vqT/8zQ91o0AGAXg
 CNS0CCekccTM+t7gTRQhgp9khrPmFlFOWrd+S35+eagOIfhCGfABxzCZijSKbai6
 HFYuhkTg3UCg1pMaPMCP1H7iV63kZHHocyPOBnb9titplJ0w5GoDh8R2oslDf/62
 vYM7XeZO9K99j1YxHH4+jMUws353XBgyQ87nHaQvT9Jhb45ZCXrXADw7sUOaUeEa
 Zw3O6mfCb1bOOQqTMcouvPh6va+RNL/G/dREj8FDdrDXOz5KdTekHKON8fluq+LM
 nWSUebzBJEMunHAnkncXxDJ229tu2x1j05ex+XwLYKcBx5gJ5omh0ugMOeYnnB8U
 wMUpEhnXLGBuNdNS0qR6Ql4wiS+2kKPXDn4sSKOW1ORbHeklFbtfnyZDu+rJfu6n
 +lc+KbZFd63ct9IIB2W7D3ZELEgWP3Z82eAXcj6yNcBXIgUYjEihZeFf51EB5EaF
 2oIpiAQXbPdnzkUPNSR46h2Kg5w1alJgs5Elu/WO7RF+GT0lBZOrhP8Yxav30h1j
 w6JJnG9Oq96TJ4FrzZbX8/Szmhheu8DrAo3JslxT+hjSJv2CweM+8Dbwcp5it+Vw
 0rh/efDa84RPDS4YiwSXJQd6/DuskPE04qnry09WS5g67ediBLf1NNX4r26R68l5
 plIISkrqCxYxUhNjbOJa
 =WVMt
 -----END PGP SIGNATURE-----

Merge tag 'renesas-fixes4-for-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into fixes

From Simon Horman:
Fourth Round of Renesas ARM based SoC fixes for v3.12

* Remove unused #gpio-ranges-cells DT property

* Remove usage of deprecated #gpio-range-cells DT property
  from GPIO R-Car

  Property was deprecated in v3.11-rc2

* Correct ether pinctl naming for armadillo800eva board

  Regression introduced in v3.10-rc5

* Add Micrel KSZ8041 PHY fixup to lager board

  This resolves a problem that has been present since 3.11-rc2

* Update SDHI DT compatibility string to the <unit>-<soc> format

  This makes compatibility strings consistent across all renesas
  hardware which currently supports DT.

  The bindings which are being updated where intorodiced on
  a per-SoC basis starting in v3.8-rc7. They may have
  been internally consistent when originally added.

* tag 'renesas-fixes4-for-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: Remove #gpio-ranges-cells DT property
  gpio: rcar: Remove #gpio-range-cells DT property usage
  ARM: shmobile: armadillo: fixup ether pinctrl naming
  ARM: shmobile: Lager: add Micrel KSZ8041 PHY fixup
  ARM: shmobile: update SDHI DT compatibility string to the <unit>-<soc> format

Signed-off-by: Olof Johansson <olof@lixom.net>
2013-09-30 09:24:20 -07:00
Renwei Wu 262bcc1d6f ARM: dts: sirf: fix interrupt and dma prop of VIP for prima2 and atlas6
the current dts is lacking interrupt and dma prop for video input
processor of prima2 and atlas6, this patch fixes it.

Signed-off-by: Renwei Wu <Renwei.Wu@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2013-09-30 09:17:49 -07:00
Barry Song 9e85b9d100 ARM: dts: sirf: fix the ranges of peri-iobrg of prima2
we lost an address range <0x56000000 0x56000000 0x1b00000> for peri-iobg
of prima2.

Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2013-09-30 09:17:49 -07:00
Barry Song 3349a4b901 ARM: dts: makefile: build atlas6-evb.dtb for ARCH_ATLAS6
Makefile missed to include atlas6-evb.dtb for ARCH_ATLAS6.

Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2013-09-30 09:17:48 -07:00
Qipan Li a136997841 ARM: dts: sirf: fix fifosize, clks, dma channels for UART
sirf uart and usp-based uart driver with full dma support has
hit 3.12, here we fix the fifosize, dma channels for some HW
prop.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2013-09-30 09:17:48 -07:00
Ramkumar Ramachandra 4eb507b874 arm64: include VIRTIO_{MMIO,BLK} in defconfig
Currently, development on arm64 is aided by a Foundation_v8 emulator
distributed by ARM [1]. To run their kernels, users will execute:

  $ ./Foundation_v8 --image linux-system.axf --block-device raring-rootfs

To mount the raring-rootfs filesystem, the kernel parameter should
typically include:

  root=/dev/vda

For this device to be present, the kernel must be compiled with
VIRTIO_{MMIO,BLK}. To make this work out-of-the-box, make it part of the
default configuration.

[1]: https://silver.arm.com/browse/FM00A

Cc: Will Deacon <will.deacon@arm.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2013-09-30 15:51:29 +01:00
Ramkumar Ramachandra ade3719893 arm64: include EXT4 in defconfig
Most readily available root filesystems are formatted as EXT4 these
days. For example, see the raring rootfs that the Debian folk is
preparing [1].

[1]: http://people.debian.org/~wookey/bootstrap/rootfs/

Cc: Will Deacon <will.deacon@arm.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2013-09-30 15:51:00 +01:00
Arnaud Ebalard 2832cf2558 ARM: mvebu: Add DT entry for ReadyNAS 102 to use gpio-poweroff driver
Without that fix, at the end of the shutdown process, the board is
still powered (led glowing, fan running, ...).

Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2013-09-30 14:09:45 +00:00
Arnaud Ebalard aa06a5adb9 ARM: mvebu: fix ReadyNAS 102 Power button GPIO to make it active high
NETGEAR ReadyNAS 102 Power button definition in .dts file flags
associated GPIO active low instead of active high. This results
in reversed events reported by input subsystem (0 returned when
the button is pressed, 1 when released). This patch makes
associated GPIO active high to recover correct behaviour.

Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2013-09-30 14:03:40 +00:00
Bartlomiej Zolnierkiewicz 08ebb250ef MIPS: Alchemy: MTX-1: fix incorrect placement of __initdata tag
__initdata tag should be placed between the variable name and equal
sign for the variable to be placed in the intended .init.data section.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/5934/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-09-30 15:14:07 +02:00
Marc Kleine-Budde 0d1862ea1a can: flexcan: fix flexcan_chip_start() on imx6
In the flexcan_chip_start() function first the flexcan core is going through
the soft reset sequence, then the RX FIFO is enabled.

With the hardware is put into FIFO mode, message buffers 1...7 are reserved by
the FIFO engine. The remaining message buffers are in reset default values.
This patch removes the bogus initialization of the message buffers, as it
causes an imprecise external abort on imx6.

Cc: linux-stable <stable@vger.kernel.org>
Reported-by: Lothar Waßmann <LW@KARO-electronics.de>
Tested-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2013-09-30 13:49:09 +02:00
Mark Brown f3d17a7e4d Merge remote-tracking branch 'regulator/fix/wm8350' into regulator-linus 2013-09-30 12:04:33 +01:00
Mark Brown 60c32f3ec8 Merge remote-tracking branch 'regulator/fix/wm831x' into regulator-linus 2013-09-30 12:04:33 +01:00
Mark Brown 0f5da28f93 Merge remote-tracking branch 'regulator/fix/ti-abb' into regulator-linus 2013-09-30 12:04:32 +01:00
Mark Brown 780a0ff76e Merge remote-tracking branch 'regulator/fix/palmas' into regulator-linus 2013-09-30 12:04:31 +01:00
Mark Brown 3abd38db6d Merge remote-tracking branch 'regulator/fix/doc' into regulator-linus 2013-09-30 12:04:30 +01:00
Mark Brown e7b87825e8 Merge remote-tracking branch 'regulator/fix/da9063' into regulator-linus 2013-09-30 12:04:29 +01:00
Patrick McHardy f4a87e7bd2 netfilter: synproxy: fix BUG_ON triggered by corrupt TCP packets
TCP packets hitting the SYN proxy through the SYNPROXY target are not
validated by TCP conntrack. When th->doff is below 5, an underflow happens
when calculating the options length, causing skb_header_pointer() to
return NULL and triggering the BUG_ON().

Handle this case gracefully by checking for NULL instead of using BUG_ON().

Reported-by: Martin Topholm <mph@one.com>
Tested-by: Martin Topholm <mph@one.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2013-09-30 12:44:38 +02:00
Takashi Iwai 4a4370442c ALSA: hda - Fix GPIO for Acer Aspire 3830TG
Acer Aspire 3830TG seems requiring GPIO bit 0 as the primary mute
control.  When a machine is booted after Windows 8, the GPIO pin is
turned off and it results in the silent output.

This patch adds the manual fixup of GPIO bit 0 for this model.

Reported-by: Christopher <DIDI2002@web.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-30 12:18:36 +02:00
Ondrej Zary dfc2cd7c28 ALSA: ac97: Add ID for TI TLV320AIC27 codec
Add 0x54584e03 ID for TI TLV320AIC27 AC'97 codec according to datasheet:
http://www.ti.com/lit/ds/slas253a/slas253a.pdf

The weird thing is that the chip is physically marked 320AD91.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-30 11:09:21 +02:00
Takashi Iwai 6ae405996c ASoC: Fixes for v3.12
Nothing too exciting here, all driver specific except for the fix from
 Liam for DPCM systems which have both front and back end DAIs which is
 not yet used by anything in mainline.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSRacdAAoJELSic+t+oim9jcQP/jhvJuQgo0B4di3vsRPNtlbN
 rKS/+0kiMxwOxiHQbqSop/AQJe4n55kDVeaX8b25oJCuXGdytiwDMT8Oa74OL+rJ
 kENXrHSV7/0YIhKvotEJW7vltIzRwZ6ArncVtxwPmdCkFFw3UAxOwk0lvTxE5S/M
 q2BOpShKGRLXIX3dIKH+NOgYSdqCt6Hk4KpJuCP6AVfJo2ctWK5aVwenyGnBL5tv
 kgQl2RywC4iRmp/DzdPnfHWhxFZsU9jVKYAQ/qqt2paOWVJ5hMW9CiT06ACjGZwU
 R+0uhgYEa3s9DpNvaUv6IS+khFGMHFkm5H2tYY3DUoIyzI3z5KbPJBKRTDFBgDrn
 JO72JyPxRQVZ889h3Chl3MUs3Pj+cHIPP7pb4TOIdoQStta60ykna5Q92RjVp+hM
 sugBrYIrx4EOGCo3Ae/GVCCA5zJ6aSAWZDc5UFAlr1CHodwF/msGXjkhjyG8tZpl
 flObWlwFxo6UXPKWSAnnuogwglsFoLpdrWHxWBq9iIeUO2snTPOnuQ7Nbjs54Clp
 f4b8gx2v3Iv5SKfXVsXLoHJVDmgs4qyhN42pHPLzUeXMHLmD3oyBdGi8hgXDsApz
 PtVqpRy2Ui/hy1QL0jP2jq/qeqcM7PkzOUrcoOFKGoL3wpRUYbq1x7j1aYeepNL3
 zHw2uE99IwlfS1vmwPc3
 =Oljt
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v3.12

Nothing too exciting here, all driver specific except for the fix from
Liam for DPCM systems which have both front and back end DAIs which is
not yet used by anything in mainline.
2013-09-30 10:49:45 +02:00