7 years agotcp: fix tcp_rcv_rtt_update() use of an unscaled RTT sample
Neal Cardwell [Tue, 10 Apr 2012 07:59:20 +0000]
tcp: fix tcp_rcv_rtt_update() use of an unscaled RTT sample

Fix a code path in tcp_rcv_rtt_update() that was comparing scaled and
unscaled RTT samples.

The intent in the code was to only use the 'm' measurement if it was a
new minimum.  However, since 'm' had not yet been shifted left 3 bits
but 'new_sample' had, this comparison would nearly always succeed,
leading us to erroneously set our receive-side RTT estimate to the 'm'
sample when that sample could be nearly 8x too high to use.

The overall effect is to often cause the receive-side RTT estimate to
be significantly too large (up to 40% too large for brief periods in
my tests).

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

7 years agotcp: restore correct limit
Eric Dumazet [Tue, 10 Apr 2012 00:56:42 +0000]
tcp: restore correct limit

Commit c43b874d5d714f (tcp: properly initialize tcp memory limits) tried
to fix a regression added in commits 4acb4190 & 3dc43e3,
but still get it wrong.

Result is machines with low amount of memory have too small tcp_rmem[2]
value and slow tcp receives : Per socket limit being 1/1024 of memory
instead of 1/128 in old kernels, so rcv window is capped to small

Fix this to match comment and previous behavior.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Glauber Costa <glommer@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

7 years agonetfilter: nf_conntrack: fix incorrect logic in nf_conntrack_init_net
Gao feng [Sat, 7 Apr 2012 16:08:28 +0000]
netfilter: nf_conntrack: fix incorrect logic in nf_conntrack_init_net

in function nf_conntrack_init_net,when nf_conntrack_timeout_init falied,
we should call nf_conntrack_ecache_fini to do rollback.
but the current code calls nf_conntrack_timeout_fini.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

7 years agonetfilter: nf_ct_ipv4: packets with wrong ihl are invalid
Jozsef Kadlecsik [Tue, 3 Apr 2012 20:02:01 +0000]
netfilter: nf_ct_ipv4: packets with wrong ihl are invalid

It was reported that the Linux kernel sometimes logs:

klogd: [2629147.402413] kernel BUG at net / netfilter /
nf_conntrack_proto_tcp.c: 447!
klogd: [1072212.887368] kernel BUG at net / netfilter /
nf_conntrack_proto_tcp.c: 392

ipv4_get_l4proto() in nf_conntrack_l3proto_ipv4.c and tcp_error() in
nf_conntrack_proto_tcp.c should catch malformed packets, so the errors
at the indicated lines - TCP options parsing - should not happen.
However, tcp_error() relies on the "dataoff" offset to the TCP header,
calculated by ipv4_get_l4proto().  But ipv4_get_l4proto() does not check
bogus ihl values in IPv4 packets, which then can slip through tcp_error()
and get caught at the TCP options parsing routines.

The patch fixes ipv4_get_l4proto() by invalidating packets with bogus
ihl value.

The patch closes netfilter bugzilla id 771.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

7 years agonetfilter: nf_ct_ipv4: handle invalid IPv4 and IPv6 packets consistently
Jozsef Kadlecsik [Mon, 9 Apr 2012 14:32:16 +0000]
netfilter: nf_ct_ipv4: handle invalid IPv4 and IPv6 packets consistently

IPv6 conntrack marked invalid packets as INVALID and let the user
drop those by an explicit rule, while IPv4 conntrack dropped such
packets itself.

IPv4 conntrack is changed so that it marks INVALID packets and let
the user to drop them.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

7 years agonetfilter: ip6_tables: ip6t_ext_hdr is now static inline
Pablo Neira Ayuso [Fri, 6 Apr 2012 16:12:54 +0000]
netfilter: ip6_tables: ip6t_ext_hdr is now static inline

We may hit this in xt_LOG:

net/built-in.o:xt_LOG.c:function dump_ipv6_packet:
error: undefined reference to 'ip6t_ext_hdr'

happens with these config options:


ip6t_ext_hdr is fairly small and it is called in the packet path.
Make it static inline.

Reported-by: Simon Kirby <sim@netnation.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

7 years agonetfilter: nf_ct_tcp: don't scale the size of the window up twice
Changli Gao [Sun, 1 Apr 2012 17:25:06 +0000]
netfilter: nf_ct_tcp: don't scale the size of the window up twice

For a picked up connection, the window win is scaled twice: one is by the
initialization code, and the other is by the sender updating code.

I use the temporary variable swin instead of modifying the variable win.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

7 years agodrm/exynos: fixed exynos broken ioctl
Inki Dae [Thu, 12 Apr 2012 07:42:54 +0000]
drm/exynos: fixed exynos broken ioctl

this patch removes the pointer of uint64_t *edid. it should be just
a uint64_t.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

7 years agodrm/exynos: fix to pointer manager member of struct exynos_drm_subdrv
Joonyoung Shim [Thu, 5 Apr 2012 11:49:27 +0000]
drm/exynos: fix to pointer manager member of struct exynos_drm_subdrv

The struct exynos_drm_manager has to exist for exynos drm sub driver
using encoder and connector. If it isn't NULL to member of struct
exynos_drm_subdrv, will create encoder and connector else will not. And
the is_local member also doesn't need.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

7 years agodrm/exynos: fix struct for operation callback functions to driver name
Joonyoung Shim [Thu, 5 Apr 2012 11:49:26 +0000]
drm/exynos: fix struct for operation callback functions to driver name

The mixer driver and hdmi driver have each operation callback functions
and they is registered to hdmi common driver. Their struct names in hdmi
common driver include display, manager and overlay. It confuses to
appear whose operation and two driver cannot register same operation
callback functions at the same time. Use their struct names to driver

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

7 years agodrm/exynos: use define instead of default_win member in struct mixer_context
Joonyoung Shim [Thu, 5 Apr 2012 11:49:25 +0000]
drm/exynos: use define instead of default_win member in struct mixer_context

The default_win member in struct mixer_context isn't change its value
after initialized to 0, so it's better using to define.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

7 years agodrm/exynos: rename s/HDMI_OVERLAY_NUMBER/MIXER_WIN_NR
Joonyoung Shim [Thu, 5 Apr 2012 11:49:24 +0000]

HDMI_OVERLAY_NUMBER is specific of mixer driver and be used "windows
layer" term in exynos user manaual, so rename it.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

7 years agodrm/exynos: remove unused codes in hdmi and mixer
Joonyoung Shim [Thu, 5 Apr 2012 11:49:23 +0000]
drm/exynos: remove unused codes in hdmi and mixer

Some members in struct mixer_context aren't used and the define
HDMI_OVERLAY_NUMBER is unused in hdmi driver, remove them.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

7 years agodrm/exynos: remove unnecessary type conversion of hdmi and mixer
Joonyoung Shim [Thu, 5 Apr 2012 11:49:22 +0000]
drm/exynos: remove unnecessary type conversion of hdmi and mixer

When the void pointer type variable is assigned to the specific pointer
type variable, don't need to do type conversion.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

7 years agodrm/exynos: add format list of plane
Seung-Woo Kim [Thu, 5 Apr 2012 02:21:09 +0000]
drm/exynos: add format list of plane

NV12, NV12M and NV12MT are added to format list of plane to use these
formats for hdmi vp layer.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

7 years agodrm/exynos: fixed duplicated page allocation bug.
Inki Dae [Tue, 3 Apr 2012 12:49:15 +0000]
drm/exynos: fixed duplicated page allocation bug.

this patch fixes that buf->pages is allocated two times when it allocates
physically continuous memory region and removes unnecessary codes.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

7 years agodrm/exynos: fixed page align and code clean.
Inki Dae [Tue, 3 Apr 2012 12:27:58 +0000]
drm/exynos: fixed page align and code clean.

1M section, 64k page count also should be rounded up so this patch
rounds up them and caculates page count of them properly and also
checks memory flags from user.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

7 years agodrm/i915: clear fencing tracking state when retiring requests
Daniel Vetter [Wed, 11 Apr 2012 23:27:57 +0000]
drm/i915: clear fencing tracking state when retiring requests

This fixes a resume regression introduced in

commit 7dd4906586274f3945f2aeaaa5a33b451c3b4bba
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Mar 21 10:48:18 2012 +0000

    drm/i915: Mark untiled BLT commands as fenced on gen2/3

which fixed fencing tracking for untiled blt commands.

A side effect of that patch was that now also untiled objects have a
non-zero obj->last_fenced_seqno to track when a fence can be set up
after a pipelined tiling change. Unfortunately this was only cleared
by the fence setup and teardown code, resulting in tons of untiled but
inactive objects with non-zero last_fenced_seqno.

Now after resume we completely reset the seqno tracking, both on the
driver side (by setting dev_priv->next_seqno = 1) and on the hw side
(by allocating a new hws page, which contains the seqnos). Hilarity
and indefinite waits ensued from the stale seqnos in
obj->last_fenced_seqno from before the suspend.

The fix is to properly clear the fencing tracking state like we
already do for the normal gpu rendering while moving objects off the
active list.

Reported-and-tested-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Jiri Slaby <jslaby@suse.cz>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

7 years agodrm/i915: make rc6 module parameter read-only
Jesse Barnes [Wed, 11 Apr 2012 16:39:02 +0000]
drm/i915: make rc6 module parameter read-only

People have been getting confused and thinking this is a runtime control.

Cc: stable@vger.kernel.org
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

7 years agodrm/i915: implement ColorBlt w/a
Daniel Vetter [Sat, 31 Mar 2012 09:21:57 +0000]
drm/i915: implement ColorBlt w/a

According to an internal workaround master list, we need to set bit 5
of register 9400 to avoid issues with color blits.

Testing shows that this seems to fix the blitter hangs when fbc is
enabled on snb, thanks to Chris Wilson for figuring this out.

Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Michael "brot" Groh <michael.groh@minad.de>
Acked-by: Ben Widawsky <ben@bwidawsk.net>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

7 years agodrm/i915/ringbuffer: Exclude last 2 cachlines of ring on 845g
Chris Wilson [Mon, 9 Apr 2012 12:59:46 +0000]
drm/i915/ringbuffer: Exclude last 2 cachlines of ring on 845g

The 845g shares the errata with i830 whereby executing a command
within 2 cachelines of the end of the ringbuffer may cause a GPU hang.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

7 years agoRevert "drm/i915: reenable gmbus on gen3+ again"
Daniel Vetter [Mon, 9 Apr 2012 19:10:38 +0000]
Revert "drm/i915: reenable gmbus on gen3+ again"

This reverts commit c3dfefa0a6d235bd465309e12f4c56ea16e71111.

gmbus in 3.4 has simply too many known issues:
- gmbus is too noisy, we need to rework the logging:
- zero-length writes cause an OOPS, and they are
- same for zero-length reads:

We can try again for 3.5.

Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

7 years agodrm/i915: properly compute dp dithering for user-created modes
Daniel Vetter [Tue, 10 Apr 2012 08:42:36 +0000]
drm/i915: properly compute dp dithering for user-created modes

We've only computed whether we need to fall back to 6bpc due to dp
link bandwidth constrains in mode_valid, but not mode_fixup. Under
various circumstances X likes to create new modes which then lack
proper 6bpc flags (if required), resulting in mode_fixup failures and
ultimately black screens.

Chris Wilson pointed out that we still get things wrong for bpp > 24,
but that should be fixed in another patch (and it'll be easier because
this patch consolidates the logic).

The likely culprit for this regression is

commit 3d794f87238f74d80e78a7611c7fbde8a54c85c2
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Jan 25 08:16:25 2012 -0800

    drm/i915: Force explicit bpp selection for intel_dp_link_required

v2: Fix indentation and tune down the too bold claim that this should
fix the world. Both noticed by Chris Wilson.

v3: Try to really git add things.

Reported-and-tested-by: Brice Goglin <Brice.Goglin@ens-lyon.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48170
Cc: stable@kernel.org
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

7 years agodrm/i915: Finish any pending operations on the framebuffer before disabling
Chris Wilson [Tue, 3 Apr 2012 16:58:35 +0000]
drm/i915: Finish any pending operations on the framebuffer before disabling

Similar to the case where we are changing from one framebuffer to
another, we need to be sure that there are no pending WAIT_FOR_EVENTs on
the pipe for the current framebuffer before switching. If we disable the
pipe, and then try to execute a WAIT_FOR_EVENT it will block
indefinitely and cause a GPU hang.

We attempted to fix this in commit 85345517fe6d4de27b0d6ca19fef9d28ac947c4a
(drm/i915: Retire any pending operations on the old scanout when switching)
for the case of mode switching, but this leaves the condition where we
are switching off the pipe vulnerable.

There still remains the race condition were a display may be unplugged,
switched off by the core, a uevent sent to notify the DDX and the DDX
may issue a WAIT_FOR_EVENT before it processes the uevent. This window
does not exist if the pipe is only switched off in response to the
uevent. Time to make sure that is so...

Reported-by: Francis Leblanc <Francis.Leblanc-Lebeau@verint.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36515
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45413
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
[danvet: fixup spelling in comment, noticed by Eugeni.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

7 years agodrm/i915: Removed IVB forced enable of sprite dest key.
acreese [Wed, 4 Apr 2012 23:22:32 +0000]
drm/i915: Removed IVB forced enable of sprite dest key.

The destination color key is always enabled for IVB.  Removed
the line that does this.

Signed-off-by: Armin Reese <armin.c.reese@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: stable@kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

7 years agodrm/radeon: only add the mm i2c bus if the hw_i2c module param is set
Alex Deucher [Tue, 10 Apr 2012 16:14:27 +0000]
drm/radeon: only add the mm i2c bus if the hw_i2c module param is set

It seems it can corrupt the monitor EDID in certain cases on certain
boards when running sensors detect.  It's rarely used anyway outside
of AIW boards.


Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>

7 years agovgaarb.h: fix build warnings
Randy Dunlap [Mon, 30 Jan 2012 19:43:52 +0000]
vgaarb.h: fix build warnings

Fix build warnings by providing a struct stub since no fields of
the struct are used:

include/linux/vgaarb.h:66:9: warning: 'struct pci_dev' declared inside parameter list
include/linux/vgaarb.h:66:9: warning: its scope is only this definition or declaration, which is probably not what you want
include/linux/vgaarb.h:99:34: warning: 'struct pci_dev' declared inside parameter list
include/linux/vgaarb.h:109:6: warning: 'struct pci_dev' declared inside parameter list
include/linux/vgaarb.h:121:8: warning: 'struct pci_dev' declared inside parameter list
include/linux/vgaarb.h:140:37: warning: 'struct pci_dev' declared inside parameter list

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>

7 years agodrm/radeon/kms: fix DVO setup on some r4xx chips
Alex Deucher [Tue, 3 Apr 2012 21:05:41 +0000]
drm/radeon/kms: fix DVO setup on some r4xx chips

Some r4xx chips have the wrong frev in the
DVOEncoderControl table.  It should always be 1
on r4xx.  Fixes modesetting on DVO on r4xx chips
with the bad frev.

Reported by twied on #radeon.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>

7 years agodrm/savage: fix integer overflows in savage_bci_cmdbuf()
Xi Wang [Fri, 6 Apr 2012 21:38:24 +0000]
drm/savage: fix integer overflows in savage_bci_cmdbuf()

Since cmdbuf->size and cmdbuf->nbox are from userspace, a large value
would overflow the allocation size, leading to out-of-bounds access.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

7 years agodrm/radeon: replace udelay with mdelay for long timeouts
Arnd Bergmann [Thu, 5 Apr 2012 18:58:22 +0000]
drm/radeon: replace udelay with mdelay for long timeouts

Some architectures require that delays longer than a few
miliseconds are called through mdelay. This was triggered
on ARM randconfig builds.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>

7 years agomd/bitmap: prevent bitmap_daemon_work running while initialising bitmap
NeilBrown [Thu, 12 Apr 2012 06:05:06 +0000]
md/bitmap: prevent bitmap_daemon_work running while initialising bitmap

If a bitmap is added while the array is active, it is possible
for bitmap_daemon_work to run while the bitmap is being
This is particularly a problem if bitmap_daemon_work sees
bitmap->filemap as non-NULL before it has been filled in properly.
So hold bitmap_info.mutex while filling in ->filemap
to prevent problems.

This patch is suitable for any -stable kernel, though it might not
apply cleanly before about 3.1.

Cc: stable@vger.kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>

7 years agomd/raid1,raid10: Fix calculation of 'vcnt' when processing error recovery.
majianpeng [Thu, 12 Apr 2012 06:04:47 +0000]
md/raid1,raid10: Fix calculation of 'vcnt' when processing error recovery.

If r1bio->sectors % 8 != 0,then the memcmp and a later
memcpy will omit the last bio_vec.

This is suitable for any stable kernel since 3.1 when bad-block
management was introduced.

Cc: stable@vger.kernel.org
Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>

7 years agoMD: Bitmap version cleanup.
Andrei Warkentin [Thu, 12 Apr 2012 05:55:21 +0000]
MD: Bitmap version cleanup.

bitmap_new_disk_sb() would still create V3 bitmap superblock
with host-endian layout.

Perhaps I'm confused, but shouldn't bitmap_new_disk_sb() be
creating a V4 bitmap superblock instead, that is portable,
as per comment in bitmap.h?

Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>

7 years agoirq_domain: Move irq_virq_count into NOMAP revmap
Grant Likely [Wed, 15 Feb 2012 22:06:08 +0000]
irq_domain: Move irq_virq_count into NOMAP revmap

This patch replaces the old global setting of irq_virq_count that is only
used by the NOMAP mapping and instead uses a revmap_data property so that
the maximum NOMAP allocation can be set per NOMAP irq_domain.

There is exactly one user of irq_virq_count in-tree right now: PS3.
Also, irq_virq_count is only useful for the NOMAP mapping.  So,
instead of having a single global irq_virq_count values, this change
drops it entirely and added a max_irq argument to irq_domain_add_nomap().
That makes it a property of an individual nomap irq domain instead of
a global system settting.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>

7 years agoirqdomain: Fix debugfs formatting
Grant Likely [Wed, 11 Apr 2012 06:26:25 +0000]
irqdomain: Fix debugfs formatting

This patch fixes the irq_domain_mapping debugfs output to pad pointer
values with leading zeros so that pointer values are displayed
correctly.  Otherwise you get output similar to "0x 5e0000000000000".
Also, when the irq_domain is set to 'null'

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: David Daney <david.daney@cavium.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>

7 years agoirq_domain: correct the debugfs file name
Mika Westerberg [Tue, 10 Apr 2012 12:25:42 +0000]
irq_domain: correct the debugfs file name

The actual name of the irq_domain mapping debugfs file is
"irq_domain_mapping" not "virq_mapping".

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

7 years agoirq: Kill pointless irqd_to_hw export
Grant Likely [Tue, 3 Apr 2012 13:11:04 +0000]
irq: Kill pointless irqd_to_hw export

It makes no sense to export this trivial function.  Make it a static inline

This patch also drops virq_to_hw from arch/c6x since it is unused by that

v2: Move irq_hw_number_t into types.h to fix ARM build failure

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>

7 years agoirq/irq_domain: Quit ignoring error returns from irq_alloc_desc_from().
David Daney [Thu, 5 Apr 2012 23:52:13 +0000]
irq/irq_domain: Quit ignoring error returns from irq_alloc_desc_from().

In commit 4bbdd45a (irq_domain/powerpc: eliminate irq_map; use
irq_alloc_desc() instead) code was added that ignores error returns
from irq_alloc_desc_from() by (silently) casting the return value to
unsigned.  The negitive value error return now suddenly looks like a
valid irq number.

Commits cc79ca69 (irq_domain: Move irq_domain code from powerpc to
kernel/irq) and 1bc04f2c (irq_domain: Add support for base irq and
hwirq in legacy mappings) move this code to its current location in

The result of all of this is a null pointer dereference OOPS if one of
the error cases is hit.

The fix: Don't cast away the negativeness of the return value and then
check for errors.

Signed-off-by: David Daney <david.daney@cavium.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
[grant.likely: dropped addition of new 'irq' variable]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

7 years agoInput: da9052 - fix memory leak in da9052_onkey_probe()
Jesper Juhl [Thu, 12 Apr 2012 03:55:18 +0000]
Input: da9052 - fix memory leak in da9052_onkey_probe()

If, in drivers/input/misc/da9052_onkey.c::da9052_onkey_probe(), the
call to either kzalloc() or input_allocate_device() fails then we will
return -ENOMEM from the function without freeing the other allocation
that may have succeeded, thus we leak either the memory allocated for
'onkey' or the memory allocated for 'input_dev' if one succeeds and
the other fails.
Fix that by jumping to the 'err_free_mem' label at the end of the
function that properly cleans up rather than returning directly.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

7 years agoInput: gpio_mouse - use linux/gpio.h rather than asm/gpio.h
Mark Brown [Tue, 10 Apr 2012 16:03:03 +0000]
Input: gpio_mouse - use linux/gpio.h rather than asm/gpio.h

Direct usage of the asm include has long been deprecated by the
introduction of gpiolib.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

7 years agoInput: trackpoint - use psmouse_fmt() for messages
JJ Ding [Tue, 10 Apr 2012 07:25:01 +0000]
Input: trackpoint - use psmouse_fmt() for messages

Use psmouse_*() macros introduced in commit b5d21704361ee.

Signed-off-by: JJ Ding <dgdunix@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

7 years agoInput: elantech - v4 is a clickpad, with only one button
JJ Ding [Tue, 10 Apr 2012 07:30:12 +0000]
Input: elantech - v4 is a clickpad, with only one button

Add pointer and buttonpad properties for v4 hardware.

Also, Jachiet reported that on Asus UX31, right button has no effect.
It turns out v4 has only one button, the right-button effect is
implemented with software when Windows driver is installed, or in
firmware when touchpad is in relative mode. So remove BTN_RIGHT
while at it.

Reported-by: Jachiet Louis <louis@jachiet.com>
Signed-off-by: JJ Ding <jj_ding@emc.com.tw>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

7 years agoInput: elantech - reset touchpad before configuring it
JJ Ding [Tue, 10 Apr 2012 07:29:12 +0000]
Input: elantech - reset touchpad before configuring it

Acer VH40 has a Fn key toggling the touchpad on and off, but it's
implemented in system firmware, and the EC chip has to receive
reset command to activate this function. Also when this machine
wakes up after resume, psmouse_reset is necessary to bring the
touchpad back on.

Signed-off-by: JJ Ding <jj_ding@emc.com.tw>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

7 years agoInput: sentelic - filter taps in absolute mode
Oskari Saarenmaa [Tue, 3 Apr 2012 16:46:32 +0000]
Input: sentelic - filter taps in absolute mode

Taps in absolute positioning single-finger mode are currently reported
as physical clicks by the driver. This should be handled by userspace,
not the kernel.

When a tap occurs, the FSP_PB0_LBTN bit is set, but the FSP_PB0_PHY_BTN
is not. We use this to filter out physical clicks from taps.

Signed-off-by: Oskari Saarenmaa <os@ohmu.fi>
Reviewed-by: Tai-hwa Liang <avatar@sentelic.com>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

7 years agoInput: tps6507x-ts - fix MODULE_ALIAS to match driver name
Uwe Kleine-König [Tue, 3 Apr 2012 16:33:58 +0000]
Input: tps6507x-ts - fix MODULE_ALIAS to match driver name

This is needed to make module auto loading work.

[dtor@mail.ru: remove file name from comment]
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

7 years agotypo fix in Documentation/filesystems/vfs.txt
Al Viro [Mon, 2 Apr 2012 23:02:48 +0000]
typo fix in Documentation/filesystems/vfs.txt

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

7 years agodentry leak in simple_fill_super() failure exit
Al Viro [Mon, 2 Apr 2012 23:22:25 +0000]
dentry leak in simple_fill_super() failure exit

d_genocide() does _not_ evict dentries; it just removes extra ref
pinning each of those.  Normally it's followed by shrinking the
tree (it's done just before generic_shutdown_super() by kill_litter_super()),
but in case of simple_fill_super() nothing of that kind will follow.
Just do shrink_dcache_parent() manually.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

7 years agofix breakage in mtdchar_open(), sanitize failure exits
Al Viro [Mon, 9 Apr 2012 05:36:28 +0000]
fix breakage in mtdchar_open(), sanitize failure exits

simple_release_fs() should be only done on failure there.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

7 years agopowerpc: Fix typo in runlatch code
Benjamin Herrenschmidt [Wed, 11 Apr 2012 00:42:15 +0000]
powerpc: Fix typo in runlatch code

Commit fe1952fc0afb9a2e4c79f103c08aef5d13db1873
"powerpc: Rework runlatch code" has a nasty typo
where it uses "TLF_RUNLATCH" instead of "_TLF_RUNLATCH"
(bit number instead of bit mask), causing some flags to
be potentially lost such as _TLF_RESTORE_SIGMASK

(Brown paper bag for me ! We should be able to make
that break at compile time with a bit of magic, any
volunteer ?)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

7 years agopowerpc: Fix page fault with lockdep regression
Benjamin Herrenschmidt [Tue, 10 Apr 2012 07:21:35 +0000]
powerpc: Fix page fault with lockdep regression

commit a546498f3bf9aac311c66f965186373aee2ca0b0
introduced a regression on 32-bit when irq tracing
is enabled by exposing an old bug in our irq tracing
code for exception entry.

The code would save and restore some GPRs around the
calls to the C lockdep code, however, it tries to be
too smart for its own good and restores some of the
GPRs from the exception frame (as saved there on
exception entry).

However, for page faults, we do replace those GPRs with
arguments to do_page_fault before we call transfer_to_handler
and so restoring from the exception frame is plain wrong in
this case.

This was fine as long as we didn't touch the interrupt state
when taking page fault, but when I started doing it, it would
trigger the lockdep calls and the bug.

This fixes it by cleaning up that code a bit. It did create
a small stack frame for the sake of backtraces, so let's
make it a bit bigger and use it to save and restore the
stuff we care about.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

7 years agoIB/core: Don't return EINVAL from sysfs rate attribute for invalid speeds
Roland Dreier [Mon, 2 Apr 2012 17:57:31 +0000]
IB/core: Don't return EINVAL from sysfs rate attribute for invalid speeds

Commit e9319b0cb00d ("IB/core: Fix SDR rates in sysfs") changed our
sysfs rate attribute to return EINVAL to userspace if the underlying
device driver returns an invalid rate.  Apparently some drivers do this
when the link is down and some userspace pukes if it gets an error when
reading this attribute, so avoid a regression by not return an error to
match the old code.

Signed-off-by: Roland Dreier <roland@purestorage.com>

7 years agoIB/mlx4: Don't return an invalid speed when a port is down
Or Gerlitz [Mon, 2 Apr 2012 14:45:20 +0000]
IB/mlx4: Don't return an invalid speed when a port is down

When the IB port is down, the active_speed value returned by the
MAD_IFC command is seven (7) which isn't among the defined IB speeds
in enum ib_port_speed, and this invalid speed value is passed up to
higher layers or applications who do port query.

Fix that by setting the speed to be SDR -- the lowest possible -- when
the port is down.

Signed-off-by: Roland Dreier <roland@purestorage.com>

7 years agoarch/tile: avoid unused variable warning in proc.c for tilegx
Chris Metcalf [Wed, 11 Apr 2012 16:45:20 +0000]
arch/tile: avoid unused variable warning in proc.c for tilegx

Until we push the unaligned access support for tilegx, it's silly
to have arch/tile/kernel/proc.c generate a warning about an unused
variable.  Extend the #ifdef to cover all the code and data for now.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agotile/CPU hotplug: Add missing call to notify_cpu_starting()
Srivatsa S. Bhat [Thu, 22 Mar 2012 11:29:11 +0000]
tile/CPU hotplug: Add missing call to notify_cpu_starting()

The scheduler depends on receiving the CPU_STARTING notification, without
which we end up into a lot of trouble. So add the missing call to
notify_cpu_starting() in the bringup code.

Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

7 years agoALSA: hda - hide HDMI/ELD printks unless snd.debug=2
Fengguang Wu [Tue, 10 Apr 2012 09:00:35 +0000]
ALSA: hda - hide HDMI/ELD printks unless snd.debug=2

Also remove two warnings when CONFIG_SND_DEBUG is not set:

sound/pci/hda/patch_hdmi.c: In function ‘hdmi_intrinsic_event’:
sound/pci/hda/patch_hdmi.c:761:6: warning: unused variable ‘eldv’ [-Wunused-variable]
sound/pci/hda/patch_hdmi.c:760:6: warning: unused variable ‘pd’ [-Wunused-variable]

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: sound/isa/sscape.c: add missing resource-release code
Julia Lawall [Mon, 9 Apr 2012 08:16:35 +0000]
ALSA: sound/isa/sscape.c: add missing resource-release code

At the point of this error-handling code, both regions and the dma have
been allocated, so free it as done in previous and subsequent
error-handling code.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agosound: sound/oss/msnd_pinnacle.c: add vfrees
Julia Lawall [Mon, 9 Apr 2012 08:16:32 +0000]
sound: sound/oss/msnd_pinnacle.c: add vfrees

At the point of this error-handling code, HAVE_DSPCODEH may be undefined,
so free INITCODE and PERMCODE as done elsewhere.  A jump and label are
introduced to avoid code duplication.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoASoC: tegra: fix i2s compilation when !CONFIG_DEBUG_FS
Stephen Warren [Wed, 18 Apr 2012 14:04:27 +0000]
ASoC: tegra: fix i2s compilation when !CONFIG_DEBUG_FS

Commit d4a2eca "ASoC: Tegra I2S: Remove dependency on pdev->id" changed
the prototype of tegra_i2s_debug_add, but didn't update the dummy inline
used when !CONFIG_DEBUG_FS. Fix that.

Change-Id: I50d69cc7de3946dfc32e7e6b3e54ae128a46d961
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: <stable@vger.kernel.org> # 3.3

7 years agoASoC: set idle_bias_off=1 for all platform DAPM contexts
Stephen Warren [Thu, 5 Apr 2012 18:28:01 +0000]
ASoC: set idle_bias_off=1 for all platform DAPM contexts

The ASoC core currently defaults to using STANDBY rather than OFF for
idle ASoC platform devices, which causes a permanent pm_runtime_get() on
them. This keeps the device active unnecessarily. This can be especially
problematic when the ASoC platform device and DAI device are the same

The distinction between OFF and STANDBY is likely not relevant for ASoC
platform drivers, since they aren't analog devices. So, solve this issue
by hard-coding idle_bias_off = 1 for all ASoC platform devices. If this
turns out to be a problem, this value could be sourced from the
snd_soc_platform_driver, similarly to soc_probe_codec().

Note: Prior to this change, this caused a large (10) runtime_active count
for the Tegra I2S controller even when not in use, and a leak in that
value as streams were started and stopped. This change probably hides a

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoASoC: imx-audmux: Check for NULL pointer
Fabio Estevam [Thu, 5 Apr 2012 13:57:51 +0000]
ASoC: imx-audmux: Check for NULL pointer

Check for NULL pointer before accessing it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoASoC: imx-audmux: Fix ssi port numbers in sysfs
Fabio Estevam [Thu, 5 Apr 2012 12:45:51 +0000]
ASoC: imx-audmux: Fix ssi port numbers in sysfs

Doing a 'cat /sys/kernel/debug/audmux/ssi7' causes the following oops to be printed by the kernel:

Uhandled fault: external abort on non-linefetch (0x008) at 0xf53b003c
Internal error: : 8 [#1] PREEMPT
Modules linked in:
CPU: 0    Not tainted  (3.3.0-00033-gecc726e-dirty #307)
PC is at audmux_read_file+0x68/0x2f4
LR is at clk_enable+0x3c/0x48
pc : [<c001b8c8>]   lr : [<c00190a0>]    psr: a0000013
sp : c3ad3f38  ip : c30a4000  fp : 00000003
r10: 00001000  r9 : be83fb00  r8 : c3ad3f80
r7 : c3ad3f80  r6 : 00000007  r5 : 00031010  r4 : c30a5000
r3 : f53b0000  r2 : 0000003c  r1 : 380fa100  r0 : c068dda0
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 83034000  DAC: 00000015
Process cat (pid: 1042, stack limit = 0xc3ad2270)
Stack: (0xc3ad3f38 to 0xc3ad4000)
3f20:                                                      c3139180 00000000
3f40: c3bc6500 00001000 be83fb00 c3ad3f80 00001000 c3ad2000 00000000 c0095f3c
3f60: 00000003 c3bc6508 c3bc6500 be83fb00 00000000 00000000 00001000 c0096010
3f80: 00000000 00000000 b6fe2050 00000000 00001000 be83fb00 00000003 00000003
3fa0: c000eb88 c000e9e0 00001000 be83fb00 00000003 be83fb00 00001000 00000000
3fc0: 00001000 be83fb00 00000003 00000003 00000001 00000001 00000000 00000003
3fe0: 000bec8c be83fae0 0000f808 b6ea8d5c 60000010 00000003 7dff7ede 749bedf1
[<c001b8c8>] (audmux_read_file+0x68/0x2f4) from [<c0095f3c>] (vfs_read+0xb0/0x144)
[<c0095f3c>] (vfs_read+0xb0/0x144) from [<c0096010>] (sys_read+0x40/0x70)
[<c0096010>] (sys_read+0x40/0x70) from [<c000e9e0>] (ret_fast_syscall+0x0/0x2c)
Code: e1a02186 e2822004 e3500000 e7935186 (e7937002)
---[ end trace 4d046e31309023de ]---

Fix the ssi port numbers in sysfs to fix this problem.

Reported-by: Joan Carles <joancarles@fqingenieria.es>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoASoC: ak4642: fixup: mute needs +1 step
Kuninori Morimoto [Thu, 5 Apr 2012 06:28:01 +0000]
ASoC: ak4642: fixup: mute needs +1 step

ak4642 out_tlv is +12.0dB to -115.0 dB, and it supports mute.
But current settings didn't care +1 step for mute.
This patch adds it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org

7 years agoMAINTAINERS: Don't list everyone working on Wolfson drivers
Mark Brown [Wed, 4 Apr 2012 11:06:24 +0000]
MAINTAINERS: Don't list everyone working on Wolfson drivers

Rather than listing every single person who works on the drivers include
the mailing list where they can all be found.  Leave myself as a human

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoMAINTAINERS: Add missing ASoC OMAP co-maintainer
Jarkko Nikula [Tue, 3 Apr 2012 06:45:43 +0000]
MAINTAINERS: Add missing ASoC OMAP co-maintainer

Peter Ujfalusi has been co-maintaining sound/soc/omap/ for years but
was missing from this MAINTAINERS entry.

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoASoC: pxa: pxa2xx-i2s: add io.h for IOMEM macro
Martin Jansa [Mon, 2 Apr 2012 08:24:08 +0000]
ASoC: pxa: pxa2xx-i2s: add io.h for IOMEM macro

* fixes
  sound/soc/pxa/pxa2xx-i2s.c:86:2: error: implicit declaration of function 'IOMEM' [-Werror=implicit-function-declaration]
  sound/soc/pxa/pxa2xx-i2s.c:86:2: error: initializer element is not constant
  after 23019a733bb83c8499f192fb428b7e6e81c95a34 removed IOMEM
  definition from arch/arm/mach-pxa/include/mach/hardware.h

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoASoC: tegra: ensure clocks are enabled when touching registers
Stephen Warren [Wed, 18 Apr 2012 14:01:26 +0000]
ASoC: tegra: ensure clocks are enabled when touching registers

Debugfs files could be accessed any time, so explicitly enable clocks
when reading registers to generate debugfs file content.

Change-Id: Idd4cff386f805ac0e9b466e5c738002cf65c2aa4
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoASoC: sgtl5000: Enable VAG when DAC/ADC up
Zeng Zhaoming [Thu, 29 Mar 2012 16:13:02 +0000]
ASoC: sgtl5000: Enable VAG when DAC/ADC up

As manual described, VAG is an internal voltage reference of DAC/ADC,
So enabled it before DAC/ADC up.

One more thing should care about is VAG fully ramped down requires 400ms,
wait it to avoid pop.

Signed-off-by: Zeng Zhaoming <zengzm.kernel@gmail.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoALSA: hda - clean up CX20549 test mixer setup
Michael Karcher [Fri, 6 Apr 2012 13:34:20 +0000]
ALSA: hda - clean up CX20549 test mixer setup

name pins consistently (MIC1/LINE1/HP-OUT/CD) on all controls
affecting those pins.

remove duplicate SET_AMP_GAIN_MUTE to 0x17/index 0 and 0x17/index 1

really select MIC1, not Mixer out for recording

"Mixer out" for recording is not a "pin", adjust comment

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: hda - CX20549 doesn't need pin_amp_workaround.
Michael Karcher [Fri, 6 Apr 2012 13:34:19 +0000]
ALSA: hda - CX20549 doesn't need pin_amp_workaround.

CX20549 (ctx5045) doesn't accept data on index 1 for output pins,
as shown in the following hda-var transaction:

  $ hda-verb /dev/snd/hwC0D0 0x10 set_amp_gain 0xb126
  nid = 0x10, verb = 0x300, param = 0xb126
  value = 0x0
  $ hda-verb /dev/snd/hwC0D0 0x10 get_amp_gain 0x8001
  nid = 0x10, verb = 0xb00, param = 0x8001
  value = 0x0

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: hda - Remove CD control from model=benq for CX20549
Michael Karcher [Fri, 6 Apr 2012 13:34:18 +0000]
ALSA: hda - Remove CD control from model=benq for CX20549

The ID used for detection of the BenQ R55E actually identifies the
Quanta TW3 ODM design, which is also used for the Gigabyte W551 laptop
series. Schematics on the internet clearly indicate that the "Port C"
(analog input connected to record source #4 and mixer input #4) is

Playing an audio CD through analog playback (using cdplay from cdtools)
produces no sound, even with the mixer input labelled "CD" enabled, and
the volume control in the CD drive set to maximum. This indicates the
connection is really not present.

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: hda - fix record volume controls of CX20459 ("Venice")
Michael Karcher [Fri, 6 Apr 2012 13:34:17 +0000]
ALSA: hda - fix record volume controls of CX20459 ("Venice")

The "input converter" widget of the CX20459 has only one input amplifier,
expose that one as "Capture Volume/Capture Switch". The actual record
source selection is already exposed through the separately installed
input mux.

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: hda - Rename capture sources of CX20549 to match common conventions
Michael Karcher [Fri, 6 Apr 2012 13:34:16 +0000]
ALSA: hda - Rename capture sources of CX20549 to match common conventions

This includes renaming "Line In" to line, also in the mixer settings.

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: hda - Fix proc output for ADC amp values of CX20549
Michael Karcher [Fri, 6 Apr 2012 13:34:15 +0000]
ALSA: hda - Fix proc output for ADC amp values of CX20549

The CX20549 has only one single input amp on it's input converter
widget. Fix printing of values in the codec file in /proc/asound.

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years agoALSA: asihpi - fix return value of hpios_locked_mem_alloc()
Eliot Blennerhassett [Thu, 29 Mar 2012 20:52:25 +0000]
ALSA: asihpi - fix return value of hpios_locked_mem_alloc()

Make this function consistent with others in this module by
returning 1 for error, instead of -ENOMEM
(reverts function signature change from a938fb1e)

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

7 years ago[media] uvcvideo: Fix race-related crash in uvc_video_clock_update()
Laurent Pinchart [Tue, 27 Mar 2012 08:51:00 +0000]
[media] uvcvideo: Fix race-related crash in uvc_video_clock_update()

The driver frees the clock samples buffer before stopping the video
buffers queue. If a DQBUF call arrives in-between,
uvc_video_clock_update() will be called with a NULL clock samples
buffer, leading to a crash. This occurs very frequently when using the
webcam with the flash browser plugin.

Move clock initialization/cleanup to uvc_video_enable() in order to free
the clock samples buffer after the queue is stopped. Make sure the clock
is reset at resume time to avoid miscalculating timestamps.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

7 years ago[media] Drivers/media/radio: Fix build error
Hans Verkuil [Sun, 1 Apr 2012 18:24:48 +0000]
[media] Drivers/media/radio: Fix build error

On Sunday, April 01, 2012 21:09:34 Tracey Dent wrote:
> radio-maxiradio depends on SND_FM801_TEA575X_BOOL to build or will
> result in an build error such as:
> Kernel: arch/x86/boot/bzImage is ready  (#1)
> ERROR: "snd_tea575x_init" [drivers/media/radio/radio-maxiradio.ko] undefined!
> ERROR: "snd_tea575x_exit" [drivers/media/radio/radio-maxiradio.ko] undefined!
> WARNING: modpost: Found 6 section mismatch(es).
> To see full details build your kernel with:
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2
> Select CONFIG_SND_TEA575X to fixes problem and enable
> the driver to be built as desired.
> v2:
> instead of selecting CONFIG_SND_FM801_TEA575X_BOOL, select
> CONFIG_SND_TEA575X, which in turns selects CONFIG_SND_FM801_TEA575X_BOOL
> and any other dependencies for it to build.

No, this is the correct patch:

RADIO_MAXIRADIO should be treated just like RADIO_SF16FMR2, I just didn't
realize at the time that it had to be added as a SND_TEA575X dependency.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Shea Levy <shea@shealevy.com>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

7 years ago[media] dvb_frontend: fix compiler warning
Hans Petter Selasky [Tue, 27 Mar 2012 15:53:19 +0000]
[media] dvb_frontend: fix compiler warning

has_get_frontend() should return a boolean, not a pointer.

Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

7 years ago[media] it913x: fix firmware loading errors
Malcolm Priestley [Sun, 25 Mar 2012 09:57:49 +0000]
[media] it913x: fix firmware loading errors

On some systems the device does not respond or give obscure values after cold,
warm or firmware reboot.

This patch retries to get chip version and type 5 times. If it
fails it applies chip version 0x1 and type 0x9135.

This patch does not fix warm cycle problems from other operating
systems and indeed the reverse applies. Users should power off cold boot.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

7 years ago[media] ivtv: Fix AUDIO_(BILINGUAL_)CHANNEL_SELECT regression
Hans Verkuil [Sat, 31 Mar 2012 08:18:19 +0000]
[media] ivtv: Fix AUDIO_(BILINGUAL_)CHANNEL_SELECT regression

When I converted ivtv to the new decoder API I introduced a regression in the
support of the old channel select API.

Thanks to Martin Dauskardt for reporting this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

7 years ago[media] dvb_frontend: regression fix: userspace ABI broken for xine
Chris Rankin [Fri, 6 Apr 2012 21:38:18 +0000]
[media] dvb_frontend: regression fix: userspace ABI broken for xine

The commit e399ce77e6e has broken the DVB ABI for xine:

The problem is that xine is expecting every event after a successful
FE_SET_FRONTEND ioctl to have a non-zero frequency parameter, regardless
of whether the tuning process has LOCKed yet. What used to happen is
that the events inherited the initial tuning parameters from the
FE_SET_FRONTEND call. However, the fepriv->parameters_out struct is now
not initialised until the status contains the FE_HAS_LOCK bit.

You might argue that this behaviour is intentional, except that if an
application other than xine uses the DVB adapter and manages to set the
parameters_out.frequency field to something other than zero, then xine
no longer has any problems until either the adapter is replugged or the
kernel modules reloaded. This can only mean that the
fepriv->parameters_out struct still contains the (stale) tuning
information from the previous application.

Signed-off-by: Chris Rankin <rankincj@yahoo.com>
Cc: stable@kernel.org # for kernel version 3.3
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

7 years agoGFS2: Allow caching of rindex glock
Bob Peterson [Tue, 10 Apr 2012 12:56:04 +0000]
GFS2: Allow caching of rindex glock

This patch allows caching of the rindex glock. We were previously
setting the GL_NOCACHE bit when the glock was released. That forced
the rindex inode to be invalidated, which caused us to re-read
rindex at the next access. However, it caused the glock to be
unnecessarily bounced around the cluster. This patch allows
the glock to remain cached, but it still causes the rindex to be
re-read once it has been written to by gfs2_grow.

Ben and I have tested single-node gfs2_grow cases and I've tested
clustered gfs2_grow cases on my four-node cluster.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

7 years agoGFS2: Make sure rindex is uptodate before starting transactions
Bob Peterson [Thu, 5 Apr 2012 02:11:16 +0000]
GFS2: Make sure rindex is uptodate before starting transactions

This patch removes the call from gfs2_blk2rgrd to function
gfs2_rindex_update and replaces it with individual calls.
The former way turned out to be too problematic.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

7 years agoGFS2: use depends instead of select in kconfig
Benjamin Poirier [Fri, 23 Mar 2012 22:06:18 +0000]
GFS2: use depends instead of select in kconfig

Avoids having to duplicate the dependencies of what is 'select'ed (and on

Those dependencies are currently incomplete, leading to broken builds with

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

7 years agoGFS2: put glock reference in error patch of read_rindex_entry
Bob Peterson [Thu, 22 Mar 2012 12:58:30 +0000]
GFS2: put glock reference in error patch of read_rindex_entry

This patch fixes the error path of function read_rindex_entry
so that it correctly gives up its glock reference in cases where
there is a race to re-read the rindex after gfs2_grow.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

7 years agox86: merge 32/64-bit versions of 'strncpy_from_user()' and speed it up
Linus Torvalds [Fri, 6 Apr 2012 21:32:32 +0000]
x86: merge 32/64-bit versions of 'strncpy_from_user()' and speed it up

This merges the 32- and 64-bit versions of the x86 strncpy_from_user()
by just rewriting it in C rather than the ancient inline asm versions
that used lodsb/stosb and had been duplicated for (trivial) differences
between the 32-bit and 64-bit versions.

While doing that, it also speeds them up by doing the accesses a word at
a time.  Finally, the new routines also properly handle the case of
hitting the end of the address space, which we have never done correctly
before (fs/namei.c has a hack around it for that reason).

Despite all these improvements, it actually removes more lines than it
adds, due to the de-duplication.  Also, we no longer export (or define)
the legacy __strncpy_from_user() function (that was defined to not do
the user permission checks), since it's not actually used anywhere, and
the user address space checks are built in to the new code.

Other architecture maintainers have been notified that the old hack in
fs/namei.c will be going away in the 3.5 merge window, in case they
copied the x86 approach of being a bit cavalier about the end of the
address space.

Cc: linux-arch@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Anvin" <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

7 years agocred: copy_process() should clear child->replacement_session_keyring
Oleg Nesterov [Mon, 9 Apr 2012 19:03:50 +0000]
cred: copy_process() should clear child->replacement_session_keyring

keyctl_session_to_parent(task) sets ->replacement_session_keyring,
it should be processed and cleared by key_replace_session_keyring().

However, this task can fork before it notices TIF_NOTIFY_RESUME and
the new child gets the bogus ->replacement_session_keyring copied by
dup_task_struct(). This is obviously wrong and, if nothing else, this
leads to put_cred(already_freed_cred).

change copy_creds() to clear this member. If copy_process() fails
before this point the wrong ->replacement_session_keyring doesn't
matter, exit_creds() won't be called.

Cc: <stable@vger.kernel.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

7 years agoSmack: build when CONFIG_AUDIT not defined
Kees Cook [Tue, 10 Apr 2012 20:26:44 +0000]
Smack: build when CONFIG_AUDIT not defined

This fixes builds where CONFIG_AUDIT is not defined and

This got introduced by the stack-usage reducation commit 48c62af68a40
("LSM: shrink the common_audit_data data union").

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

7 years agonetdma: adding alignment check for NETDMA ops
Dave Jiang [Wed, 4 Apr 2012 23:10:46 +0000]
netdma: adding alignment check for NETDMA ops

This is the fallout from adding memcpy alignment workaround for certain
IOATDMA hardware. NetDMA will only use DMA engine that can handle byte align

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

7 years agoioatdma: DMA copy alignment needed to address IOAT DMA silicon errata
Dave Jiang [Wed, 4 Apr 2012 23:10:41 +0000]
ioatdma: DMA copy alignment needed to address IOAT DMA silicon errata

Silicon errata where when RAID and legacy descriptors are mixed, the legacy
(memcpy and friends) operation must have alignment of 64 bytes to avoid
hanging. This effects Intel Xeon C55xx, C35xx, E5-2600.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

7 years agoioat: ring size variables need to be 32bit to avoid overflow
Dave Jiang [Wed, 4 Apr 2012 23:10:35 +0000]
ioat: ring size variables need to be 32bit to avoid overflow

The alloc order can be up to 16 and 1 << 16 will over flow the 16bit
integer. Change the appropriate variables to 16bit to avoid overflow.

Reported-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

7 years agoiop-adma: Corrected array overflow in RAID6 Xscale(R) test.
Don Morris [Thu, 15 Mar 2012 18:07:30 +0000]
iop-adma: Corrected array overflow in RAID6 Xscale(R) test.

Bug: cppcheck reported overflow in array assignment (for loop walks

Reported as: https://bugzilla.kernel.org/show_bug.cgi?id=42677

Test code pq_src array was grown by two elements to correspond with actual
usage (IOP_ADMA_NUM_SRC_TEST+2), stack consumption was kept constant by
modifying the pq_dest two element array which is only used when pq_src
is referenced up to IOP_ADMA_NUM_SRC_TEST elements into the address
of the new last two elements of the pq_src array. This is presumed to
be the original intent but would be reliant on compilers always having
pq_dest contiguous with the final element of pq_src.

Note: This is a re-send of a request for review from two weeks ago.
Looking for review (or shootdown), adding LKML to list for a wider
audience. Thanks.

Updated per review comments of Sergei Shtylyov <sshtylyov@mvista.com>

Signed-off-by: Don Morris <don.morris@hp.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

7 years agoioat: fix size of 'completion' for Xen
Dan Williams [Fri, 23 Mar 2012 20:36:42 +0000]
ioat: fix size of 'completion' for Xen

Starting with v3.2 Jonathan reports that Xen crashes loading the ioatdma
driver.  A debug run shows:

  ioatdma 0000:00:16.4: desc[0]: (0x300cc7000->0x300cc7040) cookie: 0 flags: 0x2 ctl: 0x29 (op: 0 int_en: 1 compl: 1)
  ioatdma 0000:00:16.4: ioat_get_current_completion: phys_complete: 0xcc7000

...which shows that in this environment GFP_KERNEL memory may be backed
by a 64-bit dma address.  This breaks the driver's assumption that an
unsigned long should be able to contain the physical address for
descriptor memory.  Switch to dma_addr_t which beyond being the right
size, is the true type for the data i.e. an io-virtual address
inidicating the engine's last processed descriptor.

[stable: 3.2+]
Cc: <stable@vger.kernel.org>
Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Reported-by: William Dauchy <wdauchy@gmail.com>
Tested-by: William Dauchy <wdauchy@gmail.com>
Tested-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

7 years agosparc32,leon: fix leon build
Sam Ravnborg [Wed, 4 Apr 2012 19:20:01 +0000]
sparc32,leon: fix leon build

Minimal fix to allow leon to be built.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Konrad Eisele <konrad@gaisler.com>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

7 years agosparc/mm/fault_32.c: Port OOM changes to do_sparc_fault
Kautuk Consul [Mon, 26 Mar 2012 06:47:54 +0000]
sparc/mm/fault_32.c: Port OOM changes to do_sparc_fault

Commit d065bd810b6deb67d4897a14bfe21f8eb526ba99
(mm: retry page fault when blocking on disk transfer) and
commit 37b23e0525d393d48a7d59f870b3bc061a30ccdb
(x86,mm: make pagefault killable)

The above commits introduced changes into the x86 pagefault handler
for making the page fault handler retryable as well as killable.

These changes reduce the mmap_sem hold time, which is crucial
during OOM killer invocation.

Port these changes to 32-bit sparc.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

7 years agosparc/mm/fault_64.c: Port OOM changes to do_sparc64_fault
Kautuk Consul [Mon, 26 Mar 2012 06:40:49 +0000]
sparc/mm/fault_64.c: Port OOM changes to do_sparc64_fault

Commit d065bd810b6deb67d4897a14bfe21f8eb526ba99
(mm: retry page fault when blocking on disk transfer) and
commit 37b23e0525d393d48a7d59f870b3bc061a30ccdb
(x86,mm: make pagefault killable)

The above commits introduced changes into the x86 pagefault handler
for making the page fault handler retryable as well as killable.

These changes reduce the mmap_sem hold time, which is crucial
during OOM killer invocation.

Port these changes to 64-bit sparc.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

7 years agoregulator: anatop: fix 'anatop_regulator' name collision
Shawn Guo [Mon, 2 Apr 2012 06:57:01 +0000]
regulator: anatop: fix 'anatop_regulator' name collision

There is a name collision between 'struct platform_driver
anatop_regulator' and 'struct anatop_regulator', which causes some
section mismatch warnings like below.

WARNING: vmlinux.o(.data+0x154d4): Section mismatch in reference from the variable anatop_regulator to the function .devinit.text:anatop_regulator_probe()
The variable anatop_regulator references
the function __devinit anatop_regulator_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Rename 'struct platform_driver anatop_regulator' to
'struct platform_driver anatop_regulator_driver' to fix the warnings.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

7 years agoum: uml_setup_stubs': warning: unused variable 'pages'
Boaz Harrosh [Tue, 27 Mar 2012 02:18:22 +0000]
um: uml_setup_stubs': warning: unused variable 'pages'

Fix the following gcc complain
arch/um/kernel/skas/mmu.c: In function 'uml_setup_stubs':
arch/um/kernel/skas/mmu.c:106:16: warning: unused variable 'pages' [-Wunused-variable]

Signed-Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

7 years agoum: Use asm-generic/switch_to.h
Richard Weinberger [Thu, 29 Mar 2012 17:10:42 +0000]
um: Use asm-generic/switch_to.h

Signed-off-by: Richard Weinberger <richard@nod.at>

7 years agoum: Disintegrate asm/system.h
Richard Weinberger [Thu, 29 Mar 2012 16:47:46 +0000]
um: Disintegrate asm/system.h

Signed-off-by: Richard Weinberger <richard@nod.at>
Reported-by: Toralf Förster <toralf.foerster@gmx.de>
CC: dhowells@redhat.com

7 years agoum: switch cow_user.h to htobe{32,64}/betoh{32,64}
Al Viro [Fri, 6 Apr 2012 03:35:03 +0000]
um: switch cow_user.h to htobe{32,64}/betoh{32,64}

... rather than open-coding the 64bit versions.  endian.h has those guys.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>