]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
12 years agovm: avoid using find_vma_prev() unnecessarily
Linus Torvalds [Wed, 7 Mar 2012 02:23:36 +0000 (18:23 -0800)]
vm: avoid using find_vma_prev() unnecessarily

Several users of "find_vma_prev()" were not in fact interested in the
previous vma if there was no primary vma to be found either.  And in
those cases, we're much better off just using the regular "find_vma()",
and then "prev" can be looked up by just checking vma->vm_prev.

The find_vma_prev() semantics are fairly subtle (see Mikulas' recent
commit 83cd904d271b: "mm: fix find_vma_prev"), and the whole "return
prev by reference" means that it generates worse code too.

Thus this "let's avoid using this inconvenient and clearly too subtle
interface when we don't really have to" patch.

Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoregulator: Remove bq24022 regulator driver
Heiko Stübner [Fri, 2 Mar 2012 12:57:44 +0000 (13:57 +0100)]
regulator: Remove bq24022 regulator driver

The bq24022 driver is just a specialised form of a gpio-regulator.

As all former users of it now use the gpio-regulator directly, there
is no need to keep it around.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
12 years agoMerge git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Wed, 7 Mar 2012 00:55:50 +0000 (16:55 -0800)]
Merge git://git.samba.org/sfrench/cifs-2.6

Pull CIFS fixes from Steve French

* git://git.samba.org/sfrench/cifs-2.6:
  cifs: fix dentry refcount leak when opening a FIFO on lookup
  CIFS: Fix mkdir/rmdir bug for the non-POSIX case

12 years agomm: fix find_vma_prev
Mikulas Patocka [Mon, 5 Mar 2012 00:52:03 +0000 (19:52 -0500)]
mm: fix find_vma_prev

Commit 6bd4837de96e ("mm: simplify find_vma_prev()") broke memory
management on PA-RISC.

After application of the patch, programs that allocate big arrays on the
stack crash with segfault, for example, this will crash if compiled
without optimization:

  int main()
  {
char array[200000];
array[199999] = 0;
return 0;
  }

The reason is that PA-RISC has up-growing stack and the stack is usually
the last memory area.  In the above example, a page fault happens above
the stack.

Previously, if we passed too high address to find_vma_prev, it returned
NULL and stored the last VMA in *pprev.  After "simplify find_vma_prev"
change, it stores NULL in *pprev.  Consequently, the stack area is not
found and it is not expanded, as it used to be before the change.

This patch restores the old behavior and makes it return the last VMA in
*pprev if the requested address is higher than address of any other VMA.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agogenirq: Clear action->thread_mask if IRQ_ONESHOT is not set
Thomas Gleixner [Tue, 6 Mar 2012 22:18:54 +0000 (23:18 +0100)]
genirq: Clear action->thread_mask if IRQ_ONESHOT is not set

Xommit ac5637611(genirq: Unmask oneshot irqs when thread was not woken)
fails to unmask when a !IRQ_ONESHOT threaded handler is handled by
handle_level_irq.

This happens because thread_mask is or'ed unconditionally in
irq_wake_thread(), but for !IRQ_ONESHOT interrupts never cleared.  So
the check for !desc->thread_active fails and keeps the interrupt
disabled.

Keep the thread_mask zero for !IRQ_ONESHOT interrupts.

Document the thread_mask magic while at it.

Reported-and-tested-by: Sven Joachim <svenjoac@gmx.de>
Reported-and-tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoARM: OMAP3+: PM: VP: fix integer truncation error
Yuan Jiangli [Tue, 6 Mar 2012 18:51:12 +0000 (12:51 -0600)]
ARM: OMAP3+: PM: VP: fix integer truncation error

commit 2f34ce81b8c05c900e45bd88595cc154f7bb5957
(OMAP3: PM: Adding voltage driver support.)
introduced runtime computation of waittime to handle all potential
sys clocks available.

In the voltage processor, the SPMSUpdateWait is calculated based on
the slew rate and the voltage step (SMPSUpdateWait = slew rate *
Voltage Step). After the voltage processor receives the SMPS_Ack
signal, the Voltage Controller will wait for SMPSUpdateWait clock
cycles for the voltage to settle to the new value. For all
practical purposes, the waittime parameter is the OMAP hardware
translation of what the slew rate on the PMIC is.

As an example, with TPS62361 on OMAP4460,
step_size = 10000
slew_rate = 32000
sys_clk_rate = 38400

Our current computation results in the following:
 = ((step_size / slew_rate) * sys_clk_rate) / 1000
 = ((10000 / 32000) * 38400 / 1000
 = 0

Fix the same using DIV_ROUND_UP as an extra wait clock cycle
is better than lesser clock cycle. For the above example, this
translates to:
 = (10000 * 38400) / (1000 * 32000)
 = 12

Acked-by: Jon Hunter <jon-hunter@ti.com>
[nm@ti.com: slightly better implementation]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Yuan Jiangli <jlyuan@motorola.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoopenvswitch: Honor dp_ifindex, when specified, for vport lookup by name.
Ben Pfaff [Tue, 6 Mar 2012 23:04:04 +0000 (15:04 -0800)]
openvswitch: Honor dp_ifindex, when specified, for vport lookup by name.

When OVS_VPORT_ATTR_NAME is specified and dp_ifindex is nonzero, the
logical behavior would be for the vport name lookup scope to be limited
to the specified datapath, but in fact the dp_ifindex value was ignored.
This commit causes the search scope to be honored.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
12 years agoIPv6: Fix not join all-router mcast group when forwarding set.
Li Wei [Mon, 5 Mar 2012 14:45:17 +0000 (14:45 +0000)]
IPv6: Fix not join all-router mcast group when forwarding set.

When forwarding was set and a new net device is register,
we need add this device to the all-router mcast group.

Signed-off-by: Li Wei <lw@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agommap: EINVAL not ENOMEM when rejecting VM_GROWS
Hugh Dickins [Tue, 6 Mar 2012 20:28:52 +0000 (12:28 -0800)]
mmap: EINVAL not ENOMEM when rejecting VM_GROWS

Currently error is -ENOMEM when rejecting VM_GROWSDOWN|VM_GROWSUP
from shared anonymous: hoist the file case's -EINVAL up for both.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agocaif-hsi: Set default MTU to 4096
Sjur Brændeland [Sun, 4 Mar 2012 08:38:58 +0000 (08:38 +0000)]
caif-hsi: Set default MTU to 4096

Default MTU for CAIF HSI was wrongly set to 15 * 4092 bytes.
The patch sets default MTU size to 4096.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoARM: OMAP2+: PM: fix wakeupgen warning when hotplug disabled
Kevin Hilman [Tue, 6 Mar 2012 20:00:25 +0000 (12:00 -0800)]
ARM: OMAP2+: PM: fix wakeupgen warning when hotplug disabled

When CONFIG_HOTPLUG_CPU=n, there are unused functions in wakeupgen:

arch/arm/mach-omap2/omap-wakeupgen.c:181: warning: 'wakeupgen_irqmask_all' defined but not used

Fix this by moving all the functions only used when CONFIG_HOTPLUG_CPU=y
together and wrapping in an #ifdef.

No functional changes.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agocxgb4vf: Add support for Chelsio's T480-CR and T440-LP-CR adapters
Vipul Pandya [Mon, 5 Mar 2012 22:56:37 +0000 (22:56 +0000)]
cxgb4vf: Add support for Chelsio's T480-CR and T440-LP-CR adapters

This patch adds PCI device ids for Chelsio's T480-CR and T440-LP-CR
adapters.

Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocxgb4: Add support for Chelsio's T480-CR and T440-LP-CR adapters
Vipul Pandya [Mon, 5 Mar 2012 22:56:36 +0000 (22:56 +0000)]
cxgb4: Add support for Chelsio's T480-CR and T440-LP-CR adapters

This patch adds PCI device ids for Chelsio's T480-CR and T440-LP-CR
adapters.

Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoARM: OMAP2+: PM: fix section mismatch with omap2_init_processor_devices()
Kevin Hilman [Tue, 6 Mar 2012 19:38:01 +0000 (11:38 -0800)]
ARM: OMAP2+: PM: fix section mismatch with omap2_init_processor_devices()

Fix the below warning by making omap2_init_processor_devices() __init.
It is called by an __init function and calls only __init functions, so
it should also be init.

WARNING: arch/arm/mach-omap2/built-in.o(.text+0x183c): Section mismatch in reference from the function omap2_init_processor_devices() to the function .init.text:_init_omap_device()
The function omap2_init_processor_devices() references
the function __init _init_omap_device().
This is often because omap2_init_processor_devices lacks a __init
annotation or the annotation of _init_omap_device is wrong.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP2: Fix section warning for n8x0 when CONFIG_MMC_OMAP is not set
Tony Lindgren [Tue, 6 Mar 2012 19:49:28 +0000 (11:49 -0800)]
ARM: OMAP2: Fix section warning for n8x0 when CONFIG_MMC_OMAP is not set

Otherwise we get:

arch/arm/mach-omap2/board-n8x0.c:39:12: warning:
'slot1_cover_open' defined but not used [-Wunused-variable]
arch/arm/mach-omap2/board-n8x0.c:40:12: warning:
'slot2_cover_open' defined but not used [-Wunused-variable]
arch/arm/mach-omap2/board-n8x0.c:41:23: warning:
'mmc_device' defined but not used [-Wunused-variable]

Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP2+: Fix omap24xx_io_desc warning if SoC subtypes are not selected
Tony Lindgren [Tue, 6 Mar 2012 19:49:22 +0000 (11:49 -0800)]
ARM: OMAP2+: Fix omap24xx_io_desc warning if SoC subtypes are not selected

Otherwise we get the following warning:

arch/arm/mach-omap2/io.c:53:24: warning:
'omap24xx_io_desc' defined but not used [-Wunused-variable]

Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agomlx4_core: remove buggy sched_queue masking
Yevgeny Petrilin [Tue, 6 Mar 2012 03:05:14 +0000 (03:05 +0000)]
mlx4_core: remove buggy sched_queue masking

Fixes a bug introduced by commit fe9a2603c, where the priority bits
in the schedule queue field were masked out.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetfilter: nf_conntrack: fix early_drop with reliable event delivery
Pablo Neira Ayuso [Tue, 6 Mar 2012 01:22:55 +0000 (01:22 +0000)]
netfilter: nf_conntrack: fix early_drop with reliable event delivery

If reliable event delivery is enabled and ctnetlink fails to deliver
the destroy event in early_drop, the conntrack subsystem cannot
drop any the candidate flow that was planned to be evicted.

Reported-by: Kerin Millar <kerframil@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobridge: netfilter: don't call iptables on vlan packets if sysctl is off
Florian Westphal [Tue, 6 Mar 2012 01:22:54 +0000 (01:22 +0000)]
bridge: netfilter: don't call iptables on vlan packets if sysctl is off

When net.bridge.bridge-nf-filter-vlan-tagged is 0 (default), vlan packets
arriving should not be sent to ip(6)tables by bridge netfilter.

However, it turns out that we currently always send VLAN packets to
netfilter, if ..
a), CONFIG_VLAN_8021Q is enabled ; or
b), CONFIG_VLAN_8021Q is not set but rx vlan offload is enabled
   on the bridge port.

This is because bridge netfilter treats skb with
skb->protocol == ETH_P_IP{V6} as "non-vlan packet".

With rx vlan offload on or CONFIG_VLAN_8021Q=y, the vlan header has
already been removed here, and we cannot rely on skb->protocol alone.

Fix this by only using skb->protocol if the skb has no vlan tag,
or if a vlan tag is present and filter-vlan-tagged bridge netfilter
sysctl is enabled.

We cannot remove the skb->protocol == htons(ETH_P_8021Q) test
because the vlan tag is still around in the CONFIG_VLAN_8021Q=n &&
"ethtool -K $itf rxvlan off" case.

reproducer:
iptables -t raw -I PREROUTING -i br0
iptables -t raw -I PREROUTING -i br0.1

Then send packets to an ip address configured on br0.1 interface.
Even with net.bridge.bridge-nf-filter-vlan-tagged=0, the 1st rule
will match instead of the 2nd one.

With this patch applied, the 2nd rule will match instead.
In the non-local address case, netfilter won't be consulted after
this patch unless the sysctl is switched on.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetfilter: bridge: fix wrong pointer dereference
Pablo Neira Ayuso [Tue, 6 Mar 2012 01:22:53 +0000 (01:22 +0000)]
netfilter: bridge: fix wrong pointer dereference

In adf7ff8, a invalid dereference was added in ebt_make_names.

CC [M]  net/bridge/netfilter/ebtables.o
net/bridge/netfilter/ebtables.c: In function `ebt_make_names':
net/bridge/netfilter/ebtables.c:1371:20: warning: `t' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetfilter: ctnetlink: remove incorrect spin_[un]lock_bh on NAT module autoload
Pablo Neira Ayuso [Tue, 6 Mar 2012 01:22:51 +0000 (01:22 +0000)]
netfilter: ctnetlink: remove incorrect spin_[un]lock_bh on NAT module autoload

Since 7d367e0, ctnetlink_new_conntrack is called without holding
the nf_conntrack_lock spinlock. Thus, ctnetlink_parse_nat_setup
does not require to release that spinlock anymore in the NAT module
autoload case.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetfilter: ebtables: fix wrong name length while copying to user-space
Santosh Nayak [Tue, 6 Mar 2012 01:22:50 +0000 (01:22 +0000)]
netfilter: ebtables: fix wrong name length while copying to user-space

user-space ebtables expects 32 bytes-long names, but xt_match names
use 29 bytes. We have to copy less 29 bytes and then, make sure we
fill the remaining bytes with zeroes.

Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agor8169: runtime resume before shutdown.
françois romieu [Tue, 6 Mar 2012 01:14:12 +0000 (01:14 +0000)]
r8169: runtime resume before shutdown.

With runtime PM, if the ethernet cable is disconnected, the device is
transitioned to D3 state to conserve energy. If the system is shutdown
in this state, any register accesses in rtl_shutdown are dropped on
the floor. As the device was programmed by .runtime_suspend() to wake
on link changes, it is thus brought back up as soon as the link recovers.

Resuming every suspended device through the driver core would slow things
down and it is not clear how many devices really need it now.

Original report and D0 transition patch by Sameer Nanda. Patch has been
changed to comply with advices by Rafael J. Wysocki and the PM folks.

Reported-by: Sameer Nanda <snanda@chromium.org>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Hayes Wang <hayeswang@realtek.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcp: fix tcp_shift_skb_data() to not shift SACKed data below snd_una
Neal Cardwell [Mon, 5 Mar 2012 19:35:04 +0000 (19:35 +0000)]
tcp: fix tcp_shift_skb_data() to not shift SACKed data below snd_una

This commit fixes tcp_shift_skb_data() so that it does not shift
SACKed data below snd_una.

This fixes an issue whose symptoms exactly match reports showing
tp->sacked_out going negative since 3.3.0-rc4 (see "WARNING: at
net/ipv4/tcp_input.c:3418" thread on netdev).

Since 2008 (832d11c5cd076abc0aa1eaf7be96c81d1a59ce41)
tcp_shift_skb_data() had been shifting SACKed ranges that were below
snd_una. It checked that the *end* of the skb it was about to shift
from was above snd_una, but did not check that the end of the actual
shifted range was above snd_una; this commit adds that check.

Shifting SACKed ranges below snd_una is problematic because for such
ranges tcp_sacktag_one() short-circuits: it does not declare anything
as SACKed and does not increase sacked_out.

Before the fixes in commits cc9a672ee522d4805495b98680f4a3db5d0a0af9
and daef52bab1fd26e24e8e9578f8fb33ba1d0cb412, shifting SACKed ranges
below snd_una happened to work because tcp_shifted_skb() was always
(incorrectly) passing in to tcp_sacktag_one() an skb whose end_seq
tcp_shift_skb_data() had already guaranteed was beyond snd_una. Hence
tcp_sacktag_one() never short-circuited and always increased
tp->sacked_out in this case.

After those two fixes, my testing has verified that shifting SACKed
ranges below snd_una could cause tp->sacked_out to go negative with
the following sequence of events:

(1) tcp_shift_skb_data() sees an skb whose end_seq is beyond snd_una,
    then shifts a prefix of that skb that is below snd_una

(2) tcp_shifted_skb() increments the packet count of the
    already-SACKed prev sk_buff

(3) tcp_sacktag_one() sees the end of the new SACKed range is below
    snd_una, so it short-circuits and doesn't increase tp->sacked_out

(5) tcp_clean_rtx_queue() sees the SACKed skb has been ACKed,
    decrements tp->sacked_out by this "inflated" pcount that was
    missing a matching increase in tp->sacked_out, and hence
    tp->sacked_out underflows to a u32 like 0xFFFFFFFF, which casted
    to s32 is negative.

(6) this leads to the warnings seen in the recent "WARNING: at
    net/ipv4/tcp_input.c:3418" thread on the netdev list; e.g.:
    tcp_input.c:3418  WARN_ON((int)tp->sacked_out < 0);

More generally, I think this bug can be tickled in some cases where
two or more ACKs from the receiver are lost and then a DSACK arrives
that is immediately above an existing SACKed skb in the write queue.

This fix changes tcp_shift_skb_data() to abort this sequence at step
(1) in the scenario above by noticing that the bytes are below snd_una
and not shifting them.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
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 [Tue, 6 Mar 2012 19:16:48 +0000 (14:16 -0500)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem

12 years agoMerge tag 'fixes-3.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Linus Torvalds [Tue, 6 Mar 2012 17:10:31 +0000 (09:10 -0800)]
Merge tag 'fixes-3.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull arm-soc bug fixes from Arnd Bergmann:
 "Here are all the fixes I got after sending the last pull request.
  These fix mostly regressions on exynos, at91, pxa and ep93xx.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>"
* tag 'fixes-3.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: ep93xx: convert vision_ep9307 to MULTI_IRQ_HANDLER
  ARM: EXYNOS: fix touchscreen IRQ setup on Universal C210 board
  ARM: pxa: fix invalid mfp pin issue
  ARM: pxa: remove duplicated registeration on pxa-gpio
  ARM: pxa: add dummy clock for pxa25x and pxa27x
  ARM: S3C24XX: DMA resume regression fix
  ARM: S3C24XX: Fix restart on S3C2442
  ARM: SAMSUNG: Fix memory size for hsotg
  ARM: at91/dma: DMA controller registering with DT support
  ARM: at91/dma: remove platform data from DMA controller

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Tue, 6 Mar 2012 16:24:15 +0000 (08:24 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 regression fix from Martin Schwidefsky:
 "It is a fix for a regression that has been introduced with git commit
  25f269f17316 - "[S390] qdio: EQBS retry after CCQ 96" - and if possible
  we would like to have working code for the fcp data router in 3.3."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  [S390] qdio: fix handler function arguments for zfcp data router

12 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Linus Torvalds [Tue, 6 Mar 2012 16:23:30 +0000 (08:23 -0800)]
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "A simple fix that's obvious from inspection.  There's no mainline
  users of this driver yet (there's some i.MX platforms which will use
  it)."

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: Fix mask parameter in da9052_reg_update calls

12 years agovsprintf: make %pV handling compatible with kasprintf()
Jan Beulich [Mon, 5 Mar 2012 16:49:24 +0000 (16:49 +0000)]
vsprintf: make %pV handling compatible with kasprintf()

kasprintf() (and potentially other functions that I didn't run across so
far) want to evaluate argument lists twice.  Caring to do so for the
primary list is obviously their job, but they can't reasonably be
expected to check the format string for instances of %pV, which however
need special handling too: On architectures like x86-64 (as opposed to
e.g.  ix86), using the same argument list twice doesn't produce the
expected results, as an internally managed cursor gets updated during
the first run.

Fix the problem by always acting on a copy of the original list when
handling %pV.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agopage_cgroup: fix horrid swap accounting regression
Hugh Dickins [Tue, 6 Mar 2012 04:52:55 +0000 (20:52 -0800)]
page_cgroup: fix horrid swap accounting regression

Why is memcg's swap accounting so broken? Insane counts, wrong
ownership, unfreeable structures, which later get freed and then
accessed after free.

Turns out to be a tiny a little 3.3-rc1 regression in 9fb4b7cc0724
"page_cgroup: add helper function to get swap_cgroup": the helper
function (actually named lookup_swap_cgroup()) returns an address using
void* arithmetic, but the structure in question is a short.

Signed-off-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Bob Liu <lliubbo@gmail.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Johannes Weiner <jweiner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'fixes' of git://github.com/hzhuang1/linux into fixes
Arnd Bergmann [Tue, 6 Mar 2012 16:12:13 +0000 (16:12 +0000)]
Merge branch 'fixes' of git://github.com/hzhuang1/linux into fixes

* 'fixes' of git://github.com/hzhuang1/linux: (3 commits)
  ARM: pxa: fix invalid mfp pin issue
  ARM: pxa: remove duplicated registeration on pxa-gpio
  ARM: pxa: add dummy clock for pxa25x and pxa27x

Includes an update to v3.3-rc6

12 years agoMerge branch 'v3.3-samsung-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Tue, 6 Mar 2012 16:11:56 +0000 (16:11 +0000)]
Merge branch 'v3.3-samsung-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into fixes

* 'v3.3-samsung-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
  ARM: EXYNOS: fix touchscreen IRQ setup on Universal C210 board
  ARM: S3C24XX: DMA resume regression fix
  ARM: S3C24XX: Fix restart on S3C2442
  ARM: SAMSUNG: Fix memory size for hsotg

12 years agoARM: ep93xx: convert vision_ep9307 to MULTI_IRQ_HANDLER
H Hartley Sweeten [Fri, 2 Mar 2012 00:13:59 +0000 (17:13 -0700)]
ARM: ep93xx: convert vision_ep9307 to MULTI_IRQ_HANDLER

As done for the other ep93xx machines in:

commit 9a6879bd902e2ec605fff4d9fb3247b440a1f66a
ARM: ep93xx: convert to MULTI_IRQ_HANDLER

Now that there is a generic IRQ handler for multiple VIC devices use it
for vision_ep9307 to help building multi platform kernels.

Signed-off-by: Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Ryan Mallon <rmallon@gmail.com>
Reviewed-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 years agoMerge branch 'ux500-fixes-20120301' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Tue, 6 Mar 2012 15:42:54 +0000 (15:42 +0000)]
Merge branch 'ux500-fixes-20120301' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson into next/fixes-non-critical

* 'ux500-fixes-20120301' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson:
  ARM: ux500: solve some Kconfig mess
  ARM: ux500: delete TPS6105X selection
  ARM: ux500: select CPU_FREQ_TABLE where needed
  ARM: ux500: select L2X0 cache on ux500
  ARM: ux500: add board autoselection
  ARM: ux500: U8500 depends on MMU
  ARM: ux500: included linux/gpio.h twice
  ARM: ux500: fix around AB8500 GPIO macro name
  ARM: ux500: set ARCH_NR_GPIO to 355 on U8500 platforms
  ARM: ux500: Add audio-regulators
  ARM: ux500: Add DMA-channels for MSP
  ARM: ux500: Add placeholder for clk_set_parent

12 years agoARM: EXYNOS: fix touchscreen IRQ setup on Universal C210 board
Bartlomiej Zolnierkiewicz [Tue, 6 Mar 2012 10:25:15 +0000 (02:25 -0800)]
ARM: EXYNOS: fix touchscreen IRQ setup on Universal C210 board

Fixes atmel_mxt_ts freeze on Universal C210.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
12 years agoALSA: hda - add quirk to detect CD input on Gigabyte EP45-DS3
Marton Balint [Mon, 5 Mar 2012 20:33:23 +0000 (21:33 +0100)]
ALSA: hda - add quirk to detect CD input on Gigabyte EP45-DS3

My CD input got lost in commit 68ef0561efe494143516df38c03a16b837b8e79c.
Raymond helped me to add the necessary pin fixup to make it appear again. In
fact, this is basically his patch. It fixes alsa bug #5541.

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agortc: sa1100: add OF support
Haojian Zhuang [Mon, 5 Mar 2012 11:26:42 +0000 (19:26 +0800)]
rtc: sa1100: add OF support

Add OF support on rtc-sa1100.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
12 years agoARM: pxa: fix invalid mfp pin issue
Haojian Zhuang [Tue, 6 Mar 2012 06:57:16 +0000 (14:57 +0800)]
ARM: pxa: fix invalid mfp pin issue

Failure is reported on hx4700 with kernel v3.3-rc1.

__mfp_validate: GPIO20 is invalid pin
__mfp_validate: GPIO21 is invalid pin
__mfp_validate: GPIO15 is invalid pin
__mfp_validate: GPIO78 is invalid pin
__mfp_validate: GPIO79 is invalid pin
__mfp_validate: GPIO80 is invalid pin
__mfp_validate: GPIO33 is invalid pin
__mfp_validate: GPIO48 is invalid pin
__mfp_validate: GPIO49 is invalid pin
__mfp_validate: GPIO50 is invalid pin

Since pxa_last_gpio is used in mfp-pxa2xx driver. But it's only
updated in pxa-gpio driver that run after mfp-pxa2xx driver.

So update the pxa_last_gpio first in mfp-pxa2xx driver.

Reported-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
12 years agoARM: pxa: remove duplicated registeration on pxa-gpio
Haojian Zhuang [Tue, 6 Mar 2012 06:37:04 +0000 (14:37 +0800)]
ARM: pxa: remove duplicated registeration on pxa-gpio

Both reboot (via reboot(RB_AUTOBOOT)) and suspend freeze on hx4700.

Registration of pxa_gpio_syscore_ops is moved into pxa-gpio driver,
but it still exists in arch-pxa directory. It resulsts failure on
reboot and suspend.

Now remove the registration code in arch-pxa.

Reported-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
12 years agoARM: pxa: add dummy clock for pxa25x and pxa27x
Haojian Zhuang [Tue, 28 Feb 2012 02:57:48 +0000 (10:57 +0800)]
ARM: pxa: add dummy clock for pxa25x and pxa27x

gpio-pxa driver is shared among arch-pxa and arch-mmp. Clock is the
essential component on pxa3xx/pxa95x and arch-mmp. So we need to
define dummy clock in pxa25x/pxa27x instead.

This regression was introduced by the commit "ARM: pxa: add dummy
clock for sa1100-rtc", id a55b5adaf403c4d032e0871ad4ee3367782f4db6.

Reported-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
12 years agotg3: Fix to use multi queue BQL interfaces
Tom Herbert [Mon, 5 Mar 2012 19:53:50 +0000 (19:53 +0000)]
tg3: Fix to use multi queue BQL interfaces

Fix tg3 to use BQL multi queue related netdev interfaces since the
device supports multi queue.

Signed-off-by: Tom Herbert <therbert@google.com>
Reported-by: Christoph Lameter <cl@gentwo.org>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agopxa: magician/hx4700: Convert to gpio-regulator from bq24022
Heiko Stübner [Fri, 2 Mar 2012 12:56:38 +0000 (13:56 +0100)]
pxa: magician/hx4700: Convert to gpio-regulator from bq24022

The bq24022 on these machines is a very simple regulator using gpios.
One provides the on/off functionality and a second one is used to
change the current between 100 and 500 mA.

This functionality can also be provided by the more generic gpio-regulator.

Therefore convert both machines which makes it possible to remove the
bq24022 driver later on.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
12 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 6 Mar 2012 00:23:12 +0000 (16:23 -0800)]
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar:
 "It contains three cherry-picked fixes from perf/core, which turned out
  to be more urgent than we originally thought."

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf tools: Handle kernels that don't support attr.exclude_{guest,host}
  perf tools: Change perf_guest default back to false
  perf record: No build id option fails

12 years agoARM: OMAP1: Fix section mismatch for omap1_init_early()
Tony Lindgren [Tue, 6 Mar 2012 00:11:04 +0000 (16:11 -0800)]
ARM: OMAP1: Fix section mismatch for omap1_init_early()

Fix the following warning:

WARNING: vmlinux.o(.text+0x1286c): Section mismatch in reference
from the function omap1_init_early() to the function .init.text:omap1_clk_init()
The function omap1_init_early() references
the function __init omap1_clk_init().
This is often because omap1_init_early lacks a __init
annotation or the annotation of omap1_clk_init is wrong.

Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP1: Fix typo in lcd_dma.c
Masanari Iida [Tue, 6 Mar 2012 00:11:04 +0000 (16:11 -0800)]
ARM: OMAP1: Fix typo in lcd_dma.c

Correct spelling "resulotion" to "resolution" in
arch/arm/mach-omap1/lcd_dma.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP: mailbox: trivial whitespace fix
Felipe Contreras [Tue, 6 Mar 2012 00:11:03 +0000 (16:11 -0800)]
ARM: OMAP: mailbox: trivial whitespace fix

Trivial whitespace fix

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP: Remove definition cpu_is_omap4430()
Jon Hunter [Tue, 6 Mar 2012 00:11:03 +0000 (16:11 -0800)]
ARM: OMAP: Remove definition cpu_is_omap4430()

The definition cpu_is_omap4430() always returns 0 even when CONFIG_ARCH_OMAP4
is enabled. This macro should be removed and the macro cpu_is_omap443x() should
be used where needed for OMAP4430 devices.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP2+: included some headers twice
Danny Kukawka [Tue, 6 Mar 2012 00:11:03 +0000 (16:11 -0800)]
ARM: OMAP2+: included some headers twice

arch/arm/mach-omap2/: included some headers tiwce:
- arch/arm/mach-omap2/board-ldp.c: 'linux/gpio.h'
- arch/arm/mach-omap2/io.c: 'common.h'
- arch/arm/mach-omap2/omap_hwmod_44xx_data.c: 'plat/i2c.h'

Remove the duplicates.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP: clock.c: included linux/debugfs.h twice
Danny Kukawka [Tue, 6 Mar 2012 00:11:03 +0000 (16:11 -0800)]
ARM: OMAP: clock.c: included linux/debugfs.h twice

arch/arm/plat-omap/clock.c: included 'linux/debugfs.h' twice,
remove the duplicate.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP: don't build hwspinlock in vain
Ohad Ben-Cohen [Tue, 6 Mar 2012 00:11:02 +0000 (16:11 -0800)]
ARM: OMAP: don't build hwspinlock in vain

Cleanup: don't build mach-omap2/hwspinlock.c if the OMAP hwspinlock
driver isn't configured.

This will both shorten build time and avoid registering a device
which isn't needed.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP2+: ads7846_init: put gpio_pendown into pdata if it's provided
Ilya Yanok [Tue, 6 Mar 2012 00:11:02 +0000 (16:11 -0800)]
ARM: OMAP2+: ads7846_init: put gpio_pendown into pdata if it's provided

If platform data is provided by the caller gpio_pendown is put into
unused static ads7846_config structure and effectively has no effect.
Of course caller can set gpio_pendown field in platform data himself
but it seems natural to do this in ads7846_init to remove duplication.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: omap: pandora: fix usbhs platform data
Grazvydas Ignotas [Tue, 6 Mar 2012 00:11:02 +0000 (16:11 -0800)]
ARM: omap: pandora: fix usbhs platform data

It turned out wrong OMAP HSUSB port was configured on pandora,
but still managed to work somehow. This was noticed after enabling
in-kernel mux, where USB muxing was causing other devices not to work,
because hsusb1 pins (instead of hsusb2) were wrongly remuxed, which
are used for other things on pandora.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP: sram: Add am33xx SRAM support (minimal)
Vaibhav Bedia [Tue, 6 Mar 2012 00:11:01 +0000 (16:11 -0800)]
ARM: OMAP: sram: Add am33xx SRAM support (minimal)

Update SRAM start & size for am33xx SoC's.

Note: cpu_is_34xx() is true for am33xx also. Doing
cpu_is_am33xx() check after cpu_is_34xx() will not
achieve what we want due to the above reason.
Hence cpu_is_am33xx() is done before cpu_is_34xx()

Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP2+: id: Add am33xx SoC type detection
Afzal Mohammed [Tue, 6 Mar 2012 00:11:01 +0000 (16:11 -0800)]
ARM: OMAP2+: id: Add am33xx SoC type detection

Determine SoC type, i.e. whether GP or HS

Note: cpu_is_34xx() is true for am33xx also. Doing
cpu_is_am33xx() check after cpu_is_34xx() will not
achieve what we want due to the above reason.
Hence cpu_is_am33xx() is done before cpu_is_34xx()

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP2+: GPMC: Export gpmc_enable_hwecc and gpmc_calculate_ecc
Bernhard Walle [Tue, 6 Mar 2012 00:11:01 +0000 (16:11 -0800)]
ARM: OMAP2+: GPMC: Export gpmc_enable_hwecc and gpmc_calculate_ecc

To be able to compile kernel/drivers/mtd/nand/omap2.ko as module, that
two symbols need to be exported. Otherwise, I get following error
message

    ERROR: "gpmc_calculate_ecc" [drivers/mtd/nand/omap2.ko] undefined!
    ERROR: "gpmc_enable_hwecc" [drivers/mtd/nand/omap2.ko] undefined!

Signed-off-by: Bernhard Walle <walle@corscience.de>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP: dmtimer: fix missing content/correction in low-power mode support
Tarun Kanti DebBarma [Tue, 6 Mar 2012 00:11:00 +0000 (16:11 -0800)]
ARM: OMAP: dmtimer: fix missing content/correction in low-power mode support

Since omap_dm_timer_write_reg/__omap_dm_timer_write is now modified
to use timer->func_base OCP_CFG should not use this wrapper anymore.
Instead use __raw_writel() directly and use timer->io_base instead
to write to OCP_CFG.

The timer->sys_stat is valid only if timer->revision is 1. In the
context restore function make this correction.

Save the contexts and loss count when timer is stopped.
Also, disable the clock. Else, clock usecount would become imbalanced.

Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Tested-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoMerge tag 'usb-3.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Tue, 6 Mar 2012 00:10:44 +0000 (16:10 -0800)]
Merge tag 'usb-3.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

USB: revert a powerpc EHCI patch

There is just one patch in here, a revert of a powerpc EHCI driver
patch that was reported to cause problems.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tag 'usb-3.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  Revert "powerpc/usb: fix issue of CPU halt when missing USB PHY clock"

12 years agoMerge tag 'tty-3.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Tue, 6 Mar 2012 00:10:27 +0000 (16:10 -0800)]
Merge tag 'tty-3.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

tty: build fix for 3.3-rc6

This contains one build fix for the powerpc udbg driver that was reported.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tag 'tty-3.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  tty/powerpc: early udbg consoles can't be modules

12 years agoRevert "ARM: OMAP2+: Fix multiple randconfig errors with SOC_OMAP and SOC_OMAP_NOOP"
Tony Lindgren [Tue, 6 Mar 2012 00:02:18 +0000 (16:02 -0800)]
Revert "ARM: OMAP2+: Fix multiple randconfig errors with SOC_OMAP and SOC_OMAP_NOOP"

This reverts commit c295fb633e321a7df3b8846c4eaddc5da3e0aaed.

This makes existing .config files bloated by selecting in all
omaps as noted by Russell King - ARM Linux <linux@arm.linux.org.uk>.

Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoMerge tag 'md-3.3-fixes' of git://neil.brown.name/md
Linus Torvalds [Tue, 6 Mar 2012 00:01:25 +0000 (16:01 -0800)]
Merge tag 'md-3.3-fixes' of git://neil.brown.name/md

Pull md fixes from Neil Brown:
 "Three fixes for md in 3.3-rc: Two relate to the recently added drive
  replacement.  One fixes the problem where a read error in RAID10 would
  sometimes be retried indefinitely."

* tag 'md-3.3-fixes' of git://neil.brown.name/md:
  md/raid10: fix assembling of arrays with replacement devices.
  md/raid10: fix handling of error on last working device in array.
  md/raid1: fix buglet in md_raid1_contested.

12 years agoMerge branch 'akpm' (Andrew's patch bomb)
Linus Torvalds [Mon, 5 Mar 2012 23:50:25 +0000 (15:50 -0800)]
Merge branch 'akpm' (Andrew's patch bomb)

Merge the emailed seties of 19 patches from Andrew Morton

* akpm:
  rapidio/tsi721: fix queue wrapping bug in inbound doorbell handler
  memcg: fix mapcount check in move charge code for anonymous page
  mm: thp: fix BUG on mm->nr_ptes
  alpha: fix 32/64-bit bug in futex support
  memcg: fix GPF when cgroup removal races with last exit
  debugobjects: Fix selftest for static warnings
  floppy/scsi: fix setting of BIO flags
  memcg: fix deadlock by inverting lrucare nesting
  drivers/rtc/rtc-r9701.c: fix crash in r9701_remove()
  c2port: class_create() returns an ERR_PTR
  pps: class_create() returns an ERR_PTR, not NULL
  hung_task: fix the broken rcu_lock_break() logic
  vfork: kill PF_STARTING
  coredump_wait: don't call complete_vfork_done()
  vfork: make it killable
  vfork: introduce complete_vfork_done()
  aio: wake up waiters when freeing unused kiocbs
  kprobes: return proper error code from register_kprobe()
  kmsg_dump: don't run on non-error paths by default

12 years agorapidio/tsi721: fix queue wrapping bug in inbound doorbell handler
Alexandre Bounine [Mon, 5 Mar 2012 22:59:21 +0000 (14:59 -0800)]
rapidio/tsi721: fix queue wrapping bug in inbound doorbell handler

Fix a bug that causes a kernel panic when the number of received doorbells
is larger than number of entries in the inbound doorbell queue (current
default value = 512).

Another possible indication for this bug is large number of spurious
doorbells reported by tsi721 driver after reaching the queue size maximum.

Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Chul Kim <chul.kim@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: <stable@vger.kernel.org> [3.2.x+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomemcg: fix mapcount check in move charge code for anonymous page
Naoya Horiguchi [Mon, 5 Mar 2012 22:59:20 +0000 (14:59 -0800)]
memcg: fix mapcount check in move charge code for anonymous page

Currently the charge on shared anonyous pages is supposed not to moved in
task migration.  To implement this, we need to check that mapcount > 1,
instread of > 2.  So this patch fixes it.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hillf Danton <dhillf@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: thp: fix BUG on mm->nr_ptes
Andrea Arcangeli [Mon, 5 Mar 2012 22:59:20 +0000 (14:59 -0800)]
mm: thp: fix BUG on mm->nr_ptes

Dave Jones reports a few Fedora users hitting the BUG_ON(mm->nr_ptes...)
in exit_mmap() recently.

Quoting Hugh's discovery and explanation of the SMP race condition:

  "mm->nr_ptes had unusual locking: down_read mmap_sem plus
   page_table_lock when incrementing, down_write mmap_sem (or mm_users
   0) when decrementing; whereas THP is careful to increment and
   decrement it under page_table_lock.

   Now most of those paths in THP also hold mmap_sem for read or write
   (with appropriate checks on mm_users), but two do not: when
   split_huge_page() is called by hwpoison_user_mappings(), and when
   called by add_to_swap().

   It's conceivable that the latter case is responsible for the
   exit_mmap() BUG_ON mm->nr_ptes that has been reported on Fedora."

The simplest way to fix it without having to alter the locking is to make
split_huge_page() a noop in nr_ptes terms, so by counting the preallocated
pagetables that exists for every mapped hugepage.  It was an arbitrary
choice not to count them and either way is not wrong or right, because
they are not used but they're still allocated.

Reported-by: Dave Jones <davej@redhat.com>
Reported-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Cc: <stable@vger.kernel.org> [3.0.x, 3.1.x, 3.2.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoalpha: fix 32/64-bit bug in futex support
Andrew Morton [Mon, 5 Mar 2012 22:59:19 +0000 (14:59 -0800)]
alpha: fix 32/64-bit bug in futex support

Michael Cree said:

: : I have noticed some user space problems (pulseaudio crashes in pthread
: : code, glibc/nptl test suite failures, java compiler freezes on SMP alpha
: : systems) that arise when using a 2.6.39 or later kernel on Alpha.
: : Bisecting between 2.6.38 and 2.6.39 (using glibc/nptl test suite as
: : criterion for good/bad kernel) eventually leads to:
: :
: : 8d7718aa082aaf30a0b4989e1f04858952f941bc is the first bad commit
: : commit 8d7718aa082aaf30a0b4989e1f04858952f941bc
: : Author: Michel Lespinasse <walken@google.com>
: : Date:   Thu Mar 10 18:50:58 2011 -0800
: :
: :     futex: Sanitize futex ops argument types
: :
: :     Change futex_atomic_op_inuser and futex_atomic_cmpxchg_inatomic
: :     prototypes to use u32 types for the futex as this is the data type the
: :     futex core code uses all over the place.
: :
: : Looking at the commit I see there is a change of the uaddr argument in
: : the Alpha architecture specific code for futexes from int to u32, but I
: : don't see why this should cause a problem.

Richard Henderson said:

: futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
:                               u32 oldval, u32 newval)
: ...
:         :       "r"(uaddr), "r"((long)oldval), "r"(newval)
:
:
: There is no 32-bit compare instruction.  These are implemented by
: consistently extending the values to a 64-bit type.  Since the
: load instruction sign-extends, we want to sign-extend the other
: quantity as well (despite the fact it's logically unsigned).
:
: So:
:
: -        :       "r"(uaddr), "r"((long)oldval), "r"(newval)
: +        :       "r"(uaddr), "r"((long)(int)oldval), "r"(newval)
:
: should do the trick.

Michael said:

: This fixes the glibc test suite failures and the pulseaudio related
: crashes, but it does not fix the java compiiler lockups that I was (and
: are still) observing.  That is some other problem.

Reported-by: Michael Cree <mcree@orcon.net.nz>
Tested-by: Michael Cree <mcree@orcon.net.nz>
Acked-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Michel Lespinasse <walken@google.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomemcg: fix GPF when cgroup removal races with last exit
Hugh Dickins [Mon, 5 Mar 2012 22:59:18 +0000 (14:59 -0800)]
memcg: fix GPF when cgroup removal races with last exit

When moving tasks from old memcg (with move_charge_at_immigrate on new
memcg), followed by removal of old memcg, hit General Protection Fault in
mem_cgroup_lru_del_list() (called from release_pages called from
free_pages_and_swap_cache from tlb_flush_mmu from tlb_finish_mmu from
exit_mmap from mmput from exit_mm from do_exit).

Somewhat reproducible, takes a few hours: the old struct mem_cgroup has
been freed and poisoned by SLAB_DEBUG, but mem_cgroup_lru_del_list() is
still trying to update its stats, and take page off lru before freeing.

A task, or a charge, or a page on lru: each secures a memcg against
removal.  In this case, the last task has been moved out of the old memcg,
and it is exiting: anonymous pages are uncharged one by one from the
memcg, as they are zapped from its pagetables, so the charge gets down to
0; but the pages themselves are queued in an mmu_gather for freeing.

Most of those pages will be on lru (and force_empty is careful to
lru_add_drain_all, to add pages from pagevec to lru first), but not
necessarily all: perhaps some have been isolated for page reclaim, perhaps
some isolated for other reasons.  So, force_empty may find no task, no
charge and no page on lru, and let the removal proceed.

There would still be no problem if these pages were immediately freed; but
typically (and the put_page_testzero protocol demands it) they have to be
added back to lru before they are found freeable, then removed from lru
and freed.  We don't see the issue when adding, because the
mem_cgroup_iter() loops keep their own reference to the memcg being
scanned; but when it comes to mem_cgroup_lru_del_list().

I believe this was not an issue in v3.2: there, PageCgroupAcctLRU and
PageCgroupUsed flags were used (like a trick with mirrors) to deflect view
of pc->mem_cgroup to the stable root_mem_cgroup when neither set.
38c5d72f3ebe ("memcg: simplify LRU handling by new rule") mercifully
removed those convolutions, but left this General Protection Fault.

But it's surprisingly easy to restore the old behaviour: just check
PageCgroupUsed in mem_cgroup_lru_add_list() (which decides on which lruvec
to add), and reset pc to root_mem_cgroup if page is uncharged.  A risky
change?  just going back to how it worked before; testing, and an audit of
uses of pc->mem_cgroup, show no problem.

And there's a nice bonus: with mem_cgroup_lru_add_list() itself making
sure that an uncharged page goes to root lru, mem_cgroup_reset_owner() no
longer has any purpose, and we can safely revert 4e5f01c2b9b9 ("memcg:
clear pc->mem_cgroup if necessary").

Calling update_page_reclaim_stat() after add_page_to_lru_list() in swap.c
is not strictly necessary: the lru_lock there, with RCU before memcg
structures are freed, makes mem_cgroup_get_reclaim_stat_from_page safe
without that; but it seems cleaner to rely on one dependency less.

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agodebugobjects: Fix selftest for static warnings
Stephen Boyd [Mon, 5 Mar 2012 22:59:17 +0000 (14:59 -0800)]
debugobjects: Fix selftest for static warnings

debugobjects is now printing a warning when a fixup for a NOTAVAILABLE
object is run.  This causes the selftest to fail like:

ODEBUG: selftest warnings failed 4 != 5

We could just increase the number of warnings that the selftest is
expecting to see because that is actually what has changed.  But, it turns
out that fixup_activate() was written with inverted logic and thus a fixup
for a static object returned 1 indicating the object had been fixed, and 0
otherwise.  Fix the logic to be correct and update the counts to reflect
that nothing needed fixing for a static object.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agofloppy/scsi: fix setting of BIO flags
Muthu Kumar [Mon, 5 Mar 2012 22:59:16 +0000 (14:59 -0800)]
floppy/scsi: fix setting of BIO flags

Fix setting bio flags in drivers (sd_dif/floppy).

Signed-off-by: Muthukumar R <muthur@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomemcg: fix deadlock by inverting lrucare nesting
Hugh Dickins [Mon, 5 Mar 2012 22:59:16 +0000 (14:59 -0800)]
memcg: fix deadlock by inverting lrucare nesting

We have forgotten the rules of lock nesting: the irq-safe ones must be
taken inside the non-irq-safe ones, otherwise we are open to deadlock:

CPU0                          CPU1
----                          ----
lock(&(&pc->lock)->rlock);
                              local_irq_disable();
                              lock(&(&zone->lru_lock)->rlock);
                              lock(&(&pc->lock)->rlock);
<Interrupt>
lock(&(&zone->lru_lock)->rlock);

To check a different locking issue, I happened to add a spin_lock to
memcg's bit_spin_lock in lock_page_cgroup(), and lockdep very quickly
complained about __mem_cgroup_commit_charge_lrucare() (on CPU1 above).

So delete __mem_cgroup_commit_charge_lrucare(), passing a bool lrucare to
__mem_cgroup_commit_charge() instead, taking zone->lru_lock under
lock_page_cgroup() in the lrucare case.

The original was using spin_lock_irqsave, but we'd be in more trouble if
it were ever called at interrupt time: unconditional _irq is enough.  And
ClearPageLRU before del from lru, SetPageLRU before add to lru: no strong
reason, but that is the ordering used consistently elsewhere.

Fixes 36b62ad539498d00c2d280a151a ("memcg: simplify corner case handling
of LRU").

Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agodrivers/rtc/rtc-r9701.c: fix crash in r9701_remove()
Anatolij Gustschin [Mon, 5 Mar 2012 22:59:16 +0000 (14:59 -0800)]
drivers/rtc/rtc-r9701.c: fix crash in r9701_remove()

If probing the RTC didn't succeed due to failed RTC register access, the
RTC device will be unregistered.  Then, when removing the module
r9701_remove() causes a kernel crash while trying to unregister a not
registered RTC device.  Fix this by doing RTC register access test before
RTC device registration.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoc2port: class_create() returns an ERR_PTR
Dan Carpenter [Mon, 5 Mar 2012 22:59:15 +0000 (14:59 -0800)]
c2port: class_create() returns an ERR_PTR

class_create() doesn't return a NULL, it only returns ERR_PTRs.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agopps: class_create() returns an ERR_PTR, not NULL
Dan Carpenter [Mon, 5 Mar 2012 22:59:15 +0000 (14:59 -0800)]
pps: class_create() returns an ERR_PTR, not NULL

class_create() never returns NULLs only ERR_PTRs.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agohung_task: fix the broken rcu_lock_break() logic
Oleg Nesterov [Mon, 5 Mar 2012 22:59:14 +0000 (14:59 -0800)]
hung_task: fix the broken rcu_lock_break() logic

check_hung_uninterruptible_tasks()->rcu_lock_break() introduced by
"softlockup: check all tasks in hung_task" commit ce9dbe24 looks
absolutely wrong.

- rcu_lock_break() does put_task_struct(). If the task has exited
  it is not safe to even read its ->state, nothing protects this
  task_struct.

- The TASK_DEAD checks are wrong too. Contrary to the comment, we
  can't use it to check if the task was unhashed. It can be unhashed
  without TASK_DEAD, or it can be valid with TASK_DEAD.

  For example, an autoreaping task can do release_task(current)
  long before it sets TASK_DEAD in do_exit().

  Or, a zombie task can have ->state == TASK_DEAD but release_task()
  was not called, and in this case we must not break the loop.

Change this code to check pid_alive() instead, and do this before we drop
the reference to the task_struct.

Note: while_each_thread() under rcu_read_lock() is not really safe, it can
livelock.  This will be fixed later, but fortunately in this case the
"max_count" logic saves us anyway.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Mandeep Singh Baines <msb@google.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agovfork: kill PF_STARTING
Oleg Nesterov [Mon, 5 Mar 2012 22:59:14 +0000 (14:59 -0800)]
vfork: kill PF_STARTING

Previously it was (ab)used by utrace.  Then it was wrongly used by the
scheduler code.

Currently it is not used, kill it before it finds the new erroneous user.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agocoredump_wait: don't call complete_vfork_done()
Oleg Nesterov [Mon, 5 Mar 2012 22:59:13 +0000 (14:59 -0800)]
coredump_wait: don't call complete_vfork_done()

Now that CLONE_VFORK is killable, coredump_wait() no longer needs
complete_vfork_done().  zap_threads() should find and kill all tasks with
the same ->mm, this includes our parent if ->vfork_done is set.

mm_release() becomes the only caller, unexport complete_vfork_done().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agovfork: make it killable
Oleg Nesterov [Mon, 5 Mar 2012 22:59:13 +0000 (14:59 -0800)]
vfork: make it killable

Make vfork() killable.

Change do_fork(CLONE_VFORK) to do wait_for_completion_killable().  If it
fails we do not return to the user-mode and never touch the memory shared
with our child.

However, in this case we should clear child->vfork_done before return, we
use task_lock() in do_fork()->wait_for_vfork_done() and
complete_vfork_done() to serialize with each other.

Note: now that we use task_lock() we don't really need completion, we
could turn task->vfork_done into "task_struct *wake_up_me" but this needs
some complications.

NOTE: this and the next patches do not affect in-kernel users of
CLONE_VFORK, kernel threads run with all signals ignored including
SIGKILL/SIGSTOP.

However this is obviously the user-visible change.  Not only a fatal
signal can kill the vforking parent, a sub-thread can do execve or
exit_group() and kill the thread sleeping in vfork().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agovfork: introduce complete_vfork_done()
Oleg Nesterov [Mon, 5 Mar 2012 22:59:13 +0000 (14:59 -0800)]
vfork: introduce complete_vfork_done()

No functional changes.

Move the clear-and-complete-vfork_done code into the new trivial helper,
complete_vfork_done().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoaio: wake up waiters when freeing unused kiocbs
Jeff Moyer [Mon, 5 Mar 2012 22:59:12 +0000 (14:59 -0800)]
aio: wake up waiters when freeing unused kiocbs

Bart Van Assche reported a hung fio process when either hot-removing
storage or when interrupting the fio process itself.  The (pruned) call
trace for the latter looks like so:

  fio             D 0000000000000001     0  6849   6848 0x00000004
   ffff880092541b88 0000000000000046 ffff880000000000 ffff88012fa11dc0
   ffff88012404be70 ffff880092541fd8 ffff880092541fd8 ffff880092541fd8
   ffff880128b894d0 ffff88012404be70 ffff880092541b88 000000018106f24d
  Call Trace:
    schedule+0x3f/0x60
    io_schedule+0x8f/0xd0
    wait_for_all_aios+0xc0/0x100
    exit_aio+0x55/0xc0
    mmput+0x2d/0x110
    exit_mm+0x10d/0x130
    do_exit+0x671/0x860
    do_group_exit+0x44/0xb0
    get_signal_to_deliver+0x218/0x5a0
    do_signal+0x65/0x700
    do_notify_resume+0x65/0x80
    int_signal+0x12/0x17

The problem lies with the allocation batching code.  It will
opportunistically allocate kiocbs, and then trim back the list of iocbs
when there is not enough room in the completion ring to hold all of the
events.

In the case above, what happens is that the pruning back of events ends
up freeing up the last active request and the context is marked as dead,
so it is thus responsible for waking up waiters.  Unfortunately, the
code does not check for this condition, so we end up with a hung task.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reported-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Bart Van Assche <bvanassche@acm.org>
Cc: <stable@kernel.org> [3.2.x only]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agokprobes: return proper error code from register_kprobe()
Prashanth Nageshappa [Mon, 5 Mar 2012 22:59:12 +0000 (14:59 -0800)]
kprobes: return proper error code from register_kprobe()

register_kprobe() aborts if the address of the new request falls in a
prohibited area (such as ftrace pouch, __kprobes annotated functions,
non-kernel text addresses, jump label text).  We however don't return the
right error on this abort, resulting in a silent failure - incorrect
adding/reporting of kprobes ('perf probe do_fork+18' or 'perf probe
mcount' for instance).

In V2 we are incorporating Masami Hiramatsu's  feedback.

This patch fixes it by returning -EINVAL upon failure.

While we are here, rename the label used for exit to be more appropriate.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Prashanth K Nageshappa <prashanth@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Jason Baron <jbaron@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agokmsg_dump: don't run on non-error paths by default
Matthew Garrett [Mon, 5 Mar 2012 22:59:10 +0000 (14:59 -0800)]
kmsg_dump: don't run on non-error paths by default

Since commit 04c6862c055f ("kmsg_dump: add kmsg_dump() calls to the
reboot, halt, poweroff and emergency_restart paths"), kmsg_dump() gets
run on normal paths including poweroff and reboot.

This is less than ideal given pstore implementations that can only
represent single backtraces, since a reboot may overwrite a stored oops
before it's been picked up by userspace.  In addition, some pstore
backends may have low performance and provide a significant delay in
reboot as a result.

This patch adds a printk.always_kmsg_dump kernel parameter (which can also
be changed from userspace).  Without it, the code will only be run on
failure paths rather than on normal paths.  The option can be enabled in
environments where there's a desire to attempt to audit whether or not a
reboot was cleanly requested or not.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Seiji Aguchi <seiji.aguchi@hds.com>
Cc: Seiji Aguchi <seiji.aguchi@hds.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Marco Stornelli <marco.stornelli@gmail.com>
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Don Zickus <dzickus@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoARM: ecard: ensure fake vma vm_flags is setup
Russell King [Mon, 5 Mar 2012 23:29:51 +0000 (23:29 +0000)]
ARM: ecard: ensure fake vma vm_flags is setup

Our TLB ops want to check the vma vm_flags to find out whether the
mapping is executable.  However, we leave this uninitialized in
ecard.c.  Initialize it with an appropriate value.

Reported-by: Al Viro <viro@ftp.linux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agomd/raid10: fix assembling of arrays with replacement devices.
NeilBrown [Mon, 5 Mar 2012 06:48:12 +0000 (17:48 +1100)]
md/raid10: fix assembling of arrays with replacement devices.

commit 56a2559bb654a (md/raid10: recognise replacements ...)
changed 'run' to set ->replacement or ->rdev depending on the
'Replacement' status if the device, but it didn't remove the
old unconditional setting of 'rdev'.  So it was largely ineffective.

So remove that now.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agodrm, gma500: Fix Cedarview boot failures in 3.3-rc
Alan Cox [Mon, 5 Mar 2012 14:22:16 +0000 (14:22 +0000)]
drm, gma500: Fix Cedarview boot failures in 3.3-rc

Production GMA3600/3650 hardware turns out to be subtly different to the
development platforms.  This combined with a minor driver bug is causing
the kernel to hang on these platforms.

This patch does the following

 - turn down a couple of messages that were meant to be debug and are
   causing much confusion

 - ensure the hotplug interrupt is disabled on Cedartrail systems.

 - fix a bug where gtt roll mode called psbfb_sync, which tries to sync
   the 2D engine. On other devices it is harmless as the 2D engine is
   present but not in use when in gtt roll mode, on Cedartrail it causes
   a hang

Without these changes 3.3-rc hangs on boot on Cedartrail based systems.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Mon, 5 Mar 2012 22:30:54 +0000 (14:30 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

1) TCP SACK processing can calculate an incorrect reordering value in
   some cases, fix from Neal Cardwell.

2) tcp_mark_head_lost() can split SKBs in situations where it should
   not, violating send queue invariants expected by other pieces of
   code and thus resulting (eventually) in corrupted retransmit state
   counters.  Also from Neal Cardwell.

3) qla3xxx erroneously calls spin_lock_irqrestore() with constant
   hw_flags of zero.  Fix from Santosh Nayak.

4) Fix NULL deref in rt2x00, from Gabor Juhos.

5) pch_gbe passes address of wrong typed object to pch_gbe_validate_option
   thus corrupting part of the value.  From Dan Carpenter.

6) We must check the return value of nlmsg_parse() before trying to use
   the results.  From Eric Dumazet.

7) Bridging code fails to check return value of ipv6_dev_get_saddr()
   thus potentially leaving uninitialized garbage in the outgoing ipv6
   header.  From Ulrich Weber.

8) Due to rounding and a reversed operation on jiffies, bridge message
   ages can go backwards instead of forwards, thus breaking STP.  Fixes
   from Joakim Tjernlund.

9) r8169 modifies Config* registers without properly holding the
   Config9346 lock, resulting in corrupted IP fragments on some chips.
   Fix from Francois Romieu.

10) NET_PACKET_ENGINE default wan't set properly during the network
   driver mega-move.  Fix from Stephen Hemminger.

11) vmxnet3 uses TCP header size where it actually should use the UDP
   header size, fix from Shreyas Bhatewara.

12) Netfilter bridge module autoload is busted in the compat case, fix
   from Florian Westphal.

13) Wireless Key removal was not setting multicast bits correctly thus
   accidently killing the unicast key 0 and thus all traffic stops.
   Fix from Johannes Berg.

14) Fix endless retries of A-MPDU transmissions in brcm80211 driver.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (22 commits)
  qla3xxx: ethernet: Fix bogus interrupt state flag.
  bridge: check return value of ipv6_dev_get_saddr()
  rtnetlink: fix rtnl_calcit() and rtnl_dump_ifinfo()
  bridge: message age needs to increase, not decrease.
  bridge: Adjust min age inc for HZ > 256
  tcp: don't fragment SACKed skbs in tcp_mark_head_lost()
  r8169: corrupted IP fragments fix for large mtu.
  packetengines: fix config default
  vmxnet3: Fix transport header size
  enic: fix an endian bug in enic_probe()
  pch_gbe: memory corruption calling pch_gbe_validate_option()
  tg3: Fix tg3_get_stats64 for 5700 / 5701 devs
  tcp: fix false reordering signal in tcp_shifted_skb
  tcp: fix comment for tp->highest_sack
  netfilter: bridge: fix module autoload in compat case
  brcm80211: smac: only print block-ack timeout message at trace level
  brcm80211: smac: fix endless retry of A-MPDU transmissions
  mac80211: Fix a warning on changing to monitor mode from STA
  mac80211: zero initialize count field in ieee80211_tx_rate
  iwlwifi: fix key removal
  ...

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci
Linus Torvalds [Mon, 5 Mar 2012 22:30:12 +0000 (14:30 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci

Pull PCI fixes from Jesse Barnes:
 "A couple of fixes for booting specific machines, and one for a minor
  memory leak on pre-_CRS platforms."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci:
  x86/PCI: do not tie MSI MS-7253 use_crs quirk to BIOS version
  x86/PCI: use host bridge _CRS info on MSI MS-7253
  PCI: fix memleak when ACPI _CRS is not used.

12 years agoMerge branch 'for-3.3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
Linus Torvalds [Mon, 5 Mar 2012 22:28:36 +0000 (14:28 -0800)]
Merge branch 'for-3.3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu

Pull per-cpu patches from Tejun Heo:
 "This pull request contains four patches.  One replaces manual clearing
  with bitmap_clear(), two fix generic definition of __this_cpu ops so
  that they don't choose unnecessarily strict arch version.  One makes
  _this_cpu definition use raw_local_irq_*() so that it doesn't end up
  wrecking irq on/off state tracking when used from inside lockdep.

  Of the four patches, the raw_local_irq_*() update is the most
  important, so please feel free to cherry pick only that one patch and
  ignore the rest if you want to - commit e920d5971d 'percpu: use
  raw_local_irq_* in _this_cpu op'."

* 'for-3.3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
  percpu: fix __this_cpu_{sub,inc,dec}_return() definition
  percpu: use raw_local_irq_* in _this_cpu op
  percpu: fix generic definition of __this_cpu_add_and_return()
  percpu: use bitmap_clear

12 years agoMerge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Linus Torvalds [Mon, 5 Mar 2012 22:27:34 +0000 (14:27 -0800)]
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus

Pull MIPS fixes from Ralf Baechle:
 "What's in there: a number of MIPS fixes and touchups.  The most
  important change in this pull request is Kautuk Consul's port of
  changes to do_page_fault which fix a hang that affects some
  configurations.  Still not quite ready for a release, there are
  problems with 64-bit platforms."

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
  MIPS: traps.c: Fix typo
  MIPS: PowerTV: Fix defconfigs for coverage builds
  MIPS: Netlogic: Fix defconfigs for coverage builds
  MIPS: ATH79: Avoid a kernel bug on AR913X
  MIPS: PCI: use list_for_each_entry() for bus->devices traversal
  MIPS: fault.c: Port OOM changes to do_page_fault
  MIPS: vmlinux.lds.S: remove duplicate _sdata symbol
  MIPS: Alchemy: Increase minimum timeout for 32kHz timer.
  MIPS: txx9 7segled fix struct device has no member
  MIPS: Alchemy: Update Au1300 inlined GPIO macros
  MIPS: Remove temporary kludge from <asm/page.h>
  MIPS: BMIPS: smp-bmips.c does not need to include version.h

12 years agoMerge branch 'for_3.4/cleanup/sr' of git://git.kernel.org/pub/scm/linux/kernel/git...
Tony Lindgren [Mon, 5 Mar 2012 22:25:35 +0000 (14:25 -0800)]
Merge branch 'for_3.4/cleanup/sr' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into sr

12 years agoARM: OMAP2+: Fix module build errors with CONFIG_OMAP4_ERRATA_I688
R Sricharan [Fri, 2 Mar 2012 11:01:18 +0000 (16:31 +0530)]
ARM: OMAP2+: Fix module build errors with CONFIG_OMAP4_ERRATA_I688

While building modules with randconfig the below errors are observed.

ERROR: "omap_bus_sync" [drivers/watchdog/sp805_wdt.ko] undefined!
ERROR: "omap_bus_sync" [drivers/watchdog/dw_wdt.ko] undefined!
ERROR: "omap_bus_sync" [drivers/virtio/virtio_ring.ko] undefined!
ERROR: "omap_bus_sync" [drivers/video/sm501fb.ko] undefined!
ERROR: "omap_bus_sync" [drivers/usb/mon/usbmon.ko] undefined!
ERROR: "omap_bus_sync" [drivers/usb/host/sl811-hcd.ko] undefined!
ERROR: "omap_bus_sync" [drivers/usb/host/ohci-hcd.ko] undefined!
ERROR: "omap_bus_sync" [drivers/usb/host/isp1760.ko] undefined!
ERROR: "omap_bus_sync" [drivers/usb/host/isp1362-hcd.ko] undefined!
ERROR: "omap_bus_sync" [drivers/usb/host/isp116x-hcd.ko] undefined!
ERROR: "omap_bus_sync" [drivers/usb/core/usbcore.ko] undefined!
ERROR: "omap_bus_sync" [drivers/tty/serial/altera_uart.ko] undefined!
ERROR: "omap_bus_sync" [drivers/tty/serial/altera_jtaguart.ko] undefined!
ERROR: "omap_bus_sync" [drivers/tty/serial/8250/8250_dw.ko] undefined!
ERROR: "omap_bus_sync" [drivers/ssb/ssb.ko] undefined!
ERROR: "omap_bus_sync" [drivers/rtc/rtc-cmos.ko] undefined!
ERROR: "omap_bus_sync" [drivers/rtc/rtc-bq4802.ko] undefined!
ERROR: "omap_bus_sync" [drivers/mtd/nand/tmio_nand.ko] undefined!
ERROR: "omap_bus_sync" [drivers/mtd/nand/omap2.ko] undefined!

Signed-off-by: R Sricharan <r.sricharan@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoflush_tlb_range() needs ->page_table_lock when ->mmap_sem is not held
Al Viro [Mon, 5 Mar 2012 06:40:29 +0000 (06:40 +0000)]
flush_tlb_range() needs ->page_table_lock when ->mmap_sem is not held

All other callers already hold either ->mmap_sem (exclusive) or
->page_table_lock.  And we need it because some page table flushing
instanced do work explicitly with ge tables.

See e.g.  arch/powerpc/mm/tlb_hash32.c, flush_tlb_range() and
flush_range() in there.  The same goes for uml, with a lot more
extensive playing with page tables.

Almost all callers are actually fine - flush_tlb_range() may have no
need to bother playing with page tables, but it can do so safely; again,
this caller is the sole exception - everything else either has exclusive
->mmap_sem on the mm in question, or mm->page_table_lock is held.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoVM_GROWS{UP,DOWN} shouldn't be set on shmem VMAs
Al Viro [Mon, 5 Mar 2012 06:39:47 +0000 (06:39 +0000)]
VM_GROWS{UP,DOWN} shouldn't be set on shmem VMAs

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoaout: move setup_arg_pages() prior to reading/mapping the binary
Al Viro [Mon, 5 Mar 2012 06:38:42 +0000 (06:38 +0000)]
aout: move setup_arg_pages() prior to reading/mapping the binary

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoqla3xxx: ethernet: Fix bogus interrupt state flag.
Santosh Nayak [Fri, 2 Mar 2012 05:09:05 +0000 (05:09 +0000)]
qla3xxx: ethernet: Fix bogus interrupt state flag.

In 'ql_adapter_initialize'
the first call for 'spin_unlock_irqrestore()' is with hw_flags = 0,
which is as good as 'spin_unlock_irq()' (unconditional interrupt
enabling). If this is intended, then for better performance
'spin_unlock_irqrestore()' can be replaced with 'spin_unlock_irq()'
and 'spin_lock_irqsave()' can be replaced by 'spin_lock_irq()

Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobridge: check return value of ipv6_dev_get_saddr()
Ulrich Weber [Mon, 5 Mar 2012 04:52:44 +0000 (04:52 +0000)]
bridge: check return value of ipv6_dev_get_saddr()

otherwise source IPv6 address of ICMPV6_MGM_QUERY packet
might be random junk if IPv6 is disabled on interface or
link-local address is not yet ready (DAD).

Signed-off-by: Ulrich Weber <ulrich.weber@sophos.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoiwlwifi: fix wowlan suspend
Johannes Berg [Sun, 4 Mar 2012 16:31:35 +0000 (08:31 -0800)]
iwlwifi: fix wowlan suspend

This was broken by the commit 023ca58f1
"iwlwifi: Move the core suspend function to iwl-agn-lib"
where for some reason the code changed while moving,
from
.len[0] = sizeof(*key_data.rsc_tsc),
to
.len[0] = sizeof(key_data.rsc_tsc),

Cc: stable@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoARM: OMAP3+: SmartReflex: fix error handling
Jean Pihet [Wed, 29 Feb 2012 22:33:49 +0000 (23:33 +0100)]
ARM: OMAP3+: SmartReflex: fix error handling

Fix the code to correctly use IS_ERR and PTR_ERR on the return
values pointers

Reported-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agoARM: OMAP3+: SmartReflex: fix the use of debugfs_create_* API
Jean Pihet [Wed, 29 Feb 2012 22:33:48 +0000 (23:33 +0100)]
ARM: OMAP3+: SmartReflex: fix the use of debugfs_create_* API

The debugfs_create_* API returns a return code or NULL
in the return ptr in case of problem.
Fix the smartreflex code to take this into account.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agoARM: OMAP3+: SmartReflex: micro-optimization for sanity check
Felipe Balbi [Wed, 29 Feb 2012 22:33:47 +0000 (23:33 +0100)]
ARM: OMAP3+: SmartReflex: micro-optimization for sanity check

val && (val != 1) == val > 1

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agoARM: OMAP3+: SmartReflex: misc cleanups
Felipe Balbi [Wed, 29 Feb 2012 22:33:46 +0000 (23:33 +0100)]
ARM: OMAP3+: SmartReflex: misc cleanups

There are no functional changes here, only misc cleanups in general:
- re-organize variable declarations,
- converting if {} else if {} else {} into switch statements,
- correct comments typos,
- add/remove white lines to improve readability,
- etc.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agoARM: OMAP3+: SmartReflex: move late_initcall() closer to its argument
Felipe Balbi [Wed, 29 Feb 2012 22:33:45 +0000 (23:33 +0100)]
ARM: OMAP3+: SmartReflex: move late_initcall() closer to its argument

no functional changes, trivial patch.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>