pandora-kernel.git
12 years agoipv4: Fix packet size calculation for raw IPsec packets in __ip_append_data
Steffen Klassert [Sun, 5 Jun 2011 20:48:47 +0000 (20:48 +0000)]
ipv4: Fix packet size calculation for raw IPsec packets in __ip_append_data

We assume that transhdrlen is positive on the first fragment
which is wrong for raw packets. So we don't add exthdrlen to the
packet size for raw packets. This leads to a reallocation on IPsec
because we have not enough headroom on the skb to place the IPsec
headers. This patch fixes this by adding exthdrlen to the packet
size whenever the send queue of the socket is empty. This issue was
introduced with git commit 1470ddf7 (inet: Remove explicit write
references to sk/inet in ip_append_data)

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoperf: Use make kernelversion instead of parsing the Makefile
Michal Marek [Mon, 30 May 2011 12:12:09 +0000 (14:12 +0200)]
perf: Use make kernelversion instead of parsing the Makefile

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
12 years agokbuild: Hack for depmod not handling X.Y versions
Michal Marek [Thu, 9 Jun 2011 14:35:41 +0000 (16:35 +0200)]
kbuild: Hack for depmod not handling X.Y versions

depmod from module-init-tools < 3.13 and the busybox depmod check if the
kernel release starts with <num>.<num>.<num>. To support these versions,
we create a symlink with two numbers prepended.

Signed-off-by: Michal Marek <mmarek@suse.cz>
12 years agokbuild: Move depmod call to a separate script
Michal Marek [Thu, 9 Jun 2011 13:35:22 +0000 (15:35 +0200)]
kbuild: Move depmod call to a separate script

Do not bloat the Makefile with multiline shell statements. No
user-visible change intended.

Signed-off-by: Michal Marek <mmarek@suse.cz>
12 years agokbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL
Michal Marek [Mon, 30 May 2011 11:37:20 +0000 (13:37 +0200)]
kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL

expr treats all numbers as decimals, so prepending a zero is safe. Note
that the KERNEL_VERSION() macro still takes three arguments, 3.0 has to be
written as KERNEL_VERSION(3,0,0).

Signed-off-by: Michal Marek <mmarek@suse.cz>
12 years agokbuild: Fix KERNELVERSION for empty SUBLEVEL or PATCHLEVEL
Michal Marek [Mon, 30 May 2011 11:36:07 +0000 (13:36 +0200)]
kbuild: Fix KERNELVERSION for empty SUBLEVEL or PATCHLEVEL

Omit the second dot for releases without SUBLEVEL. If PATCHLEVEL is also
empty, only display VERSION.

Signed-off-by: Michal Marek <mmarek@suse.cz>
12 years agogpio/nomadik: fix sleepmode for elder Nomadik
Linus Walleij [Thu, 9 Jun 2011 09:08:47 +0000 (11:08 +0200)]
gpio/nomadik: fix sleepmode for elder Nomadik

The mach-nomadik machine did not compile properly due to bad
ux500-specific functions being called. Introduce new state
variables to fix this up.

Reported-by: Axel Lin <axel.lin@gmail.com>
Cc: Alessandro Rubini <rubini@unipv.it>
Cc: Prafulla Wadaskar <prafulla.wadaskar@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Thu, 9 Jun 2011 20:50:25 +0000 (13:50 -0700)]
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc: Force page alignment for initrd reserved memory
  dtc/powerpc: remove obsolete .gitignore entries
  powerpc/85xx: fix race bug of calling request_irq after enable elbc interrupts
  powerpc/book3e: Fix CPU feature handling on e5500 in 32-bit mode
  powerpc/fsl_rio: Fix compile error when CONFIG_FSL_RIO not set

12 years agoMerge branch 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Thu, 9 Jun 2011 20:09:07 +0000 (13:09 -0700)]
Merge branch 'staging-linus' of git://git./linux/kernel/git/gregkh/staging-2.6

* 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6:
  staging: iio: max517: Fix iio_info changes
  Staging: mei: fix debug code
  Staging: cx23885: fix include of altera.h
  staging: iio: error case memory leak fix
  staging: ath6kl: Fix a kernel panic during suspend/resume
  staging: gma500: get control from firmware framebuffer if conflicts
  staging: gma500: Skip bogus LVDS VBT mode and check for LVDS before adding backlight
  staging: usbip: bugfix prevent driver unbind
  staging: iio: industrialio-trigger: set iio_poll_func private_data
  staging: rts_pstor: use bitwise operator instead of logical one
  staging: fix ath6kl build when CFG80211 is not enabled
  staging: brcm80211: fix for 'multiple definition of wl_msg_level' build err
  staging: fix olpc_dcon build, needs BACKLIGHT_CLASS_DEVICE
  Staging: remove STAGING_EXCLUDE_BUILD option
  Staging: altera: move .h file to proper place

12 years agoMerge branch 'stable/xen-swiotlb.bugfix' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 9 Jun 2011 19:52:44 +0000 (12:52 -0700)]
Merge branch 'stable/xen-swiotlb.bugfix' of git://git./linux/kernel/git/konrad/swiotlb-2.6

* 'stable/xen-swiotlb.bugfix' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb-2.6:
  swiotlb: Export swioltb_nr_tbl and utilize it as appropiate.

12 years agoMerge branch 'stable/broadcom.ibft-bugfixes' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Thu, 9 Jun 2011 19:52:30 +0000 (12:52 -0700)]
Merge branch 'stable/broadcom.ibft-bugfixes' of git://git./linux/kernel/git/konrad/ibft-2.6

* 'stable/broadcom.ibft-bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft-2.6:
  iscsi_ibft: iscsi_ibft_find unused variable i

12 years agoMerge branch 'unicore32' of git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux...
Linus Torvalds [Thu, 9 Jun 2011 19:52:05 +0000 (12:52 -0700)]
Merge branch 'unicore32' of git://git./linux/kernel/git/epip/linux-2.6-unicore32

* 'unicore32' of git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32:
  unicore32: using generic-y format for one line asm-generic files
  unicore32: change PERCPU to PERCPU_SECTION
  unicore32: add KBUILD_DEFCONFIG with unicore32_defconfig (old debug_defconfig)
  unicore32: change zImage physical address, though it's PIC codes
  unicore32: move rtc-puv3.c to drivers/rtc directory

12 years agovsprintf: Update %pI6c to not compress a single 0
Joe Perches [Thu, 9 Jun 2011 18:23:37 +0000 (11:23 -0700)]
vsprintf: Update %pI6c to not compress a single 0

RFC 5952 (http://tools.ietf.org/html/rfc5952) mandates that 2 or more
consecutive 0's are required before using :: compression.

Update ip6_compressed_string to match the RFC and update the http
reference as well.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoexec: delay address limit change until point of no return
Mathias Krause [Thu, 9 Jun 2011 18:05:18 +0000 (20:05 +0200)]
exec: delay address limit change until point of no return

Unconditionally changing the address limit to USER_DS and not restoring
it to its old value in the error path is wrong because it prevents us
using kernel memory on repeated calls to this function.  This, in fact,
breaks the fallback of hard coded paths to the init program from being
ever successful if the first candidate fails to load.

With this patch applied switching to USER_DS is delayed until the point
of no return is reached which makes it possible to have a multi-arch
rootfs with one arch specific init binary for each of the (hard coded)
probed paths.

Since the address limit is already set to USER_DS when start_thread()
will be invoked, this redundancy can be safely removed.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Thu, 9 Jun 2011 18:23:30 +0000 (14:23 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6 into for-davem

12 years agostaging: iio: max517: Fix iio_info changes
Roland Stigge [Thu, 9 Jun 2011 14:21:00 +0000 (16:21 +0200)]
staging: iio: max517: Fix iio_info changes

struct iio_info introduced a bug where the second channel of a MAX518 can't be
used. This commit fixes the typo (using max518 instead of the max517 struct).

Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoStaging: mei: fix debug code
Dan Carpenter [Thu, 9 Jun 2011 07:18:23 +0000 (10:18 +0300)]
Staging: mei: fix debug code

! has higher precedence than !=.  H_RDY is 8 and since neither 0 nor
1 are equal to 8 the original condition was always true.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoBtrfs: unlock the trans lock properly
Josef Bacik [Thu, 9 Jun 2011 14:15:17 +0000 (10:15 -0400)]
Btrfs: unlock the trans lock properly

In btrfs_wait_for_commit if we came upon a transaction that had committed we
just exited, but that's bad since we are holding the trans_lock.  So break
instead so that the lock is dropped.  Thanks,

Reported-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <josef@redhat.com>
12 years agoBtrfs: don't map extent buffer if path->skip_locking is set
Josef Bacik [Wed, 8 Jun 2011 18:36:54 +0000 (14:36 -0400)]
Btrfs: don't map extent buffer if path->skip_locking is set

Arne's scrub stuff exposed a problem with mapping the extent buffer in
reada_for_search.  He searches the commit root with multiple threads and with
skip_locking set, so we can race and overwrite node->map_token since node isn't
locked.  So fix this so that we only map the extent buffer if we don't already
have a map_token and skip_locking isn't set.  Without this patch scrub would
panic almost immediately, with the patch it doesn't panic anymore.  Thanks,

Reported-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Josef Bacik <josef@redhat.com>
12 years agoASoC: snd_soc_new_{mixer,mux,pga} make sure to use right DAPM context
Lars-Peter Clausen [Thu, 9 Jun 2011 11:22:36 +0000 (13:22 +0200)]
ASoC: snd_soc_new_{mixer,mux,pga} make sure to use right DAPM context

Currently it is possible that snd_soc_new_{mixer,mux,pga} is called with a
DAPM context not matching the widgets context. This can lead to a wrong
prefix_len calculation, which will result in undefined behaviour. To avoid
this always use the DAPM context from the widget itself.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
12 years agox86: devicetree: Add missing early_init_dt_setup_initrd_arch stub
Florian Fainelli [Mon, 6 Jun 2011 08:15:49 +0000 (10:15 +0200)]
x86: devicetree: Add missing early_init_dt_setup_initrd_arch stub

This patch fixes the following build failure:

drivers/built-in.o: In function `early_init_dt_check_for_initrd':
/home/florian/dev/kernel/x86/linux-2.6-x86/drivers/of/fdt.c:571:
undefined reference to `early_init_dt_setup_initrd_arch'
make: *** [.tmp_vmlinux1] Error 1

which happens as soon as we enable initrd support on a x86 devicetree
platform such as Intel CE4100.

Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Maxime Bizon <mbizon@freebox.fr>
Acked-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Cc: stable@kernel.org # 2.6.39
Link: http://lkml.kernel.org/r/201106061015.50039.ffainelli@freebox.fr
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
12 years agoiscsi_ibft: iscsi_ibft_find unused variable i
Connor Hansen [Sun, 5 Jun 2011 10:35:09 +0000 (03:35 -0700)]
iscsi_ibft: iscsi_ibft_find unused variable i

int i is only needed if CONFIG_ACPI is set
so move it within a new ifdef so kernels without ACPI
don't allocate space for nothing. Fixes warning too.

Signed-off-by: Connor Hansen <cmdkhh@gmail.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
[v2: Fixed warning when CONFIG_ACPI was defined]
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
12 years agoASoC: fsl: fix initialization of DMA buffers
Timur Tabi [Wed, 8 Jun 2011 20:02:56 +0000 (15:02 -0500)]
ASoC: fsl: fix initialization of DMA buffers

The DMA (PCM) driver used by some Freescale PowerPC supports separate DAIs
for playback and capture, so DMA buffers should be allocated only for the
initialized streams.  Instead of checking for the number of active channels,
which apparently is not reliable, check to see if the actual stream object
exists.

Also provide a better name for the DMA interrupt.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: WM8804 does not support sample rates below 32kHz
Mark Brown [Wed, 8 Jun 2011 17:07:49 +0000 (18:07 +0100)]
ASoC: WM8804 does not support sample rates below 32kHz

Reported-by: Kieran O'Leary <Kieran.O'Leary@wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@kernel.org
12 years agokbuild: silence Nothing to be done for 'all' message
Peter Foley [Thu, 9 Jun 2011 00:58:32 +0000 (20:58 -0400)]
kbuild: silence Nothing to be done for 'all' message

This patch silences a Makefile.asm-generic message
by defining a dummy rule for all.

make -f /usr/src/git/scripts/Makefile.asm-generic \
            obj=arch/x86/include/generated/asm
make[1]: Nothing to be done for `all'.

Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
12 years agounicore32: using generic-y format for one line asm-generic files
Guan Xuetao [Thu, 26 May 2011 10:17:43 +0000 (18:17 +0800)]
unicore32: using generic-y format for one line asm-generic files

The patch adds one-line asm-generic files in arch/unicore32/include/asm/Kbuild
Also, remove the old implementation in arch/unicore32/Makefile
see commit from Sam Ravnborg <d8ecc5cd8e227bc318513b5306ae88a474b8886d>
  kbuild: asm-generic support

Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: Arnd Bergmann <arnd@arndb.de>
12 years agounicore32: change PERCPU to PERCPU_SECTION
Guan Xuetao [Thu, 26 May 2011 09:19:20 +0000 (17:19 +0800)]
unicore32: change PERCPU to PERCPU_SECTION

The patch changes PERCPU to PERCPU_SECTION
see commit from Tejun Heo <0415b00d175e0d8945e6785aad21b5f157976ce0>
  percpu: Always align percpu output section to PAGE_SIZE

Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: Tejun Heo <tj@kernel.org>
12 years agounicore32: add KBUILD_DEFCONFIG with unicore32_defconfig (old debug_defconfig)
Guan Xuetao [Mon, 16 May 2011 07:28:19 +0000 (15:28 +0800)]
unicore32: add KBUILD_DEFCONFIG with unicore32_defconfig (old debug_defconfig)

Rename debug_defconfig to unicore32_defconfig, which is a minimal config for
PKUnity-v3 (130nm) SoC board.
Also, add KBUILD_DEFCONFIG to use 'make defconfig'.

Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: Arnd Bergmann <arnd@arndb.de>
12 years agounicore32: change zImage physical address, though it's PIC codes
Guan Xuetao [Wed, 20 Apr 2011 11:06:53 +0000 (19:06 +0800)]
unicore32: change zImage physical address, though it's PIC codes

U-boot will load the kernel image to 48M physical memory address.
The patch changes it to the correct address, though it's PIC codes.

Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: Arnd Bergmann <arnd@arndb.de>
12 years agounicore32: move rtc-puv3.c to drivers/rtc directory
Guan Xuetao [Thu, 26 May 2011 08:43:27 +0000 (16:43 +0800)]
unicore32: move rtc-puv3.c to drivers/rtc directory

The patch moves rtc driver for PKUnity-v3 SoC from arch/unicore32/kernel/
to drivers/rtc/, with renaming it to rtc-puv3.c.
Also, Kconfig, Makefile, and MAINTAINERS are modified correspondingly.

Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: Arnd Bergmann <arnd@arndb.de>
12 years agonetpoll: prevent netpoll setup on slave devices
WANG Cong [Thu, 9 Jun 2011 07:28:13 +0000 (00:28 -0700)]
netpoll: prevent netpoll setup on slave devices

In commit 8d8fc29d02a33e4bd5f4fa47823c1fd386346093
(netpoll: disable netpoll when enslave a device), we automatically
disable netpoll when the underlying device is being enslaved,
we also need to prevent people from setuping netpoll on
devices that are already enslaved.

Signed-off-by: WANG Cong <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: pmtu_expires fixes
Eric Dumazet [Wed, 8 Jun 2011 06:07:07 +0000 (06:07 +0000)]
net: pmtu_expires fixes

commit 2c8cec5c10bc (ipv4: Cache learned PMTU information in inetpeer)
added some racy peer->pmtu_expires accesses.

As its value can be changed by another cpu/thread, we should be more
careful, reading its value once.

Add peer_pmtu_expired() and peer_pmtu_cleaned() helpers

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile...
Ingo Molnar [Thu, 9 Jun 2011 07:14:34 +0000 (09:14 +0200)]
Merge branch 'urgent' of git://git./linux/kernel/git/rric/oprofile into perf/urgent

12 years agogianfar:localized filer table
Wu Jiajun-B06378 [Tue, 7 Jun 2011 21:46:51 +0000 (21:46 +0000)]
gianfar:localized filer table

Each eTSEC device should own localized filer table.

Signed-off-by: Jiajun Wu <b06378@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agopowerpc: Force page alignment for initrd reserved memory
Benjamin Herrenschmidt [Thu, 9 Jun 2011 06:52:38 +0000 (16:52 +1000)]
powerpc: Force page alignment for initrd reserved memory

When using 64K pages with a separate cpio rootfs, U-Boot will align
the rootfs on a 4K page boundary. When the memory is reserved, and
subsequent early memblock_alloc is called, it will allocate memory
between the 64K page alignment and reserved memory. When the reserved
memory is subsequently freed, it is done so by pages, causing the
early memblock_alloc requests to be re-used, which in my case, caused
the device-tree to be clobbered.

This patch forces the reserved memory for initrd to be kernel page
aligned, and will move the device tree if it overlaps with the range
extension of initrd. This patch will also consolidate the identical
function free_initrd_mem() from mm/init_32.c, init_64.c to mm/mem.c,
and adds the same range extension when freeing initrd. free_initrd_mem()
is also moved to the __init section.

Many thanks to Milton Miller for his input on this patch.

[BenH: Fixed build without CONFIG_BLK_DEV_INITRD]

Signed-off-by: Dave Carroll <dcarroll@astekcorp.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 years agoMerge remote branch 'kumar/merge' into merge
Benjamin Herrenschmidt [Thu, 9 Jun 2011 04:46:32 +0000 (14:46 +1000)]
Merge remote branch 'kumar/merge' into merge

12 years agoMerge remote branch 'gcl/powerpc/merge' into merge
Benjamin Herrenschmidt [Thu, 9 Jun 2011 04:46:12 +0000 (14:46 +1000)]
Merge remote branch 'gcl/powerpc/merge' into merge

12 years agodrm/radeon: fix GUI idle IH debug statements
Ilija Hadzic [Tue, 7 Jun 2011 18:54:48 +0000 (14:54 -0400)]
drm/radeon: fix GUI idle IH debug statements

debug statement for GUI idle interrupt is wrong and incorrectly
reports CP EOP interrupt; trivial issue, but confusing for
someone trying to distinguish interrupt sources while debugging
... fixed

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: check modes against max pixel clock
Alex Deucher [Wed, 8 Jun 2011 17:01:11 +0000 (13:01 -0400)]
drm/radeon/kms: check modes against max pixel clock

Filter out modes that are higher than the max pixel
clock.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl
Sascha Hauer [Fri, 3 Jun 2011 10:54:14 +0000 (12:54 +0200)]
drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl

The DRM_IOCTL_MODE_GETRESOURCES ioctl just returns bogus framebuffers.
That is because the framebuffers for each file are in the filp_head
member of struct drm_framebuffer, not in the head member.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoAppArmor: Fix sleep in invalid context from task_setrlimit
John Johansen [Wed, 8 Jun 2011 22:07:47 +0000 (15:07 -0700)]
AppArmor: Fix sleep in invalid context from task_setrlimit

Affected kernels 2.6.36 - 3.0

AppArmor may do a GFP_KERNEL memory allocation with task_lock(tsk->group_leader);
held when called from security_task_setrlimit.  This will only occur when the
task's current policy has been replaced, and the task's creds have not been
updated before entering the LSM security_task_setrlimit() hook.

BUG: sleeping function called from invalid context at mm/slub.c:847
 in_atomic(): 1, irqs_disabled(): 0, pid: 1583, name: cupsd
 2 locks held by cupsd/1583:
  #0:  (tasklist_lock){.+.+.+}, at: [<ffffffff8104dafa>] do_prlimit+0x61/0x189
  #1:  (&(&p->alloc_lock)->rlock){+.+.+.}, at: [<ffffffff8104db2d>]
do_prlimit+0x94/0x189
 Pid: 1583, comm: cupsd Not tainted 3.0.0-rc2-git1 #7
 Call Trace:
  [<ffffffff8102ebf2>] __might_sleep+0x10d/0x112
  [<ffffffff810e6f46>] slab_pre_alloc_hook.isra.49+0x2d/0x33
  [<ffffffff810e7bc4>] kmem_cache_alloc+0x22/0x132
  [<ffffffff8105b6e6>] prepare_creds+0x35/0xe4
  [<ffffffff811c0675>] aa_replace_current_profile+0x35/0xb2
  [<ffffffff811c4d2d>] aa_current_profile+0x45/0x4c
  [<ffffffff811c4d4d>] apparmor_task_setrlimit+0x19/0x3a
  [<ffffffff811beaa5>] security_task_setrlimit+0x11/0x13
  [<ffffffff8104db6b>] do_prlimit+0xd2/0x189
  [<ffffffff8104dea9>] sys_setrlimit+0x3b/0x48
  [<ffffffff814062bb>] system_call_fastpath+0x16/0x1b

Signed-off-by: John Johansen <john.johansen@canonical.com>
Reported-by: Miles Lane <miles.lane@gmail.com>
Cc: stable@kernel.org
Signed-off-by: James Morris <jmorris@namei.org>
12 years agomd:Documentation/md.txt - fix typo
NeilBrown [Thu, 9 Jun 2011 01:43:04 +0000 (11:43 +1000)]
md:Documentation/md.txt - fix typo

Reported-by: CoolCold <coolthecold@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/bitmap: remove unused fields from struct bitmap
Namhyung Kim [Thu, 9 Jun 2011 01:43:01 +0000 (11:43 +1000)]
md/bitmap: remove unused fields from struct bitmap

Get rid of ->syncchunk and ->counter_bits since they're never used.

Also discard COUNTER_BYTE_RATIO which is unused.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/bitmap: use proper accessor macro
Namhyung Kim [Thu, 9 Jun 2011 01:42:57 +0000 (11:42 +1000)]
md/bitmap: use proper accessor macro

Use COUNTER()/NEEDED() macro instead of open-coding them.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd: check ->hot_remove_disk when removing disk
Namhyung Kim [Thu, 9 Jun 2011 01:42:54 +0000 (11:42 +1000)]
md: check ->hot_remove_disk when removing disk

Check pers->hot_remove_disk instead of pers->hot_add_disk in slot_store()
during disk removal. The linear personality only has ->hot_add_disk and
no ->hot_remove_disk, so that removing disk in the array resulted to
following kernel bug:

$ sudo mdadm --create /dev/md0 --level=linear --raid-devices=4 /dev/loop[0-3]
$ echo none | sudo tee /sys/block/md0/md/dev-loop2/slot
 BUG: unable to handle kernel NULL pointer dereference at           (null)
 IP: [<          (null)>]           (null)
 PGD c9f5d067 PUD 8575a067 PMD 0
 Oops: 0010 [#1] SMP
 CPU 2
 Modules linked in: linear loop bridge stp llc kvm_intel kvm asus_atk0110 sr_mod cdrom sg

 Pid: 10450, comm: tee Not tainted 3.0.0-rc1-leonard+ #173 System manufacturer System Product Name/P5G41TD-M PRO
 RIP: 0010:[<0000000000000000>]  [<          (null)>]           (null)
 RSP: 0018:ffff880085757df0  EFLAGS: 00010282
 RAX: ffffffffa00168e0 RBX: ffff8800d1431800 RCX: 000000000000006e
 RDX: 0000000000000001 RSI: 0000000000000002 RDI: ffff88008543c000
 RBP: ffff880085757e48 R08: 0000000000000002 R09: 000000000000000a
 R10: 0000000000000000 R11: ffff88008543c2e0 R12: 00000000ffffffff
 R13: ffff8800b4641000 R14: 0000000000000005 R15: 0000000000000000
 FS:  00007fe8c9e05700(0000) GS:ffff88011fa00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 0000000000000000 CR3: 00000000b4502000 CR4: 00000000000406e0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process tee (pid: 10450, threadinfo ffff880085756000, task ffff8800c9f08000)
 Stack:
  ffffffff8138496a ffff8800b4641000 ffff88008543c268 0000000000000000
  ffff8800b4641000 ffff88008543c000 ffff8800d1431868 ffffffff81a78a90
  ffff8800b4641000 ffff88008543c000 ffff8800d1431800 ffff880085757e98
 Call Trace:
  [<ffffffff8138496a>] ? slot_store+0xaa/0x265
  [<ffffffff81384bae>] rdev_attr_store+0x89/0xa8
  [<ffffffff8115a96a>] sysfs_write_file+0x108/0x144
  [<ffffffff81106b87>] vfs_write+0xb1/0x10d
  [<ffffffff8106e6c0>] ? trace_hardirqs_on_caller+0x111/0x135
  [<ffffffff81106cac>] sys_write+0x4d/0x77
  [<ffffffff814fe702>] system_call_fastpath+0x16/0x1b
 Code:  Bad RIP value.
 RIP  [<          (null)>]           (null)
  RSP <ffff880085757df0>
 CR2: 0000000000000000
 ---[ end trace ba5fc64319a826fb ]---

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd: Using poll /proc/mdstat can monitor the events of adding a spare disks
马建朋 [Thu, 9 Jun 2011 01:42:48 +0000 (11:42 +1000)]
md: Using poll  /proc/mdstat can monitor the events of adding a spare disks

Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoMD: use is_power_of_2 macro
Jonathan Brassow [Wed, 8 Jun 2011 23:01:10 +0000 (18:01 -0500)]
MD: use is_power_of_2 macro

Make use of is_power_of_2 macro.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoMD: raid5 do not set fullsync
Jonathan Brassow [Wed, 8 Jun 2011 23:00:28 +0000 (18:00 -0500)]
MD: raid5 do not set fullsync

Add check to determine if a device needs full resync or if partial resync will do

RAID 5 was assuming that if a device was not In_sync, it must undergo a full
resync.  We add a check to see if 'saved_raid_disk' is the same as 'raid_disk'.
If it is, we can safely skip the full resync and rely on the bitmap for
partial recovery instead.  This is the legitimate purpose of 'saved_raid_disk',
from md.h:
int saved_raid_disk;            /* role that device used to have in the
                                 * array and could again if we did a partial
                                 * resync from the bitmap
                                 */

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoMD: support initial bitmap creation in-kernel
Jonathan Brassow [Wed, 8 Jun 2011 22:59:30 +0000 (17:59 -0500)]
MD: support initial bitmap creation in-kernel

Add bitmap support to the device-mapper specific metadata area.

This patch allows the creation of the bitmap metadata area upon
initial array creation via device-mapper.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agodtc/powerpc: remove obsolete .gitignore entries
Wolfram Sang [Sat, 12 Mar 2011 16:44:10 +0000 (17:44 +0100)]
dtc/powerpc: remove obsolete .gitignore entries

dtc was moved and .gitignores have been added to the new location. So, we can
delete the old, forgotten ones.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoMerge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspe...
Linus Torvalds [Wed, 8 Jun 2011 22:58:51 +0000 (15:58 -0700)]
Merge branch 'pm-fixes' of git://git./linux/kernel/git/rafael/suspend-2.6

* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
  PM / Runtime: Fix loops in pm_runtime_clk_notify()
  PM / Intel IOMMU: Fix init_iommu_pm_ops() for CONFIG_PM unset

12 years agovfs: reorganize 'struct inode' layout a bit
Linus Torvalds [Wed, 8 Jun 2011 22:18:19 +0000 (15:18 -0700)]
vfs: reorganize 'struct inode' layout a bit

This tries to make the 'struct inode' accesses denser in the data cache
by moving a commonly accessed field (i_security) closer to other fields
that are accessed often.

It also makes 'i_state' just an 'unsigned int' rather than 'unsigned
long', since we only use a few bits of that field, and moves it next to
the existing 'i_flags' so that we potentially get better structure
layout (although depending on config options, i_flags may already have
packed in the same word as i_lock, so this improves packing only for the
case of spinlock debugging)

Out 'struct inode' is still way too big, and we should probably move
some other fields around too (the acl fields in particular) for better
data cache access density.  Other fields (like the inode hash) are
likely to be entirely irrelevant under most loads.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoselinux: simplify and clean up inode_has_perm()
Linus Torvalds [Wed, 8 Jun 2011 22:11:56 +0000 (15:11 -0700)]
selinux: simplify and clean up inode_has_perm()

This is a rather hot function that is called with a potentially NULL
"struct common_audit_data" pointer argument.  And in that case it has to
provide and initialize its own dummy common_audit_data structure.

However, all the _common_ cases already pass it a real audit-data
structure, so that uncommon NULL case not only creates a silly run-time
test, more importantly it causes that function to have a big stack frame
for the dummy variable that isn't even used in the common case!

So get rid of that stupid run-time behavior, and make the (few)
functions that currently call with a NULL pointer just call a new helper
function instead (naturally called inode_has_perm_noapd(), since it has
no adp argument).

This makes the run-time test be a static code generation issue instead,
and allows for a much denser stack since none of the common callers need
the dummy structure.  And a denser stack not only means less stack space
usage, it means better cache behavior.  So we have a win-win-win from
this simplification: less code executed, smaller stack footprint, and
better cache behavior.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Wed, 8 Jun 2011 21:27:48 +0000 (14:27 -0700)]
Merge branch 'usb-linus' of git://git./linux/kernel/git/gregkh/usb-2.6

* 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (28 commits)
  MAINTAINERS: add a maintainer to Gadget Framework
  USB: serial: add another 4N-GALAXY.DE PID to ftdi_sio driver
  Revert "USB: option: add ID for ZTE MF 330"
  drivers/usb/host/ohci-pxa27x.c: add missing clk_put
  USB: CONFIG_USB_GADGET_DUALSPEED is not user-configurable
  USB: dummy-hcd needs the has_tt flag
  usb-storage: redo incorrect reads
  usb/renesas_usbhs: free uep on removal
  usb/s3c-hsudc: fix error path
  usb/pxa25x_udc: cleanup the LUBBOCK err path
  usb/mv_udc_core: fix compile
  usb: gadget: include <linux/prefetch.h> to fix compiling error
  USB: s3c-hsotg: Tone down debugging
  usb: remove bad dput after dentry_unhash
  USB: core: Tolerate protocol stall during hub and port status read
  musb: fix prefetch build failure
  USB: cdc-acm: Adding second ACM channel support for Nokia E7 and C7
  usb-gadget: unlock data->lock mutex on error path in ep_write()
  USB: option Add blacklist for ZTE K3765-Z (19d2:2002)
  option: add Prolink PH300 modem IDs
  ...

12 years agoMAINTAINERS: add a maintainer to Gadget Framework
Felipe Balbi [Wed, 8 Jun 2011 16:16:28 +0000 (19:16 +0300)]
MAINTAINERS: add a maintainer to Gadget Framework

I'll be continuing the amazing work Dave has
done with the Gadget Framework.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoMerge branch 'spi/merge' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Wed, 8 Jun 2011 20:54:46 +0000 (13:54 -0700)]
Merge branch 'spi/merge' of git://git.secretlab.ca/git/linux-2.6

* 'spi/merge' of git://git.secretlab.ca/git/linux-2.6:
  spi/rtc-m41t93: Use spi_get_drvdata() for SPI devices
  spi/omap2: fix uninitialized variable

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Wed, 8 Jun 2011 20:54:29 +0000 (13:54 -0700)]
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  cifs: trivial: add space in fsc error message
  cifs: silence printk when establishing first session on socket
  CIFS ACL support needs CONFIG_KEYS, so depend on it
  possible memory corruption in cifs_parse_mount_options()
  cifs: make CIFS depend on CRYPTO_ECB
  cifs: fix the kernel release version in the default security warning message

12 years agoMerge 3.0-rc2 + Linus's latest into usb-linus
Greg Kroah-Hartman [Wed, 8 Jun 2011 20:50:00 +0000 (13:50 -0700)]
Merge 3.0-rc2 + Linus's latest into usb-linus

This is needed to get the following MAINTAINERS patch to apply properly.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: serial: add another 4N-GALAXY.DE PID to ftdi_sio driver
Steffen Sledz [Tue, 7 Jun 2011 12:01:56 +0000 (14:01 +0200)]
USB: serial: add another 4N-GALAXY.DE PID to ftdi_sio driver

E.g. newer CAN 2.0 A/B <=> USB 2.0 converters report idProduct=f3c2.

Signed-off-by: Steffen Sledz <sledz@dresearch-fe.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoBtrfs: fix duplicate checking logic
Josef Bacik [Mon, 6 Jun 2011 14:50:35 +0000 (10:50 -0400)]
Btrfs: fix duplicate checking logic

When merging my code into the integration test the second check for duplicate
entries got screwed up.  This patch fixes it by dropping ret2 and just using ret
for the return value, and checking if we got an error before adding the bitmap
to the local list.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
12 years agoBtrfs: fix the allocator loop logic
Josef Bacik [Fri, 27 May 2011 20:11:38 +0000 (16:11 -0400)]
Btrfs: fix the allocator loop logic

I was testing with empty_cluster = 0 to try and reproduce a problem and kept
hitting early enospc panics.  This was because our loop logic was a little
confused.  So this is what I did

1) Make the loop variable the ultimate decider on wether we should loop again
isntead of checking to see if we had an uncached bg, empty size or empty
cluster.

2) Increment loop before checking to see what we are on to make the loop
definitions make more sense.

3) If we are on the chunk alloc loop don't set empty_size/empty_cluster to 0
unless we didn't actually allocate a chunk.  If we did allocate a chunk we
should be able to easily setup a new cluster so clearing
empty_size/empty_cluster makes us less efficient.

This kept me from hitting panics while trying to reproduce the other problem.
Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
12 years agoBtrfs: fix bitmap regression
Josef Bacik [Fri, 27 May 2011 18:07:49 +0000 (14:07 -0400)]
Btrfs: fix bitmap regression

In cleaning up the clustering code I accidently introduced a regression by
adding bitmap entries to the cluster rb tree.  The problem is if we've maxed out
the number of bitmaps we can have for the block group we can only add free space
to the bitmaps, but since the bitmap is on the cluster we can't find it and we
try to create another one.  This would result in a panic because the total
bitmaps was bigger than the max bitmaps that were allowed.  This patch fixes
this by checking to see if we have a cluster, and then looking at the cluster rb
tree to see if it has a bitmap entry and if it does and that space belongs to
that bitmap, go ahead and add it to that bitmap.

I could hit this panic every time with an fs_mark test within a couple of
minutes.  With this patch I no longer hit the panic and fs_mark goes to
completion.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
12 years agospi/rtc-m41t93: Use spi_get_drvdata() for SPI devices
Geert Uytterhoeven [Wed, 8 Jun 2011 19:48:03 +0000 (21:48 +0200)]
spi/rtc-m41t93: Use spi_get_drvdata() for SPI devices

One new offender detected by the recently increased type checking in
platform_get_drvdata():

drivers/rtc/rtc-m41t93.c: In function â€˜m41t93_remove’:
drivers/rtc/rtc-m41t93.c:192: warning: passing argument 1 of â€˜platform_get_drvdata’ from incompatible pointer type

Use spi_get_drvdata() instead of platform_get_drvdata(), cfr. commit
42fea15d6dc410e62dac6a764142045280624a5b ("spi/rtc-{ds1390,ds3234,m41t94}:
Use spi_get_drvdata() for SPI devices")

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoBtrfs: don't commit the transaction if we dont have enough pinned bytes
Josef Bacik [Wed, 25 May 2011 17:10:16 +0000 (13:10 -0400)]
Btrfs: don't commit the transaction if we dont have enough pinned bytes

I noticed when running an enospc test that we would get stuck committing the
transaction in check_data_space even though we truly didn't have enough space.
So check to see if bytes_pinned is bigger than num_bytes, if it's not don't
commit the transaction.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
12 years agoBtrfs: noinline the cluster searching functions
Josef Bacik [Wed, 25 May 2011 17:07:37 +0000 (13:07 -0400)]
Btrfs: noinline the cluster searching functions

When profiling the find cluster code it's hard to tell where we are spending our
time because the bitmap and non-bitmap functions get inlined by the compiler, so
make that not happen.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
12 years agoBtrfs: cache bitmaps when searching for a cluster
Josef Bacik [Wed, 25 May 2011 17:03:16 +0000 (13:03 -0400)]
Btrfs: cache bitmaps when searching for a cluster

If we are looking for a cluster in a particularly sparse or fragmented block
group, we will do a lot of looping through the free space tree looking for
various things, and if we need to look at bitmaps we will endup doing the whole
dance twice.  So instead add the bitmap entries to a temporary list so if we
have to do the bitmap search we can just look through the list of entries we've
found quickly instead of having to loop through the entire tree again.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
12 years agoMerge branch 'stable/bug.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 8 Jun 2011 19:03:37 +0000 (12:03 -0700)]
Merge branch 'stable/bug.fixes' of git://git./linux/kernel/git/konrad/xen

* 'stable/bug.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: off by one errors in multicalls.c
  xen: use the trigger info we already have to choose the irq handler

12 years agoiwlegacy: fix channel switch locking
Stanislaw Gruszka [Wed, 8 Jun 2011 13:26:31 +0000 (15:26 +0200)]
iwlegacy: fix channel switch locking

We use priv->mutex to avoid race conditions between chswitch_done()
and mac_channel_switch(), when marking channel switch in
progress. But chswitch_done() can be called in atomic context
from rx_csa() or with mutex already taken from commit_rxon().

To fix remove mutex from chswitch_done() and use atomic bitops
for marking channel switch pending.

Cc: stable@kernel.org # 2.6.39+
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: fix IBSS teardown race
Johannes Berg [Wed, 8 Jun 2011 11:27:29 +0000 (13:27 +0200)]
mac80211: fix IBSS teardown race

Ignacy reports that sometimes after leaving an IBSS
joining a new one didn't work because there still
were stations on the list. He fixed it by flushing
stations when attempting to join a new IBSS, but
this shouldn't be happening in the first case. When
I looked into it I saw a race condition in teardown
that could cause stations to be added after flush,
and thus cause this situation. Ignacy confirms that
after applying my patch he hasn't seen this happen
again.

Reported-by: Ignacy Gawedzki <i@lri.fr>
Debugged-by: Ignacy Gawedzki <i@lri.fr>
Tested-by: Ignacy Gawedzki <i@lri.fr>
Cc: stable@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: send tx power command if defer cause by RXON not match
Wey-Yi Guy [Fri, 27 May 2011 15:40:24 +0000 (08:40 -0700)]
iwlagn: send tx power command if defer cause by RXON not match

During channge channel, tx power will not send to uCode, the tx power command
should send after scan complete. but should also can send after RXON command.

Stable fix identified by Stanislaw Gruszka <sgruszka@redhat.com>.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Cc: stable@kernel.org [2.6.38+]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoStaging: cx23885: fix include of altera.h
Greg Kroah-Hartman [Wed, 8 Jun 2011 16:18:32 +0000 (09:18 -0700)]
Staging: cx23885: fix include of altera.h

The cx23885 driver was including staging/altera.h, but that file has
moved back into the driver directory.

Why a non-staging driver was including a staging driver is beyond me,
but this fixes the build so everything is happy for now.

For the record, it's not ok for a non-staging driver to depend on a
staging one, as that implies that the non-staging one should also be in
the staging tree if that's needed.

Cc: Igor M. Liplianin <liplianin@netup.ru>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agocifs: trivial: add space in fsc error message
Jeff Layton [Wed, 8 Jun 2011 11:35:24 +0000 (07:35 -0400)]
cifs: trivial: add space in fsc error message

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 8 Jun 2011 15:36:15 +0000 (08:36 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf: Fix comments in include/linux/perf_event.h
  perf: Comment /proc/sys/kernel/perf_event_paranoid to be part of user ABI
  perf python: Fix argument name list of read_on_cpu()
  perf evlist: Don't die if sample_{id_all|type} is invalid
  perf python: Use exception to propagate errors
  perf evlist: Remove dependency on debug routines
  perf, cgroups: Fix up for new API

12 years agoMerge branch 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Wed, 8 Jun 2011 15:22:29 +0000 (08:22 -0700)]
Merge branch 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6

* 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6:
  gpio/samsung: make Kconfig options def_bool
  gpio/exynos4: Fix incorrect mapping of gpio pull-up macro to register setting
  GPIO: OMAP: add locking around calls to _set_gpio_triggering
  GPIO: OMAP: fix setting IRQWAKEN bits for OMAP4
  GPIO: OMAP: fix section mismatch warnings
  gpio: Fix gpio-exynos4 build fails in mainline

12 years agoMerge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Wed, 8 Jun 2011 15:21:48 +0000 (08:21 -0700)]
Merge branch 'v4l_for_linus' of git://git./linux/kernel/git/mchehab/linux-2.6

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  [media] soc_camera: preserve const attribute
  [media] uvc_entity: initialize return value
  [media] media: Fix media device minor registration
  [media] Make nchg variable signed because the code compares this variable against negative values
  [media] omap3isp: fix compiler warning
  [media] v4l: Fix media_entity_to_video_device macro argument name
  [media] ivtv: Internally separate encoder & decoder standard setting
  [media] ivtvfb: Add sanity check to ivtvfb_pan_display()
  [media] ivtvfb: use display information in info not in var for panning
  [media] ivtv: Make two ivtv_msleep_timeout calls uninterruptable
  [media] anysee: return EOPNOTSUPP for unsupported I2C messages
  [media] gspca - ov519: Set the default frame rate to 15 fps
  [media] gspca - stv06xx: Set a lower default value of gain for hdcs sensors
  [media] gspca: Remove coarse_expo_autogain.h
  [media] gspca - ov519: Change the ovfx2 bulk transfer size
  [media] gspca - ov519: Fix a regression for ovfx2 webcams

12 years agoMerge branch 'drm-radeon-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 8 Jun 2011 15:19:14 +0000 (08:19 -0700)]
Merge branch 'drm-radeon-urgent' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-radeon-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/radeon/kms: disable hdmi audio by default
  drm/radeon/kms: fix for radeon on systems >4GB without hardware iommu
  drm/radeon/kms: set family for use in parser.

12 years agoMerge branch 'for_3.0/gpio-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git...
Grant Likely [Wed, 8 Jun 2011 15:12:16 +0000 (09:12 -0600)]
Merge branch 'for_3.0/gpio-fixes' of git://git./linux/kernel/git/khilman/linux-omap-pm into gpio/merge

12 years agotty_buffer: get rid of 'seen_tail' logic in flush_to_ldisc
Linus Torvalds [Wed, 8 Jun 2011 14:46:30 +0000 (07:46 -0700)]
tty_buffer: get rid of 'seen_tail' logic in flush_to_ldisc

The flush_to_ldisc() work entry has special logic to notice when it has
seen the original tail of the data queue, and it avoids continuing the
flush if it sees that _original_ tail rather than the current tail.

This logic can trigger in case somebody is constantly adding new data to
the tty while the flushing is active - and the intent is to avoid
excessive CPU usage while flushing the tty, especially as we used to do
this from a softirq context which made it non-preemptible.

However, since we no longer re-arm the work-queue from within itself
(because that causes other trouble: see commit a5660b41af6a "tty: fix
endless work loop when the buffer fills up"), this just leads to
possible hung tty's (most easily seen in SMP and with a test-program
that floods a pty with data - nobody seems to have reported this for any
real-life situation yet).

And since the workqueue isn't done from timers and softirq's any more,
it's doubtful whether the CPU useage issue is really relevant any more.
So just remove the logic entirely, and see if anybody ever notices.

Alternatively, we might want to re-introduce the "re-arm the work" for
just this case, but then we'd have to re-introduce the delayed work
model or some explicit timer, which really doesn't seem worth it for
this.

Reported-and-tested-by: Guillaume Chazarain <guichaz@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoASoC: Fix WM8962 headphone volume update for use of advanced caches
Mark Brown [Tue, 7 Jun 2011 22:42:04 +0000 (23:42 +0100)]
ASoC: Fix WM8962 headphone volume update for use of advanced caches

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@kernel.org
12 years agoMerge branch 'tip/perf/urgent-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Ingo Molnar [Wed, 8 Jun 2011 14:09:55 +0000 (16:09 +0200)]
Merge branch 'tip/perf/urgent-2' of git://git./linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent

12 years agoMerge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile...
Ingo Molnar [Wed, 8 Jun 2011 13:49:03 +0000 (15:49 +0200)]
Merge branch 'urgent' of git://git./linux/kernel/git/rric/oprofile into perf/urgent

12 years agodrm/radeon/kms: disable hdmi audio by default
Alex Deucher [Mon, 6 Jun 2011 21:39:16 +0000 (17:39 -0400)]
drm/radeon/kms: disable hdmi audio by default

The current RE'd code causes blank screens and
display problems on a lot of systems.  So disable
it by default for now.  It can still be enabled
by setting the audio parameter to 1.  E.g.:
radeon.audio=1

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=38010
https://bugs.freedesktop.org/show_bug.cgi?id=27731
https://bugs.freedesktop.org/show_bug.cgi?id=35970
https://bugs.freedesktop.org/show_bug.cgi?id=26195
and many other reported problems.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: fix for radeon on systems >4GB without hardware iommu
Daniel Haid [Wed, 8 Jun 2011 10:04:45 +0000 (20:04 +1000)]
drm/radeon/kms: fix for radeon on systems >4GB without hardware iommu

On my x86_64 system with >4GB of ram and swiotlb instead of
a hardware iommu (because I have a VIA chipset), the call
to pci_set_dma_mask (see below) with 40bits returns an error.

But it seems that the radeon driver is designed to have
need_dma32 = true exactly if pci_set_dma_mask is called
with 32 bits and false if it is called with 40 bits.

I have read somewhere that the default are 32 bits. So if the
call fails I suppose that need_dma32 should be set to true.

And indeed the patch fixes the problem I have had before
and which I had described here:
http://choon.net/forum/read.php?21,106131,115940

Acked-by: Alex Deucher <alexdeucher@gmail.com>
cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: set family for use in parser.
Dave Airlie [Wed, 8 Jun 2011 09:58:29 +0000 (19:58 +1000)]
drm/radeon/kms: set family for use in parser.

Wierdly the kms parser never initialised the family, it wasn't really used
much, but the fmt checker patch started using it and it fell over.

Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agox86: cpu-hotplug: Prevent softirq wakeup on wrong CPU
Thomas Gleixner [Tue, 20 Jul 2010 12:34:50 +0000 (14:34 +0200)]
x86: cpu-hotplug: Prevent softirq wakeup on wrong CPU

After a newly plugged CPU sets the cpu_online bit it enables
interrupts and goes idle. The cpu which brought up the new cpu waits
for the cpu_online bit and when it observes it, it sets the cpu_active
bit for this cpu. The cpu_active bit is the relevant one for the
scheduler to consider the cpu as a viable target.

With forced threaded interrupt handlers which imply forced threaded
softirqs we observed the following race:

cpu 0                         cpu 1

bringup(cpu1);
                              set_cpu_online(smp_processor_id(), true);
              local_irq_enable();
while (!cpu_online(cpu1));
                              timer_interrupt()
                                -> wake_up(softirq_thread_cpu1);
                                     -> enqueue_on(softirq_thread_cpu1, cpu0);

                                                                        ^^^^

cpu_notify(CPU_ONLINE, cpu1);
  -> sched_cpu_active(cpu1)
     -> set_cpu_active((cpu1, true);

When an interrupt happens before the cpu_active bit is set by the cpu
which brought up the newly onlined cpu, then the scheduler refuses to
enqueue the woken thread which is bound to that newly onlined cpu on
that newly onlined cpu due to the not yet set cpu_active bit and
selects a fallback runqueue. Not really an expected and desirable
behaviour.

So far this has only been observed with forced hard/softirq threading,
but in theory this could happen without forced threaded hard/softirqs
as well. It's probably unobservable as it would take a massive
interrupt storm on the newly onlined cpu which causes the softirq loop
to wake up the softirq thread and an even longer delay of the cpu
which waits for the cpu_online bit.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Peter Zijlstra <peterz@infradead.org>
Cc: stable@kernel.org # 2.6.39
12 years agoMD: add sync_super to mddev_t struct
Jonathan Brassow [Tue, 7 Jun 2011 22:51:30 +0000 (17:51 -0500)]
MD: add sync_super to mddev_t struct

Add the 'sync_super' function pointer to MD array structure (struct mddev_s)

If device-mapper (dm-raid.c) is to define its own on-disk superblock and be
able to load it, there must still be a way for MD to initiate superblock
updates.  The simplest way to make this happen is to provide a pointer in
the MD array structure that can be set by device-mapper (or other module)
with a function to do this.  If the function has been set, it will be used;
otherwise, the method with be looked up via 'super_types' as usual.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoMD: raid1 changes to allow use by device mapper
Jonathan Brassow [Tue, 7 Jun 2011 22:50:35 +0000 (17:50 -0500)]
MD: raid1 changes to allow use by device mapper

MD RAID1: Changes to allow RAID1 to be used by device-mapper (dm-raid.c)

Added the necessary congestion function and conditionalize calls requiring an
array 'queue' or 'gendisk'.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoMD: move thread wakeups into resume
Jonathan Brassow [Tue, 7 Jun 2011 22:49:36 +0000 (17:49 -0500)]
MD: move thread wakeups into resume

Move personality and sync/recovery thread starting outside md_run.

Moving the wakeup's of the personality and sync/recovery threads out of
md_run and into do_md_run and mddev_resume solves two issues:
1) It allows bitmap_load to be called before the sync_thread is run and
2) when MD personalities are used by device-mapper (dm-raid.c), the start-up
of the array is better alligned with device-mapper primatives
(CTR/resume/suspend/DTR).  I/O - in this case, recovery operations - should
not happen until after a resume has taken place.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoMD: possible typo
Jonathan Brassow [Tue, 7 Jun 2011 22:48:35 +0000 (17:48 -0500)]
MD: possible typo

Make message a bit clearer by s/blocks/k/

I chose 'k' vs 'kiB' or 'kB' because it is what is used earlier in the
message.  'k' may be a bit ambigous, but I think it's better than "blocks"
which normally means 512, but means 1024 in MD.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoMD: no sync IO while suspended
Jonathan Brassow [Wed, 8 Jun 2011 05:10:08 +0000 (15:10 +1000)]
MD: no sync IO while suspended

Disallow resync I/O while the RAID array is suspended.

Recovery, resync, and metadata I/O should not be allowed while a device is
suspended.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoMD: no integrity register if no gendisk
Jonathan Brassow [Wed, 8 Jun 2011 05:10:08 +0000 (15:10 +1000)]
MD: no integrity register if no gendisk

Don't attempt md_integrity_register if there is no gendisk struct available.

When MD arrays are built via device-mapper, the gendisk structure is not
available via mddev.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoceph: unwind canceled flock state
Sage Weil [Wed, 25 May 2011 21:56:12 +0000 (14:56 -0700)]
ceph: unwind canceled flock state

If we request a lock and then abort (e.g., ^C), we need to send a matching
unlock request to the MDS to unwind our lock attempt to avoid indefinitely
blocking other clients.

Reported-by: Brian Chrisman <brchrisman@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
12 years agoceph: fix ENOENT logic in striped_read
Sage Weil [Wed, 8 Jun 2011 03:40:35 +0000 (20:40 -0700)]
ceph: fix ENOENT logic in striped_read

Getting ENOENT is equivalent to reading 0 bytes.  Make that correction
before setting up the hit_stripe and was_short flags.

Fixes the following case:
 dd if=/dev/zero of=/mnt/fs_depot/dd3 bs=1 seek=1048576 count=0
 dd if=/mnt/fs_depot/dd3 of=/root/ddout1 skip=8 bs=500 count=2 iflag=direct

Reported-by: Henry C Chang <henry.cy.chang@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
12 years agoceph: fix short sync reads from the OSD
Sage Weil [Wed, 1 Jun 2011 23:08:44 +0000 (16:08 -0700)]
ceph: fix short sync reads from the OSD

If we get a short read from the OSD because the object is small, we need to
zero the remainder of the buffer.  For O_DIRECT reads, the attempted range
is not trimmed to i_size by the VFS, so we were actually looping
indefinitely.

Fix by trimming by i_size, and the unconditionally zeroing the trailing
range.

Reported-by: Jeff Wu <cpwu@tnsoft.com.cn>
Signed-off-by: Sage Weil <sage@newdream.net>
12 years agoceph: fix sync vs canceled write
Sage Weil [Fri, 3 Jun 2011 16:37:09 +0000 (09:37 -0700)]
ceph: fix sync vs canceled write

If we cancel a write, trigger the safe completions to prevent a sync from
blocking indefinitely in ceph_osdc_sync().

Signed-off-by: Sage Weil <sage@newdream.net>
12 years agoceph: use ihold when we already have an inode ref
Sage Weil [Fri, 27 May 2011 16:24:26 +0000 (09:24 -0700)]
ceph: use ihold when we already have an inode ref

We should use ihold whenever we already have a stable inode ref, even
when we aren't holding i_lock.  This avoids adding new and unnecessary
locking dependencies.

Signed-off-by: Sage Weil <sage@newdream.net>
12 years agoxfrm: Fix off by one in the replay advance functions
Steffen Klassert [Sun, 5 Jun 2011 20:46:03 +0000 (20:46 +0000)]
xfrm: Fix off by one in the replay advance functions

We may write 4 byte too much when we reinitialize the anti replay
window in the replay advance functions. This patch fixes this by
adjusting the last index of the initialization loop.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 8 Jun 2011 02:21:11 +0000 (19:21 -0700)]
Merge branch 'irq-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  genirq: Ensure we locate the passed IRQ in irq_alloc_descs()
  genirq: Fix descriptor init on non-sparse IRQs
  irq: Handle spurios irq detection for threaded irqs
  genirq: Print threaded handler in spurious debug output

12 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 8 Jun 2011 02:20:53 +0000 (19:20 -0700)]
Merge branch 'x86-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86/amd-iommu: Fix boot crash with hidden PCI devices
  x86/amd-iommu: Use only per-device dma_ops
  x86/amd-iommu: Fix 3 possible endless loops

12 years agoMerge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 8 Jun 2011 02:20:28 +0000 (19:20 -0700)]
Merge branch 'sched-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: Fix/clarify set_task_cpu() locking rules
  lockdep: Fix lock_is_held() on recursion
  sched: Fix schedstat.nr_wakeups_migrate
  sched: Fix cross-cpu clock sync on remote wakeups