1. 16 May, 2012 4 commits
    • Suresh Siddha's avatar
      x86, fpu: drop the fpu state during thread exit · 1dcc8d7b
      Suresh Siddha authored
      There is no need to save any active fpu state to the task structure
      memory if the task is dead. Just drop the state instead.
      
      For example, this saved some 1770 xsave's during the system boot
      of a two socket Xeon system.
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Link: http://lkml.kernel.org/r/1336692811-30576-4-git-send-email-suresh.b.siddha@intel.com
      Cc: Oleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      1dcc8d7b
    • Suresh Siddha's avatar
      x86, xsave: remove thread_has_fpu() bug check in __sanitize_i387_state() · d75f1b39
      Suresh Siddha authored
      Code paths like fork(), exit() and signal handling flush the fpu
      state explicitly to the structures in memory.
      
      BUG_ON() in __sanitize_i387_state() is checking that the fpu state
      is not live any more. But for preempt kernels, task can be scheduled
      out and in at any place and the preload_fpu logic during context switch
      can make the fpu registers live again.
      
      For example, consider a 64-bit Task which uses fpu frequently and as such
      you will find its fpu_counter mostly non-zero. During its time slice, kernel
      used fpu by doing kernel_fpu_begin/kernel_fpu_end(). After this, in the same
      scheduling slice, task-A got a signal to handle. Then during the signal
      setup path we got preempted when we are just before the sanitize_i387_state()
      in arch/x86/kernel/xsave.c:save_i387_xstate(). And when we come back we
      will have the fpu registers live that can hit the bug_on.
      
      Similarly during core dump, other threads can context-switch in and out
      (because of spurious wakeups while waiting for the coredump to finish in
       kernel/exit.c:exit_mm()) and the main thread dumping core can run into this
      bug when it finds some other thread with its fpu registers live on some other cpu.
      
      So remove the paranoid check for now, even though it caught a bug in the
      multi-threaded core dump case (fixed in the previous patch).
      Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Link: http://lkml.kernel.org/r/1336692811-30576-3-git-send-email-suresh.b.siddha@intel.com
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      d75f1b39
    • Suresh Siddha's avatar
      coredump: ensure the fpu state is flushed for proper multi-threaded core dump · 11aeca0b
      Suresh Siddha authored
      Nalluru reported hitting the BUG_ON(__thread_has_fpu(tsk)) in
      arch/x86/kernel/xsave.c:__sanitize_i387_state() during the coredump
      of a multi-threaded application.
      
      A look at the exit seqeuence shows that other threads can still be on the
      runqueue potentially at the below shown exit_mm() code snippet:
      
      		if (atomic_dec_and_test(&core_state->nr_threads))
      			complete(&core_state->startup);
      
      ===> other threads can still be active here, but we notify the thread
      ===> dumping core to wakeup from the coredump_wait() after the last thread
      ===> joins this point. Core dumping thread will continue dumping
      ===> all the threads state to the core file.
      
      		for (;;) {
      			set_task_state(tsk, TASK_UNINTERRUPTIBLE);
      			if (!self.task) /* see coredump_finish() */
      				break;
      			schedule();
      		}
      
      As some of those threads are on the runqueue and didn't call schedule() yet,
      their fpu state is still active in the live registers and the thread
      proceeding with the coredump will hit the above mentioned BUG_ON while
      trying to dump other threads fpustate to the coredump file.
      
      BUG_ON() in arch/x86/kernel/xsave.c:__sanitize_i387_state() is
      in the code paths for processors supporting xsaveopt. With or without
      xsaveopt, multi-threaded coredump is broken and maynot contain
      the correct fpustate at the time of exit.
      
      In coredump_wait(), wait for all the threads to be come inactive, so
      that we are sure all the extended register state is flushed to
      the memory, so that it can be reliably copied to the core file.
      Reported-by: default avatarSuresh Nalluru <suresh@aristanetworks.com>
      Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Link: http://lkml.kernel.org/r/1336692811-30576-2-git-send-email-suresh.b.siddha@intel.comAcked-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      11aeca0b
    • Suresh Siddha's avatar
      fork: move the real prepare_to_copy() users to arch_dup_task_struct() · 55ccf3fe
      Suresh Siddha authored
      Historical prepare_to_copy() is mostly a no-op, duplicated for majority of
      the architectures and the rest following the x86 model of flushing the extended
      register state like fpu there.
      
      Remove it and use the arch_dup_task_struct() instead.
      Suggested-by: default avatarOleg Nesterov <oleg@redhat.com>
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Link: http://lkml.kernel.org/r/1336692811-30576-1-git-send-email-suresh.b.siddha@intel.comAcked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: James E.J. Bottomley <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Chen Liqin <liqin.chen@sunplusct.com>
      Cc: Lennox Wu <lennox.wu@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      55ccf3fe
  2. 13 May, 2012 3 commits
    • Linus Torvalds's avatar
      Linux 3.4-rc7 · 36be5051
      Linus Torvalds authored
      .. and this should hopefully be the last -rc before final 3.4 release.
      36be5051
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 5889fc32
      Linus Torvalds authored
      Pull ARM: SoC fixes from Olof Johansson:
       "I was hoping to be done with fixes for 3.4 but we got two branches
        from subarch maintainers the last couple of days.  So here is one
        last(?) pull request for arm-soc containing 7 patches:
      
         - Five of them are for shmobile dealing with SMP setup and compile
           failures
         - The remaining two are for regressions on the Samsung platforms"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: EXYNOS: fix ctrlbit for exynos5_clk_pdma1
        ARM: EXYNOS: use s5p-timer for UniversalC210 board
        ARM / mach-shmobile: Invalidate caches when booting secondary cores
        ARM / mach-shmobile: sh73a0 SMP TWD boot regression fix
        ARM / mach-shmobile: r8a7779 SMP TWD boot regression fix
        ARM: mach-shmobile: convert ag5evm to use the generic MMC GPIO hotplug helper
        ARM: mach-shmobile: convert mackerel to use the generic MMC GPIO hotplug helper
      5889fc32
    • Linus Torvalds's avatar
      Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6 · 1bc4a5be
      Linus Torvalds authored
      Pull a few more GPIO bug fixes from Grant Likely:
       "Oops, missed a couple.  Here's an updated pull req for GPIO"
      
      A set of PCH bug fixes, and one patch to fix up compile warnings
      
      * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6:
        gpio/exynos: Fix compiler warnings when non-exynos machines are selected
        gpio: pch9: Use proper flow type handlers
      1bc4a5be
  3. 12 May, 2012 19 commits
    • Olof Johansson's avatar
      Merge branch 'v3.4-samsung-fixes-5' of... · 85d5c4a3
      Olof Johansson authored
      Merge branch 'v3.4-samsung-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into fixes
      
      * 'v3.4-samsung-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
        ARM: EXYNOS: fix ctrlbit for exynos5_clk_pdma1
        ARM: EXYNOS: use s5p-timer for UniversalC210 board
      85d5c4a3
    • Kukjin Kim's avatar
      ARM: EXYNOS: fix ctrlbit for exynos5_clk_pdma1 · 28b874a8
      Kukjin Kim authored
      It should be (1 << 2) for ctrlbit of exynos5_clk_pdma1.
      Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
      28b874a8
    • Marek Szyprowski's avatar
      ARM: EXYNOS: use s5p-timer for UniversalC210 board · fd717cd7
      Marek Szyprowski authored
      Commit 069d4e74 ("ARM: EXYNOS4: Remove clock event timers using
      ARM private timers") removed support for local timers and forced
      to use MCT as event source. However MCT is not operating properly
      on early revision of EXYNOS4 SoCs. All UniversalC210 boards are
      based on it, so that commit broke support for it. This patch
      provides a workaround that enables UniversalC210 boards to boot
      again. s5p-timer is used as an event source, it works only for
      non-SMP builds.
      Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
      fd717cd7
    • Olof Johansson's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/renesas into fixes · d2919c65
      Olof Johansson authored
      By Guennadi Liakhovetski (2) and others via Rafael J. Wysocki:
      "[...] urgent fixes for Renesas ARM-based platforms.  Four of these
      commits are fixes of regressions new in 3.4-rc and the last one is
      necessary for SMP to work on those systems in general."
      
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/renesas:
        ARM / mach-shmobile: Invalidate caches when booting secondary cores
        ARM / mach-shmobile: sh73a0 SMP TWD boot regression fix
        ARM / mach-shmobile: r8a7779 SMP TWD boot regression fix
        ARM: mach-shmobile: convert ag5evm to use the generic MMC GPIO hotplug helper
        ARM: mach-shmobile: convert mackerel to use the generic MMC GPIO hotplug helper
      d2919c65
    • Magnus Damm's avatar
      ARM / mach-shmobile: Invalidate caches when booting secondary cores · e994d5eb
      Magnus Damm authored
      Make sure L1 caches are invalidated when booting secondary
      cores. Needed to boot all mach-shmobile SMP systems that
      are using Cortex-A9 including sh73a0, r8a7779 and EMEV2.
      
      Thanks to imx and tegra guys for actual code.
      Signed-off-by: default avatarMagnus Damm <damm@opensource.se>
      Tested-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      e994d5eb
    • Kuninori Morimoto's avatar
      ARM / mach-shmobile: sh73a0 SMP TWD boot regression fix · d6720003
      Kuninori Morimoto authored
      Fix SMP TWD boot regression on sh73a0 based platforms caused by:
      
      4200b16d ARM: shmobile: convert to twd_local_timer_register() interface
      
      After the merge of the above commit it has been impossible to boot
      sh73a0 based SoCs with SMP enabled and CONFIG_HAVE_ARM_TWD=y. The
      kernel crashes at smp_init_cpus() timing which is before the console
      has been initialized, so to the user this looks like a kernel lock up
      without any particular error message.
      
      This patch fixes the regression on sh73a0 by moving the TWD
      registration code from smp_init_cpus() to sys_timer->init() time.
      
      This patch removed shmobile_twd_init() which is no longer needed
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: default avatarMagnus Damm <damm@opensource.se>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      d6720003
    • Magnus Damm's avatar
      ARM / mach-shmobile: r8a7779 SMP TWD boot regression fix · b759bd11
      Magnus Damm authored
      Fix SMP TWD boot regression on r8a7779 based platforms caused by:
      
      4200b16d ARM: shmobile: convert to twd_local_timer_register() interface
      
      After the merge of the above commit it has been impossible to boot
      r8a7779 based SoCs with SMP enabled and CONFIG_HAVE_ARM_TWD=y. The
      kernel crashes at smp_init_cpus() timing which is before the console
      has been initialized, so to the user this looks like a kernel lock up
      without any particular error message.
      
      This patch fixes the regression on r8a7779 by moving the TWD
      registration code from smp_init_cpus() to sys_timer->init() time.
      Signed-off-by: default avatarMagnus Damm <damm@opensource.se>
      Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      b759bd11
    • Guennadi Liakhovetski's avatar
      ARM: mach-shmobile: convert ag5evm to use the generic MMC GPIO hotplug helper · 173e2fec
      Guennadi Liakhovetski authored
      This also fixes the following modular mmc build failure:
      
      arch/arm/mach-shmobile/built-in.o: In function `mackerel_sdhi0_gpio_cd':
      pfc-sh7372.c:(.text+0x1138): undefined reference to `mmc_detect_change'
      
      on this platform by eliminating the use of an inline function, which
      calls into the mmc core.
      Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
      Reviewed-by: default avatarSimon Horman <horms@verge.net.au>
      Acked-by: default avatarMagnus Damm <damm@opensource.se>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      173e2fec
    • Guennadi Liakhovetski's avatar
      ARM: mach-shmobile: convert mackerel to use the generic MMC GPIO hotplug helper · 2b3e38c4
      Guennadi Liakhovetski authored
      This also fixes the following modular mmc build failure:
      
      arch/arm/mach-shmobile/built-in.o: In function `ag5evm_sdhi0_gpio_cd':
      pfc-sh73a0.c:(.text+0x7c0): undefined reference to `mmc_detect_change'
      
      on this platform by eliminating the use of an inline function, which
      calls into the mmc core.
      Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
      Tested-by: default avatarSimon Horman <horms@verge.net.au>
      Acked-by: default avatarMagnus Damm <damm@opensource.se>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      2b3e38c4
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · cf00c55e
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "This is a set of minor qla and virto fixes plus one major regression
        fix (oops in all legacy host drivers)."
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        [SCSI] virtio_scsi: fix TMF use-after-free
        [SCSI] fix oops in all legacy host adapters caused by 6f381fa3
        [SCSI] qla2xxx: Update version number to 8.04.00.03-k.
        [SCSI] qla2xxx: Properly check for current state after the fabric-login request.
        [SCSI] qla2xxx: Proper completion to scsi-ml for scsi status task_set_full and busy.
        [SCSI] qla2xxx: Block flash access from application when device is initialized for ISP82xx.
        [SCSI] qla2xxx: Fix reset time out as qla2xxx not ack to reset request.
      cf00c55e
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 4a873f53
      Linus Torvalds authored
      Pull networking fixes from David S. Miller:
      
       1) Since we do RCU lookups on ipv4 FIB entries, we have to test if the
          entry is dead before returning it to our caller.
      
       2) openvswitch locking and packet validation fixes from Ansis Atteka,
          Jesse Gross, and Pravin B Shelar.
      
       3) Fix PM resume locking in IGB driver, from Benjamin Poirier.
      
       4) Fix VLAN header handling in vhost-net and macvtap, from Basil Gor.
      
       5) Revert a bogus network namespace isolation change that was causing
          regressions on S390 networking devices.
      
       6) If bonding decides to process and handle a LACPDU frame, we
          shouldn't bump the rx_dropped counter.  From Jiri Bohac.
      
       7) Fix mis-calculation of available TX space in r8169 driver when doing
          TSO, which can lead to crashes and/or hung device.  From Julien
          Ducourthial.
      
       8) SCTP does not validate cached routes properly in all cases, from
          Nicolas Dichtel.
      
       9) Link status interrupt needs to be handled in ks8851 driver, from
          Stephen Boyd.
      
      10) Use capable(), not cap_raised(), in connector/userns netlink code.
          From Eric W. Biederman via Andrew Morton.
      
      11) Fix pktgen OOPS on module unload, from Eric Dumazet.
      
      12) iwlwifi under-estimates SKB truesizes, also from Eric Dumazet.
      
      13) Cure division by zero in SFC driver, from Ben Hutchings.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits)
        ks8851: Update link status during link change interrupt
        macvtap: restore vlan header on user read
        vhost-net: fix handle_rx buffer size
        bonding: don't increase rx_dropped after processing LACPDUs
        connector/userns: replace netlink uses of cap_raised() with capable()
        sctp: check cached dst before using it
        pktgen: fix crash at module unload
        Revert "net: maintain namespace isolation between vlan and real device"
        ehea: fix losing of NEQ events when one event occurred early
        igb: fix rtnl race in PM resume path
        ipv4: Do not use dead fib_info entries.
        r8169: fix unsigned int wraparound with TSO
        sfc: Fix division by zero when using one RX channel and no SR-IOV
        openvswitch: Validation of IPv6 set port action uses IPv4 header
        net: compare_ether_addr[_64bits]() has no ordering
        cdc_ether: Ignore bogus union descriptor for RNDIS devices
        bnx2x: bug fix when loading after SAN boot
        e1000: Silence sparse warnings by correcting type
        igb, ixgbe: netdev_tx_reset_queue incorrectly called from tx init path
        openvswitch: Release rtnl_lock if ovs_vport_cmd_build_info() failed.
        ...
      4a873f53
    • Linus Torvalds's avatar
      Merge tag 'dm-3.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm · 2eb42967
      Linus Torvalds authored
      Pull device-mapper fixes from Alasdair G Kergon:
       "Fix a couple of serious memory leaks in device-mapper thin
        provisioning and tidy its MODULE_DESCRIPTION.
      
        Mitigate occasional reported hangs associated with multipath scsi_dh
        module loading."
      
      * tag 'dm-3.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm:
        dm mpath: check if scsi_dh module already loaded before trying to load
        dm thin: correct module description
        dm thin: fix unprotected use of prepared_discards list
        dm thin: reinstate missing mempool_free in cell_release_singleton
      2eb42967
    • Rafael J. Wysocki's avatar
      MAINTAINERS: Add myself as the cpufreq maintainer · a6c072c7
      Rafael J. Wysocki authored
      Since cpufreq has no official maintainer at the moment, I'm willing
      to maintain it along some other power management core code I've been
      maintaining already.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a6c072c7
    • Mike Snitzer's avatar
      dm mpath: check if scsi_dh module already loaded before trying to load · 510193a2
      Mike Snitzer authored
      If the requested scsi_dh module is already loaded then skip
      request_module().
      
      Multipath table loads can hang in an unnecessary __request_module.
      Reported-by: default avatarBen Marzinski <bmarzins@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      510193a2
    • Alasdair G Kergon's avatar
      dm thin: correct module description · 7cab8bf1
      Alasdair G Kergon authored
      Remove duplicate copy of string "device-mapper" (DM_NAME) from
      MODULE_DESCRIPTION.
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      7cab8bf1
    • Mike Snitzer's avatar
      dm thin: fix unprotected use of prepared_discards list · c3a0ce2e
      Mike Snitzer authored
      Fix two places in commit 104655fd ("dm thin: support discards") that
      didn't use pool->lock to protect against concurrent changes to the
      prepared_discards list.
      
      Without this fix, thin_endio() can race with process_discard(), leading
      to concurrent list_add()s that result in the processes locking up with
      an error like the following:
      
      WARNING: at lib/list_debug.c:32 __list_add+0x8f/0xa0()
      ...
      list_add corruption. next->prev should be prev (ffff880323b96140), but was ffff8801d2c48440. (next=ffff8801d2c485c0).
      ...
      Pid: 17205, comm: kworker/u:1 Tainted: G        W  O 3.4.0-rc3.snitm+ #1
      Call Trace:
       [<ffffffff8103ca1f>] warn_slowpath_common+0x7f/0xc0
       [<ffffffff8103cb16>] warn_slowpath_fmt+0x46/0x50
       [<ffffffffa04f6ce6>] ? bio_detain+0xc6/0x210 [dm_thin_pool]
       [<ffffffff8124ff3f>] __list_add+0x8f/0xa0
       [<ffffffffa04f70d2>] process_discard+0x2a2/0x2d0 [dm_thin_pool]
       [<ffffffffa04f6a78>] ? remap_and_issue+0x38/0x50 [dm_thin_pool]
       [<ffffffffa04f7c3b>] process_deferred_bios+0x7b/0x230 [dm_thin_pool]
       [<ffffffffa04f7df0>] ? process_deferred_bios+0x230/0x230 [dm_thin_pool]
       [<ffffffffa04f7e42>] do_worker+0x52/0x60 [dm_thin_pool]
       [<ffffffff81056fa9>] process_one_work+0x129/0x450
       [<ffffffff81059b9c>] worker_thread+0x17c/0x3c0
       [<ffffffff81059a20>] ? manage_workers+0x120/0x120
       [<ffffffff8105eabe>] kthread+0x9e/0xb0
       [<ffffffff814ceda4>] kernel_thread_helper+0x4/0x10
       [<ffffffff8105ea20>] ? kthread_freezable_should_stop+0x70/0x70
       [<ffffffff814ceda0>] ? gs_change+0x13/0x13
      ---[ end trace 7e0a523bc5e52692 ]---
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      c3a0ce2e
    • Mike Snitzer's avatar
      dm thin: reinstate missing mempool_free in cell_release_singleton · 03aaae7c
      Mike Snitzer authored
      Fix a significant memory leak inadvertently introduced during
      simplification of cell_release_singleton() in commit
      6f94a4c4 ("dm thin: fix stacked bi_next
      usage").
      
      A cell's hlist_del() must be accompanied by a mempool_free().
      Use __cell_release() to do this, like before.
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      03aaae7c
    • Sachin Kamat's avatar
      gpio/exynos: Fix compiler warnings when non-exynos machines are selected · 2760f7ad
      Sachin Kamat authored
      Fixes the following compiler warnings:
      
      drivers/gpio/gpio-samsung.c: In function ‘samsung_gpiolib_init’:
      drivers/gpio/gpio-samsung.c:2980:1: warning: label ‘err_ioremap1’ defined but not used [-Wunused-label]
      drivers/gpio/gpio-samsung.c:2978:1: warning: label ‘err_ioremap2’ defined but not used [-Wunused-label]
      drivers/gpio/gpio-samsung.c:2976:1: warning: label ‘err_ioremap3’ defined but not used [-Wunused-label]
      drivers/gpio/gpio-samsung.c:2974:1: warning: label ‘err_ioremap4’ defined but not used [-Wunused-label]
      drivers/gpio/gpio-samsung.c:2722:55: warning: unused variable ‘gpio_base4’ [-Wunused-variable]
      
      drivers/gpio/gpio-samsung.c:455:32: warning: ‘exynos_gpio_cfg’ defined but not used [-Wunused-variable]
      drivers/gpio/gpio-samsung.c:2126:33: warning: ‘exynos4_gpios_1’ defined but not used [-Wunused-variable]
      drivers/gpio/gpio-samsung.c:2228:33: warning: ‘exynos4_gpios_2’ defined but not used [-Wunused-variable]
      drivers/gpio/gpio-samsung.c:2373:33: warning: ‘exynos4_gpios_3’ defined but not used [-Wunused-variable]
      Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      2760f7ad
    • Thomas Gleixner's avatar
      gpio: pch9: Use proper flow type handlers · df9541a6
      Thomas Gleixner authored
      Jean-Francois Dagenais reported:
      
       Configuring a gpio pin with the gpio-pch driver with
       "IRQF_TRIGGER_LOW | IRQF_ONESHOT" generates an interrupt storm for
       threaded ISR until the ISR thread actually gets to physically clear
       the interrupt on the triggering chip!! The immediate observable
       symptom is the high CPU usage for my ISR thread task and the
       interrupt count in /proc/interrupts incrementing radically.
      
      The driver is wrong in several ways:
      
      1) Using handle_simple_irq() does not provide proper flow control
         handling. In the case of oneshot threaded handlers for the
         demultiplexed interrupts this results in an interrupt storm because
         the simple handler does not deal with masking/unmasking.  Even
         without threaded oneshot handlers an interrupt storm for level type
         interrupts can easily be triggered when the interrupt is disabled
         and the interrupt line is activated from the device.
      
      2) Acknowlegding the demultiplexed interrupt before calling the
         handler is wrong for level type interrupts.
      
      3) The set_type function unconditionally enables the interrupt. It's
         supposed to set the type and nothing else. The unmasking is done by
         the core code.
      
      Move the acknowledge code into a separate function and add it to the
      demux irqchip callbacks.
      
      Remove the unconditional enabling from the set_type() callback and set
      the proper flow handlers depending on the selected type (level/edge).
      Reported-and-tested-by: default avatarJean-Francois Dagenais <jeff.dagenais@gmail.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      df9541a6
  4. 11 May, 2012 14 commits
    • Linus Torvalds's avatar
      Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6 · bcc62fb0
      Linus Torvalds authored
      Pull GPIO omap bug fix from Grant Likely.
      
      * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6:
        gpio/omap: fix incorrect initialization of omap_gpio_mod_init
      bcc62fb0
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · ec53646f
      Linus Torvalds authored
      Pull another powerpc irq fix from Benjamin Herrenschmidt:
       "It looks like my previous fix for the lazy irq masking problem wasn't
        quite enough.  There was another problem related to performance
        monitor interrupts acting as NMIs leaving the flags in an incorrect
        state.  Here's a fix that finally seems to make perf solid again."
      
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc/irq: Fix another case of lazy IRQ state getting out of sync
      ec53646f
    • Linus Torvalds's avatar
      Merge branch '3.4-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · 04e53358
      Linus Torvalds authored
      Pull target fix from Nicholas Bellinger:
       "This patch removes some incorrect legacy code to free se_lun_acl
        memory in the NodeACL release path that could potentially trigger an
        OOPS during shutdown once dynamic -> explicit initiator NodeACL
        conversion has occurred.
      
        That said, we've been able to trigger an OOPS in v4.0 code for this
        special case when the associated MappedLUNs had not also been made
        explicit based on active TPG LUN layout during the conversion, so it
        really makes senses to go ahead and drop this extra cruft to avoid any
        possible issues here.
      
        This ends up only effecting iscsi-target module code (it's the only
        user) and is CC'ed to stable."
      
      * '3.4-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
        target: Drop incorrect se_lun_acl release for dynamic -> explict ACL conversion
      04e53358
    • Benjamin Herrenschmidt's avatar
      powerpc/irq: Fix another case of lazy IRQ state getting out of sync · 7c0482e3
      Benjamin Herrenschmidt authored
      So we have another case of paca->irq_happened getting out of
      sync with the HW irq state. This can happen when a perfmon
      interrupt occurs while soft disabled, as it will return to a
      soft disabled but hard enabled context while leaving a stale
      PACA_IRQ_HARD_DIS flag set.
      
      This patch fixes it, and also adds a test for the condition
      of those flags being out of sync in arch_local_irq_restore()
      when CONFIG_TRACE_IRQFLAGS is enabled.
      
      This helps catching those gremlins faster (and so far I
      can't seem see any anymore, so that's good news).
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7c0482e3
    • Stephen Boyd's avatar
      ks8851: Update link status during link change interrupt · 062e55e3
      Stephen Boyd authored
      If a link change interrupt comes in we just clear the interrupt
      and continue along without notifying the upper networking layers
      that the link has changed. Use the mii_check_link() function to
      update the link status whenever a link change interrupt occurs.
      
      Cc: Ben Dooks <ben-linux@fluff.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      062e55e3
    • Basil Gor's avatar
      macvtap: restore vlan header on user read · f09e2249
      Basil Gor authored
      Ethernet vlan header is not on the packet and kept in the skb->vlan_tci
      when it comes from lower dev. This patch inserts vlan header in user
      buffer during skb copy on user read.
      Signed-off-by: default avatarBasil Gor <basil.gor@gmail.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f09e2249
    • Basil Gor's avatar
      vhost-net: fix handle_rx buffer size · c53cff5e
      Basil Gor authored
      Take vlan header length into account, when vlan id is stored as
      vlan_tci. Otherwise tagged packets coming from macvtap will be
      truncated.
      Signed-off-by: default avatarBasil Gor <basil.gor@gmail.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c53cff5e
    • Nicholas Bellinger's avatar
      target: Drop incorrect se_lun_acl release for dynamic -> explict ACL conversion · cfebf8f4
      Nicholas Bellinger authored
      This patch removes some potentially problematic legacy code within
      core_clear_initiator_node_from_tpg() that was originally intended to
      release left over se_lun_acl setup during dynamic NodeACL+MappedLUN
      generate when running with TPG demo-mode operation.
      
      Since we now only ever expect to allocate and release se_lun_acl from
      within target_core_fabric_configfs.c:target_fabric_make_mappedlun() and
      target_fabric_drop_mappedlun() context respectively, this code for
      demo-mode release is incorrect and needs to be removed.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      cfebf8f4
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu · 4e25651b
      Linus Torvalds authored
      Pull a m68knommu fix from Greg Ungerer:
       "It contains a single fix for including the ColdFire QSPI interface
        setup code when enabled as a module.  This was broken in the
        consolidation of the ColdFire SoC device tables in the 3.4 merge
        window."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
        m68knommu: enable qspi support when SPI_COLDFIRE_QSPI = m
      4e25651b
    • Hugh Dickins's avatar
      mm: raise MemFree by reverting percpu_pagelist_fraction to 0 · 1b76b02f
      Hugh Dickins authored
      Why is there less MemFree than there used to be?  It perturbed a test,
      so I've just been bisecting linux-next, and now find the offender went
      upstream yesterday.
      
      Commit 93278814 "mm: fix division by 0 in percpu_pagelist_fraction()"
      mistakenly initialized percpu_pagelist_fraction to the sysctl's minimum 8,
      which leaves 1/8th of memory on percpu lists (on each cpu??); but most of
      us expect it to be left unset at 0 (and it's not then used as a divisor).
      
        MemTotal: 8061476kB  8061476kB  8061476kB  8061476kB  8061476kB  8061476kB
        Repetitive test with percpu_pagelist_fraction 8:
        MemFree:  6948420kB  6237172kB  6949696kB  6840692kB  6949048kB  6862984kB
        Same test with percpu_pagelist_fraction back to 0:
        MemFree:  7945000kB  7944908kB  7948568kB  7949060kB  7948796kB  7948812kB
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      [ We really should fix the crazy sysctl interface too, but that's a
        separate thing - Linus ]
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1b76b02f
    • Jiri Bohac's avatar
      bonding: don't increase rx_dropped after processing LACPDUs · 13a8e0c8
      Jiri Bohac authored
      Since commit 3aba891d, bonding processes LACP frames (802.3ad
      mode) with bond_handle_frame(). Currently a copy of the skb is
      made and the original is left to be processed by other
      rx_handlers and the rest of the network stack by returning
      RX_HANDLER_ANOTHER.  As there is no protocol handler for
      PKT_TYPE_LACPDU, the frame is dropped and dev->rx_dropped
      increased.
      
      Fix this by making bond_handle_frame() return RX_HANDLER_CONSUMED
      if bonding has processed the LACP frame.
      Signed-off-by: default avatarJiri Bohac <jbohac@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      13a8e0c8
    • Eric W. Biederman's avatar
      connector/userns: replace netlink uses of cap_raised() with capable() · 38bf1953
      Eric W. Biederman authored
      In 2009 Philip Reiser notied that a few users of netlink connector
      interface needed a capability check and added the idiom
      cap_raised(nsp->eff_cap, CAP_SYS_ADMIN) to a few of them, on the premise
      that netlink was asynchronous.
      
      In 2011 Patrick McHardy noticed we were being silly because netlink is
      synchronous and removed eff_cap from the netlink_skb_params and changed
      the idiom to cap_raised(current_cap(), CAP_SYS_ADMIN).
      
      Looking at those spots with a fresh eye we should be calling
      capable(CAP_SYS_ADMIN).  The only reason I can see for not calling capable
      is that it once appeared we were not in the same task as the caller which
      would have made calling capable() impossible.
      
      In the initial user_namespace the only difference between between
      cap_raised(current_cap(), CAP_SYS_ADMIN) and capable(CAP_SYS_ADMIN) are a
      few sanity checks and the fact that capable(CAP_SYS_ADMIN) sets
      PF_SUPERPRIV if we use the capability.
      
      Since we are going to be using root privilege setting PF_SUPERPRIV seems
      the right thing to do.
      
      The motivation for this that patch is that in a child user namespace
      cap_raised(current_cap(),...) tests your capabilities with respect to that
      child user namespace not capabilities in the initial user namespace and
      thus will allow processes that should be unprivielged to use the kernel
      services that are only protected with cap_raised(current_cap(),..).
      
      To fix possible user_namespace issues and to just clean up the code
      replace cap_raised(current_cap(), CAP_SYS_ADMIN) with
      capable(CAP_SYS_ADMIN).
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Acked-by: default avatarSerge E. Hallyn <serge.hallyn@canonical.com>
      Acked-by: default avatarAndrew G. Morgan <morgan@kernel.org>
      Cc: Vasiliy Kulikov <segoon@openwall.com>
      Cc: David Howells <dhowells@redhat.com>
      Reviewed-by: default avatarJames Morris <james.l.morris@oracle.com>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      38bf1953
    • Nicolas Dichtel's avatar
      sctp: check cached dst before using it · e0268868
      Nicolas Dichtel authored
      dst_check() will take care of SA (and obsolete field), hence
      IPsec rekeying scenario is taken into account.
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Acked-by: default avatarVlad Yaseivch <vyasevich@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e0268868
    • Eric Dumazet's avatar
      pktgen: fix crash at module unload · c57b5468
      Eric Dumazet authored
      commit 7d3d43da (net: In unregister_netdevice_notifier unregister
      the netdevices.) makes pktgen crashing at module unload.
      
      [  296.820578] BUG: spinlock bad magic on CPU#6, rmmod/3267
      [  296.820719]  lock: ffff880310c38000, .magic: ffff8803, .owner: <none>/-1, .owner_cpu: -1
      [  296.820943] Pid: 3267, comm: rmmod Not tainted 3.4.0-rc5+ #254
      [  296.821079] Call Trace:
      [  296.821211]  [<ffffffff8168a715>] spin_dump+0x8a/0x8f
      [  296.821345]  [<ffffffff8168a73b>] spin_bug+0x21/0x26
      [  296.821507]  [<ffffffff812b4741>] do_raw_spin_lock+0x131/0x140
      [  296.821648]  [<ffffffff8169188e>] _raw_spin_lock+0x1e/0x20
      [  296.821786]  [<ffffffffa00cc0fd>] __pktgen_NN_threads+0x4d/0x140 [pktgen]
      [  296.821928]  [<ffffffffa00ccf8d>] pktgen_device_event+0x10d/0x1e0 [pktgen]
      [  296.822073]  [<ffffffff8154ed4f>] unregister_netdevice_notifier+0x7f/0x100
      [  296.822216]  [<ffffffffa00d2a0b>] pg_cleanup+0x48/0x73 [pktgen]
      [  296.822357]  [<ffffffff8109528e>] sys_delete_module+0x17e/0x2a0
      [  296.822502]  [<ffffffff81699652>] system_call_fastpath+0x16/0x1b
      
      Hold the pktgen_thread_lock while splicing pktgen_threads, and test
      pktgen_exiting in pktgen_device_event() to make unload faster.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c57b5468