firefly-linux-kernel-4.4.55.git
11 years agoMerge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm
Linus Torvalds [Fri, 12 Oct 2012 03:32:43 +0000 (12:32 +0900)]
Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm

Pull second set of ARM updates from Russell King:
 "This is the second set of ARM updates for this merge window.

  Contained within are changes to allow the kernel to boot in hypervisor
  mode on CPUs supporting virtualization, and cache flushing support to
  the point of inner sharable unification, which are used by the
  suspend/resume code to avoid having to do a full cache flush.

  Also included is one fix for VFP code identified by Michael Olbrich."

* 'for-linus' of git://git.linaro.org/people/rmk/linux-arm:
  ARM: vfp: fix saving d16-d31 vfp registers on v6+ kernels
  ARM: 7549/1: HYP: fix boot on some ARM1136 cores
  ARM: 7542/1: mm: fix cache LoUIS API for xscale and feroceon
  ARM: mm: update __v7_setup() to the new LoUIS cache maintenance API
  ARM: kernel: update __cpu_disable to use cache LoUIS maintenance API
  ARM: kernel: update cpu_suspend code to use cache LoUIS operations
  ARM: mm: rename jump labels in v7_flush_dcache_all function
  ARM: mm: implement LoUIS API for cache maintenance ops
  ARM: virt: arch_timers: enable access to physical timers
  ARM: virt: Add CONFIG_ARM_VIRT_EXT option
  ARM: virt: Add boot-time diagnostics
  ARM: virt: Update documentation for hyp mode entry support
  ARM: zImage/virt: hyp mode entry support for the zImage loader
  ARM: virt: allow the kernel to be entered in HYP mode
  ARM: opcodes: add __ERET/__MSR_ELR_HYP instruction encoding

11 years agoMerge tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Fri, 12 Oct 2012 03:31:28 +0000 (12:31 +0900)]
Merge tag 'sound-3.7' of git://git./linux/kernel/git/tiwai/sound

Pull sound updates #2 from Takashi Iwai:
 "This update contains a few cleanup works, regression/stable fixes
  gathered since the last pull request.

   - Clean up with generic hd-audio jack handling code by David
     Henningsson
   - A few regression fixes for standardized HD-audio auto-parser
   - Misc clean-up and small fixes"

* tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - do not detect jack on internal speakers for Realtek
  ALSA: hda - Fix missing beep on ASUS X43U notebook
  ALSA: hda - Remove AZX_DCAPS_POSFIX_COMBO
  ALSA: hda - Warn an allocation for an uninitialized array
  ALSA: hda/cirrus - Add missing init/free of hda_gen_spec
  ALSA: hda - Fix memory leaks at error path in patch_cirrus.c
  ALSA: hda - Add missing hda_gen_spec to struct via_spec
  ALSA: hda - remove "Mic Jack Mode" for headset jacks (Latitude Exx30)
  ALSA: hda - make Cirrus codec use generic unsol event handler
  ALSA: hda - make VIA codec use generic unsol event handler
  ALSA: hda - Remove dead GPIO code for VIA codec
  ALSA: usb-audio: Add TASCAM US122 MKII playback

11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Fri, 12 Oct 2012 01:52:03 +0000 (10:52 +0900)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs

Pull pile 2 of vfs updates from Al Viro:
 "Stuff in this one - assorted fixes, lglock tidy-up, death to
  lock_super().

  There'll be a VFS pile tomorrow (with patches from Jeff Layton,
  sanitizing getname() and related parts of audit and preparing for
  ESTALE fixes), but I'd rather push the stuff in this one ASAP - some
  of the bugs closed here are quite unpleasant."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  vfs: bogus warnings in fs/namei.c
  consitify do_mount() arguments
  lglock: add DEFINE_STATIC_LGLOCK()
  lglock: make the per_cpu locks static
  lglock: remove unused DEFINE_LGLOCK_LOCKDEP()
  MAX_LFS_FILESIZE definition for 64bit needs LL...
  tmpfs,ceph,gfs2,isofs,reiserfs,xfs: fix fh_len checking
  vfs: drop lock/unlock super
  ufs: drop lock/unlock super
  sysv: drop lock/unlock super
  hpfs: drop lock/unlock super
  fat: drop lock/unlock super
  ext3: drop lock/unlock super
  exofs: drop lock/unlock super
  dup3: Return an error when oldfd == newfd.
  fs: handle failed audit_log_start properly
  fs: prevent use after free in auditing when symlink following was denied

11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Linus Torvalds [Fri, 12 Oct 2012 01:49:08 +0000 (10:49 +0900)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/signal

Pull pile 2 of execve and kernel_thread unification work from Al Viro:
 "Stuff in there: kernel_thread/kernel_execve/sys_execve conversions for
  several more architectures plus assorted signal fixes and cleanups.

  There'll be more (in particular, real fixes for the alpha
  do_notify_resume() irq mess)..."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (43 commits)
  alpha: don't open-code trace_report_syscall_{enter,exit}
  Uninclude linux/freezer.h
  m32r: trim masks
  avr32: trim masks
  tile: don't bother with SIGTRAP in setup_frame
  microblaze: don't bother with SIGTRAP in setup_rt_frame()
  mn10300: don't bother with SIGTRAP in setup_frame()
  frv: no need to raise SIGTRAP in setup_frame()
  x86: get rid of duplicate code in case of CONFIG_VM86
  unicore32: remove pointless test
  h8300: trim _TIF_WORK_MASK
  parisc: decide whether to go to slow path (tracesys) based on thread flags
  parisc: don't bother looping in do_signal()
  parisc: fix double restarts
  bury the rest of TIF_IRET
  sanitize tsk_is_polling()
  bury _TIF_RESTORE_SIGMASK
  unicore32: unobfuscate _TIF_WORK_MASK
  mips: NOTIFY_RESUME is not needed in TIF masks
  mips: merge the identical "return from syscall" per-ABI code
  ...

Conflicts:
arch/arm/include/asm/thread_info.h

11 years agoMerge branch 'writeback-for-next' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 12 Oct 2012 01:46:03 +0000 (10:46 +0900)]
Merge branch 'writeback-for-next' of git://git./linux/kernel/git/wfg/linux

Pull writeback fixes from Fengguang Wu:
 "Three trivial writeback fixes"

* 'writeback-for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
  CPU hotplug, writeback: Don't call writeback_set_ratelimit() too often during hotplug
  writeback: correct comment for move_expired_inodes()
  backing-dev: use kstrto* in preference to simple_strtoul

11 years agomake sure that kernel_thread() callbacks call do_exit() themselves
Al Viro [Thu, 11 Oct 2012 00:09:44 +0000 (20:09 -0400)]
make sure that kernel_thread() callbacks call do_exit() themselves

Most of them never returned anyway - only two functions had to be
changed.  That allows to simplify their callers a whole lot.

Note that this does *not* apply to kthread_run() callbacks - all of
those had been called from the same kernel_thread() callback, which
did do_exit() already.  This is strictly about very few low-level
kernel_thread() callbacks (there are only 6 of those, mostly as part
of kthread.h and kmod.h exported mechanisms, plus kernel_init()
itself).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
11 years agomake sure that we always have a return path from kernel_execve()
Al Viro [Wed, 10 Oct 2012 23:57:26 +0000 (19:57 -0400)]
make sure that we always have a return path from kernel_execve()

The only place where kernel_execve() is called without a way to
return to the caller of kernel_thread() callback is kernel_post().
Reorganize kernel_init()/kernel_post() - instead of the former
calling the latter in the end (and getting freed by it), have the
latter *begin* with calling the former (and turn the latter into
kernel_thread() callback, of course).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
11 years agoppc: eeh_event should just use kthread_run()
Al Viro [Tue, 2 Oct 2012 19:32:10 +0000 (15:32 -0400)]
ppc: eeh_event should just use kthread_run()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
11 years agodon't bother with kernel_thread/kernel_execve for launching linuxrc
Al Viro [Tue, 2 Oct 2012 19:29:10 +0000 (15:29 -0400)]
don't bother with kernel_thread/kernel_execve for launching linuxrc

exec_usermodehelper_fns() will do just fine...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
11 years agoalpha: get rid of switch_stack argument of do_work_pending()
Al Viro [Thu, 11 Oct 2012 03:50:59 +0000 (23:50 -0400)]
alpha: get rid of switch_stack argument of do_work_pending()

... and now the asm glue side of that.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
11 years agoalpha: don't bother passing switch_stack separately from regs
Al Viro [Wed, 5 Sep 2012 22:53:18 +0000 (18:53 -0400)]
alpha: don't bother passing switch_stack separately from regs

It's needed only in setup_sigcontext() and it's always reg - <constant>;
no point passing it all way down through the call chain.  This is just
the signal.c side of that stuff; next will come the asm glue one...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
11 years agoalpha: take SIGPENDING/NOTIFY_RESUME loop into signal.c
Al Viro [Wed, 5 Sep 2012 22:30:34 +0000 (18:30 -0400)]
alpha: take SIGPENDING/NOTIFY_RESUME loop into signal.c

Turn the slow side of work_pending into C function, including all
the looping.  What we get out of that:
* we do _not_ call get_signal_to_deliver() with IRQs disabled
anymore
* no need to save/restore volatiles on each pass if there
turns to be more than one (unlikely, but still)
* all double-restart prevention is in C now.
* glue gets simpler.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
11 years agoalpha: simplify TIF_NEED_RESCHED handling
Al Viro [Wed, 5 Sep 2012 22:08:40 +0000 (18:08 -0400)]
alpha: simplify TIF_NEED_RESCHED handling

In case we have both NEED_RESCHED and SIGPENDING/NOTIFY_RESUME,
handle the latter first.  We'll get to original priorities in
the next commit, but now that allows to simplify the treatment
of NEED_RESCHED-only case nicely.  Namely, now there no need to
preserve the data for restarts across the call of schedule() in
$work_resched; we can get there only if we had either returned
from syscall without SIGPENDING (in which case we should've
had no restart-worthy return value and want no restarts) or
already got through do_notify_resume() call (in which case we
want no restarts anymore).  So we can just slap 0 into $19
instead of preserving it (and $20).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
11 years agoMerge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Linus Torvalds [Fri, 12 Oct 2012 01:32:29 +0000 (10:32 +0900)]
Merge branch 'misc' of git://git./linux/kernel/git/mmarek/kbuild

Pull kbuild misc changes from Michal Marek:
 "In the non-critical part of kbuild, I have
   - Some make coccicheck improvements and two new tests
   - Support for a cleaner html output in scripts/kernel-doc, named
     html5 (no, it does not play videos, yet)

  BTW, Randy wants to route further kernel-doc patches through the
  kbuild tree."

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  Update SmPL/Coccinelle section of MAINTAINERS
  coccicheck: Add the rep+ctxt mode
  scripts/coccinelle/tests/odd_ptr_err.cocci: semantic patch for IS_ERR/PTR_ERR inconsistency
  scripts/tags.sh: Add magic for pci access functions
  scripts/coccinelle: ptr_ret: Add ternary operator version
  scripts/kernel-doc: drop maintainer
  scripts/kernel-doc: added support for html5

11 years agoMerge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Linus Torvalds [Fri, 12 Oct 2012 01:28:52 +0000 (10:28 +0900)]
Merge branch 'kconfig' of git://git./linux/kernel/git/mmarek/kbuild

Pull kconfig changes from Michal Marek:
 "kconfig in v3.7 is going to
   - initialize ncurses only once in menuconfig
   - be able to jump to a search result in menuconfig
   - change the misnomer oldnoconfig to a more meaningful name
     olddefconfig, keeping the old name as alias"

* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kconfig: replace 'oldnoconfig' with 'olddefconfig', and keep the old name as an alias
  menuconfig: Assign jump keys per-page instead of globally
  menuconfig: Do not open code textbox scroll up/down
  menuconfig: Add jump keys to search results
  menuconfig: Extend dialog_textbox so that it can return to a scrolled position
  menuconfig: Extend dialog_textbox so that it can exit on arbitrary keypresses
  menuconfig: Remove superfluous conditionnal
  kconfig: document oldnoconfig to what it really does in conf.c
  kconfig/mconf.c: revision of curses initialization.

11 years agoMerge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Linus Torvalds [Fri, 12 Oct 2012 01:27:27 +0000 (10:27 +0900)]
Merge branch 'kbuild' of git://git./linux/kernel/git/mmarek/kbuild

Pull kbuild changes from Michal Marek:
 "The main part of kbuild for v3.7 contains:
   - Fix for scripts/Makefile.modpost to not choke on a '.ko' substring
     in the build directory path
   - Two warning fixes (modpost and main Makefile)
   - __compiletime_error works also with gcc 4.3
   - make tar{gz,bz2,xz}-pkg uses default compression settings instead
     of saving as many bytes as possible (this should actually be in the
     misc branch, I don't know why I applied it here)."

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  compiler-gcc4.h: correct verion check for __compiletime_error
  modpost: Permit .GCC.command.line sections
  Kbuild: use normal compression settings for tar*-pkg
  scripts/Makefile.modpost: error in finding modules from .mod files.
  kbuild: Remove useless warning while appending KCFLAGS

11 years agoMerge tag 'fbdev-updates-for-3.7' of git://github.com/schandinat/linux-2.6
Linus Torvalds [Fri, 12 Oct 2012 01:21:02 +0000 (10:21 +0900)]
Merge tag 'fbdev-updates-for-3.7' of git://github.com/schandinat/linux-2.6

Pull fbdev updates from Florian Tobias Schandinat:
 "This includes:
   - large updates for OMAP
     - basic OMAP5 DSS support for DPI and DSI outputs
     - large cleanups and restructuring
   - some update to Exynos and da8xx-fb
   - removal of the pnx4008 driver (arch removed)
   - various other small patches"

Fix up some trivial conflicts (mostly just include line changes, but
also some due to the renaming of the deferred work functions by Tejun).

* tag 'fbdev-updates-for-3.7' of git://github.com/schandinat/linux-2.6: (193 commits)
  gbefb: fix compile error
  video: mark nuc900fb_map_video_memory as __devinit
  video/mx3fb: set .owner to prevent module unloading while being used
  video: exynos_dp: use clk_prepare_enable and clk_disable_unprepare
  drivers/video/exynos/exynos_mipi_dsi.c: fix error return code
  drivers/video/savage/savagefb_driver.c: fix error return code
  video: s3c-fb: use clk_prepare_enable and clk_disable_unprepare
  da8xx-fb: save and restore LCDC context across suspend/resume cycle
  da8xx-fb: add pm_runtime support
  video/udlfb: fix line counting in fb_write
  OMAPDSS: add missing include for string.h
  OMAPDSS: DISPC: Configure color conversion coefficients for writeback
  OMAPDSS: DISPC: Add manager like functions for writeback
  OMAPDSS: DISPC: Configure writeback FIFOs
  OMAPDSS: DISPC: Configure writeback specific parameters in dispc_wb_setup()
  OMAPDSS: DISPC: Configure overlay-like parameters in dispc_wb_setup
  OMAPDSS: DISPC: Add function to set channel in for writeback
  OMAPDSS: DISPC: Don't set chroma resampling bit for writeback
  OMAPDSS: DISPC: Downscale chroma if plane is writeback
  OMAPDSS: DISPC: Configure input and output sizes for writeback
  ...

11 years agoMerge tag 'for-linus-merge-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 12 Oct 2012 00:59:23 +0000 (09:59 +0900)]
Merge tag 'for-linus-merge-3.7' of git://git./linux/kernel/git/ericvh/v9fs

Pull v9fs update from Eric Van Hensbergen.

* tag 'for-linus-merge-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  9P: Fix race between p9_write_work() and p9_fd_request()
  9P: Fix race in p9_write_work()
  9P: fix test at the end of p9_write_work()
  9P: Fix race in p9_read_work()
  9p: don't use __getname/__putname for uname/aname
  net/9p: Check errno validity
  fs/9p: avoid debug OOPS when reading a long symlink

11 years agovfs: bogus warnings in fs/namei.c
Arnd Bergmann [Thu, 11 Oct 2012 13:20:00 +0000 (13:20 +0000)]
vfs: bogus warnings in fs/namei.c

The follow_link() function always initializes its *p argument,
or returns an error, but when building with 'gcc -s', the compiler
gets confused by the __always_inline attribute to the function
and can no longer detect where the cookie was initialized.

The solution is to always initialize the pointer from follow_link,
even in the error path. When building with -O2, this has zero impact
on generated code and adds a single instruction in the error path
for a -Os build on ARM.

Without this patch, building with gcc-4.6 through gcc-4.8 and
CONFIG_CC_OPTIMIZE_FOR_SIZE results in:

fs/namei.c: In function 'link_path_walk':
fs/namei.c:649:24: warning: 'cookie' may be used uninitialized in this function [-Wuninitialized]
fs/namei.c:1544:9: note: 'cookie' was declared here
fs/namei.c: In function 'path_lookupat':
fs/namei.c:649:24: warning: 'cookie' may be used uninitialized in this function [-Wuninitialized]
fs/namei.c:1934:10: note: 'cookie' was declared here
fs/namei.c: In function 'path_openat':
fs/namei.c:649:24: warning: 'cookie' may be used uninitialized in this function [-Wuninitialized]
fs/namei.c:2899:9: note: 'cookie' was declared here

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
11 years agoconsitify do_mount() arguments
Al Viro [Thu, 11 Oct 2012 15:42:01 +0000 (11:42 -0400)]
consitify do_mount() arguments

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
11 years agoUAPI: (Scripted) Disintegrate include/linux/mmc
David Howells [Tue, 9 Oct 2012 08:48:45 +0000 (09:48 +0100)]
UAPI: (Scripted) Disintegrate include/linux/mmc

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: mxs-mmc: Fix merge issue causing build error
Marek Vasut [Mon, 1 Oct 2012 20:52:43 +0000 (20:52 +0000)]
mmc: mxs-mmc: Fix merge issue causing build error

The following error appeared due to a merge problem; the patches:

fc108d24 "mmc: mxs-mmc: fix deadlock caused by recursion loop"
829c1bf4 "mmc: spi: Pull out parts shared between MMC and SPI"

came in through separate branches and cause this build error when
combined.

drivers/mmc/host/mxs-mmc.c: In function 'mxs_mmc_enable_sdio_irq':
drivers/mmc/host/mxs-mmc.c:527:3: error: 'struct mxs_mmc_host' has no member named 'base'
drivers/mmc/host/mxs-mmc.c:527:3: error: 'struct mxs_mmc_host' has no member named 'devid'
make[3]: *** [drivers/mmc/host/mxs-mmc.o] Error 1

This patch corrects the issue.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agocompiler-gcc4.h: correct verion check for __compiletime_error
Daniel Santos [Fri, 28 Sep 2012 23:20:02 +0000 (18:20 -0500)]
compiler-gcc4.h: correct verion check for __compiletime_error

__attribute__((error(msg))) was introduced in gcc 4.3 (not 4.4) and as I
was unable to find any gcc bugs pertaining to it, I'm presuming that it
has functioned as advertised since 4.3.0.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: David Rientjes <rientjes@google.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
11 years agomodpost: Permit .GCC.command.line sections
Jonathan Kliegman [Thu, 4 Oct 2012 20:32:19 +0000 (16:32 -0400)]
modpost: Permit .GCC.command.line sections

Allow .GCC.command.line sections in modules to prevent modpost warnings:
WARNING: sound/usb/snd-usbmidi-lib.o (.GCC.command.line): unexpected non-allocatable section.
Did you forget to use "ax"/"aw" in a .S file?
Note that for example <linux/init.h> contains
section definitions for use in .S files.

Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
11 years agousbnet: Support devices reporting idleness
Oliver Neukum [Thu, 11 Oct 2012 02:50:10 +0000 (02:50 +0000)]
usbnet: Support devices reporting idleness

Some device types support a form of power management in which
the device suggests to the host that the device may be suspended
now. Support for that is best located in usbnet.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoAdd CDC-ACM support for the CX93010-2x UCMxx USB Modem
Jean-Christian de Rivaz [Wed, 10 Oct 2012 12:49:02 +0000 (12:49 +0000)]
Add CDC-ACM support for the CX93010-2x UCMxx USB Modem

This USB V.92/V.32bis Controllered Modem have the USB vendor ID 0x0572
and device ID 0x1340. It need the NO_UNION_NORMAL quirk to be recognized.

Reference:
http://www.conexant.com/servlets/DownloadServlet/DSH-201723-005.pdf?docid=1725&revid=5
See idVendor and idProduct in table 6-1. Device Descriptors

Signed-off-by: Jean-Christian de Rivaz <jc@eclis.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/ethernet/jme: disable ASPM
Kevin Baradon [Wed, 10 Oct 2012 10:50:49 +0000 (10:50 +0000)]
net/ethernet/jme: disable ASPM

Based on patch from Matthew Garrett <mjg@redhat.com> (https://lkml.org/lkml/2011/11/11/168).

http://driveragent.com/archive/30421/7-0-14 indicates that ASPM is
disabled on the 250 and 260. Duplicate for sanity.

Fixes random RX engine hangs I experienced with JMC250 on Clevo W270HU.

Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com>
Cc: Guo-Fu Tseng <cooldavid@cooldavid.org>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge tag 'disintegrate-wimax-20121009' of git://git.infradead.org/users/dhowells...
David S. Miller [Thu, 11 Oct 2012 19:15:35 +0000 (15:15 -0400)]
Merge tag 'disintegrate-wimax-20121009' of git://git.infradead.org/users/dhowells/linux-headers

UAPI Disintegration 2012-10-09

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotcp: sysctl interface leaks 16 bytes of kernel memory
Alan Cox [Thu, 11 Oct 2012 06:24:14 +0000 (06:24 +0000)]
tcp: sysctl interface leaks 16 bytes of kernel memory

If the rc_dereference of tcp_fastopen_ctx ever fails then we copy 16 bytes
of kernel stack into the proc result.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agokaweth: print correct debug ptr
Alan Cox [Thu, 11 Oct 2012 06:22:03 +0000 (06:22 +0000)]
kaweth: print correct debug ptr

We nowdays copy the buffer and free fw->data, so make the debug printk use
the right thing.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'staging/for_v3.7' into v4l_for_linus
Mauro Carvalho Chehab [Thu, 11 Oct 2012 18:07:19 +0000 (15:07 -0300)]
Merge branch 'staging/for_v3.7' into v4l_for_linus

Applied on the top of changeset 782cd9e, as some of those patches
depend on some fixes that went via -arm tree.

* staging/for_v3.7: (109 commits)
  [media] m5mols: Add missing #include <linux/sizes.h>
  [media] stk1160: Add support for S-Video input
  Revert "[media] omap3isp: Replace cpu_is_omap3630() with ISP revision check"
  [media]  dvb: LNA implementation changes
  [media] v4l2-ioctl: fix W=1 warnings
  [media] v4l2-ioctl: add blocks check for VIDIOC_SUBDEV_G/S_EDID
  [media] omap3isp: Fix compilation error in ispreg.h
  [media] rc-msi-digivox-ii: Add full scan keycodes
  [media] cx25821: testing the wrong variable
  [media] tda18271-common: hold the I2C adapter during write transfers
  [media] ds3000: add module parameter to force firmware upload
  [media] drivers/media: Remove unnecessary semicolon
  [media] winbond: remove space from driver name
  [media] iguanair: cannot send data from the stack
  [media] omap3isp: Replace cpu_is_omap3630() with ISP revision check
  [media] dvb-usb: print small buffers via %*ph
  [media] uvc: Add return code check at vb2_queue_init()
  [media] em28xx: Replace memcpy with struct assignment
  [media] bt8xx: Add video4linux control V4L2_CID_COLOR_KILLER
  [media] mem2mem_testdev: Use devm_kzalloc() in probe
  ...

11 years ago9P: Fix race between p9_write_work() and p9_fd_request()
Simon Derr [Mon, 17 Sep 2012 13:16:31 +0000 (15:16 +0200)]
9P: Fix race between p9_write_work() and p9_fd_request()

Race scenario:

thread A thread B

p9_write_work()                p9_fd_request()

if (list_empty
  (&m->unsent_req_list))
  ...

                               spin_lock(&client->lock);
                               req->status = REQ_STATUS_UNSENT;
                               list_add_tail(..., &m->unsent_req_list);
                               spin_unlock(&client->lock);
                               ....
                               if (n & POLLOUT &&
                               !test_and_set_bit(Wworksched, &m->wsched)
                               schedule_work(&m->wq);
                               --> not done because Wworksched is set

  clear_bit(Wworksched, &m->wsched);
  return;

--> nobody will take care of sending the new request.

This is not very likely to happen though, because p9_write_work()
being called with an empty unsent_req_list is not frequent.
But this also means that taking the lock earlier will not be costly.

Signed-off-by: Simon Derr <simon.derr@bull.net>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
11 years agoMerge Trond's bugfixes
J. Bruce Fields [Thu, 11 Oct 2012 16:40:00 +0000 (12:40 -0400)]
Merge Trond's bugfixes

Merge branch 'bugfixes' of git://linux-nfs.org/~trondmy/nfs-2.6 into
for-3.7-incoming.  Mainly needed for Bryan's "SUNRPC: Set alloc_slot for
backchannel tcp ops", without which the 4.1 server oopses.

11 years agoUpdate SmPL/Coccinelle section of MAINTAINERS
Nicolas Palix [Thu, 20 Sep 2012 20:52:42 +0000 (22:52 +0200)]
Update SmPL/Coccinelle section of MAINTAINERS

This patch updates some email addresses and the new
mailing list address.

Signed-off-by: Nicolas Palix <nicolas.palix@imag.fr>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
11 years agococcicheck: Add the rep+ctxt mode
Nicolas Palix [Thu, 20 Sep 2012 20:30:46 +0000 (22:30 +0200)]
coccicheck: Add the rep+ctxt mode

This adds a 'rep+ctxt' mode which prints the warning
message followed by the context.

Signed-off-by: Nicolas Palix <nicolas.palix@imag.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
11 years agoscripts/coccinelle/tests/odd_ptr_err.cocci: semantic patch for IS_ERR/PTR_ERR inconsi...
Julia Lawall [Sat, 25 Aug 2012 20:42:45 +0000 (22:42 +0200)]
scripts/coccinelle/tests/odd_ptr_err.cocci: semantic patch for IS_ERR/PTR_ERR inconsistency

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
11 years agoMerge tag 'disintegrate-arm64-20121011' of git://git.infradead.org/users/dhowells...
Catalin Marinas [Thu, 11 Oct 2012 10:51:41 +0000 (11:51 +0100)]
Merge tag 'disintegrate-arm64-20121011' of git://git.infradead.org/users/dhowells/linux-headers into uapi

UAPI Disintegration 2012-10-11

* tag 'disintegrate-arm64-20121011' of git://git.infradead.org/users/dhowells/linux-headers:
  UAPI: (Scripted) Disintegrate arch/arm64/include/asm

11 years agoMerge branch 'tpmdd-next-v3.6' of git://github.com/shpedoikal/linux into for-linus
James Morris [Thu, 11 Oct 2012 10:41:29 +0000 (18:41 +0800)]
Merge branch 'tpmdd-next-v3.6' of git://github.com/shpedoikal/linux into for-linus

11 years agoMerge branch 'tpmdd-fixes-v3.6' of git://github.com/shpedoikal/linux into for-linus
James Morris [Thu, 11 Oct 2012 10:40:09 +0000 (18:40 +0800)]
Merge branch 'tpmdd-fixes-v3.6' of git://github.com/shpedoikal/linux into for-linus

11 years agoUAPI: (Scripted) Disintegrate arch/arm64/include/asm
David Howells [Thu, 11 Oct 2012 10:05:13 +0000 (11:05 +0100)]
UAPI: (Scripted) Disintegrate arch/arm64/include/asm

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Dave Jones <davej@redhat.com>
11 years agoMerge branch 'fixes' into for-linus
Russell King [Thu, 11 Oct 2012 09:55:04 +0000 (10:55 +0100)]
Merge branch 'fixes' into for-linus

Conflicts:
arch/arm/kernel/smp.c

11 years agoarm64: Do not export the compat-specific definitions to the user
Catalin Marinas [Wed, 10 Oct 2012 14:50:03 +0000 (15:50 +0100)]
arm64: Do not export the compat-specific definitions to the user

This patch adds #ifdef __KERNEL__ guards around the COMPAT_* definitions
to avoid exporting them to user. AArch32 user requiring the kernel
headers must use those generated with ARCH=arm.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
11 years agoarm64: Do not include asm/unistd32.h in asm/unistd.h
Catalin Marinas [Wed, 10 Oct 2012 14:27:04 +0000 (15:27 +0100)]
arm64: Do not include asm/unistd32.h in asm/unistd.h

This patch only includes asm/unistd32.h where necessary and removes its
inclusion in the asm/unistd.h file. The __SYSCALL_COMPAT guard is
dropped.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
11 years agoarm64: Remove unused definitions from asm/unistd32.h
Catalin Marinas [Wed, 10 Oct 2012 14:16:13 +0000 (15:16 +0100)]
arm64: Remove unused definitions from asm/unistd32.h

This patch removes the compat __NR_* definitions from the unistd32.h
file and only keeps those that are used by the AArch64 kernel with a new
__NR_compat_* prefix. The additional wrapper definitions in
arch/arm64/kernel/sys32.S have been removed and the actual wrapper names
included in the asm/unistd32.h file.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
11 years agoopenrisc: mask interrupts in irq_mask_ack function
Gong Tao [Fri, 21 Sep 2012 06:49:58 +0000 (08:49 +0200)]
openrisc: mask interrupts in irq_mask_ack function

or1k_pic_mask_ack was failing to actually mask the IRQ.

Signed-off-by: Gong Tao <gongtao0607@gmail.com>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
11 years agoopenrisc: fix typos in comments and warnings
Jonas Bonn [Fri, 21 Sep 2012 07:19:48 +0000 (09:19 +0200)]
openrisc: fix typos in comments and warnings

Signed-off-by: Jonas Bonn <jonas@southpole.se>
11 years agoopenrisc: PIC should act on domain-local irqs
Jonas Bonn [Fri, 21 Sep 2012 07:17:32 +0000 (09:17 +0200)]
openrisc: PIC should act on domain-local irqs

Now that IRQ domains are in use, we should be acting on domain-local
IRQ numbers (hwirq) instead of 'global' ones.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
11 years agoopenrisc: Make cpu_relax() invoke barrier()
Vladimir Murzin [Mon, 17 Sep 2012 16:57:08 +0000 (20:57 +0400)]
openrisc: Make cpu_relax() invoke barrier()

Make cpu_relax() invoke barrier() to be the same as other arches.

Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
11 years agoMerge branch 'next' into for-linus
Dmitry Torokhov [Thu, 11 Oct 2012 07:45:21 +0000 (00:45 -0700)]
Merge branch 'next' into for-linus

Prepare second set of updates for 3.7 merge window (Wacom driver update
and patches extending number of input minors).

11 years agomd: refine reporting of resync/reshape delays.
NeilBrown [Thu, 11 Oct 2012 03:25:57 +0000 (14:25 +1100)]
md: refine reporting of resync/reshape delays.

If 'resync_max' is set to 0 (as is often done when starting a
reshape, so the mdadm can remain in control during a sensitive
period), and if the reshape request is initially delayed because
another array using the same array is resyncing or reshaping etc,
when user-space cannot easily tell when the delay changes from being
due to a conflicting reshape, to being due to resync_max = 0.

So introduce a new state: (curr_resync == 3) to reflect this, make
sure it is visible both via /proc/mdstat and via the "sync_completed"
sysfs attribute, and ensure that the event transition from one delay
state to the other is properly notified.

Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd/raid5: be careful not to resize_stripes too big.
NeilBrown [Thu, 11 Oct 2012 03:24:13 +0000 (14:24 +1100)]
md/raid5: be careful not to resize_stripes too big.

When a RAID5 is reshaping, conf->raid_disks is increased
before mddev->delta_disks becomes zero.
This can result in check_reshape calling resize_stripes with a
number that is too large.  This particularly happens
when md_check_recovery calls ->check_reshape().

If we use ->previous_raid_disks, we don't risk this.

Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd: make sure manual changes to recovery checkpoint are saved.
NeilBrown [Thu, 11 Oct 2012 03:22:17 +0000 (14:22 +1100)]
md: make sure manual changes to recovery checkpoint are saved.

If you make an array bigger but suppress resync of the new region with
  mdadm --grow /dev/mdX --size=max --assume-clean

then stop the array before anything is written to it, the effect of
the "--assume-clean" is lost and the array will resync the new space
when restarted.
So ensure that we update the metadata in the case.

Reported-by: Sebastian Riemer <sebastian.riemer@profitbricks.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd/raid10: use correct limit variable
Dan Carpenter [Thu, 11 Oct 2012 03:20:58 +0000 (14:20 +1100)]
md/raid10: use correct limit variable

Clang complains that we are assigning a variable to itself.  This should
be using bad_sectors like the similar earlier check does.

Bug has been present since 3.1-rc1.  It is minor but could
conceivably cause corruption or other bad behaviour.

Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd: writing to sync_action should clear the read-auto state.
NeilBrown [Thu, 11 Oct 2012 03:19:39 +0000 (14:19 +1100)]
md: writing to sync_action should clear the read-auto state.

In some cases array are started in 'read-auto' state where in
nothing gets written to any device until the array is written
to.  The purpose of this is to make accidental auto-assembly
of the wrong arrays less of a risk, and to allow arrays to be
started to read suspend-to-disk images without actually changing
anything (as might happen if the array were dirty and a
resync seemed necessary).

Explicitly writing the 'sync_action' for a read-auto array currently
doesn't clear the read-auto state, so the sync action doesn't
happen, which can be confusing.

So allow any successful write to sync_action to clear any read-auto
state.

Reported-by: Alexander Kühn <alexander.kuehn@nagilum.de>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoSubject: [PATCH] md:change resync_mismatches to atomic64_t to avoid races
Jianpeng Ma [Thu, 11 Oct 2012 03:17:59 +0000 (14:17 +1100)]
Subject: [PATCH] md:change resync_mismatches to atomic64_t to avoid races

Now that multiple threads can handle stripes, it is safer to
use an atomic64_t for resync_mismatches, to avoid update races.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoe1000e: Change wthresh to 1 to avoid possible Tx stalls
Hiroaki SHIMODA [Wed, 10 Oct 2012 15:34:20 +0000 (15:34 +0000)]
e1000e: Change wthresh to 1 to avoid possible Tx stalls

This patch originated from Hiroaki SHIMODA but has been modified
by Intel with some minor cleanups and additional commit log text.

Denys Fedoryshchenko and others reported Tx stalls on e1000e with
BQL enabled.  Issue was root caused to hardware delays. They were
introduced because some of the e1000e hardware with transmit
writeback bursting enabled, waits until the driver does an
explict flush OR there are WTHRESH descriptors to write back.

Sometimes the delays in question were on the order of seconds,
causing visible lag for ssh sessions and unacceptable tx
completion latency, especially for BQL enabled kernels.

To avoid possible Tx stalls, change WTHRESH back to 1.

The current plan is to investigate a method for re-enabling
WTHRESH while not harming BQL, but those patches will be later
for net-next if they work.

please enqueue for stable since v3.3 as this bug was introduced in
commit 3f0cfa3bc11e7f00c9994e0f469cbc0e7da7b00c
Author: Tom Herbert <therbert@google.com>
Date:   Mon Nov 28 16:33:16 2011 +0000

    e1000e: Support for byte queue limits

    Changes to e1000e to use byte queue limits.

Reported-by: Denys Fedoryshchenko <denys@visp.net.lb>
Tested-by: Denys Fedoryshchenko <denys@visp.net.lb>
Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
CC: eric.dumazet@gmail.com
CC: therbert@google.com
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'uapi-for-3.7' of git://gitorious.org/linux-can/linux-can
David S. Miller [Thu, 11 Oct 2012 02:57:16 +0000 (22:57 -0400)]
Merge branch 'uapi-for-3.7' of git://gitorious.org/linux-can/linux-can

Marc Kleine-Budde says:

====================
this pull request for net, i.e. the v3.7 release cycle, contains the patch by
David Howells to move the UAPI related headers for the CAN subsystem.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv4: fix route mark sparse warning
stephen hemminger [Wed, 10 Oct 2012 08:27:25 +0000 (08:27 +0000)]
ipv4: fix route mark sparse warning

Sparse complains about RTA_MARK which is should be host order according
to include file and usage in iproute.

net/ipv4/route.c:2223:46: warning: incorrect type in argument 3 (different base types)
net/ipv4/route.c:2223:46:    expected restricted __be32 [usertype] value
net/ipv4/route.c:2223:46:    got unsigned int [unsigned] [usertype] flowic_mark

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoxen: netback: handle compound page fragments on transmit.
Ian Campbell [Wed, 10 Oct 2012 03:48:42 +0000 (03:48 +0000)]
xen: netback: handle compound page fragments on transmit.

An SKB paged fragment can consist of a compound page with order > 0.
However the netchannel protocol deals only in PAGE_SIZE frames.

Handle this in netbk_gop_frag_copy and xen_netbk_count_skb_slots by
iterating over the frames which make up the page.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobridge: Pull ip header into skb->data before looking into ip header.
Sarveshwar Bandi [Wed, 10 Oct 2012 01:15:01 +0000 (01:15 +0000)]
bridge: Pull ip header into skb->data before looking into ip header.

If lower layer driver leaves the ip header in the skb fragment, it needs to
be first pulled into skb->data before inspecting ip header length or ip version
number.

Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoisdn: fix a wrapping bug in isdn_ppp_ioctl()
Dan Carpenter [Tue, 9 Oct 2012 23:42:18 +0000 (23:42 +0000)]
isdn: fix a wrapping bug in isdn_ppp_ioctl()

"protos" is an array of unsigned longs and "i" is the number of bits in
an unsigned long so we need to use 1UL as well to prevent the shift
from wrapping around.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agomd/raid5: make sure to_read and to_write never go negative.
NeilBrown [Thu, 11 Oct 2012 02:50:13 +0000 (13:50 +1100)]
md/raid5: make sure to_read and to_write never go negative.

to_read and to_write are part of the result of analysing
a stripe before handling it.
Their use is to avoid some loops and tests if the values are
known to be zero.  Thus it is not a problem if they are a
little bit larger than they should be.

So decrementing them in handle_failed_stripe serves little value, and
due to races it could cause some loops to be skipped incorrectly.

So remove those decrements.

Reported-by: "Jianpeng Ma" <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd: When RAID5 is dirty, force reconstruct-write instead of read-modify-write.
Alexander Lyakas [Thu, 11 Oct 2012 02:50:12 +0000 (13:50 +1100)]
md: When RAID5 is dirty, force reconstruct-write instead of read-modify-write.

Signed-off-by: Alex Lyakas <alex@zadarastorage.com>
Suggested-by: Yair Hershko <yair@zadarastorage.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd/raid5: protect debug message against NULL derefernce.
NeilBrown [Thu, 11 Oct 2012 02:50:12 +0000 (13:50 +1100)]
md/raid5: protect debug message against NULL derefernce.

The pr_debug in add_stripe_bio could race with something
changing *bip, so it is best to hold the lock until
after the pr_debug.

Reported-by: "Jianpeng Ma" <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd/raid5: add some missing locking in handle_failed_stripe.
NeilBrown [Thu, 11 Oct 2012 02:50:12 +0000 (13:50 +1100)]
md/raid5: add some missing locking in handle_failed_stripe.

We really should hold the stripe_lock while accessing
'toread' else we could race with add_stripe_bio and corrupt
a list.

Reported-by: "Jianpeng Ma" <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoMD: raid5 avoid unnecessary zero page for trim
Shaohua Li [Thu, 11 Oct 2012 02:49:49 +0000 (13:49 +1100)]
MD: raid5 avoid unnecessary zero page for trim

We want to avoid zero discarded dev page, because it's useless for discard.
But if we don't zero it, another read/write hit such page in the cache and will
get inconsistent data.

To avoid zero the page, we don't set R5_UPTODATE flag after construction is
done. In this way, discard write request is still issued and finished, but read
will not hit the page. If the stripe gets accessed soon, we need reread the
stripe, but since the chance is low, the reread isn't a big deal.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoMD: raid5 trim support
Shaohua Li [Thu, 11 Oct 2012 02:49:05 +0000 (13:49 +1100)]
MD: raid5 trim support

Discard for raid4/5/6 has limitation. If discard request size is
small, we do discard for one disk, but we need calculate parity and
write parity disk.  To correctly calculate parity, zero_after_discard
must be guaranteed. Even it's true, we need do discard for one disk
but write another disks, which makes the parity disks wear out
fast. This doesn't make sense. So an efficient discard for raid4/5/6
should discard all data disks and parity disks, which requires the
write pattern to be (A, A+chunk_size, A+chunk_size*2...). If A's size
is smaller than chunk_size, such pattern is almost impossible in
practice. So in this patch, I only handle the case that A's size
equals to chunk_size. That is discard request should be aligned to
stripe size and its size is multiple of stripe size.

Since we can only handle request with specific alignment and size (or
part of the request fitting stripes), we can't guarantee
zero_after_discard even zero_after_discard is true in low level
drives.

The block layer doesn't send down correctly aligned requests even
correct discard alignment is set, so I must filter out.

For raid4/5/6 parity calculation, if data is 0, parity is 0. So if
zero_after_discard is true for all disks, data is consistent after
discard.  Otherwise, data might be lost. Let's consider a scenario:
discard a stripe, write data to one disk and write parity disk. The
stripe could be still inconsistent till then depending on using data
from other data disks or parity disks to calculate new parity. If the
disk is broken, we can't restore it. So in this patch, we only enable
discard support if all disks have zero_after_discard.

If discard fails in one disk, we face the similar inconsistent issue
above. The patch will make discard follow the same path as normal
write request. If discard fails, a resync will be scheduled to make
the data consistent. This isn't good to have extra writes, but data
consistency is important.

If a subsequent read/write request hits raid5 cache of a discarded
stripe, the discarded dev page should have zero filled, so the data is
consistent. This patch will always zero dev page for discarded request
stripe. This isn't optimal because discard request doesn't need such
payload. Next patch will avoid it.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd/bitmap:Don't use IS_ERR to judge alloc_page().
Jianpeng Ma [Thu, 11 Oct 2012 02:45:36 +0000 (13:45 +1100)]
md/bitmap:Don't use IS_ERR to judge alloc_page().

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd/raid1: Don't release reference to device while handling read error.
NeilBrown [Thu, 11 Oct 2012 02:44:30 +0000 (13:44 +1100)]
md/raid1: Don't release reference to device while handling read error.

When we get a read error, we arrange for raid1d to handle it.
Currently we release the reference on the device.  This can result
in
   conf->mirrors[read_disk].rdev
being NULL in fix_read_error, if the device happens to get removed
before the read error is handled.

So instead keep the reference until the read error has been fully
handled.

Reported-by: hank <pyu@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoraid: replace list_for_each_continue_rcu with new interface
Michael Wang [Thu, 11 Oct 2012 02:43:21 +0000 (13:43 +1100)]
raid: replace list_for_each_continue_rcu with new interface

This patch replaces list_for_each_continue_rcu() with
list_for_each_entry_continue_rcu() to save a few lines
of code and allow removing list_for_each_continue_rcu().

Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoadd further __init annotations to crypto/xor.c
Jan Beulich [Thu, 11 Oct 2012 02:42:32 +0000 (13:42 +1100)]
add further __init annotations to crypto/xor.c

Allow particularly do_xor_speed() to be discarded post-init.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoDM RAID: Fix for "sync" directive ineffectiveness
Jonathan Brassow [Thu, 11 Oct 2012 02:42:19 +0000 (13:42 +1100)]
DM RAID: Fix for "sync" directive ineffectiveness

There are two table arguments that can be given to a DM RAID target
that control whether the array is forced to (re)synchronize or skip
initialization: "sync" and "nosync".  When "sync" is given, we set
mddev->recovery_cp to 0 in order to cause the device to resynchronize.
This is insufficient if there is a bitmap in use, because the array
will simply look at the bitmap and see that there is no recovery
necessary.

The fix is to skip over the loading of the superblocks when "sync" is
given, causing new superblocks to be written that will force the array
to go through initialization (i.e. synchronization).

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agovxlan: fix oops when give unknown ifindex
stephen hemminger [Tue, 9 Oct 2012 20:35:53 +0000 (20:35 +0000)]
vxlan: fix oops when give unknown ifindex

If vxlan is created and the ifindex is passed; there are two cases which
are incorrectly handled by the existing code. The ifindex could be zero
(i.e. no device) or there could be no device with that ifindex.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agovxlan: fix receive checksum handling
stephen hemminger [Tue, 9 Oct 2012 20:35:52 +0000 (20:35 +0000)]
vxlan: fix receive checksum handling

Vxlan was trying to use postpull_rcsum to allow receive checksum
offload to work on drivers using CHECKSUM_COMPLETE method. But this
doesn't work correctly. Just force full receive checksum on received
packet.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agovxlan: add additional headroom
stephen hemminger [Tue, 9 Oct 2012 20:35:51 +0000 (20:35 +0000)]
vxlan: add additional headroom

Tell upper layer protocols to allocate skb with additional headroom.
This avoids allocation and copy in local packet sends.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agovxlan: allow configuring port range
stephen hemminger [Tue, 9 Oct 2012 20:35:50 +0000 (20:35 +0000)]
vxlan: allow configuring port range

VXLAN bases source UDP port based on flow to help the
receiver to be able to load balance based on outer header flow.

This patch restricts the port range to the normal UDP local
ports, and allows overriding via configuration.

It also uses jhash of Ethernet header when looking at flows
with out know L3 header.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agovxlan: associate with tunnel socket on transmit
stephen hemminger [Tue, 9 Oct 2012 20:35:49 +0000 (20:35 +0000)]
vxlan: associate with tunnel socket on transmit

When tunnelling a skb, associate it with the tunnel socket.
This allows parameters set on tunnel socket (like multicast loop
flag), to be picked up by ip_output.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agovxlan: use ip_route_output
stephen hemminger [Tue, 9 Oct 2012 20:35:48 +0000 (20:35 +0000)]
vxlan: use ip_route_output

Select source address for VXLAN packet based on route destination
and don't lie to route code. VXLAN is not GRE.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agovxlan: fix byte order in hash function
stephen hemminger [Tue, 9 Oct 2012 20:35:47 +0000 (20:35 +0000)]
vxlan: fix byte order in hash function

Shift was wrong direction causing packets to hash based on
other parts of the ethernet header, not the address.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agovxlan: minor output refactoring
stephen hemminger [Tue, 9 Oct 2012 20:35:46 +0000 (20:35 +0000)]
vxlan: minor output refactoring

Move code to find destination to a small function.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoof/mdio: Staticise !CONFIG_OF stubs
Mark Brown [Tue, 9 Oct 2012 18:33:38 +0000 (18:33 +0000)]
of/mdio: Staticise !CONFIG_OF stubs

The !CONFIG_OF stubs aren't static so if multiple files include the
header with this configuration then the linker will see multiple
definitions of the stubs.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoDM RAID: Fix comparison of index and quantity for "rebuild" parameter
Jonathan Brassow [Thu, 11 Oct 2012 02:40:36 +0000 (13:40 +1100)]
DM RAID: Fix comparison of index and quantity for "rebuild" parameter

DM RAID: Fix comparison of index and quantity for "rebuild" parameter

The "rebuild" parameter takes an index argument that starts counting from
zero.  The conditional used to validate the index was using '>' rather than
'>=', leaving the door open for an index value that would be 1 too large.

Reported-by: Neil Brown <neilb@suse.de>
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoDM RAID: Add rebuild capability for RAID10
Jonathan Brassow [Thu, 11 Oct 2012 02:40:24 +0000 (13:40 +1100)]
DM RAID: Add rebuild capability for RAID10

DM RAID:  Add code to validate replacement slots for RAID10 arrays

RAID10 can handle 'copies - 1' failures for each mirror group.  This code
ensures the user has provided a valid array - one whose devices specified for
rebuild do not exceed the amount of redundancy available.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoDM RAID: Move 'rebuild' checking code to its own function
Jonathan Brassow [Thu, 11 Oct 2012 02:40:09 +0000 (13:40 +1100)]
DM RAID: Move 'rebuild' checking code to its own function

DM RAID:  Move chunk of code to it's own function

The code that checks whether device replacements/rebuilds are possible given
a specific RAID type is moved to it's own function.  It will further expand
when the code to check RAID10 is added.  A separate function makes it easier
to read.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoMD RAID10: Prep for DM RAID10 device replacement capability
Jonathan Brassow [Thu, 11 Oct 2012 02:38:58 +0000 (13:38 +1100)]
MD RAID10: Prep for DM RAID10 device replacement capability

MD RAID10:  Fix a couple potential kernel panics if RAID10 is used by dm-raid

When device-mapper uses the RAID10 personality through dm-raid.c, there is no
'gendisk' structure in mddev and some sysfs information is also not populated.

This patch avoids touching those non-existent structures.

Signed-off-by: Jonathan Brassow <jbrassow@rehdat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd: avoid taking the mutex on some ioctls.
NeilBrown [Thu, 11 Oct 2012 02:37:33 +0000 (13:37 +1100)]
md: avoid taking the mutex on some ioctls.

Some ioctls don't need to take the mutex and doing so can cause
a delay as it is held during super-block update.
So move those ioctls out of the mutex and rely on rcu locking
to ensure we don't access stale data.

Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoMD: change the parameter of md thread
Shaohua Li [Thu, 11 Oct 2012 02:34:00 +0000 (13:34 +1100)]
MD: change the parameter of md thread

Change the thread parameter, so the thread can carry extra info. Next patch
will use it.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agopktgen: replace scan_ip6() with in6_pton()
Amerigo Wang [Tue, 9 Oct 2012 17:48:20 +0000 (17:48 +0000)]
pktgen: replace scan_ip6() with in6_pton()

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agopktgen: enable automatic IPv6 address setting
Amerigo Wang [Tue, 9 Oct 2012 17:48:19 +0000 (17:48 +0000)]
pktgen: enable automatic IPv6 address setting

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agopktgen: display IPv4 address in human-readable format
Amerigo Wang [Tue, 9 Oct 2012 17:48:18 +0000 (17:48 +0000)]
pktgen: display IPv4 address in human-readable format

It is weird to display IPv4 address in %x format, what's more,
IPv6 address is disaplayed in human-readable format too. So,
make it human-readable.

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agopktgen: set different default min_pkt_size for different protocols
Amerigo Wang [Tue, 9 Oct 2012 17:48:17 +0000 (17:48 +0000)]
pktgen: set different default min_pkt_size for different protocols

ETH_ZLEN is too small for IPv6, so this default value is not
suitable.

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agopktgen: fix crash when generating IPv6 packets
Amerigo Wang [Tue, 9 Oct 2012 17:48:16 +0000 (17:48 +0000)]
pktgen: fix crash when generating IPv6 packets

For IPv6, sizeof(struct ipv6hdr) = 40, thus the following
expression will result negative:

        datalen = pkt_dev->cur_pkt_size - 14 -
                  sizeof(struct ipv6hdr) - sizeof(struct udphdr) -
                  pkt_dev->pkt_overhead;

And,  the check "if (datalen < sizeof(struct pktgen_hdr))" will be
passed as "datalen" is promoted to unsigned, therefore will cause
a crash later.

This is a quick fix by checking if "datalen" is negative. The following
patch will increase the default value of 'min_pkt_size' for IPv6.

This bug should exist for a long time, so Cc -stable too.

Cc: <stable@vger.kernel.org>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agomd/raid10: submit IO from originating thread instead of md thread.
NeilBrown [Thu, 11 Oct 2012 02:32:13 +0000 (13:32 +1100)]
md/raid10: submit IO from originating thread instead of md thread.

queuing writes to the md thread means that all requests go through the
one processor which may not be able to keep up with very high request
rates.

So use the plugging infrastructure to submit all requests on unplug.
If a 'schedule' is needed, we fall back on the old approach of handing
the requests to the thread for it to handle.

This is nearly identical to a recent patch which provided similar
functionality to RAID1.

Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd: raid 10 supports TRIM
Shaohua Li [Thu, 11 Oct 2012 02:30:52 +0000 (13:30 +1100)]
md: raid 10 supports TRIM

This makes md raid 10 support TRIM.

If one disk supports discard and another not, or one has
discard_zero_data and another not, there could be inconsistent between
data from such disks. But this should not matter, discarded data is
useless. This will add extra copy in rebuild though.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd: raid 1 supports TRIM
Shaohua Li [Thu, 11 Oct 2012 02:28:54 +0000 (13:28 +1100)]
md: raid 1 supports TRIM

This makes md raid 1 support TRIM.
If one disk supports discard and another not, or one has discard_zero_data and
another not, there could be inconsistent between data from such disks. But this
should not matter, discarded data is useless. This will add extra copy in rebuild
though.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd: raid 0 supports TRIM
Shaohua Li [Thu, 11 Oct 2012 02:25:44 +0000 (13:25 +1100)]
md: raid 0 supports TRIM

This makes md raid 0 support TRIM.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd: linear supports TRIM
Shaohua Li [Thu, 11 Oct 2012 02:08:44 +0000 (13:08 +1100)]
md: linear supports TRIM

This makes md linear support TRIM.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd/linear: rcu_dereference outside read-lock section
Denis Efremov [Thu, 11 Oct 2012 02:08:02 +0000 (13:08 +1100)]
md/linear: rcu_dereference outside read-lock section

According to the comment in linear_stop function
rcu_dereference in linear_start and linear_stop functions
occurs under reconfig_mutex. The patch represents this
agreement in code and prevents lockdep complaint.

Found by Linux Driver Verification project (linuxtesting.org)

Signed-off-by: Denis Efremov <yefremov.denis@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoMerge branch 'i2c-embedded/for-next' of git://git.pengutronix.de/git/wsa/linux
Linus Torvalds [Thu, 11 Oct 2012 01:27:51 +0000 (10:27 +0900)]
Merge branch 'i2c-embedded/for-next' of git://git.pengutronix.de/git/wsa/linux

Pull i2c-embedded changes from Wolfram Sang:
 "The changes for i2c-embedded include:

   - massive rework of the omap driver
   - massive rework of the at91 driver.  In fact, the old driver gets
     removed; I am okay with this approach since the old driver was
     depending on BROKEN and its limitations made it practically
     unusable, so people used bitbanging instead.  But even if there are
     users, there is no platform_data or module parameter which would
     need to be converted.  It is just another driver doing I2C
     transfers, just way better.  Modifications of arch/arm/at91 related
     files have proper acks from the maintainer.
   - new driver for R-Car I2C
   - devicetree and generic_clock conversions and fixes
   - usual driver fixes and changes.

  The rework patches have come a long way and lots of people have been
  involved in creating/testing them.  Most patches have been in
  linux-next at least since 3.6-rc5.  A few have been added in the last
  week, I have to admit.

  An unexpected (but welcome :)) peak in private life is the cause for
  that.  The "late" patches shouldn't cause any merge conflicts and I
  will have a special eye on them during the stabilization phase.  This
  is an exception and I want to have the patches in place properly in
  time again for the next kernels."

* 'i2c-embedded/for-next' of git://git.pengutronix.de/git/wsa/linux: (44 commits)
  MXS: Implement DMA support into mxs-i2c
  i2c: add Renesas R-Car I2C driver
  i2c: s3c2410: use clk_prepare_enable and clk_disable_unprepare
  ARM: OMAP: convert I2C driver to PM QoS for MPU latency constraints
  i2c: nomadik: Add Device Tree support to the Nomadik I2C driver
  i2c: algo: pca: Fix chip reset function for PCA9665
  i2c: mpc: Wait for STOP to hit the bus
  i2c: davinci: preparation for switch to common clock framework
  omap-i2c: fix incorrect log message when using a device tree
  i2c: omap: sanitize exit path
  i2c: omap: switch over to autosuspend API
  i2c: omap: remove unnecessary pm_runtime_suspended check
  i2c: omap: switch to threaded IRQ support
  i2c: omap: remove redundant status read
  i2c: omap: get rid of the "complete" label
  i2c: omap: resize fifos before each message
  i2c: omap: simplify IRQ exit path
  i2c: omap: always return IRQ_HANDLED
  i2c: omap: simplify errata check
  i2c: omap: bus: add a receiver flag
  ...

11 years agoMerge tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Linus Torvalds [Thu, 11 Oct 2012 01:21:48 +0000 (10:21 +0900)]
Merge tag 'fixes' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "A series of fixes (and in some cases, some cleanups):

  Via Tony Lindgren:
   - A collection of OMAP regression fixes, in particular because
     firmware no longer sets up all pin states before starting the
     kernel.
   - cpufreq fixes for OMAP (Rafael is on vacation and this was
     pre-agreed).
   - A longer series of misc regression fixes and cleanups, warning
     removals, etc for OMAP

  From Arnd Bergmann:
   - A series of warning fixes for various platforms (defconfig builds)

  Misc:
   - A couple of tegra fixes, one for i.MX, some vt8500 fixes, etc."

* tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (73 commits)
  ARM: pxa: armcore: fix PCI PIO warnings
  ARM: integrator: use __iomem pointers for MMIO, part 2
  ARM: assabet: fix bogus warning in get_assabet_scr (again)
  ARM: shmobile: mark shmobile_init_late as __init
  ARM: integrator_cp: fix build failure
  ARM: OMAP4/AM335x: hwmod: fix disable_module regression in hardreset handling
  ARM: OMAP3: fix workaround for EMU clockdomain
  arm/omap: Replace board_ref_clock with enum values
  ARM: OMAP2+: remove duplicated include from board-omap3stalker.c
  arch/arm/plat-omap/omap-pm-noop.c: Remove unecessary semicolon
  arch/arm/mach-omap2: Remove unecessary semicolon
  arch/arm/mach-omap1/devices.c: Remove unecessary semicolon
  ARM/dts: omap5-evm: pinmux configuration for audio
  ARM/dts: Add pinctrl driver entries for omap5
  ARM/dts: omap4-panda: pinmux configuration for audio
  ARM/dts: omap4-sdp: pinmux configuration for audio
  ARM/dts: omap5-evm: Disable unused McBSP3
  ARM/dts: omap4-sdp: Disable unused McBSP3
  ARM/dts: omap4-panda: Disable unused audio IPs
  ARM: OMAP: board-omap4panda: Pin mux configuration for audio needs
  ...