1
0
Fork 0
Commit Graph

442655 Commits (6538b8ea886e472f4431db8ca1d60478f838d14b)

Author SHA1 Message Date
Minchan Kim 6538b8ea88 x86_64: expand kernel stack to 16K
While I play inhouse patches with much memory pressure on qemu-kvm,
3.14 kernel was randomly crashed. The reason was kernel stack overflow.

When I investigated the problem, the callstack was a little bit deeper
by involve with reclaim functions but not direct reclaim path.

I tried to diet stack size of some functions related with alloc/reclaim
so did a hundred of byte but overflow was't disappeard so that I encounter
overflow by another deeper callstack on reclaim/allocator path.

Of course, we might sweep every sites we have found for reducing
stack usage but I'm not sure how long it saves the world(surely,
lots of developer start to add nice features which will use stack
agains) and if we consider another more complex feature in I/O layer
and/or reclaim path, it might be better to increase stack size(
meanwhile, stack usage on 64bit machine was doubled compared to 32bit
while it have sticked to 8K. Hmm, it's not a fair to me and arm64
already expaned to 16K. )

So, my stupid idea is just let's expand stack size and keep an eye
toward stack consumption on each kernel functions via stacktrace of ftrace.
For example, we can have a bar like that each funcion shouldn't exceed 200K
and emit the warning when some function consumes more in runtime.
Of course, it could make false positive but at least, it could make a
chance to think over it.

I guess this topic was discussed several time so there might be
strong reason not to increase kernel stack size on x86_64, for me not
knowing so Ccing x86_64 maintainers, other MM guys and virtio
maintainers.

Here's an example call trace using up the kernel stack:

         Depth    Size   Location    (51 entries)
         -----    ----   --------
   0)     7696      16   lookup_address
   1)     7680      16   _lookup_address_cpa.isra.3
   2)     7664      24   __change_page_attr_set_clr
   3)     7640     392   kernel_map_pages
   4)     7248     256   get_page_from_freelist
   5)     6992     352   __alloc_pages_nodemask
   6)     6640       8   alloc_pages_current
   7)     6632     168   new_slab
   8)     6464       8   __slab_alloc
   9)     6456      80   __kmalloc
  10)     6376     376   vring_add_indirect
  11)     6000     144   virtqueue_add_sgs
  12)     5856     288   __virtblk_add_req
  13)     5568      96   virtio_queue_rq
  14)     5472     128   __blk_mq_run_hw_queue
  15)     5344      16   blk_mq_run_hw_queue
  16)     5328      96   blk_mq_insert_requests
  17)     5232     112   blk_mq_flush_plug_list
  18)     5120     112   blk_flush_plug_list
  19)     5008      64   io_schedule_timeout
  20)     4944     128   mempool_alloc
  21)     4816      96   bio_alloc_bioset
  22)     4720      48   get_swap_bio
  23)     4672     160   __swap_writepage
  24)     4512      32   swap_writepage
  25)     4480     320   shrink_page_list
  26)     4160     208   shrink_inactive_list
  27)     3952     304   shrink_lruvec
  28)     3648      80   shrink_zone
  29)     3568     128   do_try_to_free_pages
  30)     3440     208   try_to_free_pages
  31)     3232     352   __alloc_pages_nodemask
  32)     2880       8   alloc_pages_current
  33)     2872     200   __page_cache_alloc
  34)     2672      80   find_or_create_page
  35)     2592      80   ext4_mb_load_buddy
  36)     2512     176   ext4_mb_regular_allocator
  37)     2336     128   ext4_mb_new_blocks
  38)     2208     256   ext4_ext_map_blocks
  39)     1952     160   ext4_map_blocks
  40)     1792     384   ext4_writepages
  41)     1408      16   do_writepages
  42)     1392      96   __writeback_single_inode
  43)     1296     176   writeback_sb_inodes
  44)     1120      80   __writeback_inodes_wb
  45)     1040     160   wb_writeback
  46)      880     208   bdi_writeback_workfn
  47)      672     144   process_one_work
  48)      528     112   worker_thread
  49)      416     240   kthread
  50)      176     176   ret_from_fork

[ Note: the problem is exacerbated by certain gcc versions that seem to
  generate much bigger stack frames due to apparently bad coalescing of
  temporaries and generating too many spills.  Rusty saw gcc-4.6.4 using
  35% more stack on the virtio path than 4.8.2 does, for example.

  Minchan not only uses such a bad gcc version (4.6.3 in his case), but
  some of the stack use is due to debugging (CONFIG_DEBUG_PAGEALLOC is
  what causes that kernel_map_pages() frame, for example). But we're
  clearly getting too close.

  The VM code also seems to have excessive stack frames partly for the
  same compiler reason, triggered by excessive inlining and lots of
  function arguments.

  We need to improve on our stack use, but in the meantime let's do this
  simple stack increase too.  Unlike most earlier reports, there is
  nothing simple that stands out as being really horribly wrong here,
  apart from the fact that the stack frames are just bigger than they
  should need to be.        - Linus ]

Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Peter Anvin <hpa@zytor.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dave Jones <davej@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael S Tsirkin <mst@redhat.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: PJ Waskiewicz <pjwaskiewicz@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-05-30 11:52:51 -07:00
Linus Torvalds 6f6111e4a7 Merge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs dcache livelock fix from Al Viro:
 "Fixes for livelocks in shrink_dentry_list() introduced by fixes to
  shrink list corruption; the root cause was that trylock of parent's
  ->d_lock could be disrupted by d_walk() happening on other CPUs,
  resulting in shrink_dentry_list() making no progress *and* the same
  d_walk() being called again and again for as long as
  shrink_dentry_list() doesn't get past that mess.

  The solution is to have shrink_dentry_list() treat that trylock
  failure not as 'try to do the same thing again', but 'lock them in the
  right order'"

* 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  dentry_kill() doesn't need the second argument now
  dealing with the rest of shrink_dentry_list() livelock
  shrink_dentry_list(): take parent's ->d_lock earlier
  expand dentry_kill(dentry, 0) in shrink_dentry_list()
  split dentry_kill()
  lift the "already marked killed" case into shrink_dentry_list()
2014-05-30 09:52:55 -07:00
Al Viro 8cbf74da43 dentry_kill() doesn't need the second argument now
it's 1 in the only remaining caller.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-30 11:10:33 -04:00
Al Viro b2b80195d8 dealing with the rest of shrink_dentry_list() livelock
We have the same problem with ->d_lock order in the inner loop, where
we are dropping references to ancestors.  Same solution, basically -
instead of using dentry_kill() we use lock_parent() (introduced in the
previous commit) to get that lock in a safe way, recheck ->d_count
(in case if lock_parent() has ended up dropping and retaking ->d_lock
and somebody managed to grab a reference during that window), trylock
the inode->i_lock and use __dentry_kill() to do the rest.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-30 11:10:33 -04:00
Al Viro 046b961b45 shrink_dentry_list(): take parent's ->d_lock earlier
The cause of livelocks there is that we are taking ->d_lock on
dentry and its parent in the wrong order, forcing us to use
trylock on the parent's one.  d_walk() takes them in the right
order, and unfortunately it's not hard to create a situation
when shrink_dentry_list() can't make progress since trylock
keeps failing, and shrink_dcache_parent() or check_submounts_and_drop()
keeps calling d_walk() disrupting the very shrink_dentry_list() it's
waiting for.

Solution is straightforward - if that trylock fails, let's unlock
the dentry itself and take locks in the right order.  We need to
stabilize ->d_parent without holding ->d_lock, but that's doable
using RCU.  And we'd better do that in the very beginning of the
loop in shrink_dentry_list(), since the checks on refcount, etc.
would need to be redone anyway.

That deals with a half of the problem - killing dentries on the
shrink list itself.  Another one (dropping their parents) is
in the next commit.

locking parent is interesting - it would be easy to do rcu_read_lock(),
lock whatever we think is a parent, lock dentry itself and check
if the parent is still the right one.  Except that we need to check
that *before* locking the dentry, or we are risking taking ->d_lock
out of order.  Fortunately, once the D1 is locked, we can check if
D2->d_parent is equal to D1 without the need to lock D2; D2->d_parent
can start or stop pointing to D1 only under D1->d_lock, so taking
D1->d_lock is enough.  In other words, the right solution is
rcu_read_lock/lock what looks like parent right now/check if it's
still our parent/rcu_read_unlock/lock the child.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-30 11:03:21 -04:00
Linus Torvalds fe45736f41 Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King:
 "The usual random collection of relatively small ARM fixes"

* 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  ARM: 8063/1: bL_switcher: fix individual online status reporting of removed CPUs
  ARM: 8064/1: fix v7-M signal return
  ARM: 8057/1: amba: Add Qualcomm vendor ID.
  ARM: 8052/1: unwind: Fix handling of "Pop r4-r[4+nnn],r14" opcode
  ARM: 8051/1: put_user: fix possible data corruption in put_user
  ARM: 8048/1: fix v7-M setup stack location
2014-05-29 18:31:09 -07:00
Linus Torvalds a991639c26 - Fix CoW regression for transparent hugepages by routing set_pmd_at to
set_pte_at, which correctly handles PTE_WRITE and will mark the
   resulting table entry as read-only where appropriate.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCgAGBQJThzGHAAoJEC379FI+VC/ZXKUP/2sJVWkvaON/8wx8j2xLAS1o
 DhzFIQVdWirji4EI/qDtPZZSsFbPztE0w4Lg880RW6QdY74S56Gpd40ollm8JXU+
 r/GCPMt9JwM8UsmT91MMUQA5qY0iyirG2FyWdihZwdwxhidWYKxBGBZYSq4a4qly
 yhqlpBH/OssnLxN/kSn1EvEpylxr/rDlU3r4bKsvlQ61woZuFu+WRZDmYA2fuAWW
 cemTXxUmCR70jYPhCuwGA1uBLyKc6QPcssb86iuW8vhhXj3932dDuvfoobGEe7rC
 VwilTujQUbBXCP3/b+agbi3q4eabX9Wr1yM8fvLx23k0cRKvMyhqR4xIxKpPDFPk
 tarKhpBODER5D7X7na5D/9f8URB2U3EWrwCn2Wijmh113A98ADR+bUpgnZA2wdoR
 /ehy4VlTmajESL1CQ8m1PuSTdBNg3Yi0skQ0pOf+dI6vj8pjF53TfSRn32ior4Ow
 4/k+FT1jfLJZOncYFI+AyRhmOi+nqzuxZiurH7eukkqnzJ9eWZtO0WnjHBhlqx7X
 C1kxyd+2TpkqHUmF/aybgEEdZKN8EtXQevIMKzlemTu8Ptyrao+qqz9NctV4e7AC
 I+n2u0KN4QOLygFCsk5KuG5U0IgxoFideMdFNhA3M0CfSke+AfYf3AH70/mIk0Qz
 fMvUR3OsK+aOUx/aXVed
 =o10I
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fix from Will Deacon:
 "Fix CoW regression for transparent hugepages by routing set_pmd_at to
  set_pte_at, which correctly handles PTE_WRITE and will mark the
  resulting table entry as read-only where appropriate"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: mm: fix pmd_write CoW brokenness
2014-05-29 14:14:43 -07:00
Linus Torvalds f035b3d322 ACPI and power management fixes for 3.15-rc8
- A workqueue is destroyed too early during the ACPI thermal driver
    module unload which leads to a NULL pointer dereference in the
    driver's remove callback.  Fix from Aaron Lu.
 
  - A wrong argument is passed to devm_regulator_get_optional() in
    the probe routine of the cpu0 cpufreq driver which leads to
    resource leaks if the driver is unbound from the cpufreq
    platform device.  Fix from Lucas Stach.
 
  - A lock is missing in cpufreq_governor_dbs() which leads to
    memory corruption and NULL pointer dereferences during
    system suspend/resume, for example.  Fix from Bibek Basu.
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJThxUIAAoJEILEb/54YlRxafAP/id28hueh9a7qlIG4n70OBkC
 LmWcWM0/0Ttw22HKCz4QLSHYIvfaqGgiIsWcZ9bNj6ffHhuGGL6GHPZYypmhJ0vL
 m6VhZnxM72rm0viisPJJXCjVenf5SoiaFDG+9GlqRsgIViK8zC999HFvkgsShP0Y
 75UxdgkZqwlLnzh6HDKAE0nBuYZCbNNyWbV1fv8FtPlR1LSaWEzUoj5FLLPxQ8An
 /6r5gENBLU8BnZhQBbd/BOPAW7aIFclE+SfdtPvDoYKlIve4gAbEn/9MuMJWCwGi
 9DjCxUwrO5cnhAvYhL3FAqu9q2D75piX76HKph/WZ0A6hVPWncldeF8m4We03fE8
 MJVrmd7c8R0HfkfN6yWAbYMk5ckB0Zbs/3qHUlltnatLiCswjoYY+b4kIYJbGF9q
 /b46CnsuQCsKm2zc4ESyCHB+FS+bWlDySCCDNllD9gfFZ7mNy+BB8ysqbQmlr1vG
 27f/e/kCsHQKirKfGJfV3YUzBaC8wgWxNRux058f8q0MHOJSI2YYvjC2xrAkbHGy
 cj5klaJxUEHmTORAjcr+B7aDolnXH5B4ZewAFFQsTSYZmr+nzUnfz7ZrtDYetHsn
 nXuW4mbdr7xtp46ZwwH3WMvetWodJ2focUDWYxMnNbK1ZBFq28W0tOY9Mkjgdk7I
 zpYWyrM3s+TH6JwQonu6
 =I5ce
 -----END PGP SIGNATURE-----

Merge tag 'pm+acpi-3.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes from Rafael Wysocki:
 "These are three stable-candidate fixes, one for the ACPI thermal
  driver and two for cpufreq drivers.

  Specifics:

   - A workqueue is destroyed too early during the ACPI thermal driver
     module unload which leads to a NULL pointer dereference in the
     driver's remove callback.  Fix from Aaron Lu.

   - A wrong argument is passed to devm_regulator_get_optional() in the
     probe routine of the cpu0 cpufreq driver which leads to resource
     leaks if the driver is unbound from the cpufreq platform device.
     Fix from Lucas Stach.

   - A lock is missing in cpufreq_governor_dbs() which leads to memory
     corruption and NULL pointer dereferences during system
     suspend/resume, for example.  Fix from Bibek Basu"

* tag 'pm+acpi-3.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / thermal: fix workqueue destroy order
  cpufreq: cpu0: drop wrong devm usage
  cpufreq: remove race while accessing cur_policy
2014-05-29 14:05:57 -07:00
Linus Torvalds 15a7b60ea1 Small number of user-visible regression fixes for clock drivers. There
is a memory leak fix for an ST platform, an infinite Loop Of Doom fix
 for the recent changes to the basic clock divider (hopefully the last
 fix for those recent changes) and some Tegra PLL changes which keep PCI
 from being hosed on that platform.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJThtlQAAoJEKI6nJvDJaTU4aUQALJuaJjFli8Q8DX1mBQYIHh6
 v1cyLJYBygmFUQ3FWSar7qZMu6ub+uuu/RLOUQfqZheG99imnVulPdeC+SlcEzqm
 BHiUsIu+rBtveOF0a0f/1G+heuqS5rmv+oHNDUWABekVQ9lwy+1dXkh+4Kw7eA+3
 YEX85ypfJuYnGh9aA6/dt9Ldw29RtdXfdeX9LhOCLV5GZ4e61fBcUCoCID4rnzqQ
 viXkqpbjnONnd0ShtnkN+NsIJTn1bgu13EDLcFFyXDfjNucyhINR1FDveWe1OsaZ
 iWHZGVgyXRzV8bBgCrjfVtwP4vQlaiACKmF30jffYqkxK+DxdB55hiCER1WpRg37
 PrRDFRpzXTT0HHovldvlhoUnpRS3055RO+NiD4hIV6WzhTsbLlz1a5EY0gBQRM4U
 dLRxnSpVlR2Vfvhkr54Hrc+AT4j/IMnRlZfUQu6MsuQ76YD153BAUwfMffJbuumC
 iwphEOnJNIcssNeSngDQDJlgXINfucaLnSAjnG01U+qQmFqlqdVWHKTdXRRuW48P
 cdkYRENm4JzwUIyq9sa1rXtRMd7pNwXCmngmXwNe5z8TdhMiNszHCpR9aY9zCIgC
 HNIqp1Mqru+1KEUGRzbLo1gy+uy3JbwQSfw603upFga7Xsyjz7qDacjx1g0qe3Wd
 dp9/GjPKFGD2KydD/XIb
 =MU0S
 -----END PGP SIGNATURE-----

Merge tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linux

Pull clock fixes from Mike Turquette:
 "Small number of user-visible regression fixes for clock drivers.

  There is a memory leak fix for an ST platform, an infinite Loop Of
  Doom fix for the recent changes to the basic clock divider (hopefully
  the last fix for those recent changes) and some Tegra PLL changes
  which keep PCI from being hosed on that platform"

* tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linux:
  clk: st: Fix memory leak
  clk: divider: Fix table round up function
  clk: tegra: Fix enabling of PLLE
  clk: tegra: Introduce divider mask and shift helpers
  clk: tegra: Fix PLLE programming
2014-05-29 13:59:18 -07:00
Al Viro ff2fde9929 expand dentry_kill(dentry, 0) in shrink_dentry_list()
Result will be massaged to saner shape in the next commits.  It is
ugly, no questions - the point of that one is to be a provably
equivalent transformation (and it might be worth splitting a bit
more).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-29 08:50:08 -04:00
Al Viro e55fd01154 split dentry_kill()
... into trylocks and everything else.  The latter (actual killing)
is __dentry_kill().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-29 08:46:08 -04:00
Will Deacon ceb218359d arm64: mm: fix pmd_write CoW brokenness
Commit 9c7e535fcc ("arm64: mm: Route pmd thp functions through pte
equivalents") changed the pmd manipulator and accessor functions to
convert the target pmd to a pte, process it with the pte functions, then
convert it back. Along the way, we gained support for PTE_WRITE, however
this is completely ignored by set_pmd_at, and so we fail to set the
PMD_SECT_RDONLY for PMDs, resulting in all sorts of lovely failures (like
CoW not working).

Partially reverting the offending commit (by making use of
PMD_SECT_RDONLY explicitly for pmd_{write,wrprotect,mkwrite} functions)
leads to further issues because pmd_write can then return potentially
incorrect values for page table entries marked as RDONLY, leading to
BUG_ON(pmd_write(entry)) tripping under some THP workloads.

This patch fixes the issue by routing set_pmd_at through set_pte_at,
which correctly takes the PTE_WRITE flag into account. Given that
THP mappings are always anonymous, the additional cache-flushing code
in __sync_icache_dcache won't impose any significant overhead as the
flush will be skipped.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Steve Capper <steve.capper@arm.com>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2014-05-29 11:31:14 +01:00
Linus Torvalds f2159d1e99 sound fixes for 3.15-rc8
Just two small stable fixes: an HD-audio fix for the new Intel chipsets
 and a PM handling fix in PCM dmaengine core.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJThIaYAAoJEGwxgFQ9KSmksjgP/A1q0X4AqHk5vzj0OebJXO+T
 XgolsAz2jL3UbIqGZt1FwnfSmbN8N+ahVb7Bg4J4ErmgjmCQoWX08WvsD8vogIwy
 WghWiLQFn+hxiKbP3VSOYVmO+4JypsqH6ZMpI4rXHntcpzTCjX9iBR9BPUknrOjC
 Qpg63+/JF7b7geDX3z3nSJ8OXJDiuhw2BMfVM1Ls5Hf8Kz5jVB3KU2zteRLjvI5S
 BvnZFI5kzXW04W7IR0bCzZiGhXKjowmYzDR9i8hzi/pV1/06UBTcd4VWZmDfKn8L
 HsiKH+V2lWYM9E6tnTB/T6XdV6WzV4weCXckpz69xYRdLXL/72eEeflLcBKB894S
 ulzigvPkNG5v2XpxvpDDfXytIabGix9gNvoECwOf/3qXB1XlWj3iGD0gYZbnbFjy
 wzUaNSpVVRNBVuuiI2Zzwqv8in2dM3AyIjrGfatTRrkCFvvQjjzqOrGQZtPgWiVV
 dVABx0tt184UYup2xNIjjE8GmlvDKFz2eNqm1KqrBb6bZbqZqhpYCrLSP9cmDoHF
 OQUUq9IdN6RHbeKAvFheMRVRS7eBIdm40ZspyRqG3GExP7T9GCxs+QJgP0QFPA4J
 WU/o/FSqodeZxyqaTHTIonOoOuzVcbuKmfeQnBuK0kqUfjtr95onD1dZb+0xy55c
 0N1OaI/kWR8+guWjdQ2M
 =cVUF
 -----END PGP SIGNATURE-----

Merge tag 'sound-3.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Just two small stable fixes: an HD-audio fix for the new Intel
  chipsets and a PM handling fix in PCM dmaengine core"

* tag 'sound-3.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets
  ALSA: pcm_dmaengine: Add check during device suspend
2014-05-28 11:17:41 -07:00
Linus Torvalds 2826958029 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fix from Al Viro:
 "Oh, well...  Still nothing useful on that livelock (I had something
  that looked kinda-sorta like a non-invasive solution, but it
  deadlocks), so it's just Miklos' vmsplice fix for now"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  vfs: fix vmplice_to_user()
2014-05-28 11:15:57 -07:00
Nicolas Pitre 3f8517e793 ARM: 8063/1: bL_switcher: fix individual online status reporting of removed CPUs
The content of /sys/devices/system/cpu/cpu*/online  is still 1 for those
CPUs that the switcher has removed even though the global state in
/sys/devices/system/cpu/online is updated correctly.

It turns out that commit 0902a9044f ("Driver core: Use generic
offline/online for CPU offline/online") has changed the way those files
retrieve their content by relying on on the generic attribute handling
code.  The switcher, by calling cpu_down() directly, bypasses this
handling and the attribute value doesn't get updated.

Fix this by calling device_offline()/device_online() instead.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-05-28 16:33:02 +01:00
Linus Torvalds 4efdedca93 Small fixes for x86, slightly larger fixes for PPC, and a forgotten s390 patch.
The PPC fixes are important because they fix breakage that is new in 3.15.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTdivEAAoJEBvWZb6bTYbyw3YQAIILnflhHNtklj1mfPnnibQf
 c3BLCkJ0gtK6A0FO2aAHgSja0kpgbEEnSphE/A/cb0vkLon3n5O0pQoSKjGUUbBO
 Mo0ndjzBYNmCP4MGxhkrg49VdqD40NaR0BjJAZudb4vUOw892WLFIJMIVmIqs9eG
 8V/y6S7mPLmrooAKHZxXql9y30UC77T1VZ3r4pXwYgKtUT51BQfTyWiSfjQBa8yI
 oGOSb8uqEC7YiOYPJYUNIMsyVqW4E6Qqs46rqtP4XZmSxzWXDzzgP4nQHHyJJCdZ
 aBYkeG+sJZG7ZwleJLejAncjWUY9Oq9GkMYNj0cTAoP/zA6jBGAll96KGKRbes9z
 bZUtCNL3ifLcgbIGeAxgjmYOq0XLGahHbqm9QISYW2XdRkBI+8EJs5FCP4YEHzZn
 FSm3zcCQ+wtbqjBbZZcqqLa6A/CGzjyO26qz+BCxrZ0BQkQX/2am3UykQ0JWam3H
 vX5ZM2ewJhs6SjFisPcswd20AN+SHjPyzPvErBLDfrqnAVbwj2ehgqyN2slVsqrj
 UyGzeKCfJgA0TiEH/4K6j6hvQWynUU+/2JglIfGE6AXmWddazCzl/qx4LvuGKFoB
 b8JSQ7YaHSsq/tHc8WhHkvcP0FSDZEiHcJN2iY1pwLKTSQp9JN3aPNruPKiO8dsW
 N+LoHL5fFcDi6Uu6wS7w
 =E2fU
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
 "Small fixes for x86, slightly larger fixes for PPC, and a forgotten
  s390 patch.  The PPC fixes are important because they fix breakage
  that is new in 3.15"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: s390: announce irqfd capability
  KVM: x86: disable master clock if TSC is reset during suspend
  KVM: vmx: disable APIC virtualization in nested guests
  KVM guest: Make pv trampoline code executable
  KVM: PPC: Book3S: ifdef on CONFIG_KVM_BOOK3S_32_HANDLER for 32bit
  KVM: PPC: Book3S HV: Add missing code for transaction reclaim on guest exit
  KVM: PPC: Book3S: HV: make _PAGE_NUMA take effect
2014-05-28 08:08:03 -07:00
Linus Torvalds 9e3d633178 Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull two powerpc fixes from Ben Herrenschmidt:
 "Here's a pair of powerpc fixes for 3.15 which are also going to
  stable.

  One's a fix for building with newer binutils (the problem currently
  only affects the BookE kernels but the affected macro might come back
  into use on BookS platforms at any time).  Unfortunately, the binutils
  maintainer did a backward incompatible change to a construct that we
  use so we have to add Makefile check.

  The other one is a fix for CPUs getting stuck in kexec when running
  single threaded.  Since we routinely use kexec on power (including in
  our newer bootloaders), I deemed that important enough"

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode
  powerpc: Fix 64 bit builds with binutils 2.24
2014-05-28 08:06:50 -07:00
Al Viro 64fd72e0a4 lift the "already marked killed" case into shrink_dentry_list()
It can happen only when dentry_kill() is called with unlock_on_failure
equal to 0 - other callers had dentry pinned until the moment they've
got ->d_lock and DCACHE_DENTRY_KILLED is set only after lockref_mark_dead().

IOW, only one of three call sites of dentry_kill() might end up reaching
that code.  Just move it there.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-28 09:48:44 -04:00
Miklos Szeredi b6dd6f4738 vfs: fix vmplice_to_user()
Commit 6130f5315e "switch vmsplice_to_user() to copy_page_to_iter()" in
v3.15-rc1 broke vmsplice(2).

This patch fixes two bugs:

 - count is not initialized to a proper value, which resulted in no data
   being copied

 - if rw_copy_check_uvector() returns negative then the iov might be leaked.

Tested OK.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-05-28 01:54:52 -04:00
Mike Turquette 5178438041 PLLE fixes for 3.15
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJTT8KcAAoJEFFb18rurjwTlF4QAIkOAZJMs6+qOI+u3+zio7Gl
 ptnMEje9/k4sT5w8z6I0zUddV+S+VKz7xHIb7sB21+iog8E5ug1meSlJY+XlrfB0
 YLZk6iaUdvmYuNK7NWYDDZm3vUR8gdOlDCt5nq/YdSoJM3WG0r+9piWha4LeqQVF
 KCCNHEPV7RlSfFAsmdVi9VIJaFQy/a/uIOqAs2W9Ujuj8kfuPwYbRWXPhwCMoqlu
 AzDWoS+Y3Dqk4BhGV+wfLk0IQICP3f6JQ2zj08Dtri2PkmgYkxCLoEmgJcqQgpB8
 oSF9ps9ZymeHYwaZ73M9IiYYwXCo3jQ77hMlgh/NH2KW59APrlbvJeDGNQLs7T+v
 fVPj0lWj05yDSgYYroeKravaPbBAopfLIIM7yrfJs65cgpbNTuqolPnbgdOrqH4f
 Hsg09T/WNZFruEhXtfFyjc7/zkWUIrc6eSCBXuMC/KwDMCnp/fQq/aQ0Qi4eB/jm
 HcaqxEDu5KITg35f1+yiSkAaSZhuS4ykKjnBbAXaSlxGSvOt/ZRJTR1EFF5U9dWy
 OZbkinKw9gUZCFOY9tVvEbIBYoWoXt2tDwtyRemZGb143ymgh2KGGrzhrzv/RaG5
 p2DksbKhB+YfkETE607hlNiCpWsoTTvtQhd7f5NyYlTrpoMhfrS1zshmHDxAJFCj
 ik0guIurGCVA4xibDT8n
 =jb8m
 -----END PGP SIGNATURE-----

Merge tag 'clk-tegra-fixes-3.15' of git://nv-tegra.nvidia.com/user/pdeschrijver/linux into clk-fixes

PLLE fixes for 3.15
2014-05-27 21:11:08 -07:00
Srivatsa S. Bhat 011e4b02f1 powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode
If we try to perform a kexec when the machine is in ST (Single-Threaded) mode
(ppc64_cpu --smt=off), the kexec operation doesn't succeed properly, and we
get the following messages during boot:

[    0.089866] POWER8 performance monitor hardware support registered
[    0.089985] power8-pmu: PMAO restore workaround active.
[    5.095419] Processor 1 is stuck.
[   10.097933] Processor 2 is stuck.
[   15.100480] Processor 3 is stuck.
[   20.102982] Processor 4 is stuck.
[   25.105489] Processor 5 is stuck.
[   30.108005] Processor 6 is stuck.
[   35.110518] Processor 7 is stuck.
[   40.113369] Processor 9 is stuck.
[   45.115879] Processor 10 is stuck.
[   50.118389] Processor 11 is stuck.
[   55.120904] Processor 12 is stuck.
[   60.123425] Processor 13 is stuck.
[   65.125970] Processor 14 is stuck.
[   70.128495] Processor 15 is stuck.
[   75.131316] Processor 17 is stuck.

Note that only the sibling threads are stuck, while the primary threads (0, 8,
16 etc) boot just fine. Looking closer at the previous step of kexec, we observe
that kexec tries to wakeup (bring online) the sibling threads of all the cores,
before performing kexec:

[ 9464.131231] Starting new kernel
[ 9464.148507] kexec: Waking offline cpu 1.
[ 9464.148552] kexec: Waking offline cpu 2.
[ 9464.148600] kexec: Waking offline cpu 3.
[ 9464.148636] kexec: Waking offline cpu 4.
[ 9464.148671] kexec: Waking offline cpu 5.
[ 9464.148708] kexec: Waking offline cpu 6.
[ 9464.148743] kexec: Waking offline cpu 7.
[ 9464.148779] kexec: Waking offline cpu 9.
[ 9464.148815] kexec: Waking offline cpu 10.
[ 9464.148851] kexec: Waking offline cpu 11.
[ 9464.148887] kexec: Waking offline cpu 12.
[ 9464.148922] kexec: Waking offline cpu 13.
[ 9464.148958] kexec: Waking offline cpu 14.
[ 9464.148994] kexec: Waking offline cpu 15.
[ 9464.149030] kexec: Waking offline cpu 17.

Instrumenting this piece of code revealed that the cpu_up() operation actually
fails with -EBUSY. Thus, only the primary threads of all the cores are online
during kexec, and hence this is a sure-shot receipe for disaster, as explained
in commit e8e5c2155b (powerpc/kexec: Fix orphaned offline CPUs across kexec),
as well as in the comment above wake_offline_cpus().

It turns out that cpu_up() was returning -EBUSY because the variable
'cpu_hotplug_disabled' was set to 1; and this disabling of CPU hotplug was done
by migrate_to_reboot_cpu() inside kernel_kexec().

Now, migrate_to_reboot_cpu() was originally written with the assumption that
any further code will not need to perform CPU hotplug, since we are anyway in
the reboot path. However, kexec is clearly not such a case, since we depend on
onlining CPUs, atleast on powerpc.

So re-enable cpu-hotplug after returning from migrate_to_reboot_cpu() in the
kexec path, to fix this regression in kexec on powerpc.

Also, wrap the cpu_up() in powerpc kexec code within a WARN_ON(), so that we
can catch such issues more easily in the future.

Fixes: c97102ba96 (kexec: migrate to reboot cpu)
Cc: stable@vger.kernel.org
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-05-28 13:24:26 +10:00
Guenter Roeck 7998eb3dc7 powerpc: Fix 64 bit builds with binutils 2.24
With binutils 2.24, various 64 bit builds fail with relocation errors
such as

arch/powerpc/kernel/built-in.o: In function `exc_debug_crit_book3e':
	(.text+0x165ee): relocation truncated to fit: R_PPC64_ADDR16_HI
	against symbol `interrupt_base_book3e' defined in .text section
	in arch/powerpc/kernel/built-in.o
arch/powerpc/kernel/built-in.o: In function `exc_debug_crit_book3e':
	(.text+0x16602): relocation truncated to fit: R_PPC64_ADDR16_HI
	against symbol `interrupt_end_book3e' defined in .text section
	in arch/powerpc/kernel/built-in.o

The assembler maintainer says:

 I changed the ABI, something that had to be done but unfortunately
 happens to break the booke kernel code.  When building up a 64-bit
 value with lis, ori, shl, oris, ori or similar sequences, you now
 should use @high and @higha in place of @h and @ha.  @h and @ha
 (and their associated relocs R_PPC64_ADDR16_HI and R_PPC64_ADDR16_HA)
 now report overflow if the value is out of 32-bit signed range.
 ie. @h and @ha assume you're building a 32-bit value. This is needed
 to report out-of-range -mcmodel=medium toc pointer offsets in @toc@h
 and @toc@ha expressions, and for consistency I did the same for all
 other @h and @ha relocs.

Replacing @h with @high in one strategic location fixes the relocation
errors. This has to be done conditionally since the assembler either
supports @h or @high but not both.

Cc: <stable@vger.kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-05-28 13:24:05 +10:00
Linus Torvalds cd79bde29f Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull virtio_blk fix from Jens Axboe:
 "There's a start/stop queue race in virtio_blk, which causes stalls and
  erratic behaviour for some.  I've had this queued up for 3.16 for a
  while, but I think we should push it into the current series as well.

  So I cherry picked the commit and added a stable marker as well, so it
  can propagate down"

* 'for-linus' of git://git.kernel.dk/linux-block:
  virtio_blk: fix race between start and stop queue
2014-05-27 15:59:34 -07:00
Linus Torvalds aa699a1d84 Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull two timer fixes from Thomas Gleixner:
 "Two small fixlets for ARM SoC clocksource drivers:

   - avoid calling functions which might sleep from interrupt [disabled]
     context in tcb_clksrc used on Atmel SoCs

   - use irq_force_affinity() to pin the per cpu timer interrupt on a
     not yet online cpu in the SiRFprimaII driver"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clocksource: tcb_clksrc: Make tc_mode interrupt safe
  clocksource: marco: Fix the affinity set for local timer of CPU1
2014-05-27 15:58:20 -07:00
Linus Torvalds 758b67126f ARM: SoC fixes for 3.15
A slightly larger set of fixes than we'd like at this point in the
 release. Hopefully our very last batch before 3.15:
 
  - OMAP:
    * Fix boot regression with CPU_IDLE enabled
    * Fixes for audio playback on OMAP5
    * Clock rate setting fix for OMAP3
    * Misc idle/PM fixes
  - Exynos:
    * Removal of a couple of power domains to work around issues with access
      when they are powered down
    * Enabling missing highspeed-i2c driver to make MMC regulators work
    * Secondary CPU spin-up fix for 4212
    * Remove MDMA1 engine to avoid conflicts on secure mode platforms
    * A few other DT fixes
  - Marvell:
    * PCI-e fixes for clocks and resource allocation
 
  + a few other smaller fixes, add a MAINTAINERS entry for reset drivers, etc.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJThNe/AAoJEIwa5zzehBx3fzAP/1Zd06ozJ3nkTyJwwFRJNudq
 ZkVA6KM8W12BpgNeyAekn0l6IHEZheNlUStarnnqh7xUq32cnF0mmiz20m+IzRes
 TBBUt7gF608Cddg/+yEwocJUS2fu5ME63kWIA8mcEsNeMMoytT6JHtMuq3HJseyk
 rTHyRrqvlRrxhK5nJaq5kQtWMy1NLufEW6BQbYBX3jzJ7mN6fMbQxKGEfwjlLjEI
 qb7v8wm+o20VZguX8/Jc//in29nLh1HXVvGAtQULdcOItwRSD8bnKi4Zzv4I0pwM
 S3wD5O/6qdibD+ov72qJEcQYYG/vOlGCbMEFEDFvKWsxm8UZ4hVIEk07dzgZGUEW
 TK6OdDgM/f12M1Hlxa8M/yu1zmQH2c4JADBs1/pJ+OEkDF8ap3jD0l6FTT2dKqfq
 Q8Jdf/KfD1pRRZoX9+QNBuAdXrekaYOhsrRL7hEv0bR3Q+eYN1x24mYIupeyfkwP
 S70I94kC4dBDz7CWy1LeBvCt2Wl6AuAwIfCvQ0kr0Kaj5WXHK6NZB1nl9zG+OKXX
 xyerBsRQmLUORNOK6bszAL28PvFveWQzwOJULaMRho8fLlbjI1gu/5YVjFpuF1Tt
 qPtiL4IfMJMgtebrMvpj9Ydb5TiS1pI0MxwyL6eSUz0Fo8MurXkDPLoQGwhEFvCh
 OkcKykZ63weo+iLOJw8o
 =73IV
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "A slightly larger set of fixes than we'd like at this point in the
  release.  Hopefully our very last batch before 3.15:

  OMAP:
   - Fix boot regression with CPU_IDLE enabled
   - Fixes for audio playback on OMAP5
   - Clock rate setting fix for OMAP3
   - Misc idle/PM fixes
  Exynos:
   - Removal of a couple of power domains to work around issues with
     access when they are powered down
   - Enabling missing highspeed-i2c driver to make MMC regulators work
   - Secondary CPU spin-up fix for 4212
   - Remove MDMA1 engine to avoid conflicts on secure mode platforms
   - A few other DT fixes
  Marvell:
   - PCI-e fixes for clocks and resource allocation

  plus a few other smaller fixes, add a MAINTAINERS entry for reset
  drivers, etc"

* tag 'fixes-for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (21 commits)
  MAINTAINERS: Add reset controller framework entry
  ARM: trusted_foundations: fix compile error on non-SMP
  ARM: at91: sam9260: fix compilation issues
  ARM: mvebu: fix definitions of PCIe interfaces on Armada 38x
  ARM: imx: fix error handling in ipu device registration
  ARM: OMAP4: Fix the boot regression with CPU_IDLE enabled
  ARM: dts: Keep LDO4 always ON for exynos5250-arndale board
  ARM: dts: Fix SPI interrupt numbers for exynos5420
  ARM: dts: fix incorrect ak8975 compatible for exynos4412-trats2 board
  ARM: OMAP2+: Fix DMA hang after off-idle
  ARM: OMAP2+: nand: Fix NAND on OMAP2 and OMAP3 boards
  ARM: dts: Remove g2d_pd node for exynos5420
  ARM: dts: Remove mau_pd node for exynos5420
  ARM: exynos_defconfig: enable HS-I2C to fix for mmc partition mount
  ARM: dts: disable MDMA1 node for exynos5420
  ARM: EXYNOS: fix the secondary CPU boot of exynos4212
  ARM: omap5: hwmod_data: Correct IDLEMODE for McPDM
  ARM: mvebu: mvebu-soc-id: keep clock enabled if PCIe unit is enabled
  ARM: mvebu: mvebu-soc-id: add missing clk_put() call
  ARM: at91/dt: sam9260: correct external trigger value
  ...
2014-05-27 13:59:24 -07:00
Linus Torvalds 51d566523b A single last pinctrl fix for the v3.15 series:
the vt8500 driver was failing to update the output value
 when the combined set direction output and set value was
 executed.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJThD6DAAoJEEEQszewGV1zH6EP/i9QeRZlQyD6lvSfuZG/gO6q
 f6Dvj+H7NqLnV3pRix7578LgclqozOUealOiSWrRpXFnJLMcNAoct9yr2hSlzZ+2
 El6M0+u5d+HSrZRrv+tUXTGglzyuF6Z2hc3xZgOy0PuDXD4xc716aG8Zn9Ck9w7s
 X3maSLaGJFSUOzNNoQLejqdRG+vMZs9pZ1jLkvcipOz7GDhlX7HuXwPVlp+chiKU
 0sGfEpLCUlNHxgmcNu0IUJOty6UvI2STQ57zA7N/Q+/IfLB6GsPa4FF69kJjg5Sl
 hU3MUUAmR0hvws4S4DCm6HTohXcz+P41PlIIVGDz3I7Io/GQSDhnlQTlN1iJqhqy
 erhQzXII40GrWJs2yEYpZU1wtcVmgJR+SZHTJlAMr42+SaE0zBJJA42FG+7XbNLM
 FxBbS53KKbJefV1s1gtmZNaVfrSMXZBKRoeV7NrhYuAWL57jywlxO1o0RNpxzVyk
 7/nAigFRvG/2iKrso1zQyscNxJKk0LAuHgUzivuUlIsXOeFC4ndI46ObP/D6u4r/
 TOS/UjdZysOFCWIXDJElLH0sXLugj2q4Yq3KJAyLjTnwnJPwVEkJdr0qS/STplww
 10AbGU8AW4rL7+gal+DeleiviNqz2RhR4tBVM8Ph9KgrYiaXuiJH3rIA1hwXxIz0
 tRaIkK1A/GJAinM2XL8h
 =pdRP
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-v3.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pinctrl fix from Linus Walleij:
 "A single last pinctrl fix for the v3.15 series: the vt8500 driver was
  failing to update the output value when the combined set direction
  output and set value was executed"

* tag 'pinctrl-v3.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: vt8500: Ensure value reg is updated when setting direction
2014-05-27 13:58:46 -07:00
Linus Torvalds c949ddf9eb Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine fixes from Vinod Koul:
 "We have three small fixes.

  First one from Andy reverts the devm_request irq as we need to ensure
  the tasklet is killed after irq is freed, so we need to do free irq in
  our code.  Other two from Arnd are fixing the compilation issue in
  omap and sa11x0 drivers with ARM randconfigs"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: sa11x0: remove broken #ifdef
  dmaengine: omap: hide filter_fn for built-in drivers
  dmaengine: dw: went back to plain {request,free}_irq() calls
2014-05-27 13:57:00 -07:00
Philipp Zabel 1b0fe6be85 MAINTAINERS: Add reset controller framework entry
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Olof Johansson <olof@lixom.net>
2014-05-27 10:59:58 -07:00
Ming Lei aa0818c6ee virtio_blk: fix race between start and stop queue
When there isn't enough vring descriptor for adding to vq,
blk-mq will be put as stopped state until some of pending
descriptors are completed & freed.

Unfortunately, the vq's interrupt may come just before
blk-mq's BLK_MQ_S_STOPPED flag is set, so the blk-mq will
still be kept as stopped even though lots of descriptors
are completed and freed in the interrupt handler. The worst
case is that all pending descriptors are freed in the
interrupt handler, and the queue is kept as stopped forever.

This patch fixes the problem by starting/stopping blk-mq
with holding vq_lock.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Jens Axboe <axboe@fb.com>

Conflicts:
	drivers/block/virtio_blk.c
2014-05-27 08:41:10 -06:00
Rafael J. Wysocki 9b961aa99b Merge branches 'pm-cpufreq' and 'acpi-thermal'
* pm-cpufreq:
  cpufreq: cpu0: drop wrong devm usage
  cpufreq: remove race while accessing cur_policy

* acpi-thermal:
  ACPI / thermal: fix workqueue destroy order
2014-05-26 23:20:16 +02:00
Aaron Lu 2807bd18cc ACPI / thermal: fix workqueue destroy order
When the thermal module is to be removed, we should destroy the wq
acpi_thermal_pm_queue after the ACPI driver's remove callback is
executed as we will need to flush the workqueue there, or a NULL pointer
access will be hit.

Reported-and-tested-by: Kui Zhang <kuizhang@gmail.com>
References: http://www.spinics.net/lists/kernel/msg1747251.html
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-05-26 14:34:07 +02:00
Linus Torvalds c7208164e6 Linux 3.15-rc7 2014-05-25 16:06:00 -07:00
Rabin Vincent 483a6c9d44 ARM: 8064/1: fix v7-M signal return
According to the ARM ARM, the behaviour is UNPREDICTABLE if the PC read
from the exception return stack is not half word aligned.  See the
pseudo code for ExceptionReturn() and PopStack().

The signal handler's address has the bit 0 set, and setup_return()
directly writes this to regs->ARM_pc.  Current hardware happens to
discard this bit, but QEMU's emulation doesn't and this makes processes
crash.  Mask out bit 0 before the exception return in order to get
predictable behaviour.

Fixes: 19c4d593f0 ("ARM: ARMv7-M: Add support for exception handling")

Cc: stable@kernel.org
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-05-25 23:44:27 +01:00
srinik fbebf59778 ARM: 8057/1: amba: Add Qualcomm vendor ID.
This patch adds Qualcomm amba vendor Id to the list. This ID is used in mmci driver. The ID selected in same lines like 0x41 is "A" for ARM, 0x51 is "Q" for Qualcomm.

As there are no physical register on Qcom SOC for amba vendor id, this is a fake ID assigned based on "Q" prefix from Qualcomm.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-05-25 23:44:27 +01:00
Nikolay Borisov 8203d5b628 ARM: 8052/1: unwind: Fix handling of "Pop r4-r[4+nnn],r14" opcode
The arm EABI states that unwind opcode 10100nnn means pop register r4-4[4+nnn],aditionally there is a similar unwind opcode: 10101nnn which means the same thing plus popping r14. Those two cases are handled by the unwind_exec_pop_r4_to_rN function which checks whether the 4th bit is set and does r14 popping.

However, up until now it has been checking whether the 8th bit was set (mask & 0x80) instead of the 4th (mask & 0x8), a simple to make typo but this meant that we were always popping r14 even if we had the former opcode.

This patch changes the mask so that the 2 unwind opcodes are being handled correctly.

Signed-off-by: Nikolay Borisov <Nikolay.Borisov@arm.com>
Reviewed-by: Anurag Aggarwal <anurag19aggarwal@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-05-25 23:44:26 +01:00
Andrey Ryabinin 537094b64b ARM: 8051/1: put_user: fix possible data corruption in put_user
According to arm procedure call standart r2 register is call-cloberred.
So after the result of x expression was put into r2 any following
function call in p may overwrite r2. To fix this, the result of p
expression must be saved to the temporary variable before the
assigment x expression to __r2.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-05-25 23:44:25 +01:00
Rabin Vincent f9ff907b0a ARM: 8048/1: fix v7-M setup stack location
__v7m_setup_stack currently sits in the .proc.info.init section, and
thus creates a bogus proc info entry (which by the way matches any
unknown CPU IDs, due to the entry's mask being 0).  Move it out of
there.

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-05-25 23:44:24 +01:00
Linus Torvalds db1003f231 Merge branch 'afs' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
Pull AFS fixes and cleanups from David Howells:
 "Here are some patches to the AFS filesystem:

  1) Fix problems in the clean-up parts of the cache manager service
     handler.

  2) Split afs_end_call() introduced in (1) and replace some identical
     code elsewhere with a call to the first half of the split function.

  3) Fix an error introduced in the workqueue PREPARE_WORK() elimination
     commits.

  4) Clean up argument passing to functions called from the workqueue as
     there's now an insulating layer between them and the workqueue.
     This is possible from (3)"

* 'afs' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
  AFS: Pass an afs_call* to call->async_workfn() instead of a work_struct*
  AFS: Fix kafs module unloading
  AFS: Part of afs_end_call() is identical to code elsewhere, so split it
  AFS: Fix cache manager service handlers
2014-05-25 12:40:36 -07:00
Linus Torvalds ef0d2c1686 Merge branch 'rdunlap' (patches from Randy Dunlap)
Merge documentation fixes from Randy Dunlap.

* emailed patches from Randy Dunlap <rdunlap@infradead.org>:
  Documentation: update /proc/stat "intr" count summary
  Documentation: update java sample wrapper for java 7
  Documentation: update thunderbird email client settings
  Documentation: fix typos in drm docbook
2014-05-25 12:39:08 -07:00
Jan Moskyto Matejka 3568a1dbf1 Documentation: update /proc/stat "intr" count summary
The sum at the beginning of line "intr" includes also unnumbered
interrupts.  It implies that the sum at the beginning isn't the sum
of the remainder of the line, not even an estimation.

Fixed the documentation to mention that.

This behaviour was added to /proc/stat in commit a2eddfa959 ("x86:
make /proc/stat account for all interrupts")

Signed-off-by: Jan Moskyto Matejka <mq@suse.cz>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-05-25 12:39:00 -07:00
Jonathan Callen f76f133b0c Documentation: update java sample wrapper for java 7
The sample wrapper currently fails on some Java 7 .class files.  This
updates the wrapper to properly handle those files.

Signed-off-by: Jonathan Callen <jcallen@gentoo.org>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-05-25 12:39:00 -07:00
Paul McQuade f9a0974d3f Documentation: update thunderbird email client settings
Added setting to email-clients that is easier to read and is easier to
setup thunderbird.  Removed config settings and added GUI settings.

Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-05-25 12:39:00 -07:00
Masanari Iida f9b899c44f Documentation: fix typos in drm docbook
Fix spelling typo in DocBook/drm.tmpl

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-05-25 12:39:00 -07:00
Linus Torvalds f016a6441a Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
Pull hwmon subsystem fixes from Jean Delvare.

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (ntc_thermistor) Fix OF device ID mapping
  hwmon: (ntc_thermistor) Fix dependencies
  hwmon: Document temp[1-*]_min_hyst sysfs attribute
2014-05-25 10:20:36 -07:00
Linus Torvalds 0e37c27542 SCSI fixes on 20140524
This is a single fix for a bug exposed by a sysfs change in 3.13 which now
 causes libsas to trigger a warn on in device removal.
 
 Signed-off-by: James Bottomley <JBottomley@Parallels.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQEcBAABAgAGBQJTgKNGAAoJEDeqqVYsXL0ML98IALHiBnsPd8LqtLPDgCg7poBY
 ci4gHgthKRMDiwSi847x6eXxXKDWgPfrMjiVL4pulAkNtAFh52c+BxUcAoEwgSpj
 WmFJwFYwNzExhvOM6my42e1D60G3Gu1DvwrdP065ajygjBZl4beMF06ZWrz+6UxF
 WMpCVw4Rmu8PdAm8aH5N13Sl71nIY6W/rlbC/CtrGLelB7Om1gPbr9YpPfISLFdn
 1A99lJEKjDvZNk64BhJtnRCgvzBWzJ4TVEmnWIx/2mJe/z0pM7whYIKAbqX2WgCi
 JrZ/rdCDJe+lq/rVhCVU/enEoqJsbtWjF6+Wp7/0lK0PDvfSXyR92KfCIXCFi4A=
 =HAcQ
 -----END PGP SIGNATURE-----

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull single scsi fix from James Bottomley:
 "This is a single fix for a bug exposed by a sysfs change in 3.13 which
  now causes libsas to trigger a warn on in device removal"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  [SCSI] scsi_transport_sas: move bsg destructor into sas_rphy_remove
2014-05-25 10:13:50 -07:00
Linus Torvalds 80a1de29a5 Merge branch 'for-3.15' of git://linux-nfs.org/~bfields/linux
Pull two nfsd bugfixes from Bruce Fields:
 "Just two bugfixes, one for a merge-window-introduced ACL regression,
  the other for a longer-standing v4 state bug"

* 'for-3.15' of git://linux-nfs.org/~bfields/linux:
  nfsd4: warn on finding lockowner without stateid's
  nfsd4: remove lockowner when removing lock stateid
  nfsd4: fix corruption on setting an ACL.
2014-05-25 10:08:48 -07:00
Jean Delvare ead82d6792 hwmon: (ntc_thermistor) Fix OF device ID mapping
The mapping from OF device IDs to platform device IDs is wrong.
TYPE_NCPXXWB473 is 0, TYPE_NCPXXWL333 is 1, so
ntc_thermistor_id[TYPE_NCPXXWB473] is { "ncp15wb473", TYPE_NCPXXWB473 }
while
ntc_thermistor_id[TYPE_NCPXXWL333] is { "ncp18wb473", TYPE_NCPXXWB473 }.

So the name is wrong for all but the "ntc,ncp15wb473" entry, and the
type is wrong for the "ntc,ncp15wl333" entry.

So map the entries by index, it is neither elegant nor robust but at
least it is correct.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Fixes: 9e8269de hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Cc: Doug Anderson <dianders@chromium.org>
2014-05-25 17:23:08 +02:00
Jean Delvare 59cf4243e5 hwmon: (ntc_thermistor) Fix dependencies
In commit 9e8269de, support was added for ntc_thermistor devices being
declared in the device tree and implemented on top of IIO. With that
change, a dependency was added to the ntc_thermistor driver:

	depends on (!OF && !IIO) || (OF && IIO)

This construct has the drawback that the driver can no longer be
selected when OF is set and IIO isn't, nor when IIO is set and OF is
not. This is a regression for the original users of the driver.

As the new code depends on IIO and is useless without OF, include it
only if both are enabled, and set the dependencies accordingly. This
is clearer, more simple and more correct.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Fixes: 9e8269de hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Cc: Doug Anderson <dianders@chromium.org>
2014-05-25 17:23:08 +02:00
Jean Delvare 0132514588 hwmon: Document temp[1-*]_min_hyst sysfs attribute
The temp[1-*]_min_hyst sysfs attribute is already implemented by 3
hwmon drivers (adt7x10, lm77 and lm92) but was missing from the
standard interface.

Also add temp[1-*]_lcrit_hyst for consistency, even though no driver
implement that one for the time being.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
2014-05-25 17:23:07 +02:00
Linus Torvalds 037430078f Two fixes for -stable:
1/ async_mult() sometimes maps less buffers than initially requested.
    We end up freeing dmaengine_unmap_data on an invalid pool.
 
 2/ mv_xor: register write ordering fix
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTfoDyAAoJEB7SkWpmfYgC5sUP/3r0GU3071DcZ74rW7yW9UMC
 EW+GyYLISl2X4+zdTTV4iLhtOx4tnS+xock5LylrMi0WKD8ma4/6057dc+ham9t7
 1/5qeZyZ/lKUjOjhNBqBevzyKubWryafRklOnglP6KjNiDSKbVsvl7pgzPLTjhCE
 7tqv3/86Q6W7MIGFDUPQhrd2zTk46Gmu7GZixJ1jN3YhW0hqsqbk+QJALjT7rG5n
 0q7f7PM83e+f5LEqlM1Om4AEkCaYrf6P8Nkatcut6tecixplI2kDOgK/0JEIA5FT
 Fnr/3j6/WFYrpn/BVRR+33FeTA2ZUl2kWSVpyOKNiAHrzE2AGhlFN+uZelUERUGE
 cDeEw//dFdjf+JjotTdBtukzHlijhSLttX5cF2lK5XOUql1AK1WnWsPm4iZAQ1/x
 Hv3k6BnhwfIyyYRyo1qIr4QqYxpMjgW1U4Cn9WV03A+6OT4UK5Q/8dvIg6KtmF+o
 fXzHWCI/pRU6zLj5t1UmoNL+0EmT/gDAEkmHXdcbbKQUlB3tiGyPAzt1mCwlqcx8
 p3VQk9BqlNvDzYtGRCabCGaRxnxtlY0agBu+2AmXIwg6a+qd70BSoo1Nypb2bTMk
 qrHmWX7RvqssPiWa9PUfIsUYSoCG162n6Eh93cMgPNoxXl380o+kD8t5wzHoWSoB
 UdMsu58bfuBbDVIQM/ec
 =XFIL
 -----END PGP SIGNATURE-----

Merge tag 'dmaengine-fixes-3.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/dmaengine

Pull dmaengine fixes from Dan Williams:
 "Two fixes for -stable:

   - async_mult() sometimes maps less buffers than initially requested.
      We end up freeing dmaengine_unmap_data on an invalid pool.

   - mv_xor: register write ordering fix"

* tag 'dmaengine-fixes-3.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/dmaengine:
  dmaengine: fix dmaengine_unmap failure
  dma: mv_xor: Flush descriptors before activating a channel
2014-05-23 16:52:15 -07:00