platform/adaptation/renesas_rcar/renesas_kernel.git
10 years agolockref: implement lockless reference count updates using cmpxchg()
Linus Torvalds [Mon, 2 Sep 2013 19:12:15 +0000 (12:12 -0700)]
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>
10 years agolockref: uninline lockref helper functions
Linus Torvalds [Mon, 2 Sep 2013 18:58:20 +0000 (11:58 -0700)]
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>
10 years agovfs: reimplement d_rcu_to_refcount() using lockref_get_or_lock()
Linus Torvalds [Mon, 2 Sep 2013 18:38:06 +0000 (11:38 -0700)]
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>
10 years agovfs: use lockref_get_not_zero() for optimistic lockless dget_parent()
Waiman Long [Mon, 2 Sep 2013 18:29:22 +0000 (11:29 -0700)]
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>
10 years agolockref: add 'lockref_get_or_lock() helper
Linus Torvalds [Mon, 2 Sep 2013 18:14:19 +0000 (11:14 -0700)]
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>
10 years agoMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Linus Torvalds [Mon, 2 Sep 2013 17:43:13 +0000 (10:43 -0700)]
Merge tag 'scsi-fixes' of git://git./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

10 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 2 Sep 2013 16:55:14 +0000 (09:55 -0700)]
Merge branch 'x86-urgent-for-linus' of git://git./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

10 years agoMerge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Mon, 2 Sep 2013 16:54:06 +0000 (09:54 -0700)]
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

10 years agoMerge remote-tracking branch 'regulator/topic/tps65912' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:23 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/tps65912' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/ti-abb' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:22 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/ti-abb' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/sec' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:21 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/sec' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/ramp' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:20 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/ramp' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/pfuze100' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:18 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/pfuze100' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/palmas' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:17 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/palmas' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/optional' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:17 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/optional' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/max8660' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:16 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/max8660' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/lp8755' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:14 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/lp8755' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/lp872x' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:13 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/lp872x' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/linear-range' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:12 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/linear-range' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/kconfig' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:11 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/kconfig' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/helpers' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:09 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/helpers' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/fan53555' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:08 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/fan53555' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/da9063' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:07 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/da9063' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/core' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:06 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/core' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/as3711' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:05 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/as3711' into regulator-next

10 years agoMerge remote-tracking branch 'regulator/topic/88pm800' into regulator-next
Mark Brown [Sun, 1 Sep 2013 12:50:04 +0000 (13:50 +0100)]
Merge remote-tracking branch 'regulator/topic/88pm800' into regulator-next

10 years agoMerge remote-tracking branch 'spi/topic/txx9' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:18 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/txx9' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/topcliff' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:17 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/topcliff' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/tle62x0' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:15 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/tle62x0' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/tel62x0' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:14 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/tel62x0' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/tegra' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:13 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/tegra' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/sirf' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:12 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/sirf' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/sh-msiof' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:11 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/sh-msiof' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/sh-hspi' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:10 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/sh-hspi' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/s3c64xx' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:09 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/s3c64xx' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/rspi' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:08 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/rspi' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/quad' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:07 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/quad' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/qspi' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:06 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/qspi' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/pxa' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:05 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/pxa' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/pl022' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:04 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/pl022' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/pdata' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:03 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/pdata' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/orion' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:02 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/orion' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/omap-100k' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:01 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/omap-100k' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/octeon' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:49:00 +0000 (13:49 +0100)]
Merge remote-tracking branch 'spi/topic/octeon' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/nuc900' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:59 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/nuc900' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/mxs' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:59 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/mxs' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/msglen' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:58 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/msglen' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/mpc512x' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:57 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/mpc512x' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/ioremap' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:56 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/ioremap' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/imx' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:55 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/imx' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/ep93xx' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:54 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/ep93xx' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/efm32' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:53 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/efm32' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/dspi' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:52 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/dspi' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/doc' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:51 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/doc' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/davinci' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:51 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/davinci' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/core' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:50 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/core' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/clps711x' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:49 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/clps711x' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/checks' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:48 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/checks' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/build' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:47 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/build' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/bpw' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:46 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/bpw' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/blackfin-v3' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:45 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/blackfin-v3' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/bitbang' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:44 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/bitbang' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/bcm2835' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:44 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/bcm2835' into spi-next

10 years agoMerge remote-tracking branch 'spi/topic/atmel' into spi-next
Mark Brown [Sun, 1 Sep 2013 12:48:43 +0000 (13:48 +0100)]
Merge remote-tracking branch 'spi/topic/atmel' into spi-next

10 years agospi/qspi: fix missing unlock on error in ti_qspi_start_transfer_one()
Wei Yongjun [Sun, 1 Sep 2013 01:01:00 +0000 (09:01 +0800)]
spi/qspi: fix missing unlock on error in ti_qspi_start_transfer_one()

Add the missing unlock before return from function ti_qspi_start_transfer_one()
in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agospi: quad: fix the name of DT property
wangyuhang [Sun, 1 Sep 2013 09:36:21 +0000 (17:36 +0800)]
spi: quad: fix the name of DT property

spi: quad: fix the name of DT property in patch

The previous property name spi-tx-nbits and spi-rx-nbits looks not
human-readable. To make it consistent with other devices, using property
name spi-tx-bus-width and spi-rx-bus-width instead of the previous one
specify the number of data wires that spi controller will work in.
Add the specification in spi-bus.txt.

Signed-off-by: wangyuhang <wangyuhang2014@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoregulator: da9063: Statize da9063_ldo_lim_event
Axel Lin [Sun, 1 Sep 2013 04:19:51 +0000 (12:19 +0800)]
regulator: da9063: Statize da9063_ldo_lim_event

da9063_ldo_lim_event() is only referenced in this driver, make it static.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agotarget: Fix se_cmd->state_list leak regression during WRITE failure
Nicholas Bellinger [Sat, 31 Aug 2013 22:12:01 +0000 (15:12 -0700)]
target: Fix se_cmd->state_list leak regression during WRITE failure

This patch addresses a v3.11 specific regression where se_cmd->state_list
was being leaked during a fabric WRITE failure, when the fabric releases
an associated se_cmd descriptor before I/O submission occurs, and normal
fast path callbacks have a chance to call target_remove_from_state_list().

It was manifesting with Poison overwritten messages with iscsi-target
once an ImmediateData payload CRC32C failure occured.

This bug was originally introduced during v3.11-rc1 with the following
commit:

commit 0b66818ac6de67a6125ae203272fb76e79b3a20f
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Thu Jun 6 01:36:41 2013 -0700

    target: Drop unnecessary CMD_T_DEV_ACTIVE check from transport_lun_remove_cmd

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
10 years agoMerge branches 'doc.2013.08.19a', 'fixes.2013.08.20a', 'sysidle.2013.08.31a' and...
Paul E. McKenney [Sat, 31 Aug 2013 21:44:45 +0000 (14:44 -0700)]
Merge branches 'doc.2013.08.19a', 'fixes.2013.08.20a', 'sysidle.2013.08.31a' and 'torture.2013.08.20a' into HEAD

doc.2013.08.19a: Documentation updates
fixes.2013.08.20a: Miscellaneous fixes
sysidle.2013.08.31a: Detect system-wide idle state.
torture.2013.08.20a: rcutorture updates.

10 years agonohz_full: Force RCU's grace-period kthreads onto timekeeping CPU
Paul E. McKenney [Sat, 22 Jun 2013 00:10:40 +0000 (17:10 -0700)]
nohz_full: Force RCU's grace-period kthreads onto timekeeping CPU

Because RCU's quiescent-state-forcing mechanism is used to drive the
full-system-idle state machine, and because this mechanism is executed
by RCU's grace-period kthreads, this commit forces these kthreads to
run on the timekeeping CPU (tick_do_timer_cpu).  To do otherwise would
mean that the RCU grace-period kthreads would force the system into
non-idle state every time they drove the state machine, which would
be just a bit on the futile side.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
10 years agonohz_full: Add full-system-idle state machine
Paul E. McKenney [Fri, 21 Jun 2013 23:37:22 +0000 (16:37 -0700)]
nohz_full: Add full-system-idle state machine

This commit adds the state machine that takes the per-CPU idle data
as input and produces a full-system-idle indication as output.  This
state machine is driven out of RCU's quiescent-state-forcing
mechanism, which invokes rcu_sysidle_check_cpu() to collect per-CPU
idle state and then rcu_sysidle_report() to drive the state machine.

The full-system-idle state is sampled using rcu_sys_is_idle(), which
also drives the state machine if RCU is idle (and does so by forcing
RCU to become non-idle).  This function returns true if all but the
timekeeping CPU (tick_do_timer_cpu) are idle and have been idle long
enough to avoid memory contention on the full_sysidle_state state
variable.  The rcu_sysidle_force_exit() may be called externally
to reset the state machine back into non-idle state.

For large systems the state machine is driven out of RCU's
force-quiescent-state logic, which provides good scalability at the price
of millisecond-scale latencies on the transition to full-system-idle
state.  This is not so good for battery-powered systems, which are usually
small enough that they don't need to care about scalability, but which
do care deeply about energy efficiency.  Small systems therefore drive
the state machine directly out of the idle-entry code.  The number of
CPUs in a "small" system is defined by a new NO_HZ_FULL_SYSIDLE_SMALL
Kconfig parameter, which defaults to 8.  Note that this is a build-time
definition.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
[ paulmck: Use true and false for boolean constants per Lai Jiangshan. ]
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
[ paulmck: Simplify logic and provide better comments for memory barriers,
  based on review comments and questions by Lai Jiangshan. ]

10 years agoMerge remote-tracking branch 'regmap/topic/sparse' into regmap-next
Mark Brown [Sat, 31 Aug 2013 18:25:16 +0000 (19:25 +0100)]
Merge remote-tracking branch 'regmap/topic/sparse' into regmap-next

10 years agoMerge remote-tracking branch 'regmap/topic/rbtree' into regmap-next
Mark Brown [Sat, 31 Aug 2013 18:25:15 +0000 (19:25 +0100)]
Merge remote-tracking branch 'regmap/topic/rbtree' into regmap-next

10 years agoMerge remote-tracking branch 'regmap/topic/range' into regmap-next
Mark Brown [Sat, 31 Aug 2013 18:25:14 +0000 (19:25 +0100)]
Merge remote-tracking branch 'regmap/topic/range' into regmap-next

10 years agoMerge remote-tracking branch 'regmap/topic/patch' into regmap-next
Mark Brown [Sat, 31 Aug 2013 18:25:13 +0000 (19:25 +0100)]
Merge remote-tracking branch 'regmap/topic/patch' into regmap-next

10 years agoMerge remote-tracking branch 'regmap/topic/irq' into regmap-next
Mark Brown [Sat, 31 Aug 2013 18:25:12 +0000 (19:25 +0100)]
Merge remote-tracking branch 'regmap/topic/irq' into regmap-next

10 years agoMerge remote-tracking branch 'regmap/topic/cache' into regmap-next
Mark Brown [Sat, 31 Aug 2013 18:25:11 +0000 (19:25 +0100)]
Merge remote-tracking branch 'regmap/topic/cache' into regmap-next

10 years agospi: core: Fix spi_register_master error handling
Axel Lin [Sat, 31 Aug 2013 12:25:52 +0000 (20:25 +0800)]
spi: core: Fix spi_register_master error handling

In the case spi_master_initialize_queue() fails, current code calls
device_unregister() before return error from spi_register_master().
However, all the drivers call spi_master_put() in the error path if
spi_register_master() fails. Thus we should call device_del() rather than
device_unregister() before return error from spi_register_master().

This also makes all the spi_register_master() error handling consistent,
because all other error paths of spi_register_master() expect drivers to
call spi_master_put() if spi_register_master() fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agospi: efm32: Fix build error
Axel Lin [Sat, 31 Aug 2013 14:27:27 +0000 (22:27 +0800)]
spi: efm32: Fix build error

Obviously the of_device_id table name is wrong.

Fix below build error:

  CC [M]  drivers/spi/spi-efm32.o
drivers/spi/spi-efm32.c:499:1: error: '__mod_of_device_table' aliased to undefined symbol 'efm32_uart_dt_ids'
make[2]: *** [drivers/spi/spi-efm32.o] Error 1
make[1]: *** [drivers/spi] Error 2
make: *** [drivers] Error 2

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agospi: altera: Use DIV_ROUND_UP to calculate hw->bytes_per_word
Axel Lin [Thu, 29 Aug 2013 15:41:20 +0000 (23:41 +0800)]
spi: altera: Use DIV_ROUND_UP to calculate hw->bytes_per_word

The Altera SPI hardware can be configured to support data width from 1 to 32
since Quartus II 8.1. To avoid truncation by integer division, use DIV_ROUND_UP
to calculate hw->bytes_per_word.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agospi: rspi: Add spi_master_get() call to prevent use after free
Axel Lin [Sat, 31 Aug 2013 11:42:56 +0000 (19:42 +0800)]
spi: rspi: Add spi_master_get() call to prevent use after free

In rspi_remove(), current code dereferences rspi after spi_unregister_master(),
thus add an extra spi_master_get() call is necessary to prevent use after free.

Current code already has an extra spi_master_put() call in rspi_remove(), so
this patch just adds a spi_master_get() call rather than a spi_master_get() with
spi_master_put() calls.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agousbcore: fix incorrect type in assignment in descriptors_changed()
Xenia Ragiadakou [Sat, 31 Aug 2013 01:40:49 +0000 (04:40 +0300)]
usbcore: fix incorrect type in assignment in descriptors_changed()

This patch fixes the incorrect assignment of a variable with type 'le16'
to a variable with type 'unsigned int'.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Sat, 31 Aug 2013 00:43:17 +0000 (17:43 -0700)]
Merge git://git./linux/kernel/git/davem/net

Pull networking fixes from David Miller:

 1) There was a simplification in the ipv6 ndisc packet sending
    attempted here, which avoided using memory accounting on the
    per-netns ndisc socket for sending NDISC packets.  It did fix some
    important issues, but it causes regressions so it gets reverted here
    too.  Specifically, the problem with this change is that the IPV6
    output path really depends upon there being a valid skb->sk
    attached.

    The reason we want to do this change in some form when we figure out
    how to do it right, is that if a device goes down the ndisc_sk
    socket send queue will fill up and block NDISC packets that we want
    to send to other devices too.  That's really bad behavior.

    Hopefully Thomas can come up with a better version of this change.

 2) Fix a severe TCP performance regression by reverting a change made
    to dev_pick_tx() quite some time ago.  From Eric Dumazet.

 3) TIPC returns wrongly signed error codes, fix from Erik Hugne.

 4) Fix OOPS when doing IPSEC over ipv4 tunnels due to orphaning the
    skb->sk too early.  Fix from Li Hongjun.

 5) RAW ipv4 sockets can use the wrong routing key during lookup, from
    Chris Clark.

 6) Similar to #1 revert an older change that tried to use plain
    alloc_skb() for SYN/ACK TCP packets, this broke the netfilter owner
    mark which needs to see the skb->sk for such frames.  From Phil
    Oester.

 7) BNX2x driver bug fixes from Ariel Elior and Yuval Mintz,
    specifically in the handling of virtual functions.

 8) IPSEC path error propagations to sockets is not done properly when
    we have v4 in v6, and v6 in v4 type rules.  Fix from Hannes Frederic
    Sowa.

 9) Fix missing channel context release in mac80211, from Johannes Berg.

10) Fix network namespace handing wrt.  SCM_RIGHTS, from Andy
    Lutomirski.

11) Fix usage of bogus NAPI weight in jme, netxen, and ps3_gelic
    drivers.  From Michal Schmidt.

12) Hopefully a complete and correct fix for the genetlink dump locking
    and module reference counting.  From Pravin B Shelar.

13) sk_busy_loop() must do a cpu_relax(), from Eliezer Tamir.

14) Fix handling of timestamp offset when restoring a snapshotted TCP
    socket.  From Andrew Vagin.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (44 commits)
  net: fec: fix time stamping logic after napi conversion
  net: bridge: convert MLDv2 Query MRC into msecs_to_jiffies for max_delay
  mISDN: return -EINVAL on error in dsp_control_req()
  net: revert 8728c544a9c ("net: dev_pick_tx() fix")
  Revert "ipv6: Don't depend on per socket memory for neighbour discovery messages"
  ipv4 tunnels: fix an oops when using ipip/sit with IPsec
  tipc: set sk_err correctly when connection fails
  tcp: tcp_make_synack() should use sock_wmalloc
  bridge: separate querier and query timer into IGMP/IPv4 and MLD/IPv6 ones
  ipv6: Don't depend on per socket memory for neighbour discovery messages
  ipv4: sendto/hdrincl: don't use destination address found in header
  tcp: don't apply tsoffset if rcv_tsecr is zero
  tcp: initialize rcv_tstamp for restored sockets
  net: xilinx: fix memleak
  net: usb: Add HP hs2434 device to ZLP exception table
  net: add cpu_relax to busy poll loop
  net: stmmac: fixed the pbl setting with DT
  genl: Hold reference on correct module while netlink-dump.
  genl: Fix genl dumpit() locking.
  xfrm: Fix potential null pointer dereference in xdst_queue_output
  ...

10 years agospi: quad: Make DT properties optional
Mark Brown [Fri, 30 Aug 2013 22:19:40 +0000 (23:19 +0100)]
spi: quad: Make DT properties optional

The addition SPI quad support made the DT properties mandatory, breaking
compatibility with existing systems. Fix that by making them optional,
also improving the error messages while we're at it.

Signed-off-by: Mark Brown <broonie@linaro.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
10 years agoMAINTAINERS: change my DT related maintainer address
Ian Campbell [Fri, 30 Aug 2013 08:50:42 +0000 (09:50 +0100)]
MAINTAINERS: change my DT related maintainer address

Filtering capabilities on my work email are pretty much non-existent and this
has turned out to be something of a firehose...

Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Olof Johansson <olof@lixom.net>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoMerge tag 'sound-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Sat, 31 Aug 2013 00:05:02 +0000 (17:05 -0700)]
Merge tag 'sound-3.11' of git://git./linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "This contains two Oops fixes (opti9xx and HD-audio) and a simple fixup
  for an Acer laptop.  All marked as stable patches"

* tag 'sound-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: opti9xx: Fix conflicting driver object name
  ALSA: hda - Fix NULL dereference with CONFIG_SND_DYNAMIC_MINORS=n
  ALSA: hda - Add inverted digital mic fixup for Acer Aspire One

10 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Fri, 30 Aug 2013 23:18:59 +0000 (16:18 -0700)]
Merge tag 'fixes-for-linus' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "Two straggling fixes that I had missed as they were posted a couple of
  weeks ago, causing problems with interrupts (breaking them completely)
  on the CSR SiRF platforms"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  arm: prima2: drop nr_irqs in mach as we moved to linear irqdomain
  irqchip: sirf: move from legacy mode to linear irqdomain

10 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Fri, 30 Aug 2013 23:17:10 +0000 (16:17 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Since we are getting to the pointy end, one i915 black screen on some
  machines, and one vmwgfx stop userspace ability to nuke the VM,

  There might be one or two ati or nouveau fixes trickle in before
  final, but I think this should pretty much be it"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/vmwgfx: Split GMR2_REMAP commands if they are to large
  drm/i915: ivb: fix edp voltage swing reg val

10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Fri, 30 Aug 2013 23:15:52 +0000 (16:15 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/dtor/input

Pull input layer updates from Dmitry Torokhov:
 "Just a couple of new IDs in Wacom and xpad drivers, i8042 is now
  disabled on ARC, and data checks in Elantech driver that were overly
  relaxed by the previous patch are now tightened"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: i8042 - disable the driver on ARC platforms
  Input: xpad - add signature for Razer Onza Classic Edition
  Input: elantech - fix packet check for v3 and v4 hardware
  Input: wacom - add support for 0x300 and 0x301

10 years agopstore/ram: (really) fix undefined usage of rounddown_pow_of_two
Maxime Bizon [Fri, 30 Aug 2013 16:06:41 +0000 (18:06 +0200)]
pstore/ram: (really) fix undefined usage of rounddown_pow_of_two

Previous attempt to fix was b042e47491ba5f487601b5141a3f1d8582304170

Suggested use of is_power_of_2() was bogus because is_power_of_2(0) is
false (documented behaviour).

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
10 years agonet: fec: fix time stamping logic after napi conversion
Richard Cochran [Fri, 30 Aug 2013 18:28:10 +0000 (20:28 +0200)]
net: fec: fix time stamping logic after napi conversion

Commit dc975382 "net: fec: add napi support to improve proformance"
converted the fec driver to the napi model. However, that commit
forgot to remove the call to skb_defer_rx_timestamp which is only
needed in non-napi drivers.

(The function napi_gro_receive eventually calls netif_receive_skb,
which in turn calls skb_defer_rx_timestamp.)

This patch should also be applied to the 3.9 and 3.10 kernels.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: bridge: convert MLDv2 Query MRC into msecs_to_jiffies for max_delay
Daniel Borkmann [Thu, 29 Aug 2013 21:55:05 +0000 (23:55 +0200)]
net: bridge: convert MLDv2 Query MRC into msecs_to_jiffies for max_delay

While looking into MLDv1/v2 code, I noticed that bridging code does
not convert it's max delay into jiffies for MLDv2 messages as we do
in core IPv6' multicast code.

RFC3810, 5.1.3. Maximum Response Code says:

  The Maximum Response Code field specifies the maximum time allowed
  before sending a responding Report. The actual time allowed, called
  the Maximum Response Delay, is represented in units of milliseconds,
  and is derived from the Maximum Response Code as follows: [...]

As we update timers that work with jiffies, we need to convert it.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Linus Lüssing <linus.luessing@web.de>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agospi: quad: Fix missing return
wangyuhang [Fri, 30 Aug 2013 10:05:10 +0000 (18:05 +0800)]
spi: quad: Fix missing return

Delete a "return" when commit the patch to a new kernel version
 by mistake. So recover it.

Signed-off-by: wangyuhang <wangyuhang2014@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agomISDN: return -EINVAL on error in dsp_control_req()
Dan Carpenter [Thu, 29 Aug 2013 08:47:00 +0000 (11:47 +0300)]
mISDN: return -EINVAL on error in dsp_control_req()

If skb->len is too short then we should return an error.  Otherwise we
read beyond the end of skb->data for several bytes.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: revert 8728c544a9c ("net: dev_pick_tx() fix")
Eric Dumazet [Thu, 29 Aug 2013 01:10:43 +0000 (18:10 -0700)]
net: revert 8728c544a9c ("net: dev_pick_tx() fix")

commit 8728c544a9cbdc ("net: dev_pick_tx() fix") and commit
b6fe83e9525a ("bonding: refine IFF_XMIT_DST_RELEASE capability")
are quite incompatible : Queue selection is disabled because skb
dst was dropped before entering bonding device.

This causes major performance regression, mainly because TCP packets
for a given flow can be sent to multiple queues.

This is particularly visible when using the new FQ packet scheduler
with MQ + FQ setup on the slaves.

We can safely revert the first commit now that 416186fbf8c5b
("net: Split core bits of netdev_pick_tx into __netdev_pick_tx")
properly caps the queue_index.

Reported-by: Xi Wang <xii@google.com>
Diagnosed-by: Xi Wang <xii@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Alexander Duyck <alexander.h.duyck@intel.com>
Cc: Denys Fedorysychenko <nuclearcat@nuclearcat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoRevert "ipv6: Don't depend on per socket memory for neighbour discovery messages"
David S. Miller [Fri, 30 Aug 2013 21:39:33 +0000 (17:39 -0400)]
Revert "ipv6: Don't depend on per socket memory for neighbour discovery messages"

This reverts commit 1f324e38870cc09659cf23bc626f1b8869e201f2.

It seems to cause regressions, and in particular the output path
really depends upon there being a socket attached to skb->sk for
checks such as sk_mc_loop(skb->sk) for example.  See ip6_output_finish2().

Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Reported-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodrivers: uio: Kconfig: add MMU dependancy for UIO
Chen Gang [Fri, 30 Aug 2013 05:01:45 +0000 (13:01 +0800)]
drivers: uio: Kconfig: add MMU dependancy for UIO

The User space I/O drivers are useful, only when user space meaningful
(MMU must be enabled).

So need let it depend on MMU, or can not pass compiling, the related
error (allmodconfig for H8300):

    CC [M]  drivers/uio/uio.o
  drivers/uio/uio.c: In function 'uio_mmap_physical':
  drivers/uio/uio.c:650:2: error: implicit declaration of function 'pgprot_noncached' [-Werror=implicit-function-declaration]
  drivers/uio/uio.c:650:20: error: incompatible types when assigning to type 'pgprot_t' from type 'int'

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dwc2: make dwc2_core_params documentation more complete
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:23 +0000 (18:45 +0200)]
staging: dwc2: make dwc2_core_params documentation more complete

Some of the defaults were missing or unclear. In particular, I suspect
the defaults were documented assuming there were still module parameters
and taking the default module parameters into account. Now, the defaults
are the values that will get chosen when the params passed to
dwc2_hcd_init are all -1.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dwc2: validate the value for phy_utmi_width
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:22 +0000 (18:45 +0200)]
staging: dwc2: validate the value for phy_utmi_width

The HWCFG4 register stores the supported utmi width values (8, 16 or
both). This commit reads that value and validates the configured value
against that.

If no (valid) value is given, the parameter defaulted to 8 bits
previously.  However, the documentation for dwc2_core_params_struct
suggests that the default should have been 16. Also, the pci bindings
explicitely set the value to 16, so this commit changes the default to
16 bits (if supported, 8 bits otherwise).

With the default changed, the value set in pci.c is changed to -1 to
make it autodetected as well.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dwc2: interpret all hwcfg and related register at init time
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:21 +0000 (18:45 +0200)]
staging: dwc2: interpret all hwcfg and related register at init time

Before, the hwcfg registers were read at device init time, but
interpreted at various parts in the code. This commit unpacks the hwcfg
register values into a struct with properly labeled variables at init
time, which makes all the other code using these values more consise and
easier to read. Some values that were previously stored in the hsotg
struct are now moved into this new struct as well.

In addition to the hwcfg registers, the contents of some fifo size
registers are also unpacked. The hwcfg registers are read-only, so they
can be safely stored. The fifo size registers are read-write registers,
but their power-on values are significant: they give the maximum depth
of the fifo they describe.

This commit mostly moves code, but also attempts to simplify some
expressions from (val >> shift) & (mask >> shift) to
(val & mask) >> shift.

Finally, all of the parameters read from the hardware are debug printed
after unpacking them, so a bunch of debug prints can be removed from
other places.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>