pandora-kernel.git
12 years agocifs_permission() doesn't need to bail out in RCU mode
Al Viro [Sun, 19 Jun 2011 00:03:36 +0000 (20:03 -0400)]
cifs_permission() doesn't need to bail out in RCU mode

nothing potentially blocking except generic_permission(), which
will DTRT

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agobad_inode_permission() is safe from RCU mode
Al Viro [Sat, 18 Jun 2011 23:59:04 +0000 (19:59 -0400)]
bad_inode_permission() is safe from RCU mode

return -EIO; is *not* a blocking operation, thank you very much.
Nick, what the hell have you been smoking?

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoubifs: dereferencing an ERR_PTR in ubifs_mount()
Dan Carpenter [Mon, 20 Jun 2011 07:10:24 +0000 (10:10 +0300)]
ubifs: dereferencing an ERR_PTR in ubifs_mount()

d251ed271d5 "ubifs: fix sget races" left out the goto from this
error path so the static checkers complain that we're dereferencing
"sb" when it's an ERR_PTR.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agonfsd4: fix break_lease flags on nfsd open
J. Bruce Fields [Tue, 7 Jun 2011 15:50:23 +0000 (11:50 -0400)]
nfsd4: fix break_lease flags on nfsd open

Thanks to Casey Bodley for pointing out that on a read open we pass 0,
instead of O_RDONLY, to break_lease, with the result that a read open is
treated like a write open for the purposes of lease breaking!

Reported-by: Casey Bodley <cbodley@citi.umich.edu>
Cc: stable@kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
12 years agobatman-adv: improved gateway tq-based selection
Antonio Quartulli [Tue, 26 Apr 2011 19:31:45 +0000 (21:31 +0200)]
batman-adv: improved gateway tq-based selection

If a client issues a DHCPREQUEST for renewal, the packet is dropped
if the old destination (the old gateway for the client) TQ is smaller
than the current best gateway TQ less GW_THRESHOLD

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 years agobatman-adv: throw uevent in userspace on gateway add/change/del event
Antonio Quartulli [Sun, 12 Jun 2011 09:58:58 +0000 (11:58 +0200)]
batman-adv: throw uevent in userspace on gateway add/change/del event

In case of new default gw, changing the default gw or deleting the default gw a
uevent is triggered with type=gw, action=add/change/del and
data={GW_ORIG_ADDRESS} (if any).

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 years agobatman-adv: gateway election code refactoring
Antonio Quartulli [Tue, 26 Apr 2011 22:22:00 +0000 (00:22 +0200)]
batman-adv: gateway election code refactoring

The gateway election mechanism has been a little revised. Now the
gw_election is trigered by an atomic_t flag (gw_reselect) which is set
to 1 in case of election needed, avoding to set curr_gw to NULL.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 years agobatman-adv: add wrapper function to throw uevent in userspace
Antonio Quartulli [Tue, 26 Apr 2011 16:26:01 +0000 (18:26 +0200)]
batman-adv: add wrapper function to throw uevent in userspace

Using throw_uevent() is now possible to trigger uevent signal that can
be recognised in userspace. Uevents will be triggered through the
/devices/virtual/net/{MESH_IFACE} kobject.

A triggered uevent has three properties:
- type: the event class. Who generates the event (only 'gw' is currently
  defined). Corresponds to the BATTYPE uevent variable.
- action: the associated action with the event ('add'/'change'/'del' are
  currently defined). Corresponds to the BATACTION uevent variable.
- data: any useful data for the userspace. Corresponds to the BATDATA
  uevent variable.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 years agobatman-adv: protect the local and the global trans-tables with rcu
Antonio Quartulli [Wed, 27 Apr 2011 12:28:07 +0000 (14:28 +0200)]
batman-adv: protect the local and the global trans-tables with rcu

The local and the global translation-tables are now lock free and rcu
protected.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 years agobatman-adv: improved roaming mechanism
Antonio Quartulli [Wed, 27 Apr 2011 12:27:57 +0000 (14:27 +0200)]
batman-adv: improved roaming mechanism

With the current client announcement implementation, in case of roaming,
an update is triggered on the new AP serving the client. At that point
the new information is spread around by means of the OGM broadcasting
mechanism. Until this operations is not executed, no node is able to
correctly route traffic towards the client. This obviously causes packet
drops and introduces a delay in the time needed by the client to recover
its connections.

A new packet type called ROAMING_ADVERTISEMENT is added to account this
issue.

This message is sent in case of roaming from the new AP serving the
client to the old one and will contain the client MAC address. In this
way an out-of-OGM update is immediately committed, so that the old node
can update its global translation table. Traffic reaching this node will
then be redirected to the correct destination utilising the fresher
information. Thus reducing the packet drops and the connection recovery
delay.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 years agobatman-adv: improved client announcement mechanism
Antonio Quartulli [Wed, 27 Apr 2011 12:27:44 +0000 (14:27 +0200)]
batman-adv: improved client announcement mechanism

The client announcement mechanism informs every mesh node in the network
of any connected non-mesh client, in order to find the path towards that
client from any given point in the mesh.

The old implementation was based on the simple idea of appending a data
buffer to each OGM containing all the client MAC addresses the node is
serving. All other nodes can populate their global translation tables
(table which links client MAC addresses to node addresses) using this
MAC address buffer and linking it to the node's address contained in the
OGM. A node that wants to contact a client has to lookup the node the
client is connected to and its address in the global translation table.

It is easy to understand that this implementation suffers from several
issues:
 - big overhead (each and every OGM contains the entire list of
   connected clients)
 - high latencies for client route updates due to long OGM trip time and
   OGM losses

The new implementation addresses these issues by appending client
changes (new client joined or a client left) to the OGM instead of
filling it with all the client addresses each time. In this way nodes
can modify their global tables by means of "updates", thus reducing the
overhead within the OGMs.

To keep the entire network in sync each node maintains a translation
table version number (ttvn) and a translation table checksum. These
values are spread with the OGM to allow all the network participants to
determine whether or not they need to update their translation table
information.

When a translation table lookup is performed in order to send a packet
to a client attached to another node, the destination's ttvn is added to
the payload packet. Forwarding nodes can compare the packet's ttvn with
their destination's ttvn (this node could have a fresher information
than the source) and re-route the packet if necessary. This greatly
reduces the packet loss of clients roaming from one AP to the next.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 years agobatman-adv: Unify the first 3 bytes in each packet
Antonio Quartulli [Sat, 28 May 2011 12:51:06 +0000 (14:51 +0200)]
batman-adv: Unify the first 3 bytes in each packet

The amount of duplicated code in the receive and routing code can be
reduced when all headers provide the packet type, version and ttl in the
same first bytes.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 years agobatman-adv: Reduce usage of char
Sven Eckelmann [Wed, 15 Jun 2011 07:41:37 +0000 (09:41 +0200)]
batman-adv: Reduce usage of char

char was used in different places to store information without really
using the characteristics of that data type or by ignoring the fact that
char has not a well defined signedness.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 years agobatman-adv: count_real_packets() in batman-adv assumes char is signed
David Howells [Wed, 15 Jun 2011 07:41:36 +0000 (09:41 +0200)]
batman-adv: count_real_packets() in batman-adv assumes char is signed

count_real_packets() in batman-adv assumes char is signed, and returns -1
through it:

net/batman-adv/routing.c: In function 'receive_bat_packet':
net/batman-adv/routing.c:739: warning: comparison is always false due to limited range of data type

Use int instead.

Signed-off-by: David Howells <dhowells@redhat.com>
[sven@narfation.org: Rebase on top of current version]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 years agobatman-adv: Keep interface_tx as local function
Sven Eckelmann [Wed, 15 Jun 2011 13:17:21 +0000 (15:17 +0200)]
batman-adv: Keep interface_tx as local function

interface_tx is not used outside of soft-interface.c and thus doesn't
need to be declared inside soft-interface.h

Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 years agobatman-adv: Move compare_orig to originator.c
Sven Eckelmann [Wed, 15 Jun 2011 13:08:59 +0000 (15:08 +0200)]
batman-adv: Move compare_orig to originator.c

compare_orig is only used in context of orig_node which is managed
inside originator.c. It is not necessary to keep that function inside
the header originator.h.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 years agoveth: fix 64bit stats on 32bit arches
Eric Dumazet [Mon, 20 Jun 2011 05:48:34 +0000 (22:48 -0700)]
veth: fix 64bit stats on 32bit arches

Using 64bit stats on 32bit arches must use a synchronization or readers
can get transient values.

Fixes bug introduced in commit 6311cc44a2 (veth: convert to 64 bit
statistics)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet/staging: add needed interrupt.h and hardirq.h includes
Stephen Rothwell [Mon, 20 Jun 2011 05:41:59 +0000 (22:41 -0700)]
net/staging: add needed interrupt.h and hardirq.h includes

Made necessary by commit a6b7a407865a ("net: remove
interrupt.h inclusion from netdevice.h").

Fixes these build errors:

drivers/staging/brcm80211/brcmfmac/dhd_linux.c:1212:3: error: implicit declaration of function 'in_interrupt'
drivers/staging/brcm80211/brcmfmac/dhd_linux.c:1390:4: error: implicit declaration of function 'tasklet_schedule'
drivers/staging/brcm80211/brcmfmac/dhd_linux.c:1988:3: error: implicit declaration of function 'tasklet_init'
drivers/staging/brcm80211/brcmfmac/dhd_linux.c:2288:5: error: implicit declaration of function 'tasklet_kill'
drivers/staging/brcm80211/brcmfmac/dhd_linux.c:232:24: error: field 'tasklet' has incomplete type
drivers/staging/brcm80211/brcmfmac/wl_iw.c:3670:2: error: implicit declaration of function 'in_interrupt'
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:1349:3: error: implicit declaration of function 'free_irq'
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:1352:2: error: implicit declaration of function 'tasklet_kill'
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:1538:4: error: implicit declaration of function 'tasklet_schedule'
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:765:2: error: implicit declaration of function 'tasklet_init'
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:817:2: error: implicit declaration of function 'request_irq'
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:817:31: error: 'IRQF_SHARED' undeclared (first use in this function)
drivers/staging/brcm80211/brcmsmac/wl_mac80211.h:65:24: error: field 'tasklet' has incomplete type
drivers/staging/rtl8187se/ieee80211/ieee80211.h:994:24: error: field 'ps_task' has incomplete type
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c:1790:3: error: implicit declaration of function 'tasklet_schedule'
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c:2590:2: error: implicit declaration of function 'tasklet_init'
drivers/staging/rtl8187se/r8180.h:461:24: error: field 'irq_rx_tasklet' has incomplete type
drivers/staging/rtl8187se/r8180_core.c:2764:2: error: implicit declaration of function 'tasklet_init'
drivers/staging/rtl8187se/r8180_core.c:2954:2: error: implicit declaration of function 'request_irq'
drivers/staging/rtl8187se/r8180_core.c:2954:55: error: 'IRQF_SHARED' undeclared (first use in this function)
drivers/staging/rtl8187se/r8180_core.c:3641:4: error: implicit declaration of function 'free_irq'
drivers/staging/rtl8187se/r8180_core.c:4026:3: error: implicit declaration of function 'tasklet_schedule'
drivers/staging/rtl8192e/ieee80211/ieee80211.h:2000:24: error: field 'ps_task' has incomplete type
drivers/staging/rtl8192e/r8192E.h:909:24: error: field 'irq_rx_tasklet' has incomplete type
drivers/staging/rtl8192e/r8192E.h:910:24: error: field 'irq_tx_tasklet' has incomplete type
drivers/staging/rtl8192e/r8192E.h:911:31: error: field 'irq_prepare_beacon_tasklet' has incomplete type
drivers/staging/rtl8192e/r8192E_core.c:2008:2: error: implicit declaration of function 'tasklet_init'
drivers/staging/rtl8192e/r8192E_core.c:2412:54: error: 'IRQF_SHARED' undeclared (first use in this function)
drivers/staging/rtl8192e/r8192E_core.c:2412:9: error: implicit declaration of function 'request_irq'
drivers/staging/rtl8192e/r8192E_core.c:4640:4: error: implicit declaration of function 'free_irq'
drivers/staging/rtl8192e/r8192E_core.c:620:2: error: implicit declaration of function 'synchronize_irq'
drivers/staging/rtl8192e/r8192E_core.c:913:3: error: implicit declaration of function 'tasklet_schedule'
drivers/staging/rtl8192u/ieee80211/ieee80211.h:1993:24: error: field 'ps_task' has incomplete type

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agodrm/nouveau: drop leftover debugging
Dave Airlie [Mon, 20 Jun 2011 05:25:35 +0000 (15:25 +1000)]
drm/nouveau: drop leftover debugging

this printk isn't really useful, just drop it for now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoMerge branch 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux...
Dave Airlie [Mon, 20 Jun 2011 02:02:38 +0000 (12:02 +1000)]
Merge branch 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes

* 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
  drm/nouveau: fix assumption that semaphore dmaobj is valid in x-chan sync
  drm/nv50/disp: fix gamma with page flipping overlay turned on
  drm/nouveau/pm: Prevent overflow in nouveau_perf_init()
  drm/nouveau: fix big-endian switch

12 years agodrm/radeon: avoid warnings from r600/eg irq handlers on powered off card.
Dave Airlie [Sat, 18 Jun 2011 03:59:51 +0000 (03:59 +0000)]
drm/radeon: avoid warnings from r600/eg irq handlers on powered off card.

Since we were calling the wptr function before checking if the IH was
even enabled, or the GPU wasn't shutdown, we'd get spam in the logs when
the GPU readback 0xffffffff. This reorders things so we return early
in the no IH and GPU shutdown cases.

Reported-and-tested-by: ManDay on #radeon
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add missing param for dce3.2 DP transmitter setup
Alex Deucher [Fri, 17 Jun 2011 06:11:30 +0000 (06:11 +0000)]
drm/radeon/kms: add missing param for dce3.2 DP transmitter setup

This is used during phy init to set up the phy for DP.  This may
fix DP problems on DCE3.2 cards.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms/atom: fix duallink on some early DCE3.2 cards
Alex Deucher [Fri, 17 Jun 2011 17:13:52 +0000 (13:13 -0400)]
drm/radeon/kms/atom: fix duallink on some early DCE3.2 cards

Certain revisions of the vbios on DCE3.2 cards have a bug
in the transmitter control table which prevents duallink from
being enabled properly on some cards.  The action switch statement
jumps to the wrong offset for the OUTPUT_ENABLE action.  The fix
is to use the ENABLE action rather than the OUTPUT_ENABLE action
on the affected cards.  In fixed version of the vbios, both
actions jump to the same offset, so the change should be safe.

Reported-and-tested-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodavinci_emac: fix race in transmit time stamping.
Richard Cochran [Sun, 19 Jun 2011 03:31:45 +0000 (03:31 +0000)]
davinci_emac: fix race in transmit time stamping.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosmsc9420: fix race in transmit time stamping.
Richard Cochran [Sun, 19 Jun 2011 03:31:44 +0000 (03:31 +0000)]
smsc9420: fix race in transmit time stamping.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agostmmac: fix race in transmit time stamping.
Richard Cochran [Sun, 19 Jun 2011 03:31:43 +0000 (03:31 +0000)]
stmmac: fix race in transmit time stamping.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agor6040: fix race in transmit time stamping.
Richard Cochran [Sun, 19 Jun 2011 03:31:42 +0000 (03:31 +0000)]
r6040: fix race in transmit time stamping.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotg3: fix race in transmit time stamping.
Richard Cochran [Sun, 19 Jun 2011 03:31:41 +0000 (03:31 +0000)]
tg3: fix race in transmit time stamping.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agofec: fix race in transmit time stamping.
Richard Cochran [Sun, 19 Jun 2011 03:31:40 +0000 (03:31 +0000)]
fec: fix race in transmit time stamping.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: correct comment on where to place transmit time stamp hook.
Richard Cochran [Sun, 19 Jun 2011 03:31:39 +0000 (03:31 +0000)]
net: correct comment on where to place transmit time stamp hook.

The comment for the skb_tx_timestamp() function suggests calling it just
after a buffer is released to the hardware for transmission. However,
for drivers that free the buffer in an ISR, this produces a race between
the time stamp code and the ISR. This commit changes the comment to advise
placing the call just before handing the buffer over to the hardware.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosgi-xp: fix a use after free
Eric Dumazet [Sun, 19 Jun 2011 12:52:36 +0000 (12:52 +0000)]
sgi-xp: fix a use after free

Its illegal to dereference skb after dev_kfree_skb(skb)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Robin Holt <holt@sgi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agohp100: fix an skb->len race
Eric Dumazet [Sun, 19 Jun 2011 12:43:33 +0000 (12:43 +0000)]
hp100: fix an skb->len race

As soon as skb is given to hardware and spinlock released, TX completion
can free skb under us. Therefore, we should update netdev stats before
spinlock release.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'davem.r8169' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu...
David S. Miller [Sun, 19 Jun 2011 23:26:46 +0000 (16:26 -0700)]
Merge branch 'davem.r8169' of git://git./linux/kernel/git/romieu/netdev-2.6

12 years agonetpoll: copy dev name of slaves to struct netpoll
WANG Cong [Sun, 19 Jun 2011 23:13:01 +0000 (16:13 -0700)]
netpoll: copy dev name of slaves to struct netpoll

Otherwise we will not see the name of the slave dev in error
message:

[  388.469446] (null):  doesn't support polling, aborting.

Signed-off-by: WANG Cong <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoKVM: Fix register corruption in pvclock_scale_delta
Zachary Amsden [Thu, 16 Jun 2011 03:50:04 +0000 (20:50 -0700)]
KVM: Fix register corruption in pvclock_scale_delta

The 128-bit multiply in pvclock.h was missing an output constraint for
EDX which caused a register corruption to appear.  Thanks to Ulrich for
diagnosing the EDX corruption and Avi for providing this fix.

Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoKVM: MMU: fix opposite condition in mapping_level_dirty_bitmap
Steve [Fri, 17 Jun 2011 02:25:39 +0000 (10:25 +0800)]
KVM: MMU: fix opposite condition in mapping_level_dirty_bitmap

The condition is opposite, it always maps huge page for the dirty tracked page

Reported-by: Steve <stefan.bosak@gmail.com>
Signed-off-by: Steve <stefan.bosak@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoKVM: VMX: do not overwrite uptodate vcpu->arch.cr3 on KVM_SET_SREGS
Marcelo Tosatti [Mon, 6 Jun 2011 17:27:47 +0000 (14:27 -0300)]
KVM: VMX: do not overwrite uptodate vcpu->arch.cr3 on KVM_SET_SREGS

Only decache guest CR3 value if vcpu->arch.cr3 is stale.
Fixes loadvm with live guest.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Tested-by: Markus Schade <markus.schade@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoKVM: MMU: Fix build warnings in walk_addr_generic()
Borislav Petkov [Mon, 30 May 2011 20:11:17 +0000 (22:11 +0200)]
KVM: MMU: Fix build warnings in walk_addr_generic()

On 3.0-rc1 I get

In file included from arch/x86/kvm/mmu.c:2856:
arch/x86/kvm/paging_tmpl.h: In function ‘paging32_walk_addr_generic’:
arch/x86/kvm/paging_tmpl.h:124: warning: ‘ptep_user’ may be used uninitialized in this function
In file included from arch/x86/kvm/mmu.c:2852:
arch/x86/kvm/paging_tmpl.h: In function ‘paging64_walk_addr_generic’:
arch/x86/kvm/paging_tmpl.h:124: warning: ‘ptep_user’ may be used uninitialized in this function

caused by 6e2ca7d1802bf8ed9908435e34daa116662e7790. According to Takuya
Yoshikawa, ptep_user won't be used uninitialized so shut up gcc.

Cc: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Link: http://lkml.kernel.org/r/20110530094604.GC21833@liondog.tnic
Signed-off-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoMerge branches 'perf-urgent-for-linus', 'sched-urgent-for-linus', 'timers-urgent...
Linus Torvalds [Sun, 19 Jun 2011 16:00:18 +0000 (09:00 -0700)]
Merge branches 'perf-urgent-for-linus', 'sched-urgent-for-linus', 'timers-urgent-for-linus' and 'x86-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  tools/perf: Fix static build of perf tool
  tracing: Fix regression in printk_formats file

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  generic-ipi: Fix kexec boot crash by initializing call_single_queue before enabling interrupts

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  clocksource: Make watchdog robust vs. interruption
  timerfd: Fix wakeup of processes when timer is cancelled on clock change

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, MAINTAINERS: Add x86 MCE people
  x86, efi: Do not reserve boot services regions within reserved areas

12 years agoMerge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 19 Jun 2011 15:56:56 +0000 (08:56 -0700)]
Merge branch 'core-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  rcu: Move RCU_BOOST #ifdefs to header file
  rcu: use softirq instead of kthreads except when RCU_BOOST=y
  rcu: Use softirq to address performance regression
  rcu: Simplify curing of load woes

12 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
Linus Torvalds [Sun, 19 Jun 2011 03:33:31 +0000 (20:33 -0700)]
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/groeck/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging:
  hwmon: (s3c) Initialize sysfs attributes
  hwmon: (ibmpex) Initialize sysfs attributes
  hwmon: (ibmaem) Initialize sysfs attributes
  hwmon: (asus_atk0110) Consolidate sysfs attribute initialization
  hwmon: (coretemp) Drop unused struct members

12 years agox86, MAINTAINERS: Add x86 MCE people
Ingo Molnar [Sat, 18 Jun 2011 20:51:13 +0000 (22:51 +0200)]
x86, MAINTAINERS: Add x86 MCE people

Announce the new x86 MCE infrastructure maintainers.

Acked-by: Borislav Petkov <bp@amd64.org>
Acked-by: Tony Luck <tony.luck@intel.com>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/n/tip-8hs7yob6wib4vblmrmbpbav4@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
12 years agox86, efi: Do not reserve boot services regions within reserved areas
Maarten Lankhorst [Tue, 14 Jun 2011 17:53:09 +0000 (19:53 +0200)]
x86, efi: Do not reserve boot services regions within reserved areas

Commit 916f676f8dc started reserving boot service code since some systems
require you to keep that code around until SetVirtualAddressMap is called.

However, in some cases those areas will overlap with reserved regions.
The proper medium-term fix is to fix the bootloader to prevent the
conflicts from occurring by moving the kernel to a better position,
but the kernel should check for this possibility, and only reserve regions
which can be reserved.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Link: http://lkml.kernel.org/r/4DF7A005.1050407@gmail.com
Acked-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
12 years agoipv4: fix multicast losses
Eric Dumazet [Sat, 18 Jun 2011 18:59:18 +0000 (11:59 -0700)]
ipv4: fix multicast losses

Knut Tidemann found that first packet of a multicast flow was not
correctly received, and bisected the regression to commit b23dd4fe42b4
(Make output route lookup return rtable directly.)

Special thanks to Knut, who provided a very nice bug report, including
sample programs to demonstrate the bug.

Reported-and-bisectedby: Knut Tidemann <knut.andre.tidemann@jotron.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoisofs: fix bh leak in isofs_fill_super() error case
Linus Torvalds [Wed, 8 Jun 2011 17:30:03 +0000 (10:30 -0700)]
isofs: fix bh leak in isofs_fill_super() error case

In isofs_fill_super(), when an iso_primary_descriptor is found, it is
kept in pri_bh.  The error cases don't properly release it.  Fix it.

Reported-and-tested-by: 김원석 <stanley.will.kim@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoInput: sh_keysc - 8x8 MODE_6 fix
Magnus Damm [Sat, 18 Jun 2011 09:51:52 +0000 (02:51 -0700)]
Input: sh_keysc - 8x8 MODE_6 fix

According to the data sheet for G4, AP4 and AG5 KEYSC MODE_6 is 8x8 keys.
Bump up MAXKEYS to 64 too.

Signed-off-by: Magnus Damm <damm@opensource.se>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
12 years agoInput: omap-keypad - add missing input_sync()
Janusz Krzysztofik [Thu, 16 Jun 2011 04:13:55 +0000 (21:13 -0700)]
Input: omap-keypad - add missing input_sync()

Otherwise the updated evdev driver (commit cdda911c34006f1089f3c87b1a1f,
"Input: evdev - only signal polls on full packets") no longer works on
top of omap-keypad.

Tested on Amstrad Delta.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
12 years agoInput: evdev - try to wake up readers only if we have full packet
Dmitry Torokhov [Sat, 18 Jun 2011 09:50:11 +0000 (02:50 -0700)]
Input: evdev - try to wake up readers only if we have full packet

We should only wake waiters on the event device when we actually post
an EV_SYN/SYN_REPORT to the queue. Otherwise we end up making waiting
threads runnable only to go right back to sleep because the device
still isn't readable.

Reported-by: Jeffrey Brown <jeffbrown@android.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
12 years agor8169: check firmware content sooner.
Francois Romieu [Fri, 17 Jun 2011 22:10:29 +0000 (00:10 +0200)]
r8169: check firmware content sooner.

Firmware checking is only performed when the firmware is loaded
instead of each time the driver inits the phy.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
12 years agor8169: support new firmware format.
Hayes Wang [Sat, 18 Jun 2011 09:37:48 +0000 (11:37 +0200)]
r8169: support new firmware format.

The new firmware format adds versioning as firmware for a specific
chipset appears to be subject to change. Current "legacy" format is
still supported.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
12 years agor8169: explicit firmware format check.
Francois Romieu [Fri, 17 Jun 2011 15:16:24 +0000 (17:16 +0200)]
r8169: explicit firmware format check.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
12 years agohwmon: (s3c) Initialize sysfs attributes
Guenter Roeck [Tue, 24 May 2011 19:34:55 +0000 (12:34 -0700)]
hwmon: (s3c) Initialize sysfs attributes

Initialize dynamically allocated sysfs attributes before device_create_file()
call to suppress lockdep_init_map() warning if lockdep debugging is enabled.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.34+
12 years agohwmon: (ibmpex) Initialize sysfs attributes
Guenter Roeck [Tue, 24 May 2011 19:34:12 +0000 (12:34 -0700)]
hwmon: (ibmpex) Initialize sysfs attributes

Initialize dynamically allocated sysfs attributes before device_create_file()
call to suppress lockdep_init_map() warning if lockdep debugging is enabled.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.34+
12 years agohwmon: (ibmaem) Initialize sysfs attributes
Guenter Roeck [Tue, 24 May 2011 19:33:26 +0000 (12:33 -0700)]
hwmon: (ibmaem) Initialize sysfs attributes

Initialize dynamically allocated sysfs attributes before device_create_file()
call to suppress lockdep_init_map() warning if lockdep debugging is enabled.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.34+
12 years agohwmon: (asus_atk0110) Consolidate sysfs attribute initialization
Guenter Roeck [Tue, 24 May 2011 19:19:05 +0000 (12:19 -0700)]
hwmon: (asus_atk0110) Consolidate sysfs attribute initialization

Call sysfs_attr_init() from atk_init_attribute() to handle sysfs attribute
initialization in a single function.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Luca Tettamanti <kronos.it@gmail.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (coretemp) Drop unused struct members
Jean Delvare [Tue, 7 Jun 2011 19:14:26 +0000 (15:14 -0400)]
hwmon: (coretemp) Drop unused struct members

pdev_entry.cpu and pdev_entry.cpu_core_id aren't used anywhere in the
driver code so we can drop these struct members.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agodrm/nouveau: fix assumption that semaphore dmaobj is valid in x-chan sync
Ben Skeggs [Fri, 17 Jun 2011 13:41:54 +0000 (23:41 +1000)]
drm/nouveau: fix assumption that semaphore dmaobj is valid in x-chan sync

The DDX modifies DMA_SEMAPHORE on nv50 in order to implement sync-to-vblank,
things will go very wrong for cross-channel sync after this.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nv50/disp: fix gamma with page flipping overlay turned on
Ben Skeggs [Thu, 16 Jun 2011 04:40:27 +0000 (14:40 +1000)]
drm/nv50/disp: fix gamma with page flipping overlay turned on

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau/pm: Prevent overflow in nouveau_perf_init()
Emil Velikov [Sat, 11 Jun 2011 12:30:32 +0000 (13:30 +0100)]
drm/nouveau/pm: Prevent overflow in nouveau_perf_init()

While parsing the perf table, there is no check if
the num of entries read from the vbios is less than
the currently allocated number.

In case of a buggy vbios this will cause overwriting
of kernel memory, causing aditional problems.

Add a simple check in order to prevent the case

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau: fix big-endian switch
Ben Skeggs [Tue, 14 Jun 2011 00:16:17 +0000 (10:16 +1000)]
drm/nouveau: fix big-endian switch

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Sat, 18 Jun 2011 04:15:11 +0000 (21:15 -0700)]
Merge branch 'drm-fixes' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/i915: Fix gen6 (SNB) missed BLT ring interrupts.

12 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
Linus Torvalds [Sat, 18 Jun 2011 04:13:43 +0000 (21:13 -0700)]
Merge branch 'fixes' of git://git./linux/kernel/git/davej/cpufreq

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] powernow-k8: Don't try to transition if the pstate is incorrect
  [CPUFREQ] powernow-k8: Don't notify of successful transition if we failed (vid case).
  [CPUFREQ] Don't set stat->last_index to -1 if the pol->cur has incorrect value.

12 years agoMerge branch 'anon_vma-locking'
Linus Torvalds [Sat, 18 Jun 2011 04:01:21 +0000 (21:01 -0700)]
Merge branch 'anon_vma-locking'

* anon_vma-locking:
  mm: avoid anon_vma_chain allocation under anon_vma lock
  mm: avoid repeated anon_vma lock/unlock sequences in unlink_anon_vmas()
  mm: avoid repeated anon_vma lock/unlock sequences in anon_vma_clone()

12 years agomm: avoid anon_vma_chain allocation under anon_vma lock
Linus Torvalds [Sat, 18 Jun 2011 02:05:36 +0000 (19:05 -0700)]
mm: avoid anon_vma_chain allocation under anon_vma lock

Hugh Dickins points out that lockdep (correctly) spots a potential
deadlock on the anon_vma lock, because we now do a GFP_KERNEL allocation
of anon_vma_chain while doing anon_vma_clone().  The problem is that
page reclaim will want to take the anon_vma lock of any anonymous pages
that it will try to reclaim.

So re-organize the code in anon_vma_clone() slightly: first do just a
GFP_NOWAIT allocation, which will usually work fine.  But if that fails,
let's just drop the lock and re-do the allocation, now with GFP_KERNEL.

End result: not only do we avoid the locking problem, this also ends up
getting better concurrency in case the allocation does need to block.
Tim Chen reports that with all these anon_vma locking tweaks, we're now
almost back up to the spinlock performance.

Reported-and-tested-by: Hugh Dickins <hughd@google.com>
Tested-by: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: avoid repeated anon_vma lock/unlock sequences in unlink_anon_vmas()
Peter Zijlstra [Fri, 17 Jun 2011 11:54:23 +0000 (13:54 +0200)]
mm: avoid repeated anon_vma lock/unlock sequences in unlink_anon_vmas()

This matches the anon_vma_clone() case, and uses the same lock helper
functions.  Because of the need to potentially release the anon_vma's,
it's a bit more complex, though.

We traverse the 'vma->anon_vma_chain' in two phases: the first loop gets
the anon_vma lock (with the helper function that only takes the lock
once for the whole loop), and removes any entries that don't need any
more processing.

The second phase just traverses the remaining list entries (without
holding the anon_vma lock), and does any actual freeing of the
anon_vma's that is required.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Tested-by: Hugh Dickins <hughd@google.com>
Tested-by: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: avoid repeated anon_vma lock/unlock sequences in anon_vma_clone()
Linus Torvalds [Fri, 17 Jun 2011 03:44:51 +0000 (20:44 -0700)]
mm: avoid repeated anon_vma lock/unlock sequences in anon_vma_clone()

In anon_vma_clone() we traverse the vma->anon_vma_chain of the source
vma, locking the anon_vma for each entry.

But they are all going to have the same root entry, which means that
we're locking and unlocking the same lock over and over again.  Which is
expensive in locked operations, but can get _really_ expensive when that
root entry sees any kind of lock contention.

In fact, Tim Chen reports a big performance regression due to this: when
we switched to use a mutex instead of a spinlock, the contention case
gets much worse.

So to alleviate this all, this commit creates a small helper function
(lock_anon_vma_root()) that can be used to take the lock just once
rather than taking and releasing it over and over again.

We still have the same "take the lock and release" it behavior in the
exit path (in unlink_anon_vmas()), but that one is a bit harder to fix
since we're actually freeing the anon_vma entries as we go, and that
will touch the lock too.

Reported-and-tested-by: Tim Chen <tim.c.chen@linux.intel.com>
Tested-by: Hugh Dickins <hughd@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agodrm/i915: Fix gen6 (SNB) missed BLT ring interrupts.
Daniel J Blueman [Fri, 17 Jun 2011 18:32:19 +0000 (11:32 -0700)]
drm/i915: Fix gen6 (SNB) missed BLT ring interrupts.

The failure appeared in dmesg as:

[drm:i915_hangcheck_ring_idle] *ERROR* Hangcheck timer elapsed... blt
ring idle [waiting on 35064155, at 35064155], missed IRQ?

This works around that problem on by making the blitter command
streamer write interrupt state to the Hardware Status Page when a
MI_USER_INTERRUPT command is decoded, which appears to force the seqno
out to memory before the interrupt happens.

v1->v2: Moved to prior interrupt handler installation and RMW flags as
per feedback.
v2->v3: Removed RMW of flags (by anholt)

Cc: stable@kernel.org
Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk> [v1]
Tested-by: Eric Anholt <eric@anholt.net> [v1,v3]
   (incidence of the bug with a testcase went from avg 2/1000 to
   0/12651 in the latest test run (plus more for v1))
Tested-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Tested-by: Robert Hooker <robert.hooker@canonical.com> [v1]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33394
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor8169: move the firmware down into the device private data.
Francois Romieu [Fri, 17 Jun 2011 15:00:05 +0000 (17:00 +0200)]
r8169: move the firmware down into the device private data.

No functional difference.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
12 years agomsm: timer: compensate for timer shift in msm_read_timer_count
Jeff Ohlstein [Fri, 17 Jun 2011 20:55:38 +0000 (13:55 -0700)]
msm: timer: compensate for timer shift in msm_read_timer_count

Some msm targets have timers whose lower bits are unreliable. So, we
present our timers as lower frequency than they actually are, and ignore
the bottom 5 bits on such targets. This compensation was erroneously
removed from the msm_read_timer_count function, so restore it.

This was broken by 94790ec25 "msm: timer: SMP timer support for msm".

Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
12 years agor8169: fix static initializers.
Francois Romieu [Fri, 17 Jun 2011 20:58:54 +0000 (22:58 +0200)]
r8169: fix static initializers.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
12 years agoBtrfs: avoid delayed metadata items during commits
Chris Mason [Fri, 17 Jun 2011 20:14:09 +0000 (16:14 -0400)]
Btrfs: avoid delayed metadata items during commits

Snapshot creation has two phases.  One is the initial snapshot setup,
and the second is done during commit, while nobody is allowed to modify
the root we are snapshotting.

The delayed metadata insertion code can break that rule, it does a
delayed inode update on the inode of the parent of the snapshot,
and delayed directory item insertion.

This makes sure to run the pending delayed operations before we
record the snapshot root, which avoids corruptions.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoinet_diag: fix inet_diag_bc_audit()
Eric Dumazet [Fri, 17 Jun 2011 20:25:39 +0000 (16:25 -0400)]
inet_diag: fix inet_diag_bc_audit()

A malicious user or buggy application can inject code and trigger an
infinite loop in inet_diag_bc_audit()

Also make sure each instruction is aligned on 4 bytes boundary, to avoid
unaligned accesses.

Reported-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agogigaset: call module_put before restart of if_open()
Pavel Shved [Fri, 17 Jun 2011 06:25:11 +0000 (06:25 +0000)]
gigaset: call module_put before restart of if_open()

if_open() calls try_module_get(), and after an attempt to lock a mutex
the if_open() function may return -ERESTARTSYS without
putting the module.  Then, when if_open() is executed again,
try_module_get() is called making the reference counter of THIS_MODULE
greater than one at successful exit from if_open().  The if_close()
function puts the module only once, and as a result it can't be
unloaded.

This patch adds module_put call before the return from if_open().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Pavel Shved <shved@ispras.ru>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
12 years agofarsync: add module_put to error path in fst_open()
Pavel Shved [Fri, 17 Jun 2011 06:25:10 +0000 (06:25 +0000)]
farsync: add module_put to error path in fst_open()

The fst_open() function, after a successful try_module_get() may return
an error code if hdlc_open() returns it.  However, it does not put the
module on this error path.

This patch adds the necessary module_put() call.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Pavel Shved <shved@ispras.ru>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
12 years agonet: rfs: enable RFS before first data packet is received
Eric Dumazet [Fri, 17 Jun 2011 03:45:15 +0000 (03:45 +0000)]
net: rfs: enable RFS before first data packet is received

Le jeudi 16 juin 2011 à 23:38 -0400, David Miller a écrit :
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Fri, 17 Jun 2011 00:50:46 +0100
>
> > On Wed, 2011-06-15 at 04:15 +0200, Eric Dumazet wrote:
> >> @@ -1594,6 +1594,7 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
> >>   goto discard;
> >>
> >>   if (nsk != sk) {
> >> + sock_rps_save_rxhash(nsk, skb->rxhash);
> >>   if (tcp_child_process(sk, nsk, skb)) {
> >>   rsk = nsk;
> >>   goto reset;
> >>
> >
> > I haven't tried this, but it looks reasonable to me.
> >
> > What about IPv6?  The logic in tcp_v6_do_rcv() looks very similar.
>
> Indeed ipv6 side needs the same fix.
>
> Eric please add that part and resubmit.  And in fact I might stick
> this into net-2.6 instead of net-next-2.6
>

OK, here is the net-2.6 based one then, thanks !

[PATCH v2] net: rfs: enable RFS before first data packet is received

First packet received on a passive tcp flow is not correctly RFS
steered.

One sock_rps_record_flow() call is missing in inet_accept()

But before that, we also must record rxhash when child socket is setup.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Tom Herbert <therbert@google.com>
CC: Ben Hutchings <bhutchings@solarflare.com>
CC: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
12 years agofs_enet: fix freescale FCC ethernet dp buffer alignment
Clive Stubbings [Thu, 16 Jun 2011 22:30:39 +0000 (22:30 +0000)]
fs_enet: fix freescale FCC ethernet dp buffer alignment

The RIPTR and TIPTR  (receive/transmit internal temporary data pointer),
used by microcode as a temporary buffer for data, must be 32-byte aligned
according to the RM for MPC8247.

Tested on mgcoge.

Signed-off-by: Clive Stubbings <clive.stubbings@xentech.co.uk>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Pantelis Antoniou <pantelis.antoniou@gmail.com>
cc: Vitaly Bordug <vbordug@ru.mvista.com>
cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
12 years agobtrfs: fix uninitialized return value
David Sterba [Mon, 13 Jun 2011 15:18:23 +0000 (15:18 +0000)]
btrfs: fix uninitialized return value

When allocation fails in btrfs_read_fs_root_no_name, ret is not set
although it is returned, holding a garbage value.

Signed-off-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agobtrfs: fix wrong reservation when doing delayed inode operations
Miao Xie [Wed, 15 Jun 2011 10:47:30 +0000 (10:47 +0000)]
btrfs: fix wrong reservation when doing delayed inode operations

We have migrated the space for the delayed inode items from
trans_block_rsv to global_block_rsv, but we forgot to set trans->block_rsv to
global_block_rsv when we doing delayed inode operations, and the following Oops
happened:

[ 9792.654889] ------------[ cut here ]------------
[ 9792.654898] WARNING: at fs/btrfs/extent-tree.c:5681
btrfs_alloc_free_block+0xca/0x27c [btrfs]()
[ 9792.654899] Hardware name: To Be Filled By O.E.M.
[ 9792.654900] Modules linked in: btrfs zlib_deflate libcrc32c
ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables
arc4 rt61pci rt2x00pci rt2x00lib snd_hda_codec_hdmi mac80211
snd_hda_codec_realtek cfg80211 snd_hda_intel edac_core snd_seq rfkill
pcspkr serio_raw snd_hda_codec eeprom_93cx6 edac_mce_amd sp5100_tco
i2c_piix4 k10temp snd_hwdep snd_seq_device snd_pcm floppy r8169 xhci_hcd
mii snd_timer snd soundcore snd_page_alloc ipv6 firewire_ohci pata_acpi
ata_generic firewire_core pata_via crc_itu_t radeon ttm drm_kms_helper
drm i2c_algo_bit i2c_core [last unloaded: scsi_wait_scan]
[ 9792.654919] Pid: 2762, comm: rm Tainted: G        W   2.6.39+ #1
[ 9792.654920] Call Trace:
[ 9792.654922]  [<ffffffff81053c4a>] warn_slowpath_common+0x83/0x9b
[ 9792.654925]  [<ffffffff81053c7c>] warn_slowpath_null+0x1a/0x1c
[ 9792.654933]  [<ffffffffa038e747>] btrfs_alloc_free_block+0xca/0x27c [btrfs]
[ 9792.654945]  [<ffffffffa03b8562>] ? map_extent_buffer+0x6e/0xa8 [btrfs]
[ 9792.654953]  [<ffffffffa038189b>] __btrfs_cow_block+0xfc/0x30c [btrfs]
[ 9792.654963]  [<ffffffffa0396aa6>] ? btrfs_buffer_uptodate+0x47/0x58 [btrfs]
[ 9792.654970]  [<ffffffffa0382e48>] ? read_block_for_search+0x94/0x368 [btrfs]
[ 9792.654978]  [<ffffffffa0381ba9>] btrfs_cow_block+0xfe/0x146 [btrfs]
[ 9792.654986]  [<ffffffffa03848b0>] btrfs_search_slot+0x14d/0x4b6 [btrfs]
[ 9792.654997]  [<ffffffffa03b8562>] ? map_extent_buffer+0x6e/0xa8 [btrfs]
[ 9792.655022]  [<ffffffffa03938e8>] btrfs_lookup_inode+0x2f/0x8f [btrfs]
[ 9792.655025]  [<ffffffff8147afac>] ? _cond_resched+0xe/0x22
[ 9792.655027]  [<ffffffff8147b892>] ? mutex_lock+0x29/0x50
[ 9792.655039]  [<ffffffffa03d41b1>] btrfs_update_delayed_inode+0x72/0x137 [btrfs]
[ 9792.655051]  [<ffffffffa03d4ea2>] btrfs_run_delayed_items+0x90/0xdb [btrfs]
[ 9792.655062]  [<ffffffffa039a69b>] btrfs_commit_transaction+0x228/0x654 [btrfs]
[ 9792.655064]  [<ffffffff8106e8da>] ? remove_wait_queue+0x3a/0x3a
[ 9792.655075]  [<ffffffffa03a2fa5>] btrfs_evict_inode+0x14d/0x202 [btrfs]
[ 9792.655077]  [<ffffffff81132bd6>] evict+0x71/0x111
[ 9792.655079]  [<ffffffff81132de0>] iput+0x12a/0x132
[ 9792.655081]  [<ffffffff8112aa3a>] do_unlinkat+0x106/0x155
[ 9792.655083]  [<ffffffff81127b83>] ? path_put+0x1f/0x23
[ 9792.655085]  [<ffffffff8109c53c>] ? audit_syscall_entry+0x145/0x171
[ 9792.655087]  [<ffffffff81128410>] ? putname+0x34/0x36
[ 9792.655090]  [<ffffffff8112b441>] sys_unlinkat+0x29/0x2b
[ 9792.655092]  [<ffffffff81482c42>] system_call_fastpath+0x16/0x1b
[ 9792.655093] ---[ end trace 02b696eb02b3f768 ]---

This patch fix it by setting the reservation of the transaction handle to the
correct one.

Reported-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agobtrfs: Remove unused sysfs code
Maarten Lankhorst [Thu, 16 Jun 2011 09:04:57 +0000 (09:04 +0000)]
btrfs: Remove unused sysfs code

Removes code no longer used. The sysfs file itself is kept, because the
btrfs developers expressed interest in putting new entries to sysfs.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agobtrfs: fix dereference of ERR_PTR value
David Sterba [Mon, 13 Jun 2011 17:54:22 +0000 (17:54 +0000)]
btrfs: fix dereference of ERR_PTR value

smatch reports:

btrfs_recover_log_trees error: 'wc.replay_dest' dereferencing
possible ERR_PTR()

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoMerge branch 'for-chris' of git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs...
Chris Mason [Fri, 17 Jun 2011 18:16:13 +0000 (14:16 -0400)]
Merge branch 'for-chris' of git://git./linux/kernel/git/josef/btrfs-work into for-linus

Conflicts:
fs/btrfs/transaction.c

Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Fri, 17 Jun 2011 17:37:57 +0000 (10:37 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Fix no NID error with VIA codecs
  ALSA: isight: adjust for new queueing API
  ALSA: 6fire - Fix signedness bug
  ALSA: lola - Fix section mismatch
  ALSA: hda - Fix missing static inline to beep dummy function
  ALSA: 6fire: Fix double-free bug in usb6fire_fw_ezusb_upload()
  ALSA: hda - Fix beep_device compilation warnings
  ALSA: hda - Fix wrong auto-mute type for Acer Aspire-one
  ALSA: emu10k1: Add details for E-mu 0404 PCIe version
  ALSA: hdspm - Add firmware revision ID for RME MADI PCI version
  ALSA: hdspm - Fix jumping external wordclock frequency in AutoSync mode
  ALSA: hdspm - Fix locking in snd_hdspm_midi_input_read

12 years agoMerge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Fri, 17 Jun 2011 17:37:41 +0000 (10:37 -0700)]
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: make log devices with write back caches work
  xfs: fix ->mknod() return value on xfs_get_acl() failure

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Linus Torvalds [Fri, 17 Jun 2011 17:37:01 +0000 (10:37 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jikos/hid

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  Revert "HID: magicmouse: ignore 'ivalid report id' while switching modes"
  HID: hid-multitouch: fix broken eGalax
  HID: MAINTAINERS: Update USB HID/HIDBP DRIVERS pattern
  HID: hid-multitouch: add support for Chunghwa multi-touch panel
  HID: hiddev: fix use after free in hiddev_release
  HID: add quirk for HyperPen 10000U
  HID: hiddev: fix potential use-after-free

12 years agoBtrfs: fix relocation races
Chris Mason [Tue, 14 Jun 2011 00:00:16 +0000 (20:00 -0400)]
Btrfs: fix relocation races

The recent commit to get rid of our trans_mutex introduced
some races with block group relocation.  The problem is that relocation
needs to do some record keeping about each root, and it was relying
on the transaction mutex to coordinate things in subtle ways.

This fix adds a mutex just for the relocation code and makes sure
it doesn't have a big impact on normal operations.  The race is
really fixed in btrfs_record_root_in_trans, which is where we
step back and wait for the relocation code to finish accounting
setup.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoMerge branches 'gpio/merge' and 'spi/merge' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Fri, 17 Jun 2011 17:36:32 +0000 (10:36 -0700)]
Merge branches 'gpio/merge' and 'spi/merge' of git://git.secretlab.ca/git/linux-2.6

* 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6:
  gpio: add GPIOF_ values regardless on kconfig settings
  gpio: include linux/gpio.h where needed
  gpio/omap4: Fix missing interrupts during device wakeup due to IOPAD.

* 'spi/merge' of git://git.secretlab.ca/git/linux-2.6:
  spi/bfin_spi: fix handling of default bits per word setting

12 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux...
Linus Torvalds [Fri, 17 Jun 2011 17:35:31 +0000 (10:35 -0700)]
Merge branch 'fixes' of git://git./linux/kernel/git/tmlind/linux-omap-2.6

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6:
  OMAP1: PM: register notifiers with generic clock ops even when !PM_RUNTIME
  omap: pandora: fix NAND support
  OMAP: PM: omap_device: fix device power domain callbacks
  OMAP: PM debug: fix section mismatch warnings

12 years agoKEYS/DNS: Fix ____call_usermodehelper() to not lose the session keyring
David Howells [Fri, 17 Jun 2011 10:25:59 +0000 (11:25 +0100)]
KEYS/DNS: Fix ____call_usermodehelper() to not lose the session keyring

____call_usermodehelper() now erases any credentials set by the
subprocess_inf::init() function.  The problem is that commit
17f60a7da150 ("capabilites: allow the application of capability limits
to usermode helpers") creates and commits new credentials with
prepare_kernel_cred() after the call to the init() function.  This wipes
all keyrings after umh_keys_init() is called.

The best way to deal with this is to put the init() call just prior to
the commit_creds() call, and pass the cred pointer to init().  That
means that umh_keys_init() and suchlike can modify the credentials
_before_ they are published and potentially in use by the rest of the
system.

This prevents request_key() from working as it is prevented from passing
the session keyring it set up with the authorisation token to
/sbin/request-key, and so the latter can't assume the authority to
instantiate the key.  This causes the in-kernel DNS resolver to fail
with ENOKEY unconditionally.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Eric Paris <eparis@redhat.com>
Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Fri, 17 Jun 2011 16:40:36 +0000 (12:40 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6 into for-davem

12 years agospi/bfin_spi: fix handling of default bits per word setting
Mike Frysinger [Fri, 17 Jun 2011 08:35:37 +0000 (04:35 -0400)]
spi/bfin_spi: fix handling of default bits per word setting

The default bits per word setting should be 8 bits, but since most of our
devices have been explicitly setting this up, we didn't notice when the
default stopped working.

At the moment, any default transfers without an explicit bit size setting
error out with:
bfin-spi bfin-spi.0: transfer: unsupported bits_per_word

So in the transfer logic, have a bits_per_word setting of 0 fall into the
8 bit transfer logic.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoALSA: hda - Fix no NID error with VIA codecs
Takashi Iwai [Fri, 17 Jun 2011 12:23:46 +0000 (14:23 +0200)]
ALSA: hda - Fix no NID error with VIA codecs

The via driver spews warnigs like
hda-codec: no NID for mapping control Independent HP:0:0
with some codecs because snd_hda_add_nid() is called with nid=0.
This patch fixes it by skipping the call when no corresponding widget
is found.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: isight: adjust for new queueing API
Clemens Ladisch [Fri, 17 Jun 2011 06:18:35 +0000 (08:18 +0200)]
ALSA: isight: adjust for new queueing API

Since commit 13882a82ee16 (optimize iso queueing by setting
wake only after the last packet), drivers are required to call
fw_iso_context_queue_flush() after queueing a batch of packets.
The missing call would have an effect only if the controller
queue underruns, but then the DMA would stop completely.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agogeneric-ipi: Fix kexec boot crash by initializing call_single_queue before enabling...
Takao Indoh [Tue, 29 Mar 2011 16:35:04 +0000 (12:35 -0400)]
generic-ipi: Fix kexec boot crash by initializing call_single_queue before enabling interrupts

There is a problem that kdump(2nd kernel) sometimes hangs up due
to a pending IPI from 1st kernel. Kernel panic occurs because IPI
comes before call_single_queue is initialized.

To fix the crash, rename init_call_single_data() to call_function_init()
and call it in start_kernel() so that call_single_queue can be
initialized before enabling interrupts.

The details of the crash are:

 (1) 2nd kernel boots up

 (2) A pending IPI from 1st kernel comes when irqs are first enabled
     in start_kernel().

 (3) Kernel tries to handle the interrupt, but call_single_queue
     is not initialized yet at this point. As a result, in the
     generic_smp_call_function_single_interrupt(), NULL pointer
     dereference occurs when list_replace_init() tries to access
     &q->list.next.

Therefore this patch changes the name of init_call_single_data()
to call_function_init() and calls it before local_irq_enable()
in start_kernel().

Signed-off-by: Takao Indoh <indou.takao@jp.fujitsu.com>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Milton Miller <miltonm@bga.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: kexec@lists.infradead.org
Link: http://lkml.kernel.org/r/D6CBEE2F420741indou.takao@jp.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
12 years agonetdev: bfin_mac: fix memory leak when freeing dma descriptors
Sonic Zhang [Thu, 16 Jun 2011 12:31:58 +0000 (12:31 +0000)]
netdev: bfin_mac: fix memory leak when freeing dma descriptors

The size of the desc array is not the size of the desc structure, so
when we try to free up things, we leak some parts.

Reported-by: Regis Dargent <rdargent@edevice.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
12 years agovlan: don't call ndo_vlan_rx_register on hardware that doesn't have vlan support
Antoine Reversat [Thu, 16 Jun 2011 10:47:13 +0000 (10:47 +0000)]
vlan: don't call ndo_vlan_rx_register on hardware that doesn't have vlan support

This patch removes the call to ndo_vlan_rx_register if the underlying
device doesn't have hardware support for VLAN.
Signed-off-by: Antoine Reversat <a.reversat@gmail.com>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
12 years agoe1000: remove unnecessary code
Greg Dietsche [Thu, 16 Jun 2011 07:09:30 +0000 (07:09 +0000)]
e1000: remove unnecessary code

Compile tested.
remove unnecessary code that matches this coccinelle pattern
if (...)
return ret;
return ret;

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
12 years agonet: icplus: remove unnecessary code
Greg Dietsche [Thu, 16 Jun 2011 07:04:30 +0000 (07:04 +0000)]
net: icplus: remove unnecessary code

Compile tested.
remove unnecessary code that matches this coccinelle pattern
if (...)
return ret;
return ret;

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
12 years agonet/rds: use prink_ratelimited() instead of printk_ratelimit()
Manuel Zerpies [Thu, 16 Jun 2011 02:09:57 +0000 (02:09 +0000)]
net/rds: use prink_ratelimited() instead of printk_ratelimit()

Since printk_ratelimit() shouldn't be used anymore (see comment in
include/linux/printk.h), replace it with printk_ratelimited()

Signed-off-by: Manuel Zerpies <manuel.f.zerpies@ww.stud.uni-erlangen.de>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
12 years agonet/can: use printk_ratelimited() instead of printk_ratelimit()
Manuel Zerpies [Thu, 16 Jun 2011 02:08:01 +0000 (02:08 +0000)]
net/can: use printk_ratelimited() instead of printk_ratelimit()

Since printk_ratelimit() shouldn't be used anymore (see comment in
include/linux/printk.h), replace it with printk_ratelimited().

Signed-off-by: Manuel Zerpies <manuel.f.zerpies@ww.stud.uni-erlangen.de>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
12 years agocaif: Bugfix - XOFF removed channel from caif-mux
sjur.brandeland@stericsson.com [Wed, 15 Jun 2011 12:38:25 +0000 (12:38 +0000)]
caif: Bugfix - XOFF removed channel from caif-mux

XOFF was mixed up with DOWN indication, causing causing CAIF channel to be
removed from mux and all incoming traffic to be lost after receiving flow-off.
Fix this by replacing FLOW_OFF with DOWN notification.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>