Commit graph

389540 commits

Author SHA1 Message Date
Linus Torvalds
5d3fed701d spi: Updates for v3.12
Business as usual for SPI - some new drivers, lots of fixes and updates
 to existing drivers plus some new framework features.  Notable changes
 are:
 
  - Support for dual and quad data lines, commonly used by flash chips to
    improve performance, from Wang Yuhang.
  - Factored out a common pattern for runtime PM implementation into the
    core saving a bunch of code.
  - A particularly nice set of updates to the ep93xx driver from
    H Hartley Sweeten, modernising it and reducing the code size a lot.
  - New drivers for Blackfin v3, EFM32, Freescale DSPI and TI QSPI.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSI6U6AAoJELSic+t+oim9geIQAJf9k3PONDHF9ShFMpc8C77Z
 HbUmMnWZ/69uCylG0r0Yt3fItzL2JdBCCS0vNEKy7O/smRjDs2tLlUiBPMQWh/m5
 AyGIKfXegQzarJ7c1ccQIIuIvmL+LKUmgV1P4Uh6X9f3rJ2pJD499aWjC7wLcACD
 hn2CC8idRRA7qDbwInRHRP1zYzwv1wwb96MOiNpm4ObbbxD4c8IV2d8zCvxNk/xn
 9r8MP4/FCLIwV0Fj0xzAQjtgwzDpAsBhxBcKwO+wNSCfXPy6QqlmbgDfqiG0fN4i
 9qIPADqhjt5mtBZ4ZINVWZeVKHjMJJLAtnD4Pfu05wwn/YX6p1ZcrPBAud0nGYE4
 3xJWpGmprPltwuCRCVNJ6iQeHAWu07k4FV7naE9XIIgxtaURqlI2X9Q6PXboE/WW
 xntuDjFCLrOloowWw7QGOC1Cqk5cC722PsNAzuMqDzr63NSmgHc6HudMhEDZDKcy
 No7Ha2xNXn7Wp/WVR3+jfGXHPBhHAz7SewrCMD3N8d4Mla+mXmL2DFm6cIgfjk99
 JNoAMPo0ud7uT0j3Y+TSDNiEbidTD3fSPaJsqxZ4HykyZnlYc88ZGZeY77l23DEX
 lMxG85qkO/EHRB4zi1yQ0qtrrItawGRTH+tfVV0JMa2y74p2GzGtV82Y9rew+eaw
 jZlmfzII6UtpmVc0f1uV
 =Wmbk
 -----END PGP SIGNATURE-----

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

Pull spi updates from Mark Brown:
 "Business as usual for SPI - some new drivers, lots of fixes and
  updates to existing drivers plus some new framework features.  Notable
  changes are:

   - Support for dual and quad data lines, commonly used by flash chips
     to improve performance, from Wang Yuhang.
   - Factored out a common pattern for runtime PM implementation into
     the core saving a bunch of code.
   - A particularly nice set of updates to the ep93xx driver from
     H Hartley Sweeten, modernising it and reducing the code size a lot.
   - New drivers for Blackfin v3, EFM32, Freescale DSPI and TI QSPI"

* tag 'spi-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (133 commits)
  spi/qspi: fix missing unlock on error in ti_qspi_start_transfer_one()
  spi: quad: fix the name of DT property
  spi: core: Fix spi_register_master error handling
  spi: efm32: Fix build error
  spi: altera: Use DIV_ROUND_UP to calculate hw->bytes_per_word
  spi: rspi: Add spi_master_get() call to prevent use after free
  spi: quad: Make DT properties optional
  spi: quad: Fix missing return
  spi: Use dev_get_drvdata at appropriate places
  spi: use dev_get_platdata()
  spi: nuc900: Fix mode_bits setting
  spi: simplify devm_request_mem_region/devm_ioremap
  spi: altera: Simplify altera_spi_txrx implementation for noirq case
  spi: spi-rspi: fix inconsistent spin_lock_irqsave
  spi/qspi: Add compatible string for am4372.
  spi/qspi: Fix device table entry
  spi/sirf: fix the misunderstanding about len of spi_transfer
  spi/qspi: Add dual/quad spi read support
  spi: sirf: fix error return code in spi_sirfsoc_probe()
  spi: bcm2835: Add spi_master_get() call to prevent use after free
  ...
2013-09-03 10:08:25 -07:00
Linus Torvalds
8243b7f5dc regmap: Updates for v3.12
A quiet release for regmap, some cleanups, fixes and:
 
  - Improved node coalescing for rbtree, reducing memory usage and
    improving performance during syncs.
  - Support for registering multiple register patches.
  - A quirk for handling interrupts that need to be clear when masked
    in regmap-irq.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSI6GWAAoJELSic+t+oim9Yo0P/iF0kj93XcN93urEjZ+TYWsd
 EfeqRv0AB+GB6WB7KR7Tg/bkYhH7xdm4pmTRHcSOZpwDu6tSyGZYD3lgnc9ZTeBF
 W4V5TLHyZu+VLORQcR3dQgzyzSHe+JtwVBYJPoA+JUAMSaKSchRZ0O8bQ4pw0CCH
 COw+UoSEt2/eBiVRkp5XkUZp6tb2jChRva+lZbTfEa3rBNFNnJ7dzlQAKx80Sc80
 ygK3nmLNfux7ZloeghOfHJFlCuo4Bf0u44lyOucOj+4ZgHq0b0CW6LZGGQBc2d9I
 6iVu2GZ81wbVtUg1mnTccmhVCd0MSFCytQrH9qYM7H/BK0L3gjMSnl6xJkBVItHx
 LuicibmdNNue6ToMsWS8nNQLDOqHC8p/RTJc+JY+9EqZF1e78/EIox42XAH/60mG
 PqRRtVtOsKreUzcfnpO4J6zhA8FCjgr4BsuQ7DXkl1SiKcikbIpzb+wlUxszD25m
 SiH4NsHzqwTv0AE4vIvfvz02cQwyPppBhPGJzmeMtlq45rhsZqhuhhPLu/XWY1H8
 n0uK+q0rMXtr7NZJArFNTrgKQet+gZTvJqlmi7Zl2QS7Zd4BAPFgOz7HpaF8lH4i
 9faUZgms6t4QmUncEGjOqyS62GiTHAApG9gA1UVE0xWT5q//zHN0BZN+rHx3aAR1
 TSwN/gxtLfCgYeWy6BWi
 =um4f
 -----END PGP SIGNATURE-----

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

Pull regmap updates from Mark Brown:
 "A quiet release for regmap, some cleanups, fixes and:

   - Improved node coalescing for rbtree, reducing memory usage and
     improving performance during syncs.
   - Support for registering multiple register patches.
   - A quirk for handling interrupts that need to be clear when masked
     in regmap-irq"

* tag 'regmap-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: rbtree: Make cache_present bitmap per node
  regmap: rbtree: Reduce number of nodes, take 2
  regmap: rbtree: Simplify adjacent node look-up
  regmap: debugfs: Fix continued read from registers file
  regcache-rbtree: Fix reg_stride != 1
  regmap: Allow multiple patches to be registered
  regmap: regcache: allow read-only regs to be cached
  regmap: fix regcache_reg_present() for empty cache
  regmap: core: allow a virtual range to cover its own data window
  regmap: irq: document mask/wake_invert flags
  regmap: irq: make flags bool and put them in a bitfield
  regmap: irq: Allow to acknowledge masked interrupts during initialization
  regmap: Provide __acquires/__releases annotations
2013-09-03 10:07:40 -07:00
Linus Torvalds
fc6d0b0376 Merge branch 'lockref' (locked reference counts)
Merge lockref infrastructure code by me and Waiman Long.

I already merged some of the preparatory patches that didn't actually do
any semantic changes earlier, but this merges the actual _reason_ for
those preparatory patches.

The "lockref" structure is a combination "spinlock and reference count"
that allows optimized reference count accesses.  In particular, it
guarantees that the reference count will be updated AS IF the spinlock
was held, but using atomic accesses that cover both the reference count
and the spinlock words, we can often do the update without actually
having to take the lock.

This allows us to avoid the nastiest cases of spinlock contention on
large machines under heavy pathname lookup loads.  When updating the
dentry reference counts on a large system, we'll still end up with the
cache line bouncing around, but that's much less noticeable than
actually having to spin waiting for the lock.

* lockref:
  lockref: implement lockless reference count updates using cmpxchg()
  lockref: uninline lockref helper functions
  vfs: reimplement d_rcu_to_refcount() using lockref_get_or_lock()
  vfs: use lockref_get_not_zero() for optimistic lockless dget_parent()
  lockref: add 'lockref_get_or_lock() helper
2013-09-03 08:08:21 -07:00
Linus Torvalds
6e4664525b Linux 3.11 2013-09-02 13:46:10 -07:00
Linus Torvalds
bc08b449ee lockref: implement lockless reference count updates using cmpxchg()
Instead of taking the spinlock, the lockless versions atomically check
that the lock is not taken, and do the reference count update using a
cmpxchg() loop.  This is semantically identical to doing the reference
count update protected by the lock, but avoids the "wait for lock"
contention that you get when accesses to the reference count are
contended.

Note that a "lockref" is absolutely _not_ equivalent to an atomic_t.
Even when the lockref reference counts are updated atomically with
cmpxchg, the fact that they also verify the state of the spinlock means
that the lockless updates can never happen while somebody else holds the
spinlock.

So while "lockref_put_or_lock()" looks a lot like just another name for
"atomic_dec_and_lock()", and both optimize to lockless updates, they are
fundamentally different: the decrement done by atomic_dec_and_lock() is
truly independent of any lock (as long as it doesn't decrement to zero),
so a locked region can still see the count change.

The lockref structure, in contrast, really is a *locked* reference
count.  If you hold the spinlock, the reference count will be stable and
you can modify the reference count without using atomics, because even
the lockless updates will see and respect the state of the lock.

In order to enable the cmpxchg lockless code, the architecture needs to
do three things:

 (1) Make sure that the "arch_spinlock_t" and an "unsigned int" can fit
     in an aligned u64, and have a "cmpxchg()" implementation that works
     on such a u64 data type.

 (2) define a helper function to test for a spinlock being unlocked
     ("arch_spin_value_unlocked()")

 (3) select the "ARCH_USE_CMPXCHG_LOCKREF" config variable in its
     Kconfig file.

This enables it for x86-64 (but not 32-bit, we'd need to make sure
cmpxchg() turns into the proper cmpxchg8b in order to enable it for
32-bit mode).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-09-02 12:12:15 -07:00
Linus Torvalds
2f4f12e571 lockref: uninline lockref helper functions
They aren't very good to inline, since they already call external
functions (the spinlock code), and we're going to create rather more
complicated versions of them that can do the reference count updates
locklessly.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-09-02 11:58:20 -07:00
Linus Torvalds
15570086b5 vfs: reimplement d_rcu_to_refcount() using lockref_get_or_lock()
This moves __d_rcu_to_refcount() from <linux/dcache.h> into fs/namei.c
and re-implements it using the lockref infrastructure instead.  It also
adds a lot of comments about what is actually going on, because turning
a dentry that was looked up using RCU into a long-lived reference
counted entry is one of the more subtle parts of the rcu walk.

We also used to be _particularly_ subtle in unlazy_walk() where we
re-validate both the dentry and its parent using the same sequence
count.  We used to do it by nesting the locks and then verifying the
sequence count just once.

That was silly, because nested locking is expensive, but the sequence
count check is not.  So this just re-validates the dentry and the parent
separately, avoiding the nested locking, and making the lockref lookup
possible.

Acked-by: Waiman Long <waiman.long@hp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-09-02 11:38:06 -07:00
Waiman Long
df3d0bbcdb vfs: use lockref_get_not_zero() for optimistic lockless dget_parent()
A valid parent pointer is always going to have a non-zero reference
count, but if we look up the parent optimistically without locking, we
have to protect against the (very unlikely) race against renaming
changing the parent from under us.

We do that by using lockref_get_not_zero(), and then re-checking the
parent pointer after getting a valid reference.

[ This is a re-implementation of a chunk from the original patch by
  Waiman Long: "dcache: Enable lockless update of dentry's refcount".
  I've completely rewritten the patch-series and split it up, but I'm
  attributing this part to Waiman as it's close enough to his earlier
  patch  - Linus ]

Signed-off-by: Waiman Long <Waiman.Long@hp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-09-02 11:29:22 -07:00
Linus Torvalds
b3abd80250 lockref: add 'lockref_get_or_lock() helper
This behaves like "lockref_get_not_zero()", but instead of doing nothing
if the count was zero, it returns with the lock held.

This allows callers to revalidate the lockref-protected data structure
if required even if the count was zero to begin with, and possibly
increment the count if it passes muster.

In particular, the dentry code wants this when it wants to turn an
RCU-protected dentry into a stable refcounted one: if the dentry count
it zero, but the sequence number still validates the dentry, we can take
a reference to it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-09-02 11:14:19 -07:00
Linus Torvalds
248d296d6d SCSI fixes on 20130831
This is a bug fix for the pm80xx driver.  It turns out that when the new
 hardware support was added in 3.10 the IO command size was kept at the old
 hard coded value.  This means that the driver attaches to some new cards and
 then simply hangs the system.
 
 Signed-off-by: James Bottomley <JBottomley@Parallels.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQEcBAABAgAGBQJSIh8wAAoJEDeqqVYsXL0MCOIH/3Ii/4xKN7BK/G7UYVj7QuIu
 lxmshuc6FUJJkg4fZiV3oHQgkYiUoOOYTVWg+rEKycE1XZS8b3E5BVTlM2+NHezo
 OcjFmctDb5HrElbBL7BrsJwNwSeSL+ATZEqPuOoXQ+CIJ9pkFwm3u1ernDLsM0bB
 PuDRn1duAbyUscHNqYsInpg2a21F1cuoLIzz/ziHgXtjRre30An2wZjmNVwDKeaY
 UhnCvjUy37LFFWL3mLVaS0fhkCS484uKRyloX0FJdLgtfzGvOFGF01f02gmcziti
 o0+PqIhV2wPvGpiNea761JN5opxc/IhhhPapR0kaj9Qig79TP9wjEZ8ynnQvvG4=
 =i73i
 -----END PGP SIGNATURE-----

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

Pull SCSI fix from James Bottomley:
 "This is a bug fix for the pm80xx driver.  It turns out that when the
  new hardware support was added in 3.10 the IO command size was kept at
  the old hard coded value.  This means that the driver attaches to some
  new cards and then simply hangs the system"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  [SCSI] pm80xx: fix Adaptec 71605H hang
2013-09-02 10:43:13 -07:00
Linus Torvalds
e09a1fa9be Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 boot fix from Peter Anvin:
 "A single very small boot fix for very large memory systems (> 0.5T)"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/mm: Fix boot crash with DEBUG_PAGE_ALLOC=y and more than 512G RAM
2013-09-02 09:55:14 -07:00
Linus Torvalds
ac0bc7899a Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dma fix from Vinod Koul:
 "A fix for resolving TI_EDMA driver's build error in allmodconfig to
  have filter function built in""

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dma/Kconfig: TI_EDMA needs to be boolean
2013-09-02 09:54:06 -07:00
Mark Brown
5787392598 Merge remote-tracking branch 'spi/topic/txx9' into spi-next 2013-09-01 13:49:18 +01:00
Mark Brown
961722f57c Merge remote-tracking branch 'spi/topic/topcliff' into spi-next 2013-09-01 13:49:17 +01:00
Mark Brown
989e694647 Merge remote-tracking branch 'spi/topic/tle62x0' into spi-next 2013-09-01 13:49:15 +01:00
Mark Brown
58737f127a Merge remote-tracking branch 'spi/topic/tel62x0' into spi-next 2013-09-01 13:49:14 +01:00
Mark Brown
e7c57cc124 Merge remote-tracking branch 'spi/topic/tegra' into spi-next 2013-09-01 13:49:13 +01:00
Mark Brown
a3e412dcf5 Merge remote-tracking branch 'spi/topic/sirf' into spi-next 2013-09-01 13:49:12 +01:00
Mark Brown
368ce0bca4 Merge remote-tracking branch 'spi/topic/sh-msiof' into spi-next 2013-09-01 13:49:11 +01:00
Mark Brown
874915ed4b Merge remote-tracking branch 'spi/topic/sh-hspi' into spi-next 2013-09-01 13:49:10 +01:00
Mark Brown
2dc745b6ef Merge remote-tracking branch 'spi/topic/s3c64xx' into spi-next 2013-09-01 13:49:09 +01:00
Mark Brown
121a39661b Merge remote-tracking branch 'spi/topic/rspi' into spi-next 2013-09-01 13:49:08 +01:00
Mark Brown
278ac33bbd Merge remote-tracking branch 'spi/topic/quad' into spi-next 2013-09-01 13:49:07 +01:00
Mark Brown
85cac43132 Merge remote-tracking branch 'spi/topic/qspi' into spi-next 2013-09-01 13:49:06 +01:00
Mark Brown
793b3cb6ac Merge remote-tracking branch 'spi/topic/pxa' into spi-next 2013-09-01 13:49:05 +01:00
Mark Brown
720ed2d130 Merge remote-tracking branch 'spi/topic/pl022' into spi-next 2013-09-01 13:49:04 +01:00
Mark Brown
68aa4cb337 Merge remote-tracking branch 'spi/topic/pdata' into spi-next 2013-09-01 13:49:03 +01:00
Mark Brown
11c28cfc1e Merge remote-tracking branch 'spi/topic/orion' into spi-next 2013-09-01 13:49:02 +01:00
Mark Brown
4374f332d9 Merge remote-tracking branch 'spi/topic/omap-100k' into spi-next 2013-09-01 13:49:01 +01:00
Mark Brown
45bb5065e1 Merge remote-tracking branch 'spi/topic/octeon' into spi-next 2013-09-01 13:49:00 +01:00
Mark Brown
455765f02e Merge remote-tracking branch 'spi/topic/nuc900' into spi-next 2013-09-01 13:48:59 +01:00
Mark Brown
7c2fde9b1a Merge remote-tracking branch 'spi/topic/mxs' into spi-next 2013-09-01 13:48:59 +01:00
Mark Brown
9020b75467 Merge remote-tracking branch 'spi/topic/msglen' into spi-next 2013-09-01 13:48:58 +01:00
Mark Brown
84c86edab3 Merge remote-tracking branch 'spi/topic/mpc512x' into spi-next 2013-09-01 13:48:57 +01:00
Mark Brown
4faad26c27 Merge remote-tracking branch 'spi/topic/ioremap' into spi-next 2013-09-01 13:48:56 +01:00
Mark Brown
8e37befc5c Merge remote-tracking branch 'spi/topic/imx' into spi-next 2013-09-01 13:48:55 +01:00
Mark Brown
497cb4473a Merge remote-tracking branch 'spi/topic/ep93xx' into spi-next 2013-09-01 13:48:54 +01:00
Mark Brown
afa8f0cd6c Merge remote-tracking branch 'spi/topic/efm32' into spi-next 2013-09-01 13:48:53 +01:00
Mark Brown
2f2613b028 Merge remote-tracking branch 'spi/topic/dspi' into spi-next 2013-09-01 13:48:52 +01:00
Mark Brown
96b1a28d65 Merge remote-tracking branch 'spi/topic/doc' into spi-next 2013-09-01 13:48:51 +01:00
Mark Brown
b49247907d Merge remote-tracking branch 'spi/topic/davinci' into spi-next 2013-09-01 13:48:51 +01:00
Mark Brown
7e718b4bd2 Merge remote-tracking branch 'spi/topic/core' into spi-next 2013-09-01 13:48:50 +01:00
Mark Brown
1f54f94284 Merge remote-tracking branch 'spi/topic/clps711x' into spi-next 2013-09-01 13:48:49 +01:00
Mark Brown
db04e17055 Merge remote-tracking branch 'spi/topic/checks' into spi-next 2013-09-01 13:48:48 +01:00
Mark Brown
788a739676 Merge remote-tracking branch 'spi/topic/build' into spi-next 2013-09-01 13:48:47 +01:00
Mark Brown
8e28fb63a7 Merge remote-tracking branch 'spi/topic/bpw' into spi-next 2013-09-01 13:48:46 +01:00
Mark Brown
f1632c3278 Merge remote-tracking branch 'spi/topic/blackfin-v3' into spi-next 2013-09-01 13:48:45 +01:00
Mark Brown
b29bc3df37 Merge remote-tracking branch 'spi/topic/bitbang' into spi-next 2013-09-01 13:48:44 +01:00
Mark Brown
c3dbe2b76a Merge remote-tracking branch 'spi/topic/bcm2835' into spi-next 2013-09-01 13:48:44 +01:00
Mark Brown
5264af0ca6 Merge remote-tracking branch 'spi/topic/atmel' into spi-next 2013-09-01 13:48:43 +01:00