pandora-kernel.git
12 years agoBtrfs: fix meta data raid-repair merge problem
Jan Schmidt [Thu, 1 Dec 2011 14:30:36 +0000 (09:30 -0500)]
Btrfs: fix meta data raid-repair merge problem

Commit 4a54c8c16 introduced raid-repair, killing the individual
readpage_io_failed_hook entries from inode.c and disk-io.c. Commit
4bb31e92 introduced new readahead code, adding a readpage_io_failed_hook to
disk-io.c.

The raid-repair commit had logic to disable raid-repair, if
readpage_io_failed_hook is set. Thus, the readahead commit effectively
disabled raid-repair for meta data.

This commit changes the logic to always attempt raid-repair when needed and
call the readpage_io_failed_hook in case raid-repair fails. This is much
more straight forward and should have been like that from the beginning.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Reported-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years ago[S390] ap: Setup timer for sending messages after reset.
Holger Dengler [Thu, 1 Dec 2011 12:32:23 +0000 (13:32 +0100)]
[S390] ap: Setup timer for sending messages after reset.

Setup timer for processing messages in request queue after a
successful AP bus device reset.

Signed-off-by: Holger Dengler <hd@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years ago[S390] cio: fix chsc_chp_vary
Sebastian Ott [Thu, 1 Dec 2011 12:32:22 +0000 (13:32 +0100)]
[S390] cio: fix chsc_chp_vary

The functions called by chsc_chp_vary operate on pointers to channel
path ids not channel path links. (This worked by chance since the id
is the first member of the link structure)

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years ago[S390] cio: provide fake irb for transport mode IO
Sebastian Ott [Thu, 1 Dec 2011 12:32:21 +0000 (13:32 +0100)]
[S390] cio: provide fake irb for transport mode IO

If a driver wants to do command mode IO while CIO is doing
online path verification we ignore this request and provide
a fake irb when we are done and the driver can do IO again.

For transport mode IO we have no such mechanism, giving the
driver no other chance then to retry the action until we are
done. This is not very reliable.

Provide a fake irb for transport mode IO as well.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years ago[S390] cio: disallow driver io for known to be broken paths
Sebastian Ott [Thu, 1 Dec 2011 12:32:20 +0000 (13:32 +0100)]
[S390] cio: disallow driver io for known to be broken paths

When a driver requests to do IO, we will adjust the mask of
paths to be used to exclude varied offline paths.

Drivers trying to do IO solely on paths which are online but some
way defective may lack the information to do proper error handling.

There is no reason to allow the usage of known to be broken paths.
Thus restrict the paths a ccw driver can use for IO to a subset of
the paths cio found usable (this also excludes offline paths).

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years ago[S390] hibernate: directly trigger subchannel evaluation
Sebastian Ott [Thu, 1 Dec 2011 12:32:19 +0000 (13:32 +0100)]
[S390] hibernate: directly trigger subchannel evaluation

Using the generic css_schedule_eval to evaluate subchannels
while resuming from hibernation is very slow when used with
many devices. Provide a new evaluation trigger which exploits
css_sched_sch_todo and use this in the resume callback for
ccw devices.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years ago[S390] remove reset of system call restart on psw changes
Martin Schwidefsky [Thu, 1 Dec 2011 12:32:18 +0000 (13:32 +0100)]
[S390] remove reset of system call restart on psw changes

git commit 20b40a794baf3b4b "signal race with restarting system calls"
added code to the poke_user/poke_user_compat to reset the system call
restart information in the thread-info if the PSW address is changed.
The purpose of that change has been to workaround old gdbs that do
not know about the REGSET_SYSTEM_CALL. It turned out that this is not
a good idea, it makes the behaviour of the debuggee dependent on the
order of specific ptrace call, e.g. the REGSET_SYSTEM_CALL register
set needs to be written last. And the workaround does not really fix
old gdbs, inferior calls on interrupted restarting system calls do not
work either way.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years ago[S390] add missing .set function for NT_S390_LAST_BREAK regset
Martin Schwidefsky [Thu, 1 Dec 2011 12:32:17 +0000 (13:32 +0100)]
[S390] add missing .set function for NT_S390_LAST_BREAK regset

The last breaking event address is a read-only value, the regset misses the
.set function. If a PTRACE_SETREGSET is done for NT_S390_LAST_BREAK we
get an oops due to a branch to zero:

Kernel BUG at 0000000000000002 verbose debug info unavailable
illegal operation: 0001 #1 SMP
...
Call Trace:
(<0000000000158294> ptrace_regset+0x184/0x188)
 <00000000001595b6> ptrace_request+0x37a/0x4fc
 <0000000000109a78> arch_ptrace+0x108/0x1fc
 <00000000001590d6> SyS_ptrace+0xaa/0x12c
 <00000000005c7a42> sysc_noemu+0x16/0x1c
 <000003fffd5ec10c> 0x3fffd5ec10c
Last Breaking-Event-Address:
 <0000000000158242> ptrace_regset+0x132/0x188

Add a nop .set function to prevent the branch to zero.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: stable@kernel.org
12 years ago[S390] fix page change underindication in pgste_update_all
Carsten Otte [Thu, 1 Dec 2011 12:32:16 +0000 (13:32 +0100)]
[S390] fix page change underindication in pgste_update_all

This patch makes sure we don't underindicate _PAGE_CHANGED in case
we have a race between an operation that changes the page and this
code path that hits us between page_get_storage_key and
page_set_storage_key. Note that we still have a potential
underindication on _PAGE_REFERENCED in the unlikely event that
the page was changed but not referenced _and_ someone references
the page in the race window. That's not considered to be a problem.

Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years ago[S390] ptrace inferior call interactions with TIF_SYSCALL
Martin Schwidefsky [Thu, 1 Dec 2011 12:32:15 +0000 (13:32 +0100)]
[S390] ptrace inferior call interactions with TIF_SYSCALL

The TIF_SYSCALL bit needs to be cleared if the debugger changes the state
of the ptraced process in regard to the presence of a system call.
Otherwise the system call will be restarted although the debugger set up
an inferior call.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years ago[S390] kdump: Replace is_kdump_kernel() with OLDMEM_BASE check
Michael Holzheu [Thu, 1 Dec 2011 12:32:14 +0000 (13:32 +0100)]
[S390] kdump: Replace is_kdump_kernel() with OLDMEM_BASE check

In order to have the same behavior for kdump based stand-alone dump
as for the kexec method, the is_kdump_kernel() check (only true for
the kexec method) has to be replaced by the OLDMEM_BASE check (true
for both methods).

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
12 years agoALSA: hda - Fix S3/S4 problem on machines with VREF-pin mute-LED
Charles Chin [Thu, 1 Dec 2011 10:21:00 +0000 (11:21 +0100)]
ALSA: hda - Fix S3/S4 problem on machines with VREF-pin mute-LED

The verb command in stac92xx_post_suspend caused the audio to stop
working after resuming from S3 mode on HP laptops with the VREF-pin
mute-LED control.  Removing relevant post_suspend registering.

Although removing D3 on AFG is no optimal solution, the impact should
be small in comparison with the broken S3/S4.

Signed-off-by: Charles Chin <Charles.Chin@idt.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agodrm/radeon/kms: Skip ACPI call to ATIF when possible
Jean Delvare [Wed, 30 Nov 2011 16:36:39 +0000 (17:36 +0100)]
drm/radeon/kms: Skip ACPI call to ATIF when possible

I am under the impression that it only makes sense to call the ATIF
method if the graphics device has an ACPI handle attached. So we could
skip the call altogether if there is no such handle.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: Hide debugging message
Jean Delvare [Wed, 30 Nov 2011 16:26:36 +0000 (17:26 +0100)]
drm/radeon/kms: Hide debugging message

Use the proper macro to issue the debugging message in
radeon_atif_call(). Otherwise we spam the log of many systems with a
message which looks like an error message of unknown origin, and could
thus confuse the user. Commit dc77de12dde95c8da39e4c417eb70c7d445cf84b
was a first step in this direction, but was not sufficient IMHO.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add some loop timeouts in pageflip code
Alex Deucher [Mon, 28 Nov 2011 19:49:26 +0000 (14:49 -0500)]
drm/radeon/kms: add some loop timeouts in pageflip code

Avoid infinite loops waiting for surface updates if a GPU
reset happens while waiting for a page flip.

See:
https://bugs.freedesktop.org/show_bug.cgi?id=43191

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@kernel.org
Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Tested-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoMerge branch 'drm-nouveau-fixes' of git://git.freedesktop.org/git/nouveau/linux-2...
Dave Airlie [Thu, 1 Dec 2011 09:01:55 +0000 (09:01 +0000)]
Merge branch 'drm-nouveau-fixes' of git://git.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes

* 'drm-nouveau-fixes' of git://git.freedesktop.org/git/nouveau/linux-2.6:
  drm/nv50/disp: silence compiler warning
  drm/nouveau: fix oopses caused by clear being called on unpopulated ttms
  drm/nouveau: Keep RAMIN heap within the channel.
  drm/nvd0/disp: fix sor dpms typo, preventing dpms on in some situations
  drm/nvc0/gr: fix TP init for transform feedback offset queries
  drm/nouveau: add dumb ioctl support

12 years agonet/core: fix rollback handler in register_netdevice_notifier
RongQing.Li [Thu, 1 Dec 2011 04:43:07 +0000 (23:43 -0500)]
net/core: fix rollback handler in register_netdevice_notifier

Within nested statements, the break statement terminates only the
do, for, switch, or while statement that immediately encloses it,
So replace the break with goto.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosch_red: fix red_calc_qavg_from_idle_time
Eric Dumazet [Wed, 30 Nov 2011 12:10:53 +0000 (12:10 +0000)]
sch_red: fix red_calc_qavg_from_idle_time

Since commit a4a710c4a7490587 (pkt_sched: Change PSCHED_SHIFT from 10 to
6) it seems RED/GRED are broken.

red_calc_qavg_from_idle_time() computes a delay in us units, but this
delay is now 16 times bigger than real delay, so the final qavg result
smaller than expected.

Use standard kernel time services since there is no need to obfuscate
them.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobonding: only use primary address for ARP
Henrik Saavedra Persson [Wed, 23 Nov 2011 23:37:15 +0000 (23:37 +0000)]
bonding: only use primary address for ARP

Only use the primary address of the bond device
for master_ip. This will prevent changing the ARP source
address in Active-Backup mode whenever a secondry address
is added to the bond device.

Signed-off-by: Henrik Saavedra Persson <henrik.e.persson@ericsson.com>
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: David S. Miller <davem@drr.davemloft.net>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Thu, 1 Dec 2011 00:25:02 +0000 (16:25 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB: Fix RCU lockdep splats
  IB/ipoib: Prevent hung task or softlockup processing multicast response
  IB/qib: Fix over-scheduling of QSFP work
  RDMA/cxgb4: Fix retry with MPAv1 logic for MPAv2
  RDMA/cxgb4: Fix iw_cxgb4 count_rcqes() logic
  IB/qib: Don't use schedule_work()

12 years agoMerge branch 'dt-for-linus' of git://sources.calxeda.com/kernel/linux
Linus Torvalds [Thu, 1 Dec 2011 00:24:43 +0000 (16:24 -0800)]
Merge branch 'dt-for-linus' of git://sources.calxeda.com/kernel/linux

* 'dt-for-linus' of git://sources.calxeda.com/kernel/linux:
  of: Add Silicon Image vendor prefix
  of/irq: of_irq_init: add check for parent equal to child node

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Linus Torvalds [Thu, 1 Dec 2011 00:24:24 +0000 (16:24 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/broonie/regulator

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: twl: fix twl4030 support for smps regulators
  regulator: fix use after free bug
  regulator: aat2870: Fix the logic of checking if no id is matched in aat2870_get_regulator

12 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Linus Torvalds [Thu, 1 Dec 2011 00:23:59 +0000 (16:23 -0800)]
Merge branch 'fixes' of git://git./linux/kernel/git/arm/arm-soc

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (45 commits)
  ARM: ux500: update defconfig
  ARM: u300: update defconfig
  ARM: at91: enable additional boards in existing soc defconfig files
  ARM: at91: refresh soc defconfig files for 3.2
  ARM: at91: rename defconfig files appropriately
  ARM: OMAP2+: Fix Compilation error when omap_l3_noc built as module
  ARM: OMAP2+: Remove empty io.h
  ARM: OMAP2: select ARM_AMBA if OMAP3_EMU is defined
  ARM: OMAP: smartreflex: fix IRQ handling bug
  ARM: OMAP: PM: only register TWL with voltage layer when device is present
  ARM: OMAP: hwmod: Fix the addr space, irq, dma count APIs
  arm: mx28: fix bit operation in clock setting
  ARM: imx: export imx_ioremap
  ARM: imx/mm-imx3: conditionally compile i.MX31 and i.MX35 code
  ARM: mx5: Fix checkpatch warnings in cpu-imx5.c
  MAINTAINERS: Add missing directory
  ARM: imx: drop 'ARCH_MX31' and 'ARCH_MX35'
  ARM: imx6q: move clock register map to machine_desc.map_io
  ARM: pxa168/gplugd: add the correct SSP device
  ARM: Update mach-types to fix mxs build breakage
  ...

12 years agoARM: 7182/1: ARM cpu topology: fix warning
Vincent Guittot [Tue, 29 Nov 2011 14:50:20 +0000 (15:50 +0100)]
ARM: 7182/1: ARM cpu topology: fix warning

kernel/sched.c:7354:2: warning: initialization from incompatible pointer type

Align cpu_coregroup_mask prototype interface with sched_domain_mask_f typedef
use int cpu instead of unsigned int cpu

Cc: <stable@vger.kernel.org>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7181/1: Restrict kprobes probing SWP instructions to ARMv5 and below
Jon Medhurst (Tixy) [Tue, 29 Nov 2011 07:16:02 +0000 (08:16 +0100)]
ARM: 7181/1: Restrict kprobes probing SWP instructions to ARMv5 and below

The SWP instruction is deprecated on ARMv6 and with ARMv7 it will be
UNDEFINED when CONFIG_SWP_EMULATE is selected. In this case, probing a
SWP instruction will cause an oops when the kprobes emulation code
executes an undefined instruction.

As the SWP instruction should be rare or non-existent in kernels for
ARMv6 and later, we can simply avoid these problems by not allowing
probing of these.

Reported-by: Leif Lindholm <leif.lindholm@arm.com>
Tested-by: Leif Lindholm <leif.lindholm@arm.com>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Jon Medhurst <tixy@yxit.co.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7180/1: Change kprobes testcase with unpredictable STRD instruction
Jon Medhurst (Tixy) [Tue, 29 Nov 2011 07:14:35 +0000 (08:14 +0100)]
ARM: 7180/1: Change kprobes testcase with unpredictable STRD instruction

There is a kprobes testcase for the instruction "strd r2, [r3], r4".
This has unpredictable behaviour as it uses r3 for register writeback
addressing and also stores it to memory.

On a cortex A9, this testcase would fail because the instruction writes
the updated value of r3 to memory, whereas the kprobes emulation code
writes the original value.

Fix this by changing testcase to used r5 instead of r3.

Reported-by: Leif Lindholm <leif.lindholm@arm.com>
Tested-by: Leif Lindholm <leif.lindholm@arm.com>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Jon Medhurst <tixy@yxit.co.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoipv4: fix lockdep splat in rt_cache_seq_show
Eric Dumazet [Tue, 29 Nov 2011 20:05:55 +0000 (20:05 +0000)]
ipv4: fix lockdep splat in rt_cache_seq_show

After commit f2c31e32b378 (fix NULL dereferences in check_peer_redir()),
dst_get_neighbour() should be guarded by rcu_read_lock() /
rcu_read_unlock() section.

Reported-by: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosch_teql: fix lockdep splat
Eric Dumazet [Wed, 30 Nov 2011 04:08:58 +0000 (04:08 +0000)]
sch_teql: fix lockdep splat

We need rcu_read_lock() protection before using dst_get_neighbour(), and
we must cache its value (pass it to __teql_resolve())

teql_master_xmit() is called under rcu_read_lock_bh() protection, its
not enough.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: fec: Select the FEC driver by default for i.MX SoCs
Fabio Estevam [Wed, 30 Nov 2011 22:07:21 +0000 (17:07 -0500)]
net: fec: Select the FEC driver by default for i.MX SoCs

Since commit 230dec6 (net/fec: add imx6q enet support) the FEC driver is no
longer built by default for i.MX SoCs.

Let the FEC driver be built by default again.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agomac80211: fill rate filter for internal scan requests
Simon Wunderlich [Wed, 30 Nov 2011 15:56:30 +0000 (16:56 +0100)]
mac80211: fill rate filter for internal scan requests

The rates bitmap for internal scan requests shoud be filled,
otherwise there will be probe requests with zero rates supported.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Cc: stable@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211: amend regulatory NULL dereference fix
Luis R. Rodriguez [Mon, 28 Nov 2011 21:47:16 +0000 (16:47 -0500)]
cfg80211: amend regulatory NULL dereference fix

Johannes' patch for "cfg80211: fix regulatory NULL dereference"
broke user regulaotry hints and it did not address the fact that
last_request was left populated even if the previous regulatory
hint was stale due to the wiphy disappearing.

Fix user reguluatory hints by only bailing out if for those
regulatory hints where a request_wiphy is expected. The stale last_request
considerations are addressed through the previous fixes on last_request
where we reset the last_request to a static world regdom request upon
reset_regdomains(). In this case though we further enhance the effect
by simply restoring reguluatory settings completely.

Cc: stable@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211: fix race on init and driver registration
Luis R. Rodriguez [Mon, 28 Nov 2011 21:47:15 +0000 (16:47 -0500)]
cfg80211: fix race on init and driver registration

There is a theoretical race that if hit will trigger
a crash. The race is between when we issue the first
regulatory hint, regulatory_hint_core(), gets processed
by the workqueue and between when the first device
gets registered to the wireless core. This is not easy
to reproduce but it was easy to do so through the
regulatory simulator I have been working on. This
is a port of the fix I implemented there [1].

[1] https://github.com/mcgrof/regsim/commit/a246ccf81f059cb662eee288aa13100f631e4cc8

Cc: stable@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Wed, 30 Nov 2011 19:14:42 +0000 (14:14 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless into for-davem

12 years agoBtrfs: skip allocation attempt from empty cluster
Alexandre Oliva [Wed, 30 Nov 2011 18:43:00 +0000 (13:43 -0500)]
Btrfs: skip allocation attempt from empty cluster

If we don't have a cluster, don't bother trying to allocate from it,
jumping right away to the attempt to allocate a new cluster.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: skip block groups without enough space for a cluster
Alexandre Oliva [Wed, 30 Nov 2011 18:43:00 +0000 (13:43 -0500)]
Btrfs: skip block groups without enough space for a cluster

We test whether a block group has enough free space to hold the
requested block, but when we're doing clustered allocation, we can
save some cycles by testing whether it has enough room for the cluster
upfront, otherwise we end up attempting to set up a cluster and
failing.  Only in the NO_EMPTY_SIZE loop do we attempt an unclustered
allocation, and by then we'll have zeroed the cluster size, so this
patch won't stop us from using the block group as a last resort.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: start search for new cluster at the beginning
Alexandre Oliva [Wed, 30 Nov 2011 18:43:00 +0000 (13:43 -0500)]
Btrfs: start search for new cluster at the beginning

Instead of starting at zero (offset is always zero), request a cluster
starting at search_start, that denotes the beginning of the current
block group.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: reset cluster's max_size when creating bitmap
Alexandre Oliva [Wed, 30 Nov 2011 18:43:00 +0000 (13:43 -0500)]
Btrfs: reset cluster's max_size when creating bitmap

The field that indicates the size of the largest contiguous chunk of
free space in the cluster is not initialized when setting up bitmaps,
it's only increased when we find a larger contiguous chunk.  We end up
retaining a larger value than appropriate for highly-fragmented
clusters, which may cause pointless searches for large contiguous
groups, and even cause clusters that do not meet the density
requirements to be set up.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: initialize new bitmaps' list
Alexandre Oliva [Mon, 28 Nov 2011 14:04:43 +0000 (12:04 -0200)]
Btrfs: initialize new bitmaps' list

We're failing to create clusters with bitmaps because
setup_cluster_no_bitmap checks that the list is empty before inserting
the bitmap entry in the list for setup_cluster_bitmap, but the list
field is only initialized when it is restored from the on-disk free
space cache, or when it is written out to disk.

Besides a potential race condition due to the multiple use of the list
field, filesystem performance severely degrades over time: as we use
up all non-bitmap free extents, the try-to-set-up-cluster dance is
done at every metadata block allocation.  For every block group, we
fail to set up a cluster, and after failing on them all up to twice,
we fall back to the much slower unclustered allocation.

To make matters worse, before the unclustered allocation, we try to
create new block groups until we reach the 1% threshold, which
introduces additional bitmaps and thus block groups that we'll iterate
over at each metadata block request.

12 years agoBtrfs: fix oops when calling statfs on readonly device
Li Zefan [Mon, 28 Nov 2011 08:43:00 +0000 (16:43 +0800)]
Btrfs: fix oops when calling statfs on readonly device

To reproduce this bug:

  # dd if=/dev/zero of=img bs=1M count=256
  # mkfs.btrfs img
  # losetup -r /dev/loop1 img
  # mount /dev/loop1 /mnt
  OOPS!!

It triggered BUG_ON(!nr_devices) in btrfs_calc_avail_data_space().

To fix this, instead of checking write-only devices, we check all open
deivces:

  # df -h /dev/loop1
  Filesystem            Size  Used Avail Use% Mounted on
  /dev/loop1            250M   28K  238M   1% /mnt

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
12 years agoBtrfs: Don't error on resizing FS to same size
Mike Fleetwood [Fri, 18 Nov 2011 18:55:01 +0000 (18:55 +0000)]
Btrfs: Don't error on resizing FS to same size

It seems overly harsh to fail a resize of a btrfs file system to the
same size when a shrink or grow would succeed.  User app GParted trips
over this error.  Allow it by bypassing the shrink or grow operation.

Signed-off-by: Mike Fleetwood <mike.fleetwood@googlemail.com>
12 years agoBtrfs: fix deadlock on metadata reservation when evicting a inode
Miao Xie [Fri, 18 Nov 2011 09:43:00 +0000 (17:43 +0800)]
Btrfs: fix deadlock on metadata reservation when evicting a inode

When I ran the xfstests, I found the test tasks was blocked on meta-data
reservation.

By debugging, I found the reason of this bug:
   start transaction
        |
v
   reserve meta-data space
|
v
   flush delay allocation -> iput inode -> evict inode
^ |
| v
   wait for delay allocation flush <- reserve meta-data space

And besides that, the flush on evicting inode will block the thread, which
is reclaiming the memory, and make oom happen easily.

Fix this bug by skipping the flush step when evicting inode.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
12 years agoFix URL of btrfs-progs git repository in docs
Arnd Hannemann [Wed, 16 Nov 2011 16:35:37 +0000 (17:35 +0100)]
Fix URL of btrfs-progs git repository in docs

The location of the btrfs-progs repository has been changed.
This patch updates the documentation accordingly.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
12 years agobtrfs scrub: handle -ENOMEM from init_ipath()
Dan Carpenter [Wed, 16 Nov 2011 08:28:01 +0000 (11:28 +0300)]
btrfs scrub: handle -ENOMEM from init_ipath()

init_ipath() can return an ERR_PTR(-ENOMEM).

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
12 years agodrm/nv50/disp: silence compiler warning
Ben Skeggs [Wed, 9 Nov 2011 05:30:08 +0000 (15:30 +1000)]
drm/nv50/disp: silence compiler warning

NFI why this only started appearing now.  The use of the uninitialised var
can't actually happen, so perhaps my compiler just got stupider.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau: fix oopses caused by clear being called on unpopulated ttms
Ben Skeggs [Fri, 25 Nov 2011 06:35:34 +0000 (16:35 +1000)]
drm/nouveau: fix oopses caused by clear being called on unpopulated ttms

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau: Keep RAMIN heap within the channel.
Younes Manton [Tue, 22 Nov 2011 19:58:31 +0000 (14:58 -0500)]
drm/nouveau: Keep RAMIN heap within the channel.

The entire RAMIN is allocated to be 'size', but the heap is
specified as 'base' + 'size' inside RAMIN, so it will overflow
past RAMIN by 'base' bytes on NV50+ and clobber other allocatons
unless it's size is adjusted.

Signed-off-by: Younes Manton <younes.m@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nvd0/disp: fix sor dpms typo, preventing dpms on in some situations
Ben Skeggs [Wed, 16 Nov 2011 23:10:02 +0000 (09:10 +1000)]
drm/nvd0/disp: fix sor dpms typo, preventing dpms on in some situations

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nvc0/gr: fix TP init for transform feedback offset queries
Christoph Bumiller [Fri, 11 Nov 2011 19:47:58 +0000 (20:47 +0100)]
drm/nvc0/gr: fix TP init for transform feedback offset queries

Without this, they return bytes written since the last update of
the offset, but we want the full offset.

Trace shows setting this on GPC[0]/TP[0] is enough.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agodrm/nouveau: add dumb ioctl support
Ben Skeggs [Thu, 29 Sep 2011 22:55:50 +0000 (08:55 +1000)]
drm/nouveau: add dumb ioctl support

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agoMerge branches 'cxgb4', 'ipoib', 'misc' and 'qib' into for-next
Roland Dreier [Wed, 30 Nov 2011 02:01:53 +0000 (18:01 -0800)]
Merge branches 'cxgb4', 'ipoib', 'misc' and 'qib' into for-next

12 years agoisdn: avoid copying too long drvid
Dan Carpenter [Thu, 24 Nov 2011 02:42:09 +0000 (02:42 +0000)]
isdn: avoid copying too long drvid

"cfg->drvid" comes from the user so there is a possibility they
didn't NUL terminate it properly.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoisdn: make sure strings are null terminated
Dan Carpenter [Thu, 24 Nov 2011 02:41:49 +0000 (02:41 +0000)]
isdn: make sure strings are null terminated

These strings come from the user.  We strcpy() them inside
cf_command() so we should check that they are NULL terminated and
return an error if not.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Linus Torvalds [Tue, 29 Nov 2011 22:43:22 +0000 (14:43 -0800)]
Merge branch 'pm-fixes' of git://git./linux/kernel/git/rafael/linux-pm

* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  PM: Update comments describing device power management callbacks
  PM / Sleep: Update documentation related to system wakeup
  PM / Runtime: Make documentation follow the new behavior of irq_safe
  PM / Sleep: Correct inaccurate information in devices.txt
  PM / Domains: Document how PM domains are used by the PM core
  PM / Hibernate: Do not leak memory in error/test code paths

12 years agonetlabel: Fix build problems when IPv6 is not enabled
Paul Moore [Tue, 29 Nov 2011 10:10:54 +0000 (10:10 +0000)]
netlabel: Fix build problems when IPv6 is not enabled

A recent fix to the the NetLabel code caused build problem with
configurations that did not have IPv6 enabled; see below:

 netlabel_kapi.c: In function 'netlbl_cfg_unlbl_map_add':
 netlabel_kapi.c:165:4:
  error: implicit declaration of function 'netlbl_af6list_add'

This patch fixes this problem by making the IPv6 specific code conditional
on the IPv6 configuration flags as we done in the rest of NetLabel and the
network stack as a whole.  We have to move some variable declarations
around as a result so things may not be quite as pretty, but at least it
builds cleanly now.

Some additional IPv6 conditionals were added to the NetLabel code as well
for the sake of consistency.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoIB: Fix RCU lockdep splats
Eric Dumazet [Tue, 29 Nov 2011 21:31:23 +0000 (22:31 +0100)]
IB: Fix RCU lockdep splats

Commit f2c31e32b37 ("net: fix NULL dereferences in check_peer_redir()")
forgot to take care of infiniband uses of dst neighbours.

Many thanks to Marc Aurele who provided a nice bug report and feedback.

Reported-by: Marc Aurele La France <tsi@ualberta.ca>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>
Cc: <stable@kernel.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
12 years agoIB/ipoib: Prevent hung task or softlockup processing multicast response
Mike Marciniszyn [Mon, 21 Nov 2011 13:43:54 +0000 (08:43 -0500)]
IB/ipoib: Prevent hung task or softlockup processing multicast response

This following can occur with ipoib when processing a multicast reponse:

    BUG: soft lockup - CPU#0 stuck for 67s! [ib_mad1:982]
    Modules linked in: ...
    CPU 0:
    Modules linked in: ...
    Pid: 982, comm: ib_mad1 Not tainted 2.6.32-131.0.15.el6.x86_64 #1 ProLiant DL160 G5
    RIP: 0010:[<ffffffff814ddb27>]  [<ffffffff814ddb27>] _spin_unlock_irqrestore+0x17/0x20
    RSP: 0018:ffff8802119ed860  EFLAGS: 00000246
    0000000000000004 RBX: ffff8802119ed860 RCX: 000000000000a299
    RDX: ffff88021086c700 RSI: 0000000000000246 RDI: 0000000000000246
    RBP: ffffffff8100bc8e R08: ffff880210ac229c R09: 0000000000000000
    R10: ffff88021278aab8 R11: 0000000000000000 R12: ffff8802119ed860
    R13: ffffffff8100be6e R14: 0000000000000001 R15: 0000000000000003
    FS:  0000000000000000(0000) GS:ffff880028200000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
    CR2: 00000000006d4840 CR3: 0000000209aa5000 CR4: 00000000000406f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Call Trace:
    [<ffffffffa032c247>] ? ipoib_mcast_send+0x157/0x480 [ib_ipoib]
    [<ffffffff8100bc8e>] ? apic_timer_interrupt+0xe/0x20
    [<ffffffff8100bc8e>] ? apic_timer_interrupt+0xe/0x20
    [<ffffffffa03283d4>] ? ipoib_path_lookup+0x124/0x2d0 [ib_ipoib]
    [<ffffffffa03286fc>] ? ipoib_start_xmit+0x17c/0x430 [ib_ipoib]
    [<ffffffff8141e758>] ? dev_hard_start_xmit+0x2c8/0x3f0
    [<ffffffff81439d0a>] ? sch_direct_xmit+0x15a/0x1c0
    [<ffffffff81423098>] ? dev_queue_xmit+0x388/0x4d0
    [<ffffffffa032d6b7>] ? ipoib_mcast_join_finish+0x2c7/0x510 [ib_ipoib]
    [<ffffffffa032dab8>] ? ipoib_mcast_sendonly_join_complete+0x1b8/0x1f0 [ib_ipoib]
    [<ffffffffa02a0946>] ? mcast_work_handler+0x1a6/0x710 [ib_sa]
    [<ffffffffa015f01e>] ? ib_send_mad+0xfe/0x3c0 [ib_mad]
    [<ffffffffa00f6c93>] ? ib_get_cached_lmc+0xa3/0xb0 [ib_core]
    [<ffffffffa02a0f9b>] ? join_handler+0xeb/0x200 [ib_sa]
    [<ffffffffa029e4fc>] ? ib_sa_mcmember_rec_callback+0x5c/0xa0 [ib_sa]
    [<ffffffffa029e79c>] ? recv_handler+0x3c/0x70 [ib_sa]
    [<ffffffffa01603a4>] ? ib_mad_completion_handler+0x844/0x9d0 [ib_mad]
    [<ffffffffa015fb60>] ? ib_mad_completion_handler+0x0/0x9d0 [ib_mad]
    [<ffffffff81088830>] ? worker_thread+0x170/0x2a0
    [<ffffffff8108e160>] ? autoremove_wake_function+0x0/0x40
    [<ffffffff810886c0>] ? worker_thread+0x0/0x2a0
    [<ffffffff8108ddf6>] ? kthread+0x96/0xa0
    [<ffffffff8100c1ca>] ? child_rip+0xa/0x20

Coinciding with stack trace is the following message:

    ib0: ib_address_create failed

The code below in ipoib_mcast_join_finish() will note the above
failure in the address handle but otherwise continue:

                ah = ipoib_create_ah(dev, priv->pd, &av);
                if (!ah) {
                        ipoib_warn(priv, "ib_address_create failed\n");
                } else {

The while loop at the bottom of ipoib_mcast_join_finish() will attempt
to send queued multicast packets in mcast->pkt_queue and eventually
end up in ipoib_mcast_send():

        if (!mcast->ah) {
                if (skb_queue_len(&mcast->pkt_queue) < IPOIB_MAX_MCAST_QUEUE)
                        skb_queue_tail(&mcast->pkt_queue, skb);
                else {
                        ++dev->stats.tx_dropped;
                        dev_kfree_skb_any(skb);
                }

My read is that the code will requeue the packet and return to the
ipoib_mcast_join_finish() while loop and the stage is set for the
"hung" task diagnostic as the while loop never sees a non-NULL ah, and
will do nothing to resolve.

There are GFP_ATOMIC allocates in the provider routines, so this is
possible and should be dealt with.

The test that induced the failure is associated with a host SM on the
same server during a shutdown.

This patch causes ipoib_mcast_join_finish() to exit with an error
which will flush the queued mcast packets.  Nothing is done to unwind
the QP attached state so that subsequent sends from above will retry
the join.

Reviewed-by: Ram Vepa <ram.vepa@qlogic.com>
Reviewed-by: Gary Leshner <gary.leshner@qlogic.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
12 years agosctp: better integer overflow check in sctp_auth_create_key()
Xi Wang [Tue, 29 Nov 2011 09:26:30 +0000 (09:26 +0000)]
sctp: better integer overflow check in sctp_auth_create_key()

The check from commit 30c2235c is incomplete and cannot prevent
cases like key_len = 0x80000000 (INT_MAX + 1).  In that case, the
left-hand side of the check (INT_MAX - key_len), which is unsigned,
becomes 0xffffffff (UINT_MAX) and bypasses the check.

However this shouldn't be a security issue.  The function is called
from the following two code paths:

 1) setsockopt()

 2) sctp_auth_asoc_set_secret()

In case (1), sca_keylength is never going to exceed 65535 since it's
bounded by a u16 from the user API.  As such, the key length will
never overflow.

In case (2), sca_keylength is computed based on the user key (1 short)
and 2 * key_vector (3 shorts) for a total of 7 * USHRT_MAX, which still
will not overflow.

In other words, this overflow check is not really necessary.  Just
make it more correct.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg...
Linus Torvalds [Tue, 29 Nov 2011 19:13:22 +0000 (11:13 -0800)]
Merge branch 'slab/urgent' of git://git./linux/kernel/git/penberg/linux

* 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux:
  slub: avoid potential NULL dereference or corruption
  slub: use irqsafe_cpu_cmpxchg for put_cpu_partial
  slub: move discard_slab out of node lock
  slub: use correct parameter to add a page to partial list tail

12 years agoxfs: fix attr2 vs large data fork assert
Christoph Hellwig [Sat, 19 Nov 2011 17:44:30 +0000 (17:44 +0000)]
xfs: fix attr2 vs large data fork assert

With Dmitry fsstress updates I've seen very reproducible crashes in
xfs_attr_shortform_remove because xfs_attr_shortform_bytesfit claims that
the attributes would not fit inline into the inode after removing an
attribute.  It turns out that we were operating on an inode with lots
of delalloc extents, and thus an if_bytes values for the data fork that
is larger than biggest possible on-disk storage for it which utterly
confuses the code near the end of xfs_attr_shortform_bytesfit.

Fix this by always allowing the current attribute fork, like we already
do for the attr1 format, given that delalloc conversion will take care
for moving either the data or attribute area out of line if it doesn't
fit at that point - or making the point moot by merging extents at this
point.

Also document the function better, and clean up some loose bits.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
12 years agoxfs: force buffer writeback before blocking on the ilock in inode reclaim
Christoph Hellwig [Tue, 29 Nov 2011 18:06:14 +0000 (12:06 -0600)]
xfs: force buffer writeback before blocking on the ilock in inode reclaim

If we are doing synchronous inode reclaim we block the VM from making
progress in memory reclaim.  So if we encouter a flush locked inode
promote it in the delwri list and wake up xfsbufd to write it out now.
Without this we can get hangs of up to 30 seconds during workloads hitting
synchronous inode reclaim.

The scheme is copied from what we do for dquot reclaims.

Reported-by: Simon Kirby <sim@hostway.ca>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Simon Kirby <sim@hostway.ca>
Signed-off-by: Ben Myers <bpm@sgi.com>
12 years agoMerge branch 'dev' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Linus Torvalds [Tue, 29 Nov 2011 16:59:12 +0000 (08:59 -0800)]
Merge branch 'dev' of git://git./linux/kernel/git/tytso/ext4

* 'dev' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: fix racy use-after-free in ext4_end_io_dio()

12 years agoMerge branch 'defconfigs-for-arnd' of git://git.linaro.org/people/triad/linux-sterics...
Arnd Bergmann [Tue, 29 Nov 2011 14:50:17 +0000 (14:50 +0000)]
Merge branch 'defconfigs-for-arnd' of git://git.linaro.org/people/triad/linux-stericsson into fixes

12 years agoof: Add Silicon Image vendor prefix
Pawel Moll [Tue, 8 Nov 2011 11:35:20 +0000 (11:35 +0000)]
of: Add Silicon Image vendor prefix

"sil" is the most commonly used abbreviation for Silicon
Image products.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
12 years agoof/irq: of_irq_init: add check for parent equal to child node
Rob Herring [Mon, 28 Nov 2011 02:16:33 +0000 (20:16 -0600)]
of/irq: of_irq_init: add check for parent equal to child node

With the revert of "of/irq: of_irq_find_parent: check for parent equal to
child" (dc9372808412edb), we need another way to handle parent node equal
to the child node. This can simply be handled in of_irq_init by checking
for this condition.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Tested-by: Pawel Moll <pawel.moll@arm.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
12 years agousb: gadget: fsl_udc: fix dequeuing a request in progress
Li Yang [Wed, 23 Nov 2011 12:12:56 +0000 (20:12 +0800)]
usb: gadget: fsl_udc: fix dequeuing a request in progress

The original implementation of dequeuing a request in progress
is not correct.  Change to use a correct process and also clean
up the related functions a little bit.

Signed-off-by: Li Yang <leoli@freescale.com>
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: fsl_mxc_udc.c: Remove compile-time dependency of MX35 SoC type
Fabio Estevam [Tue, 22 Nov 2011 15:48:29 +0000 (13:48 -0200)]
usb: fsl_mxc_udc.c: Remove compile-time dependency of MX35 SoC type

In order to support multiple SoC kernel image, compile-time dependency
on a specific SoC type should be avoided.

fsl_udc_clk_finalize is already protected by cpu_is_mx35(), so remove
the compile-time check for CONFIG_SOC_IMX35.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: fsl_mxc_udc.c: Fix build issue by including missing header file
Fabio Estevam [Tue, 22 Nov 2011 15:48:28 +0000 (13:48 -0200)]
usb: fsl_mxc_udc.c: Fix build issue by including missing header file

Fix the following build error:

CC [M]  drivers/usb/gadget/fsl_mxc_udc.o
drivers/usb/gadget/fsl_mxc_udc.c: In function 'fsl_udc_clk_finalize':
drivers/usb/gadget/fsl_mxc_udc.c:98: error: implicit declaration of function 'readl'
drivers/usb/gadget/fsl_mxc_udc.c:100: error: implicit declaration of function 'writel'

This error is caused by the follwing commit:
(16fcb63: arm/imx: remove mx31_setup_weimcs( ) from mx31.h)

,which removed '#include <linux/io.h>' from mx31.h.

fsl_mxc_udc.c includes <mach/hardware.h>, which in turns includes mx31.h, so
that's the reason fsl_mxc_udc.c built fine previously.

Instead of relying on the indirect inclusion of the linux/io.h header file,
include it directly in fsl_mxc_udc.c.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: fsl_udc_core: use usb_endpoint_xfer_isoc to judge ISO XFER
Peter Chen [Tue, 22 Nov 2011 01:55:45 +0000 (09:55 +0800)]
USB: fsl_udc_core: use usb_endpoint_xfer_isoc to judge ISO XFER

Some ISO gadgets, like audio, has SYNC attribute as well as
USB_ENDPOINT_XFER_ISOC for their bmAttributes at ISO endpoint
descriptor. So, it needs to use usb_endpoint_xfer_isoc to judge
ISO XFER.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: udc: Fix gadget driver's speed check in various UDC drivers
Michal Nazarewicz [Sat, 19 Nov 2011 17:26:25 +0000 (18:26 +0100)]
usb: udc: Fix gadget driver's speed check in various UDC drivers

Several UDC drivers had a gadget driver's speed sanity check of the
form of:

driver->speed != USB_SPEED_HIGH

or:

driver->speed != USB_SPEED_HIGH && driver->speed != USB_SPEED_FULL

As more and more gadget drivers support USB SuperSpeed, driver->speed
may be set to USB_SPEED_SUPER and UDC driver should handle such gadget
correctly.  The above checks however fail to recognise USB_SPEED_SUPER
as a valid speed.

This commit changes the two checks to:

driver->speed < USB_SPEED_HIGH

or:

driver->speed < USB_SPEED_FULL

respectively.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Reported-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: fix g_serial regression
Robert Jarzmik [Fri, 18 Nov 2011 19:16:27 +0000 (20:16 +0100)]
usb: gadget: fix g_serial regression

Commit "usb: gadget: use config_ep_by_speed() instead of
ep_choose()" broke g_serial in "non ACM nor OBEX"
mode. Apply a trivial fix on usb endpoints discovery.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: renesas_usbhs: fixup driver speed
Kuninori Morimoto [Fri, 18 Nov 2011 02:20:44 +0000 (18:20 -0800)]
usb: renesas_usbhs: fixup driver speed

This patch cares latest USB_SPEED_SUPER support.
renesas_usbhs can not use super-speed, but can use full/high speed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: renesas_usbhs: fixup gadget.dev.driver when udc_stop.
Kuninori Morimoto [Fri, 18 Nov 2011 02:19:56 +0000 (18:19 -0800)]
usb: renesas_usbhs: fixup gadget.dev.driver when udc_stop.

current renesas_usbhs is using new style udc_start/stop from
af1d7056a5c1e5eaaf807ddd1423101db84668d0
(usb: gadget: renesas: convert to new style).

But current renesas_usbhs driver didn't care about gadget.dev.driver
when udc_stop. it cause rmmod oops.
This patch care it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: renesas_usbhs: fixup signal the driver that cable was disconnected
Kuninori Morimoto [Fri, 18 Nov 2011 02:19:38 +0000 (18:19 -0800)]
usb: renesas_usbhs: fixup signal the driver that cable was disconnected

current renesas_usbhs is using new style udc_start/stop from
af1d7056a5c1e5eaaf807ddd1423101db84668d0
(usb: gadget: renesas: convert to new style).

cable disconnected signal was needed.
This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: renesas_usbhs: fixup device_register timing
Kuninori Morimoto [Fri, 18 Nov 2011 02:19:06 +0000 (18:19 -0800)]
usb: renesas_usbhs: fixup device_register timing

current renesas_usbhs is using new style udc_start/stop from
af1d7056a5c1e5eaaf807ddd1423101db84668d0
(usb: gadget: renesas: convert to new style).

But bind() function will fail if it was called before
device_register() (or device_add()).
This patch modifies this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: musb: PM: fix context save/restore in suspend/resume path
Kevin Hilman [Wed, 23 Nov 2011 01:18:24 +0000 (17:18 -0800)]
usb: musb: PM: fix context save/restore in suspend/resume path

Currently the driver tries to save context in the suspend path, but
will cause an abort if the device is already runtime suspended.  This
happens, for example, if MUSB loaded/compiled-in, in host mode, but no
USB devices are attached.  MUSB will be runtime suspended, but then
attempting a system suspend will crash due to the context save
being attempted while the device is disabled.

On OMAP, as of v3.1, the driver's ->runtime_suspend() callback will be
called late in the suspend path (by the PM domain layer) if the driver
is not already runtime suspended, ensuring a full shutdown.

Therefore, the context save is not needed in the ->suspend() method
since it will be called in the ->runtime_suspend() method anyways
(similarily for resume.)

NOTE: this leaves the suspend/resume methods basically empty (with
      some FIXMEs and comments, but I'll leave it to the maintainers
      to decide whether to remove them.

Cc: stable@vger.kernel.org
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoALSA: hda_intel - revert a quirk that affect VIA chipsets
Marc Vertes [Tue, 29 Nov 2011 11:21:17 +0000 (12:21 +0100)]
ALSA: hda_intel - revert a quirk that affect VIA chipsets

This quirk sould be reverted. It has the following probems:

1) The quirk was intended to "ASUS MV2-MX SE" motherboards only, but the
ID used matches a much broader range, potentially all boards containing a
VIA chipset model in the family of vendor VIA 0x1106 and audio device ID
0x3288, which encompasses VIA-VT82xx, VIA-VT1xx and VIA-VT20xx chipsets.

2) VIA chipsets rely on azx_via_get_position() to handle correctly dma
transfers during capture. Using POS_FIX_LPIB instead of POS_FIX_VIACOMBO
leads to partially corrupted input buffers during capture. The effects
of this bug are not immediately visible, it took strong DSP expertise,
some expensive signal generator and a spectrum analyzer to identify it
and verify correct behaviour using original default.

3) It's almost certain that the quirk did not fix the real problem,
if there was one. Refer to original submission:
http://mailman.alsa-project.org/pipermail/alsa-devel/2010-February/025109.html

Signed-of-by: Marc Vertes <mvertes@sigfox.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - Avoid touching mute-VREF pin for IDT codecs
Takashi Iwai [Tue, 29 Nov 2011 12:01:30 +0000 (13:01 +0100)]
ALSA: hda - Avoid touching mute-VREF pin for IDT codecs

Some HP laptops use a pin VREF for controlling the mute LED, and such a
pin shouldn't be powered off.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agofirmware: Sigma: Fix endianess issues
Lars-Peter Clausen [Mon, 28 Nov 2011 08:44:16 +0000 (09:44 +0100)]
firmware: Sigma: Fix endianess issues

Currently the SigmaDSP firmware loader only works correctly on little-endian
systems. Fix this by using the proper endianess conversion functions.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
12 years agofirmware: Sigma: Skip header during CRC generation
Lars-Peter Clausen [Mon, 28 Nov 2011 08:44:15 +0000 (09:44 +0100)]
firmware: Sigma: Skip header during CRC generation

The firmware header is not part of the CRC, so skip it. Otherwise the firmware
will be rejected due to non-matching CRCs.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
12 years agofirmware: Sigma: Prevent out of bounds memory access
Lars-Peter Clausen [Mon, 28 Nov 2011 08:44:14 +0000 (09:44 +0100)]
firmware: Sigma: Prevent out of bounds memory access

The SigmaDSP firmware loader currently does not perform enough boundary size
checks when processing the firmware. As a result it is possible that a
malformed firmware can cause an out of bounds memory access.

This patch adds checks which ensure that both the action header and the payload
are completely inside the firmware data boundaries before processing them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
12 years agoARM: ux500: update defconfig
Linus Walleij [Wed, 16 Nov 2011 19:30:35 +0000 (20:30 +0100)]
ARM: ux500: update defconfig

This updates the Ux500 defconfig with the new drivers for HWSEM
and AB5500 core that were merged in the 3.2 cycle.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agoARM: u300: update defconfig
Linus Walleij [Wed, 16 Nov 2011 19:44:13 +0000 (20:44 +0100)]
ARM: u300: update defconfig

This updates the U300 defconfig to support some new drivers like
FSMC, sets it to use the MMC clock gating scheme, and removes
some stale config options.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 years agoALSA: usb-audio - Support for Roland GAIA SH-01 Synthesizer
John F Leach [Tue, 29 Nov 2011 00:41:27 +0000 (19:41 -0500)]
ALSA: usb-audio - Support for Roland GAIA SH-01 Synthesizer

Added table quirks entry for Roland GAIA SH-01 Synthesizer based upon
Roland SH-201 table entry as template.  USB MIDI and audio was tested
with Muse and Audacity.

Signed-off-by: John F Leach <jfleach@jfleach.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge branch 'nf' of git://1984.lsi.us.es/net
David S. Miller [Tue, 29 Nov 2011 06:20:55 +0000 (01:20 -0500)]
Merge branch 'nf' of git://1984.lsi.us.es/net

12 years agosctp: integer overflow in sctp_auth_create_key()
Xi Wang [Tue, 22 Nov 2011 15:55:30 +0000 (15:55 +0000)]
sctp: integer overflow in sctp_auth_create_key()

The previous commit 30c2235c is incomplete and cannot prevent integer
overflows. For example, when key_len is 0x80000000 (INT_MAX + 1), the
left-hand side of the check, (INT_MAX - key_len), which is unsigned,
becomes 0xffffffff (UINT_MAX) and bypasses the check.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoxfs: validate acl count
Christoph Hellwig [Sun, 20 Nov 2011 15:35:32 +0000 (15:35 +0000)]
xfs: validate acl count

This prevents in-memory corruption and possible panics if the on-disk
ACL is badly corrupted.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
12 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
Linus Torvalds [Tue, 29 Nov 2011 03:28:32 +0000 (19:28 -0800)]
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/groeck/linux-staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: convert drivers/hwmon/* to use module_platform_driver()
  hwmon: Remove redundant spi driver bus initialization

12 years agoUSB: linux-cdc-acm.inf: add support for the acm_ms gadget
Klaus Schwarzkopf [Mon, 28 Nov 2011 12:03:25 +0000 (13:03 +0100)]
USB: linux-cdc-acm.inf: add support for the acm_ms gadget

Support for the acm_ms usb gadget on windows.

Signed-off-by: Klaus Schwarzkopf <schwarzkopf@sensortherm.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoEHCI : Fix a regression in the ISO scheduler
Matthieu CASTET [Mon, 28 Nov 2011 10:30:22 +0000 (11:30 +0100)]
EHCI : Fix a regression in the ISO scheduler

Fix a regression that was introduced by commit
811c926c538f7e8d3c08b630dd5844efd7e000f6 (USB: EHCI: fix HUB TT scheduling
issue with iso transfer).

We detect an error if next == start, but this means uframe 0 can't be allocated
anymore for iso transfer...

Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux
Linus Torvalds [Tue, 29 Nov 2011 00:37:35 +0000 (16:37 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/aegl/linux

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
  efivars: add missing parameter to efi_pstore_read()

12 years agoefivars: add missing parameter to efi_pstore_read()
Christoph Fritz [Mon, 28 Nov 2011 22:49:33 +0000 (23:49 +0100)]
efivars: add missing parameter to efi_pstore_read()

In the case where CONFIG_PSTORE=n, the function efi_pstore_read() doesn't
have the correct list of parameters. This patch provides a definition
of efi_pstore_read() with 'char **buf' added to fix this warning:
"drivers/firmware/efivars.c:609: warning: initialization from".

problem introduced in commit f6f8285132907757ef84ef8dae0a1244b8cde6ac

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
12 years agoASoC: Supply dcs_codes for newer WM1811 revisions
Mark Brown [Mon, 28 Nov 2011 18:48:46 +0000 (18:48 +0000)]
ASoC: Supply dcs_codes for newer WM1811 revisions

Based on initial data.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoipv6: Set mcast_hops to IPV6_DEFAULT_MCASTHOPS when -1 was given.
Li Wei [Sun, 27 Nov 2011 21:33:34 +0000 (21:33 +0000)]
ipv6: Set mcast_hops to IPV6_DEFAULT_MCASTHOPS when -1 was given.

We need to set np->mcast_hops to it's default value at this moment
otherwise when we use it and found it's value is -1, the logic to
get default hop limit doesn't take multicast into account and will
return wrong hop limit(IPV6_DEFAULT_HOPLIMIT) which is for unicast.

Signed-off-by: Li Wei <lw@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: Fix corruption in /proc/*/net/dev_mcast
Anton Blanchard [Sun, 27 Nov 2011 21:14:46 +0000 (21:14 +0000)]
net: Fix corruption in /proc/*/net/dev_mcast

I just hit this during my testing. Isn't there another bug lurking?

BUG kmalloc-8: Redzone overwritten

INFO: 0xc0000000de9dec48-0xc0000000de9dec4b. First byte 0x0 instead of 0xcc
INFO: Allocated in .__seq_open_private+0x30/0xa0 age=0 cpu=5 pid=3896
.__kmalloc+0x1e0/0x2d0
.__seq_open_private+0x30/0xa0
.seq_open_net+0x60/0xe0
.dev_mc_seq_open+0x4c/0x70
.proc_reg_open+0xd8/0x260
.__dentry_open.clone.11+0x2b8/0x400
.do_last+0xf4/0x950
.path_openat+0xf8/0x480
.do_filp_open+0x48/0xc0
.do_sys_open+0x140/0x250
syscall_exit+0x0/0x40

dev_mc_seq_ops uses dev_seq_start/next/stop but only allocates
sizeof(struct seq_net_private) of private data, whereas it expects
sizeof(struct dev_iter_state):

struct dev_iter_state {
struct seq_net_private p;
unsigned int pos; /* bucket << BUCKET_SPACE + offset */
};

Create dev_seq_open_ops and use it so we don't have to expose
struct dev_iter_state.

[ Problem added by commit f04565ddf52e4 (dev: use name hash for
  dev_seq_ops) -Eric ]

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoASoC: Error out if we can't generate a LRCLK at all for WM8994
Mark Brown [Mon, 28 Nov 2011 21:16:56 +0000 (21:16 +0000)]
ASoC: Error out if we can't generate a LRCLK at all for WM8994

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoMerge branch 'for-3.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
Linus Torvalds [Mon, 28 Nov 2011 21:55:59 +0000 (13:55 -0800)]
Merge branch 'for-3.2-fixes' of git://git./linux/kernel/git/tj/cgroup

* 'for-3.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cgroup_freezer: fix freezing groups with stopped tasks

12 years agoMerge branch 'for-3.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
Linus Torvalds [Mon, 28 Nov 2011 21:49:43 +0000 (13:49 -0800)]
Merge branch 'for-3.2-fixes' of git://git./linux/kernel/git/tj/percpu

* 'for-3.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
  percpu: explain why per_cpu_ptr_to_phys() is more complicated than necessary
  percpu: fix chunk range calculation
  percpu: rename pcpu_mem_alloc to pcpu_mem_zalloc

12 years agoPM: Update comments describing device power management callbacks
Rafael J. Wysocki [Wed, 23 Nov 2011 20:20:32 +0000 (21:20 +0100)]
PM: Update comments describing device power management callbacks

The comments describing device power management callbacks in
include/pm.h are outdated and somewhat confusing, so make them
reflect the reality more accurately.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
12 years agoPM / Sleep: Update documentation related to system wakeup
Rafael J. Wysocki [Wed, 23 Nov 2011 20:20:15 +0000 (21:20 +0100)]
PM / Sleep: Update documentation related to system wakeup

The system wakeup section of Documentation/power/devices.txt is
outdated, so make it agree with the current code.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
12 years agoPM / Runtime: Make documentation follow the new behavior of irq_safe
Rafael J. Wysocki [Wed, 23 Nov 2011 20:20:07 +0000 (21:20 +0100)]
PM / Runtime: Make documentation follow the new behavior of irq_safe

The runtime PM core code behavior related to the power.irq_safe
device flag has changed recently and the documentation should be
modified to reflect it.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>