deliverable/linux.git
12 years agoi387: don't ever touch TS_USEDFPU directly, use helper functions
Linus Torvalds [Thu, 16 Feb 2012 21:33:12 +0000 (13:33 -0800)] 
i387: don't ever touch TS_USEDFPU directly, use helper functions

This creates three helper functions that do the TS_USEDFPU accesses, and
makes everybody that used to do it by hand use those helpers instead.

In addition, there's a couple of helper functions for the "change both
CR0.TS and TS_USEDFPU at the same time" case, and the places that do
that together have been changed to use those.  That means that we have
fewer random places that open-code this situation.

The intent is partly to clarify the code without actually changing any
semantics yet (since we clearly still have some hard to reproduce bug in
this area), but also to make it much easier to use another approach
entirely to caching the CR0.TS bit for software accesses.

Right now we use a bit in the thread-info 'status' variable (this patch
does not change that), but we might want to make it a full field of its
own or even make it a per-cpu variable.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoi387: move TS_USEDFPU clearing out of __save_init_fpu and into callers
Linus Torvalds [Thu, 16 Feb 2012 20:22:48 +0000 (12:22 -0800)] 
i387: move TS_USEDFPU clearing out of __save_init_fpu and into callers

Touching TS_USEDFPU without touching CR0.TS is confusing, so don't do
it.  By moving it into the callers, we always do the TS_USEDFPU next to
the CR0.TS accesses in the source code, and it's much easier to see how
the two go hand in hand.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoi387: fix x86-64 preemption-unsafe user stack save/restore
Linus Torvalds [Thu, 16 Feb 2012 17:15:04 +0000 (09:15 -0800)] 
i387: fix x86-64 preemption-unsafe user stack save/restore

Commit 5b1cbac37798 ("i387: make irq_fpu_usable() tests more robust")
added a sanity check to the #NM handler to verify that we never cause
the "Device Not Available" exception in kernel mode.

However, that check actually pinpointed a (fundamental) race where we do
cause that exception as part of the signal stack FPU state save/restore
code.

Because we use the floating point instructions themselves to save and
restore state directly from user mode, we cannot do that atomically with
testing the TS_USEDFPU bit: the user mode access itself may cause a page
fault, which causes a task switch, which saves and restores the FP/MMX
state from the kernel buffers.

This kind of "recursive" FP state save is fine per se, but it means that
when the signal stack save/restore gets restarted, it will now take the
'#NM' exception we originally tried to avoid.  With preemption this can
happen even without the page fault - but because of the user access, we
cannot just disable preemption around the save/restore instruction.

There are various ways to solve this, including using the
"enable/disable_page_fault()" helpers to not allow page faults at all
during the sequence, and fall back to copying things by hand without the
use of the native FP state save/restore instructions.

However, the simplest thing to do is to just allow the #NM from kernel
space, but fix the race in setting and clearing CR0.TS that this all
exposed: the TS bit changes and the TS_USEDFPU bit absolutely have to be
atomic wrt scheduling, so while the actual state save/restore can be
interrupted and restarted, the act of actually clearing/setting CR0.TS
and the TS_USEDFPU bit together must not.

Instead of just adding random "preempt_disable/enable()" calls to what
is already excessively ugly code, this introduces some helper functions
that mostly mirror the "kernel_fpu_begin/end()" functionality, just for
the user state instead.

Those helper functions should probably eventually replace the other
ad-hoc CR0.TS and TS_USEDFPU tests too, but I'll need to think about it
some more: the task switching functionality in particular needs to
expose the difference between the 'prev' and 'next' threads, while the
new helper functions intentionally were written to only work with
'current'.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agodrm/exynos: added postclose to release resource.
Inki Dae [Wed, 15 Feb 2012 02:25:22 +0000 (11:25 +0900)] 
drm/exynos: added postclose to release resource.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: removed exynos_drm_fbdev_recreate function.
Inki Dae [Wed, 15 Feb 2012 02:25:21 +0000 (11:25 +0900)] 
drm/exynos: removed exynos_drm_fbdev_recreate function.

this function ins't needed anymore.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: fixed page flip issue.
Inki Dae [Wed, 15 Feb 2012 02:25:20 +0000 (11:25 +0900)] 
drm/exynos: fixed page flip issue.

with vblank_refcount = 1, there was the case that drm_vblank_put
is called by specific page flip function so this patch fixes the
issue.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: added possible_clones setup function.
Inki Dae [Wed, 15 Feb 2012 02:25:19 +0000 (11:25 +0900)] 
drm/exynos: added possible_clones setup function.

basically, all crtcs are possible to clone each other.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: removed pageflip_event_list init code when closed.
Joonyoung Shim [Wed, 15 Feb 2012 02:25:18 +0000 (11:25 +0900)] 
drm/exynos: removed pageflip_event_list init code when closed.

if one process is terminated by ctrl-c while two processes are
using pageflip feature then for last pageflip event,
user can't get poll from kernel side so this patch fixes the problem.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyoungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: changed priority of mixer layers.
Joonyoung Shim [Wed, 15 Feb 2012 02:25:17 +0000 (11:25 +0900)] 
drm/exynos: changed priority of mixer layers.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: Fix typo in exynos_mixer.c
Masanari Iida [Tue, 14 Feb 2012 07:52:41 +0000 (16:52 +0900)] 
drm/exynos: Fix typo in exynos_mixer.c

Correct spelling "sucessful" to "successful" in
drivers/gpu/drm/exynos/exynos_mixer.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agopowerpc/perf: power_pmu_start restores incorrect values, breaking frequency events
Anton Blanchard [Wed, 15 Feb 2012 18:48:22 +0000 (18:48 +0000)] 
powerpc/perf: power_pmu_start restores incorrect values, breaking frequency events

perf on POWER stopped working after commit e050e3f0a71b (perf: Fix
broken interrupt rate throttling). That patch exposed a bug in
the POWER perf_events code.

Since the PMCs count upwards and take an exception when the top bit
is set, we want to write 0x80000000 - left in power_pmu_start. We were
instead programming in left which effectively disables the counter
until we eventually hit 0x80000000. This could take seconds or longer.

With the patch applied I get the expected number of samples:

          SAMPLE events:       9948

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: <stable@kernel.org>
12 years agopowerpc/adb: Use set_current_state()
majianpeng [Fri, 3 Feb 2012 14:35:59 +0000 (14:35 +0000)] 
powerpc/adb: Use set_current_state()

Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc: Disable interrupts early in Program Check
Benjamin Herrenschmidt [Mon, 13 Feb 2012 20:42:18 +0000 (20:42 +0000)] 
powerpc: Disable interrupts early in Program Check

Program Check exceptions are the result of WARNs, BUGs, some
type of breakpoints, kprobe, and other illegal instructions.

We want interrupts (and thus preemption) to remain disabled
while doing the initial stage of testing the reason and
branching off to a debugger or kprobe, so we are still on
the original CPU which makes debugging easier in various cases.

This is how the code was intended, hence the local_irq_enable()
right in the middle of program_check_exception().

However, the assembly exception prologue for that exception was
incorrectly marked as enabling interrupts, which defeats that
(and records a redundant enable with lockdep).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc: Remove legacy iSeries from ppc64_defconfig
Stephen Rothwell [Tue, 14 Feb 2012 16:31:09 +0000 (16:31 +0000)] 
powerpc: Remove legacy iSeries from ppc64_defconfig

Since we are heading towards removing the Legacy iSeries platform, start
by no longer building it for ppc64_defconfig.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/fsl/pci: Fix PCIe fixup regression
Benjamin Herrenschmidt [Tue, 14 Feb 2012 18:22:20 +0000 (18:22 +0000)] 
powerpc/fsl/pci: Fix PCIe fixup regression

Upstream changes to the way PHB resources are registered
broke the resource fixup for FSL boards.

We can no longer rely on the resource pointer array for the PHB's
pci_bus structure, so let's leave it alone and go straight for
the PHB resources instead. This also makes the code generally
more readable.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc: Fix kernel log of oops/panic instruction dump
Ira Snyder [Fri, 6 Jan 2012 12:34:07 +0000 (12:34 +0000)] 
powerpc: Fix kernel log of oops/panic instruction dump

A kernel oops/panic prints an instruction dump showing several
instructions before and after the instruction which caused the
oops/panic.

The code intended that the faulting instruction be enclosed in angle
brackets, however a bug caused the faulting instruction to be
interpreted by printk() as the message log level.

To fix this, the KERN_CONT log level is added before the actual text of
the printed message.

=== Before the patch ===

[ 1081.587266] Instruction dump:
[ 1081.590236] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001
[ 1081.598034] 3d20c03a 9009a114 7c0004ac 39200000
[ 1081.602500]  4e800020 3803ffd0 2b800009

<4>[ 1081.587266] Instruction dump:
<4>[ 1081.590236] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001
<4>[ 1081.598034] 3d20c03a 9009a114 7c0004ac 39200000
<98090000>[ 1081.602500]  4e800020 3803ffd0 2b800009

=== After the patch ===

[   51.385216] Instruction dump:
[   51.388186] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001
[   51.395986] 3d20c03a 9009a114 7c0004ac 39200000 <980900004e800020 3803ffd0 2b800009

<4>[   51.385216] Instruction dump:
<4>[   51.388186] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001
<4>[   51.395986] 3d20c03a 9009a114 7c0004ac 39200000 <980900004e800020 3803ffd0 2b800009

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agocrypto: sha512 - use standard ror64()
Alexey Dobriyan [Sat, 14 Jan 2012 18:44:49 +0000 (21:44 +0300)] 
crypto: sha512 - use standard ror64()

Use standard ror64() instead of hand-written.
There is no standard ror64, so create it.

The difference is shift value being "unsigned int" instead of uint64_t
(for which there is no reason). gcc starts to emit native ROR instructions
which it doesn't do for some reason currently. This should make the code
faster.

Patch survives in-tree crypto test and ping flood with hmac(sha512) on.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
12 years agodrm/i915: do not enable RC6p on Sandy Bridge
Eugeni Dodonov [Tue, 14 Feb 2012 13:44:48 +0000 (11:44 -0200)] 
drm/i915: do not enable RC6p on Sandy Bridge

With base on latest findings, RC6p seems to be respondible for RC6-related
issues on Sandy Bridge platform. To work-around those issues, the previous
solution was to completely disable RC6 on Sandy Bridge for the past few
releases, even if plain RC6 was not giving any issues.

What this patch does is preventing RC6p from being enabled on Sandy Bridge
even if users enable RC6 via a kernel parameter. So it won't change the
defaults in any way, but will ensure that if users do enable RC6 manually
it won't break their machines by enabling this extra state.

Proper fix for this (enabling specific RC6 states according to the GPU
generation) were proposed for the -next kernel, but we are too late in the
release process now to pick such changes.

Acked-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
12 years agousb: host: ehci: allow ehci_* symbols to be unused
Felipe Balbi [Wed, 15 Feb 2012 07:34:26 +0000 (09:34 +0200)] 
usb: host: ehci: allow ehci_* symbols to be unused

not all platforms will use all of those ehci_*
symbols on their hc_driver structure. Sometimes
we might need to provide a modified version of
a certain method or not provide it at all, as is
the case with OMAPs which don't support port handoff
feature.

Whenever we compile a kernel for an OMAP board with
EHCI enabled, we get compile warnings:

drivers/usb/host/ehci-hub.c:1079: warning: 'ehci_relinquish_port' \
defined but not used
drivers/usb/host/ehci-hub.c:1088: warning: 'ehci_port_handed_over' \
defined but not used

In order to cleanup those warnings, we're adding
__maybe_unused annotation to those functions.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoARM: 7327/1: need to include asm/system.h in asm/processor.h
Olof Johansson [Wed, 15 Feb 2012 20:17:12 +0000 (21:17 +0100)] 
ARM: 7327/1: need to include asm/system.h in asm/processor.h

For files that include asm/processor.h but not asm/system.h:

arch/arm/mach-msm/include/mach/uncompress.h: In function 'putc':
arch/arm/mach-msm/include/mach/uncompress.h:48:3: error: implicit declaration of function 'smp_mb' [-Werror=implicit-function-declaration]

In this case, smp_mb() is from the cpu_relax() call in the msm putc().

It likely went uncaught when the uncompress.h change went in since the
defconfig didn't enable that code path, but later changes (e76f4750f4:
ARM: debug: arrange Kconfig options more logically) resulted in the
option being on for msm_defconfig and thus exposed it.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7326/2: PL330: fix null pointer dereference in pl330_chan_ctrl()
Javi Merino [Wed, 15 Feb 2012 16:36:39 +0000 (17:36 +0100)] 
ARM: 7326/2: PL330: fix null pointer dereference in pl330_chan_ctrl()

This fixes the thrd->req_running field being accessed before thrd
is checked for null. The error was introduced in

   abb959f: ARM: 7237/1: PL330: Fix driver freeze

Reference: <1326458191-23492-1-git-send-email-mans.rullgard@linaro.org>

Cc: stable@kernel.org
Signed-off-by: Mans Rullgard <mans.rullgard@linaro.org>
Acked-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7164/3: PL330: Fix the size of the dst_cache_ctrl field
Javi Merino [Wed, 16 Nov 2011 11:36:39 +0000 (12:36 +0100)] 
ARM: 7164/3: PL330: Fix the size of the dst_cache_ctrl field

dst_cache_ctrl affects bits 3, 1 and 0 of AWCACHE but it is a 3-bit
field in the Channel Control Register (see Table 3-21 of the DMA-330
Technical Reference Manual) and should be programmed as such.

Reference: <1320244259-10496-3-git-send-email-javi.merino@arm.com>

Signed-off-by: Javi Merino <javi.merino@arm.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7325/1: fix v7 boot with lockdep enabled
Rabin Vincent [Wed, 15 Feb 2012 15:01:42 +0000 (16:01 +0100)] 
ARM: 7325/1: fix v7 boot with lockdep enabled

Bootup with lockdep enabled has been broken on v7 since b46c0f74657d
("ARM: 7321/1: cache-v7: Disable preemption when reading CCSIDR").

This is because v7_setup (which is called very early during boot) calls
v7_flush_dcache_all, and the save_and_disable_irqs added by that patch
ends up attempting to call into lockdep C code (trace_hardirqs_off())
when we are in no position to execute it (no stack, MMU off).

Fix this by using a notrace variant of save_and_disable_irqs.  The code
already uses the notrace variant of restore_irqs.

Reviewed-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agonet/ethernet: ks8851_mll fix irq handling
Jan Weitzel [Tue, 14 Feb 2012 21:35:15 +0000 (21:35 +0000)] 
net/ethernet: ks8851_mll fix irq handling

There a two different irq variables ks->irq and netdev->irq.
Only ks->irq is set on probe, so disabling irq in ks_start_xmit fails.

This patches remove ks->irq from private data and use only netdev->irq.

Tested on a kernel 3.0 based OMAP4430 SMP Board

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoveth: Enforce minimum size of VETH_INFO_PEER
Thomas Graf [Wed, 15 Feb 2012 04:09:46 +0000 (04:09 +0000)] 
veth: Enforce minimum size of VETH_INFO_PEER

VETH_INFO_PEER carries struct ifinfomsg plus optional IFLA
attributes. A minimal size of sizeof(struct ifinfomsg) must be
enforced or we may risk accessing that struct beyond the limits
of the netlink message.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agostmmac: update the driver version to Feb 2012 (v2)
Giuseppe CAVALLARO [Wed, 15 Feb 2012 00:10:40 +0000 (00:10 +0000)] 
stmmac: update the driver version to Feb 2012 (v2)

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agostmmac: move hw init in the probe (v2)
Giuseppe CAVALLARO [Wed, 15 Feb 2012 00:10:39 +0000 (00:10 +0000)] 
stmmac: move hw init in the probe (v2)

This patch moves the MAC HW initialization and
the HW feature verification from the open to the probe
function as D. Miller suggested.
So the patch actually reorganizes and tidies-up some parts of
the driver and indeed fixes some problem when tune its HW features.
These can be overwritten by looking at the HW cap register at
run-time and that generated problems.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agostmmac: request_irq when use an ext wake irq line (v2)
Francesco Virlinzi [Wed, 15 Feb 2012 00:10:38 +0000 (00:10 +0000)] 
stmmac: request_irq when use an ext wake irq line (v2)

In case of we use an external Wake-Up IRQ line
(priv->wol_irq != dev->irq) we need to invoke the
request_irq.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agostmmac: do not discard frame on dribbling bit assert
Giuseppe CAVALLARO [Wed, 15 Feb 2012 00:10:37 +0000 (00:10 +0000)] 
stmmac: do not discard frame on dribbling bit assert

If this bit is set and the CRC error is reset, then the packet is valid.
Only report this as stat info.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoipheth: Add iPhone 4S
Tim Gardner [Wed, 15 Feb 2012 07:50:15 +0000 (07:50 +0000)] 
ipheth: Add iPhone 4S

BugLink: http://bugs.launchpad.net/bugs/900802
Cc: stable@vger.kernel.org 3.2+
Signed-off-by: Till Kamppeter <till.kamppeter@gmail.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agomlx4: add unicast steering entries to resource_tracker
Eugenia Emantayev [Wed, 15 Feb 2012 06:23:16 +0000 (06:23 +0000)] 
mlx4: add unicast steering entries to resource_tracker

Add unicast steering entries to resource tracker.
Do qp_detach also for these entries when VF doesn't shut down gracefully.
Otherwise there is leakage of these resources, since they are not tracked.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agomlx4: fix QP tree trashing
Eugenia Emantayev [Wed, 15 Feb 2012 06:22:57 +0000 (06:22 +0000)] 
mlx4: fix QP tree trashing

When adding new unicast steer entry, before moving qp to state ready,
actually before calling mlx4_RST2INIT_QP_wrapper(), there were added
a lot of entries with local_qpn=0 into radix tree.
This fact impacted the get_res() function and proper functioning
of resource tracker in addition to adding trash entries into radix tree.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@melllanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agomlx4: fix buffer overrun
Eugenia Emantayev [Wed, 15 Feb 2012 06:22:49 +0000 (06:22 +0000)] 
mlx4: fix buffer overrun

When passing MLX4_UC_STEER=1 it was translated to value 2
after mlx4_QP_ATTACH_wrapper. Therefore in new_steering_entry()
unicast steer entries were added to index 2 of array of size 2.
Fixing this bug by shift right to one position.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Wed, 15 Feb 2012 18:41:52 +0000 (13:41 -0500)] 
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless into for-davem

12 years agoregmap: Fix cache defaults initialization from raw cache defaults
Lars-Peter Clausen [Wed, 15 Feb 2012 09:23:25 +0000 (10:23 +0100)] 
regmap: Fix cache defaults initialization from raw cache defaults

Currently registers with a value of 0 are ignored when initializing the register
defaults from raw defaults. This worked in the past, because registers without a
explicit default were assumed to have a default value of 0. This was changed in
commit b03622a8 ("regmap: Ensure rbtree syncs registers set to zero properly").
As a result registers, which have a raw default value of 0 are now assumed to
have no default. This again can result in unnecessary writes when syncing the
cache. It will also result in unnecessary reads for e.g. the first update
operation. In the case where readback is not possible this will even let the
update operation fail, if the register has not been written to before.

So this patch removes the check. Instead it adds a check to ignore raw defaults
for registers which are volatile, since those registers are not cached.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
12 years agoi387: fix sense of sanity check
Linus Torvalds [Wed, 15 Feb 2012 16:05:18 +0000 (08:05 -0800)] 
i387: fix sense of sanity check

The check for save_init_fpu() (introduced in commit 5b1cbac37798: "i387:
make irq_fpu_usable() tests more robust") was the wrong way around, but
I hadn't noticed, because my "tests" were bogus: the FPU exceptions are
disabled by default, so even doing a divide by zero never actually
triggers this code at all unless you do extra work to enable them.

So if anybody did enable them, they'd get one spurious warning.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoARM: 7324/1: modpost: Fix section warnings for ARM for many compilers
Tony Lindgren [Tue, 14 Feb 2012 20:58:56 +0000 (21:58 +0100)] 
ARM: 7324/1: modpost: Fix section warnings for ARM for many compilers

It turns out that many compilers don't show section warnings on ARM
currently because handling for ARM_CALL relocs are missing from
modpost.c.

Based on commit c2e26114 ([ARM] 3205/1: Handle new EABI relocations when
loading kernel modules) it seems that R_ARM_PC24, R_ARM_CALL and
R_ARM_JUMP24 can be handled the same way.

Note that at least Debian libc6-dev is missing defines for both
R_ARM_CALL and R_ARM_JUMP24 in /usr/include/elf.h. So for now
we need to define them in modpost.c if not defined.

Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Anders Kaseorg <andersk@ksplice.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7323/1: Do not allow ARM_LPAE on pre-ARMv7 architectures
Catalin Marinas [Tue, 14 Feb 2012 15:33:27 +0000 (16:33 +0100)] 
ARM: 7323/1: Do not allow ARM_LPAE on pre-ARMv7 architectures

This patch expands the Kconfig dependencies for ARM_LPAE to not allow
enabling when architectures other than ARMv7 are built into the kernel.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Linus Torvalds [Tue, 14 Feb 2012 23:26:42 +0000 (15:26 -0800)] 
Merge tag 'for-linus' of git://git./linux/kernel/git/broonie/regulator

One small bug fix from Axel plus a fix for a build failure in unrealistic
but commonly built configs which for some reason manage to survive for
an awfully long time in -next without any reports.

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: Fix getting voltage in max8649_enable_time()
  regulator: Fix mc13xxx regulator modular build (again)

12 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Tue, 14 Feb 2012 23:21:25 +0000 (15:21 -0800)] 
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

Quoth BenH:
 "Here are a few powerpc fixes for 3.3, all pretty trivial.  I also
  added the patch to define GET_IP/SET_IP so we can use some more
  asm-generic goodness."

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/pseries/eeh: Fix crash when error happens during device probe
  powerpc/pseries: Fix partition migration hang in stop_topology_update
  powerpc/powernv: Disable interrupts while taking phb->lock
  powerpc: Fix WARN_ON in decrementer_check_overflow
  powerpc/wsp: Fix IRQ affinity setting
  powerpc: Implement GET_IP/SET_IP
  powerpc/wsp: Permanently enable PCI class code workaround

12 years agoMerge tag 'mmc-fixes-for-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 14 Feb 2012 23:20:50 +0000 (15:20 -0800)] 
Merge tag 'mmc-fixes-for-3.3-rc4' of git://git./linux/kernel/git/cjb/mmc

MMC fixes for 3.3-rc4:
 * The most visible fix here is against a regression introduced in 3.3-rc1
   that ran cards in Ultra High Speed mode even when they failed to initialize
   in that mode, leading to lower-speed cards failing to mount.
 * A lockdep warning introduced in 3.3-rc1 is fixed.
 * Various other small driver fixes, most notably for a NULL dereference
   when using highmem with dw_mmc.

* tag 'mmc-fixes-for-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
  mmc: dw_mmc: Fix PIO mode with support of highmem
  mmc: atmel-mci: save and restore sdioirq when soft reset is performed
  mmc: block: Init ro_lock sysfs attr to fix lockdep warnings
  mmc: sh_mmcif: fix late delayed work initialisation
  mmc: tmio_mmc: fix card eject during IO with DMA
  mmc: core: Fix comparison issue in mmc_compare_ext_csds
  mmc: core: Fix PowerOff Notify suspend/resume
  mmc: sdhci-pci: set Medfield SDIO as non-removable
  mmc: core: add the capability for broken voltage
  mmc: core: Fix low speed mmc card detection failure
  mmc: esdhc: set the timeout to the max value
  mmc: esdhc: add PIO mode support
  mmc: core: Ensure clocks are always enabled before host interaction
  mmc: of_mmc_spi: fix little endian support
  mmc: core: UHS sdio card that fails should not exceed 50MHz
  mmc: esdhc: fix errors when booting kernel on Freescale eSDHC version 2.3

12 years agoMerge tag 'stable/for-linus-fixes-3.3-rc3' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Tue, 14 Feb 2012 23:20:11 +0000 (15:20 -0800)] 
Merge tag 'stable/for-linus-fixes-3.3-rc3' of git://git./linux/kernel/git/konrad/xen

Two fixes for VCPU offlining; One to fix the string format exposed
by the xen-pci[front|back] to conform to the one used in majority of
PCI drivers; Two fixes to make the code more resilient to invalid
configurations.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* tag 'stable/for-linus-fixes-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xenbus_dev: add missing error check to watch handling
  xen/pci[front|back]: Use %d instead of %1x for displaying PCI devfn.
  xen pvhvm: do not remap pirqs onto evtchns if !xen_have_vector_callback
  xen/smp: Fix CPU online/offline bug triggering a BUG: scheduling while atomic.
  xen/bootup: During bootup suppress XENBUS: Unable to read cpu state

12 years agoUSB: option: cleanup zte 3g-dongle's pid in option.c
li.rui27@zte.com.cn [Tue, 14 Feb 2012 02:35:01 +0000 (10:35 +0800)] 
USB: option: cleanup zte 3g-dongle's pid in option.c

  1. Remove all old mass-storage ids's pid:
     0x0026,0x0053,0x0098,0x0099,0x0149,0x0150,0x0160;
  2. As the pid from 0x1401 to 0x1510 which have not surely assigned to
     use for serial-port or mass-storage port,so i think it should be
     removed now, and will re-add after it have assigned in future;
  3. sort the pid to WCDMA and CDMA.

Signed-off-by: Rui li <li.rui27@zte.com.cn>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoMerge tag 'for-usb-linus-2012-02-14' of git://git.kernel.org/pub/scm/linux/kernel...
Greg Kroah-Hartman [Tue, 14 Feb 2012 22:48:15 +0000 (14:48 -0800)] 
Merge tag 'for-usb-linus-2012-02-14' of git://git./linux/kernel/git/sarah/xhci into usb-linus

xHCI bug fix for broken BIOS on some Intel systems.

Happy Valentine's Day!  Your present is a working xHCI driver under some
Intel systems with buggy BIOSes that don't provide a legacy PCI IRQ line
for the USB 3.0 host.

Please queue for 3.3 and stable to share the love!

12 years agoMerge tag 'for-usb-next-2012-02-14' of git://git.kernel.org/pub/scm/linux/kernel...
Greg Kroah-Hartman [Tue, 14 Feb 2012 22:43:27 +0000 (14:43 -0800)] 
Merge tag 'for-usb-next-2012-02-14' of git://git./linux/kernel/git/sarah/xhci into usb-next

Support for USB 3.0 hub suspend.

This patchset adds support for suspending external USB 3.0 hubs, and fixes the
USB 3.0 device remote wakeup enabling.  Hubs are the only USB 3.0 devices on
the market right now that do remote wakeup, and they will only send a remote
wakeup if they are placed into suspend, so it's not necessary to backport this
patchset to stable kernels.

12 years ago3c59x: shorten timer period for slave devices
Eric Dumazet [Tue, 14 Feb 2012 10:27:09 +0000 (10:27 +0000)] 
3c59x: shorten timer period for slave devices

Jean Delvare reported bonding on top of 3c59x adapters was not detecting
network cable removal fast enough.

3c59x indeed uses a 60 seconds timer to check link status if carrier is
on, and 5 seconds if carrier is off.

This patch reduces timer period to 5 seconds if device is a bonding
slave.

Reported-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetpoll: netpoll_poll_dev() should access dev->flags
Eric Dumazet [Tue, 14 Feb 2012 10:11:59 +0000 (10:11 +0000)] 
netpoll: netpoll_poll_dev() should access dev->flags

commit 5a698af53f (bond: service netpoll arp queue on master device)
tested IFF_SLAVE flag against dev->priv_flags instead of dev->flags

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: WANG Cong <amwang@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoUSB: Turn on auto-suspend for USB 3.0 hubs.
Sarah Sharp [Sat, 7 Jan 2012 00:27:25 +0000 (16:27 -0800)] 
USB: Turn on auto-suspend for USB 3.0 hubs.

Now that USB 3.0 hub remote wakeup on port status changes is enabled,
and USB 3.0 device remote wakeup is handled in the USB core properly,
let's turn on auto-suspend for all USB 3.0 hubs.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
12 years agoUSB: Set wakeup bits for all children hubs.
Sarah Sharp [Tue, 24 Jan 2012 19:46:50 +0000 (11:46 -0800)] 
USB: Set wakeup bits for all children hubs.

This patch takes care of the race condition between the Function Wake
Device Notification and the auto-suspend timeout for this situation:

Roothub
  | (U3)
hub A
  | (U3)
hub B
  | (U3)
device C

When device C signals a resume, the xHCI driver will set the wakeup_bits
for the roothub port that hub A is attached to.  However, since USB 3.0
hubs do not set a link state change bit on device-initiated resume, hub
A will not indicate a port event when polled.  Without this patch, khubd
will notice the wakeup-bits are set for the roothub port, it will resume
hub A, and then it will poll the events bits for hub A and notice that
nothing has changed.  Then it will be suspended after 2 seconds.

Change hub_activate() to look at the port link state for each USB 3.0
hub port, and set hub->change_bits if the link state is U0, indicating
the device has finished resume.  Change the resume function called by
hub_events(), hub_handle_remote_wakeup(), to check the link status
for resume instead of just the port's wakeup_bits.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
12 years agoUSB/xHCI: Support device-initiated USB 3.0 resume.
Sarah Sharp [Tue, 15 Nov 2011 02:00:01 +0000 (18:00 -0800)] 
USB/xHCI: Support device-initiated USB 3.0 resume.

USB 3.0 hubs don't have a port suspend change bit (that bit is now
reserved).  Instead, when a host-initiated resume finishes, the hub sets
the port link state change bit.

When a USB 3.0 device initiates remote wakeup, the parent hubs with
their upstream links in U3 will pass the LFPS up the chain.  The first
hub that has an upstream link in U0 (which may be the roothub) will
reflect that LFPS back down the path to the device.

However, the parent hubs in the resumed path will not set their link
state change bit.  Instead, the device that initiated the resume has to
send an asynchronous "Function Wake" Device Notification up to the host
controller.  Therefore, we need a way to notify the USB core of a device
resume without going through the normal hub URB completion method.

First, make the xHCI roothub act like an external USB 3.0 hub and not
pass up the port link state change bit when a device-initiated resume
finishes.  Introduce a new xHCI bit field, port_remote_wakeup, so that
we can tell the difference between a port coming out of the U3Exit state
(host-initiated resume) and the RExit state (ending state of
device-initiated resume).

Since the USB core can't tell whether a port on a hub has resumed by
looking at the Hub Status buffer, we need to introduce a bitfield,
wakeup_bits, that indicates which ports have resumed.  When the xHCI
driver notices a port finishing a device-initiated resume, we call into
a new USB core function, usb_wakeup_notification(), that will set
the right bit in wakeup_bits, and kick khubd for that hub.

We also call usb_wakeup_notification() when the Function Wake Device
Notification is received by the xHCI driver.  This covers the case where
the link between the roothub and the first-tier hub is in U0, and the
hub reflects the resume signaling back to the device without giving any
indication it has done so until the device sends the Function Wake
notification.

Change the code in khubd that handles the remote wakeup to look at the
state the USB core thinks the device is in, and handle the remote wakeup
if the port's wakeup bit is set.

This patch only takes care of the case where the device is attached
directly to the roothub, or the USB 3.0 hub that is attached to the root
hub is the device sending the Function Wake Device Notification (e.g.
because a new USB device was attached).  The other cases will be covered
in a second patch.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
12 years agoUSB: Refactor hub remote wake handling.
Sarah Sharp [Tue, 24 Jan 2012 21:53:18 +0000 (13:53 -0800)] 
USB: Refactor hub remote wake handling.

Refactor the code to check for a remote wakeup on a port into its own
function.  Keep the behavior the same, and set connect_change in
hub_events if the device disconnected on resume.  Cleanup references to
hdev->children[i-1] to use a common variable.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
12 years agoUSB/xHCI: Enable USB 3.0 hub remote wakeup.
Sarah Sharp [Fri, 6 Jan 2012 18:34:31 +0000 (10:34 -0800)] 
USB/xHCI: Enable USB 3.0 hub remote wakeup.

USB 3.0 hubs have a different remote wakeup policy than USB 2.0 hubs.
USB 2.0 hubs, once they have remote wakeup enabled, will always send
remote wakes when anything changes on a port.

However, USB 3.0 hubs have a per-port remote wake up policy that is off
by default.  The Set Feature remote wake mask can be changed for any
port, enabling remote wakeup for a connect, disconnect, or overcurrent
event, much like EHCI and xHCI host controller "wake on" port status
bits.  The bits are cleared to zero on the initial hub power on, or
after the hub has been reset.

Without this patch, when a USB 3.0 hub gets suspended, it will not send
a remote wakeup on device connect or disconnect.  This would show up to
the user as "dead ports" unless they ran lsusb -v (since newer versions
of lsusb use the sysfs files, rather than sending control transfers).

Change the hub driver's suspend method to enable remote wake up for
disconnect, connect, and overcurrent for all ports on the hub.  Modify
the xHCI driver's roothub code to handle that request, and set the "wake
on" bits in the port status registers accordingly.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
12 years agoUSB: Suspend functions before putting dev into U3.
Sarah Sharp [Fri, 6 Jan 2012 23:48:30 +0000 (15:48 -0800)] 
USB: Suspend functions before putting dev into U3.

The USB 3.0 bus specification introduces a new type of power management
called function suspend.  The idea is to be able to suspend different
functions (i.e. a scanner or an SD card reader on a USB printer)
independently.  A device can be in U0, but have one or more functions
suspended.  Thus, signaling a function resume with the standard device
remote wake signaling was not possible.

Instead, a device will (without prompt from the host) send a "device
notification" for the function remote wake.  A new Set Feature Function
Remote Wake was developed to turn remote wake up on and off for each
function.

USB 3.0 devices can still go into device suspend (U3), and signal a
remote wakeup to bring the link back into U1.  However, they now use the
function remote wake device notification to allow the host to know which
function woke the device from U3.

The spec is a bit ambiguous about whether a function is allowed to
signal a remote wakeup if the function has been enabled for remote
wakeup, but not placed in function suspend before the device is placed
into U3.

Section 9.2.5.1 says "Suspending a device with more than one function
effectively suspends all the functions within the device."  I interpret
that to mean that putting a device in U3 suspends all functions, and
thus if the host has previously enabled remote wake for those functions,
it should be able to signal a remote wake up on port status changes.
However, hub vendors may have a different interpretation, and it can't
hurt to put the function into suspend before putting the device into U3.

I cannot get an answer out of the USB 3.0 spec architects about this
ambiguity, so I'm erring on the safe side and always suspending the
first function before placing the device in U3.  Note, this code should
be fixed if we ever find any USB 3.0 devices that have more than one
function.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
12 years agoUSB/xhci: Enable remote wakeup for USB3 devices.
Sarah Sharp [Fri, 11 Nov 2011 22:57:33 +0000 (14:57 -0800)] 
USB/xhci: Enable remote wakeup for USB3 devices.

When the USB 3.0 hub support went in, I disabled selective suspend for
all external USB 3.0 hubs because they used a different mechanism to
enable remote wakeup.  In fact, other USB 3.0 devices that could signal
remote wakeup would have been prevented from going into suspend because
they would have stalled the SetFeature Device Remote Wakeup request.

This patch adds support for the USB 3.0 way of enabling remote wake up
(with a SetFeature Function Suspend request), and enables selective
suspend for all hubs during hub_probe.  It assumes that all USB 3.0 have
only one "function" as defined by the interface association descriptor,
which is true of all the USB 3.0 devices I've seen so far.  FIXME if
that turns out to change later.

After a device signals a remote wakeup, it is supposed to send a Device
Notification packet to the host controller, signaling which function
sent the remote wakeup.  The host can then put any other functions back
into function suspend.  Since we don't have support for function suspend
(and no devices currently support it), we'll just assume the hub
function will resume the device properly when it received the port
status change notification, and simply ignore any device notification
events from the xHCI host controller.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
12 years agoxHCI: Kick khubd when USB3 resume really completes.
Sarah Sharp [Wed, 25 Jan 2012 00:39:02 +0000 (16:39 -0800)] 
xHCI: Kick khubd when USB3 resume really completes.

xHCI roothubs go through slightly different port state machines when
either a device initiates a remote wakeup and signals resume, or when
the host initiates a resume.

According to section 4.19.1.2.13 of the xHCI 1.0 spec, on host-initiated
resume, the xHC port state machine automatically goes through the U3Exit
state into the U0 state, setting the port link state change (PLC) bit in
the process.

When a device initiates resume, the xHCI port state machine goes into
the "Resume" state and sets the PLC bit.  Then the xHCI driver writes U0
into the port link state register to transition the port to U0 from the
Resume state.

We can't be sure the device is actually in the U0 state until we receive
the next port status change event with the PLC bit set.  We really don't
want khubd to be polling the roothub port status bits until the device
is really in U0.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: Andiry Xu <andiry.xu@amd.com>
12 years agoRxRPC: Fix kcalloc parameters swapped
Axel Lin [Mon, 13 Feb 2012 20:19:14 +0000 (20:19 +0000)] 
RxRPC: Fix kcalloc parameters swapped

The first parameter should be "number of elements" and the second parameter
should be "element size".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: remove the 'poll' module option
Michal Schmidt [Tue, 14 Feb 2012 09:05:46 +0000 (09:05 +0000)] 
bnx2x: remove the 'poll' module option

'poll' was a debugging option, but turning it on these days leads to
kernel panic. Remove it.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcp: fix tcp_shifted_skb() adjustment of lost_cnt_hint for FACK
Neal Cardwell [Mon, 13 Feb 2012 20:22:08 +0000 (20:22 +0000)] 
tcp: fix tcp_shifted_skb() adjustment of lost_cnt_hint for FACK

This commit ensures that lost_cnt_hint is correctly updated in
tcp_shifted_skb() for FACK TCP senders. The lost_cnt_hint adjustment
in tcp_sacktag_one() only applies to non-FACK senders, so FACK senders
need their own adjustment.

This applies the spirit of 1e5289e121372a3494402b1b131b41bfe1cf9b7f -
except now that the sequence range passed into tcp_sacktag_one() is
correct we need only have a special case adjustment for FACK.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoUSB: Don't fail USB3 probe on missing legacy PCI IRQ.
Sarah Sharp [Tue, 14 Feb 2012 00:25:57 +0000 (16:25 -0800)] 
USB: Don't fail USB3 probe on missing legacy PCI IRQ.

Intel has a PCI USB xhci host controller on a new platform. It doesn't
have a line IRQ definition in BIOS.  The Linux driver refuses to
initialize this controller, but Windows works well because it only depends
on MSI.

Actually, Linux also can work for MSI.  This patch avoids the line IRQ
checking for USB3 HCDs in usb core PCI probe.  It allows the xHCI driver
to try to enable MSI or MSI-X first.  It will fail the probe if MSI
enabling failed and there's no legacy PCI IRQ.

This patch should be backported to kernels as old as 2.6.32.

Signed-off-by: Alex Shi <alex.shi@intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
12 years agoMerge tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Tue, 14 Feb 2012 17:09:24 +0000 (09:09 -0800)] 
Merge tag 'sound-fixes' of git://git./linux/kernel/git/tiwai/sound

sound fixes for 3.3-rc4

Basically all small fixes suited as rc4: a few HD-audio regression fixes,
a stable fix for an old Dell laptop with intel8x0, and a simple fix for
ASoC fsi.

* tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: intel8x0: Fix default inaudible sound on Gateway M520
  ALSA: hda - Fix silent speaker output on Acer Aspire 6935
  ALSA: hda - Fix initialization of secondary capture source on VT1705
  ASoC: fsi: fixup fsi_pointer() calculation method
  ALSA: hda - Fix mute-LED VREF value for new HP laptops

12 years agodrm/radeon/kms: fix MSI re-arm on rv370+
Alex Deucher [Mon, 13 Feb 2012 21:36:34 +0000 (16:36 -0500)] 
drm/radeon/kms: fix MSI re-arm on rv370+

MSI_REARM_EN register is a write only trigger register.
There is no need RMW when re-arming.

May fix:
https://bugs.freedesktop.org/show_bug.cgi?id=41668

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms/atom: bios scratch reg handling updates
Alex Deucher [Mon, 13 Feb 2012 13:59:41 +0000 (08:59 -0500)] 
drm/radeon/kms/atom: bios scratch reg handling updates

- Add missing DFP6 connection state handling
- crtc routing bits not used on DCE4+

Noticed by sylware on phoronix.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: drop lock in return path of radeon_fence_count_emitted.
Dave Airlie [Mon, 13 Feb 2012 12:18:37 +0000 (12:18 +0000)] 
drm/radeon/kms: drop lock in return path of radeon_fence_count_emitted.

Silly bad return path.

Reported-and-Tested-by: Mikko Vinni
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
CC: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoALSA: intel8x0: Fix default inaudible sound on Gateway M520
Daniel T Chen [Tue, 14 Feb 2012 04:44:22 +0000 (23:44 -0500)] 
ALSA: intel8x0: Fix default inaudible sound on Gateway M520

BugLink: https://bugs.launchpad.net/bugs/930842
The reporter states that audio is inaudible by default without muting
'External Amplifier'. Add a quirk to handle his SSID so that changing
the control is not necessary.

Reported-and-tested-by: Benjamin Carlson <elderbubba0810@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge tag 'asoc-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound...
Takashi Iwai [Tue, 14 Feb 2012 08:24:58 +0000 (09:24 +0100)] 
Merge tag 'asoc-3.3' of git://git./linux/kernel/git/broonie/sound into for-linus

A simple fix from Morimoto-san for the pointer() operation in the FSI
driver.

12 years agoMerge git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Tue, 14 Feb 2012 04:34:44 +0000 (20:34 -0800)] 
Merge git://git.samba.org/sfrench/cifs-2.6

* git://git.samba.org/sfrench/cifs-2.6:
  cifs: don't return error from standard_receive3 after marking response malformed
  cifs: request oplock when doing open on lookup
  cifs: fix error handling when cifscreds key payload is an error

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Tue, 14 Feb 2012 04:33:45 +0000 (20:33 -0800)] 
Merge git://git./linux/kernel/git/herbert/crypto-2.6

This updates the sha512 fix so that it doesn't cause excessive stack
usage on i386.  This is done by reverting to the original code, and
avoiding the W duplication by moving its initialisation into the loop.

As the underlying code is in fact the one that we have used for years,
I'm pushing this now instead of postponing to the next cycle.

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: sha512 - Avoid stack bloat on i386
  crypto: sha512 - Use binary and instead of modulus

12 years agopowerpc/pseries/eeh: Fix crash when error happens during device probe
Thadeu Lima de Souza Cascardo [Wed, 11 Jan 2012 09:09:58 +0000 (09:09 +0000)] 
powerpc/pseries/eeh: Fix crash when error happens during device probe

EEH may happen during a PCI driver probe. If the driver is trying to
access some register in a loop, the EEH code will try to print the
driver name. But the driver pointer in struct pci_dev is not set until
probe returns successfully.

Use a function to test if the device and the driver pointer is NULL
before accessing the driver's name.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/pseries: Fix partition migration hang in stop_topology_update
Brian King [Wed, 11 Jan 2012 06:56:04 +0000 (06:56 +0000)] 
powerpc/pseries: Fix partition migration hang in stop_topology_update

This fixes a hang that was observed during live partition migration.
Since stop_topology_update must not be called from an interrupt
context, call it earlier in the migration process. The hang observed
can be seen below:

WARNING: at kernel/timer.c:1011
Modules linked in: ip6t_LOG xt_tcpudp xt_pkttype ipt_LOG xt_limit ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_raw xt_NOTRACK ipt_REJECT xt_state iptable_raw iptable_filter ip6table_mangle nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 ip_tables ip6table_filter ip6_tables x_tables ipv6 fuse loop ibmveth sg ext3 jbd mbcache raid456 async_raid6_recov async_pq raid6_pq async_xor xor async_memcpy async_tx raid10 raid1 raid0 scsi_dh_alua scsi_dh_rdac scsi_dh_hp_sw scsi_dh_emc dm_round_robin dm_multipath scsi_dh sd_mod crc_t10dif ibmvfc scsi_transport_fc scsi_tgt scsi_mod dm_snapshot dm_mod
NIP: c0000000000c52d8 LR: c00000000004be28 CTR: 0000000000000000
REGS: c00000005ffd77d0 TRAP: 0700   Not tainted  (3.2.0-git-00001-g07d106d)
MSR: 8000000000021032 <ME,CE,IR,DR>  CR: 48000084  XER: 00000001
CFAR: c00000000004be20
TASK = c00000005ec78860[0] 'swapper/3' THREAD: c00000005ec98000 CPU: 3
GPR00: 0000000000000001 c00000005ffd7a50 c000000000fbbc98 c000000000ec8340
GPR04: 00000000282a0020 0000000000000000 0000000000004000 0000000000000101
GPR08: 0000000000000012 c00000005ffd4000 0000000000000020 c000000000f3ba88
GPR12: 0000000000000000 c000000007f40900 0000000000000001 0000000000000004
GPR16: 0000000000000001 0000000000000000 0000000000000000 c000000001022310
GPR20: 0000000000000001 0000000000000000 0000000000200200 c000000001029e14
GPR24: 0000000000000000 0000000000000001 0000000000000040 c00000003f74bc80
GPR28: c00000003f74bc84 c000000000f38038 c000000000f16b58 c000000000ec8340
NIP [c0000000000c52d8] .del_timer_sync+0x28/0x60
LR [c00000000004be28] .stop_topology_update+0x20/0x38
Call Trace:
[c00000005ffd7a50] [c00000005ec78860] 0xc00000005ec78860 (unreliable)
[c00000005ffd7ad0] [c00000000004be28] .stop_topology_update+0x20/0x38
[c00000005ffd7b40] [c000000000028378] .__rtas_suspend_last_cpu+0x58/0x260
[c00000005ffd7bf0] [c0000000000fa230] .generic_smp_call_function_interrupt+0x160/0x358
[c00000005ffd7cf0] [c000000000036ec8] .smp_ipi_demux+0x88/0x100
[c00000005ffd7d80] [c00000000005c154] .icp_hv_ipi_action+0x5c/0x80
[c00000005ffd7e00] [c00000000012a088] .handle_irq_event_percpu+0x100/0x318
[c00000005ffd7f00] [c00000000012e774] .handle_percpu_irq+0x84/0xd0
[c00000005ffd7f90] [c000000000022ba8] .call_handle_irq+0x1c/0x2c
[c00000005ec9ba20] [c00000000001157c] .do_IRQ+0x22c/0x2a8
[c00000005ec9bae0] [c0000000000054bc] hardware_interrupt_entry+0x18/0x1c
Exception: 501 at .cpu_idle+0x194/0x2f8
    LR = .cpu_idle+0x194/0x2f8
[c00000005ec9bdd0] [c000000000017e58] .cpu_idle+0x188/0x2f8 (unreliable)
[c00000005ec9be90] [c00000000067ec18] .start_secondary+0x3e4/0x524
[c00000005ec9bf90] [c0000000000093e8] .start_secondary_prolog+0x10/0x14
Instruction dump:
ebe1fff8 4e800020 fbe1fff8 7c0802a6 f8010010 7c7f1b78 f821ff81 78290464
80090014 5400019e 7c0000d0 78000fe0 <0b0000004800000c 7c210b78 7c421378

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/powernv: Disable interrupts while taking phb->lock
Michael Ellerman [Sun, 12 Feb 2012 14:28:20 +0000 (14:28 +0000)] 
powerpc/powernv: Disable interrupts while taking phb->lock

We need to disable interrupts when taking the phb->lock. Otherwise
we could deadlock with pci_lock taken from an interrupt.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc: Fix WARN_ON in decrementer_check_overflow
Benjamin Herrenschmidt [Wed, 8 Feb 2012 19:34:13 +0000 (19:34 +0000)] 
powerpc: Fix WARN_ON in decrementer_check_overflow

We use __get_cpu_var() which triggers a false positive warning
in smp_processor_id() thinking interrupts are enabled (at this
point, they are soft-enabled but hard-disabled).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/wsp: Fix IRQ affinity setting
Benjamin Herrenschmidt [Wed, 8 Feb 2012 18:11:01 +0000 (18:11 +0000)] 
powerpc/wsp: Fix IRQ affinity setting

We call the cache_hwirq_map() function with a linux IRQ number
but it expects a HW irq number. This triggers a BUG on multic-chip
setups in addition to not doing the right thing.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc: Implement GET_IP/SET_IP
Srikar Dronamraju [Wed, 8 Feb 2012 04:53:13 +0000 (04:53 +0000)] 
powerpc: Implement GET_IP/SET_IP

With this change, helpers such as instruction_pointer() et al, get defined
in the generic header in terms of GET_IP

Removed the unnecessary definition of profile_pc in !CONFIG_SMP case as
suggested by Mike Frysinger.

Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agopowerpc/wsp: Permanently enable PCI class code workaround
Benjamin Herrenschmidt [Sun, 5 Feb 2012 13:50:04 +0000 (13:50 +0000)] 
powerpc/wsp: Permanently enable PCI class code workaround

It appears that on the Chroma card, the class code of the root
complex is still wrong even on DD2 or later chips. This could
be a firmware issue, but that breaks resource allocation so let's
unconditionally fix it up.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agoocfs2: deal with wraparounds of i_nlink in ocfs2_rename()
Al Viro [Mon, 13 Feb 2012 02:00:05 +0000 (21:00 -0500)] 
ocfs2: deal with wraparounds of i_nlink in ocfs2_rename()

unfortunately, nlink_t may be smaller than 32 bits and ->i_nlink
on ocfs2 can grow up to 0xffffffff; storing it in nlink_t variable
will lose upper bits on such architectures.  Needs to be made u32,
until we get kernel-side nlink_t uniformly 32bit...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: fix compat_sys_stat() handling of overflows in st_nlink
Al Viro [Mon, 13 Feb 2012 01:56:29 +0000 (20:56 -0500)] 
vfs: fix compat_sys_stat() handling of overflows in st_nlink

Massaged cp_compat_stat() into form closer to cp_new_stat(); the only
real issue had been in handling of st_nlink overflows - native 32bit
stat(2) returns -EOVERFLOW in such situations, compat one silently
loses upper bits.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoquota: Fix deadlock with suspend and quotas
Jan Kara [Fri, 10 Feb 2012 10:03:01 +0000 (11:03 +0100)] 
quota: Fix deadlock with suspend and quotas

This script causes a kernel deadlock:
set -e
DEVICE=/dev/vg1/linear
lvchange -ay $DEVICE
mkfs.ext3 $DEVICE
mount -t ext3 -o usrquota,grpquota $DEVICE /mnt/test
quotacheck -gu /mnt/test
umount /mnt/test
mount -t ext3 -o usrquota,grpquota $DEVICE /mnt/test
quotaon /mnt/test
dmsetup suspend $DEVICE
setquota -u root 1 2 3 4 /mnt/test &
sleep 1
dmsetup resume $DEVICE

setquota acquired semaphore s_umount for read and then tried to perform a
transaction (and waits because the device is suspended).  dmsetup resume tries
to acquire s_umount for write before resuming the device (and waits for
setquota).

Fix the deadlock by grabbing a thawed superblock for quota commands which need
it.

Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: Provide function to get superblock and wait for it to thaw
Jan Kara [Fri, 10 Feb 2012 10:03:00 +0000 (11:03 +0100)] 
vfs: Provide function to get superblock and wait for it to thaw

In quota code we need to find a superblock corresponding to a device and wait
for superblock to be unfrozen. However this waiting has to happen without
s_umount semaphore because that is required for superblock to thaw. So provide
a function in VFS for this to keep dances with s_umount where they belong.

[AV: implementation switched to saner variant]

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: fix panic in __d_lookup() with high dentry hashtable counts
Dimitri Sivanich [Wed, 8 Feb 2012 20:39:07 +0000 (12:39 -0800)] 
vfs: fix panic in __d_lookup() with high dentry hashtable counts

When the number of dentry cache hash table entries gets too high
(2147483648 entries), as happens by default on a 16TB system, use of a
signed integer in the dcache_init() initialization loop prevents the
dentry_hashtable from getting initialized, causing a panic in
__d_lookup().  Fix this in dcache_init() and similar areas.

Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoautofs4 - fix lockdep splat in autofs
Steven Rostedt [Mon, 22 Aug 2011 03:52:28 +0000 (11:52 +0800)] 
autofs4 - fix lockdep splat in autofs

When recursing down the locks when traversing a tree/list in
get_next_positive_dentry() or get_next_positive_subdir() a lock can
change from being nested to being a parent which breaks lockdep. This
patch tells lockdep about what we did.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Ian Kent <raven@themaw.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: fix d_inode_lookup() dentry ref leak
Miklos Szeredi [Fri, 3 Feb 2012 13:25:18 +0000 (14:25 +0100)] 
vfs: fix d_inode_lookup() dentry ref leak

d_inode_lookup() leaks a dentry reference on IS_DEADDIR().

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agommc: dw_mmc: Fix PIO mode with support of highmem
Seungwon Jeon [Thu, 9 Feb 2012 05:32:43 +0000 (14:32 +0900)] 
mmc: dw_mmc: Fix PIO mode with support of highmem

Current PIO mode makes a kernel crash with CONFIG_HIGHMEM.
Highmem pages have a NULL from sg_virt(sg).
This patch fixes the following problem.

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 817 [#1] PREEMPT SMP
Modules linked in:
CPU: 0    Not tainted  (3.0.15-01423-gdbf465f #589)
PC is at dw_mci_pull_data32+0x4c/0x9c
LR is at dw_mci_read_data_pio+0x54/0x1f0
pc : [<c0358824>]    lr : [<c035988c>]    psr: 20000193
sp : c0619d48  ip : c0619d70  fp : c0619d6c
r10: 00000000  r9 : 00000002  r8 : 00001000
r7 : 00000200  r6 : 00000000  r5 : e1dd3100  r4 : 00000000
r3 : 65622023  r2 : 0000007f  r1 : eeb96000  r0 : e1dd3100
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment
xkernel
Control: 10c5387d  Table: 61e2004a  DAC: 00000015
Process swapper (pid: 0, stack limit = 0xc06182f0)
Stack: (0xc0619d48 to 0xc061a000)
9d40:                   e1dd3100 e1a4f000 00000000 e1dd3100 e1a4f000 00000200
9d60: c0619da4 c0619d70 c035988c c03587e4 c0619d9c e18158f4 e1dd3100 e1dd3100
9d80: 00000020 00000000 00000000 00000020 c06e8a84 00000000 c0619e04 c0619da8
9da0: c0359b24 c0359844 e18158f4 e1dd3164 e1dd3168 e1dd3150 3d02fc79 e1dd3154
9dc0: e1dd3178 00000000 00000020 00000000 e1dd3150 00000000 c10dd7e8 e1a84900
9de0: c061e7cc 00000000 00000000 0000008d c06e8a84 c061e780 c0619e4c c0619e08
9e00: c00c4738 c0359a34 3d02fc79 00000000 c0619e4c c05a1698 c05a1670 c05a165c
9e20: c04de8b0 c061e780 c061e7cc e1a84900 ffffed68 0000008d c0618000 00000000
9e40: c0619e6c c0619e50 c00c48b4 c00c46c8 c061e780 c00423ac c061e7cc ffffed68
9e60: c0619e8c c0619e70 c00c7358 c00c487c 0000008d ffffee38 c0618000 ffffed68
9e80: c0619ea4 c0619e90 c00c4258 c00c72b0 c00423ac ffffee38 c0619ecc c0619ea8
9ea0: c004241c c00c4234 ffffffff f8810000 0000006d 00000002 00000001 7fffffff
9ec0: c0619f44 c0619ed0 c0048bc0 c00423c4 220ae7a9 00000000 386f0d30 0005d3a4
9ee0: c00423ac c10dd0b8 c06f2cd8 c0618000 c0594778 c003a674 7fffffff c0619f44
9f00: 386f0d30 c0619f18 c00a6f94 c005be3c 80000013 ffffffff 386f0d30 0005d3a4
9f20: 386f0d30 0005d2d1 c10dd0a8 c10dd0b8 c06f2cd8 c0618000 c0619f74 c0619f48
9f40: c0345858 c005be00 c00a2440 c0618000 c0618000 c00410d8 c06c1944 c00410fc
9f60: c0594778 c003a674 c0619f9c c0619f78 c004a7e8 c03457b4 c0618000 c06c18f8
9f80: 00000000 c0039c70 c06c18d4 c003a674 c0619fb4 c0619fa0 c04ceafc c004a714
9fa0: c06287b4 c06c18f8 c0619ff4 c0619fb8 c0008b68 c04cea68 c0008578 00000000
9fc0: 00000000 c003a674 00000000 10c5387d c0628658 c003aa78 c062f1c4 4000406a
9fe0: 413fc090 00000000 00000000 c0619ff8 40008044 c0008858 00000000 00000000
Backtrace:
[<c03587d8>] (dw_mci_pull_data32+0x0/0x9c) from [<c035988c>] (dw_mci_read_data_pio+0x54/0x1f0)
 r6:00000200 r5:e1a4f000 r4:e1dd3100
 [<c0359838>] (dw_mci_read_data_pio+0x0/0x1f0) from [<c0359b24>] (dw_mci_interrupt+0xfc/0x4a4)
[<c0359a28>] (dw_mci_interrupt+0x0/0x4a4) from [<c00c4738>] (handle_irq_event_percpu+0x7c/0x1b4)
[<c00c46bc>] (handle_irq_event_percpu+0x0/0x1b4) from [<c00c48b4>] (handle_irq_event+0x44/0x64)
[<c00c4870>] (handle_irq_event+0x0/0x64) from [<c00c7358>] (handle_fasteoi_irq+0xb4/0x124)
 r7:ffffed68 r6:c061e7cc r5:c00423ac r4:c061e780
 [<c00c72a4>] (handle_fasteoi_irq+0x0/0x124) from [<c00c4258>] (generic_handle_irq+0x30/0x38)
 r7:ffffed68 r6:c0618000 r5:ffffee38 r4:0000008d
 [<c00c4228>] (generic_handle_irq+0x0/0x38) from [<c004241c>] (asm_do_IRQ+0x64/0xe0)
 r5:ffffee38 r4:c00423ac
 [<c00423b8>] (asm_do_IRQ+0x0/0xe0) from [<c0048bc0>] (__irq_svc+0x80/0x14c)
Exception stack(0xc0619ed0 to 0xc0619f18)

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: atmel-mci: save and restore sdioirq when soft reset is performed
Ludovic Desroches [Thu, 9 Feb 2012 10:55:29 +0000 (11:55 +0100)] 
mmc: atmel-mci: save and restore sdioirq when soft reset is performed

Sometimes a software reset is needed. Then some registers are saved and
restored but the interrupt mask register is missing. It causes issues
with sdio devices whose interrupts are masked after reset.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: block: Init ro_lock sysfs attr to fix lockdep warnings
Rabin Vincent [Wed, 1 Feb 2012 15:31:56 +0000 (16:31 +0100)] 
mmc: block: Init ro_lock sysfs attr to fix lockdep warnings

Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Johan Rudholm <johan.rudholm@stericsson.com>
Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sh_mmcif: fix late delayed work initialisation
Guennadi Liakhovetski [Fri, 20 Jan 2012 23:41:28 +0000 (00:41 +0100)] 
mmc: sh_mmcif: fix late delayed work initialisation

If the driver is loaded with a card in the slot, mmc_add_host() will
schedule an immediate card-detection work, which will start IO and wait
for command completion. Usually the kernel first returns to the sh_mmcif
probe function, lets it finish and only then schedules the rescan work.
But sometimes, expecially under heavy system load, the work will be
scheduled immediately before returning to the probe method. In this case
it is important for the driver to be fully prepared for IO. For sh_mmcif
this means, that also the timeout work has to be initialised before
calling mmc_add_host(). It is also better to prepare interrupts
beforehand. Besides, since mmc_add_host() does card-detection itself,
there is no need to do it again immediately afterwards.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: tmio_mmc: fix card eject during IO with DMA
Guennadi Liakhovetski [Fri, 6 Jan 2012 12:06:51 +0000 (13:06 +0100)] 
mmc: tmio_mmc: fix card eject during IO with DMA

When DMA is in use and the card is ejected during IO, DMA transfers have to
be terminated, otherwise the dmaengine driver fails to operate properly,
when the card is re-inserted.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: Fix comparison issue in mmc_compare_ext_csds
Jurgen Heeks [Wed, 1 Feb 2012 12:30:55 +0000 (13:30 +0100)] 
mmc: core: Fix comparison issue in mmc_compare_ext_csds

Found this issue during code review. Actually, there are two issues which
both compensate together in lucky case.  In unlucky case the bus width
probing might not work as expected.

Signed-off-by: Jurgen Heeks <jurgen.heeks@nokia.com>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: Fix PowerOff Notify suspend/resume
Girish K S [Tue, 31 Jan 2012 10:14:03 +0000 (15:44 +0530)] 
mmc: core: Fix PowerOff Notify suspend/resume

Modified the mmc_poweroff to resume before sending the poweroff
notification command. In sleep mode only AWAKE and RESET commands are
allowed, so before sending the poweroff notification command resume from
sleep mode and then send the notification command.

PowerOff Notify is tested on a Synopsis Designware Host Controller
(eMMC 4.5). The suspend to RAM and resume works fine.

Signed-off-by: Girish K S <girish.shivananjappa@linaro.org>
Tested-by: Girish K S <girish.shivananjappa@linaro.org>
Reviewed-by: Saugata Das <saugata.das@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci-pci: set Medfield SDIO as non-removable
Adrian Hunter [Mon, 30 Jan 2012 12:27:18 +0000 (14:27 +0200)] 
mmc: sdhci-pci: set Medfield SDIO as non-removable

Set Medfield SDIO as non-removable to avoid un-necessary
card detect activity.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: add the capability for broken voltage
Jaehoon Chung [Mon, 16 Jan 2012 08:49:01 +0000 (17:49 +0900)] 
mmc: core: add the capability for broken voltage

There is an understood mismatch between the voltage the host controller is
set to and the voltage supplied to the card by a fixed voltage regulator.
Teaching the driver to accept the mismatch is overly complicated.  Instead
just accept the regulator's voltage.

This patch adds MMC_CAP2_BROKEN_VOLTAGE.

If the voltage didn't satisfy between min_uV and max_uV, try to change
the voltage in core.c.  When changing the voltage, maybe use
regulator_set_voltage().

In regulator_set_voltage(), check the below condition.

/* sanity check */
if (!rdev->desc->ops->set_voltage &&
    !rdev->desc->ops->set_voltage_sel) {
ret = -EINVAL;
goto out;
}

If some board should use the fixed-regulator, always return -EINVAL.
Then, eMMC didn't initialize always.

So if use a fixed-regulator, we need to add the MMC_CAP2_BROKEN_VOLTAGE.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: Fix low speed mmc card detection failure
Girish K S [Thu, 19 Jan 2012 03:26:19 +0000 (08:56 +0530)] 
mmc: core: Fix low speed mmc card detection failure

This patch fixes the failure of low speed mmc card detection.

Signed-off-by: Girish K S <girish.shivananjappa@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: esdhc: set the timeout to the max value
Jerry Huang [Mon, 16 Jan 2012 06:13:04 +0000 (14:13 +0800)] 
mmc: esdhc: set the timeout to the max value

When accessing the card on some FSL platform boards (e.g p2020, p1010,
mpc8536), the following error is reported with the timeout value calculated:

mmc0: Got data interrupt 0x00000020 even though no data operation was
in progress.
mmc0: Got data interrupt 0x00000020 even though no data operation was
in progress.

So we skip the calculation of timeout and use the max value to fix it.

Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Signed-off-by: Gao Guanhua <B22826@freescale.com>
Signed-off-by: Xie Xiaobo <X.Xie@freescale.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: esdhc: add PIO mode support
Jerry Huang [Mon, 16 Jan 2012 06:13:03 +0000 (14:13 +0800)] 
mmc: esdhc: add PIO mode support

For some FSL ESDHC controllers (e.g. P2020E, Rev1.0), the SDHC can not
work on DMA mode because of the hardware bug, so we set a broken dma flag
and use PIO mode.

Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Signed-off-by: Gao Guanhua <B22826@freescale.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: Ensure clocks are always enabled before host interaction
Sujit Reddy Thumma [Sat, 4 Feb 2012 21:14:50 +0000 (16:14 -0500)] 
mmc: core: Ensure clocks are always enabled before host interaction

Ensure clocks are always enabled before any interaction with the
host controller driver. This makes sure that there is no race
between host execution and the core layer turning off clocks
in different context with clock gating framework.

Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Per Forlin <per.forlin@stericsson.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: of_mmc_spi: fix little endian support
Jean-Christophe PLAGNIOL-VILLARD [Mon, 30 Jan 2012 04:15:29 +0000 (05:15 +0100)] 
mmc: of_mmc_spi: fix little endian support

The voltage_ranges is supposed to switch from big endian to little endian.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: UHS sdio card that fails should not exceed 50MHz
Philip Rakity [Thu, 26 Jan 2012 14:57:10 +0000 (06:57 -0800)] 
mmc: core: UHS sdio card that fails should not exceed 50MHz

A UHS sdio card that fails initialization at 1.8v signaling is not in
UHS mode.  We cannot use the speed in the the cis to reflect the bus
speed as this is the maxiumum value and will not reflect the fact
that the host is operating at a lower (non uhs) bus speed.

Signed-off-by: Philip Rakity <prakity@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: Aaron Lu <aaron.lu@amd.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agoMerge tag 'for-linus' of git://github.com/rustyrussell/linux
Linus Torvalds [Tue, 14 Feb 2012 00:59:53 +0000 (16:59 -0800)] 
Merge tag 'for-linus' of git://github.com/rustyrussell/linux

* tag 'for-linus' of git://github.com/rustyrussell/linux:
  module: fix broken isapnp handling in file2alias
  module: make module param bint handle nul value

12 years agomodule: fix broken isapnp handling in file2alias
Ondrej Zary [Fri, 10 Feb 2012 19:12:27 +0000 (20:12 +0100)] 
module: fix broken isapnp handling in file2alias

Handling of isapnp module aliases was broken by commit
626596e295d477c0fefa08cd5daa7dd011b1bb2c by changing "isapnp" string to "isa".
The code was then modified by commit
e49ce14150c64b29a8dd211df785576fa19a9858 but this bug remained.

Change the string back to "isapnp".

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agomodule: make module param bint handle nul value
Dave Young [Wed, 1 Feb 2012 02:33:11 +0000 (10:33 +0800)] 
module: make module param bint handle nul value

Allow bint param accept nul values, just do same as bool param.

Signed-off-by: Dave Young <dyoung@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agoMerge branch 'at91-fixes' of git://github.com/at91linux/linux-at91 into fixes
Arnd Bergmann [Mon, 13 Feb 2012 23:25:44 +0000 (23:25 +0000)] 
Merge branch 'at91-fixes' of git://github.com/at91linux/linux-at91 into fixes

* 'at91-fixes' of git://github.com/at91linux/linux-at91:
  ARM: at91: drop ide driver in favor of the pata one
  pata/at91: use newly introduced SMC accessors
  ARM: at91: add accessor to manage SMC
  ARM: at91:rtc/rtc-at91sam9: ioremap register bank
  ARM: at91: USB AT91 gadget registration for module

This page took 0.068833 seconds and 5 git commands to generate.