summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-05-10drivers/leds: correct __devexit annotationsArnd Bergmann2-3/+3
__devexit functions are discarded without CONFIG_HOTPLUG, so they need to be referenced carefully. A __devexit function may also not be called from a __devinit function. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Bryan Wu <bryan.wu@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10memcg: free spare array to avoid memory leakSha Zhengju1-0/+6
When the last event is unregistered, there is no need to keep the spare array anymore. So free it to avoid memory leak. Signed-off-by: Sha Zhengju <handai.szj@taobao.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Reviewed-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10namespaces, pid_ns: fix leakage on fork() failureMike Galbraith1-0/+3
Fork() failure post namespace creation for a child cloned with CLONE_NEWPID leaks pid_namespace/mnt_cache due to proc being mounted during creation, but not unmounted during cleanup. Call pid_ns_release_proc() during cleanup. Signed-off-by: Mike Galbraith <efault@gmx.de> Acked-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Cc: Louis Rilling <louis.rilling@kerlabs.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10hugetlb: prevent BUG_ON in hugetlb_fault() -> hugetlb_cow()Chris Metcalf1-1/+0
Commit 66aebce747eaf ("hugetlb: fix race condition in hugetlb_fault()") added code to avoid a race condition by elevating the page refcount in hugetlb_fault() while calling hugetlb_cow(). However, one code path in hugetlb_cow() includes an assertion that the page count is 1, whereas it may now also have the value 2 in this path. The consensus is that this BUG_ON has served its purpose, so rather than extending it to cover both cases, we just remove it. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> Acked-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Hillf Danton <dhillf@gmail.com> Acked-by: Hugh Dickins <hughd@google.com> Cc: Michal Hocko <mhocko@suse.cz> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: <stable@vger.kernel.org> [3.0.29+, 3.2.16+, 3.3.3+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10mm: fix division by 0 in percpu_pagelist_fraction()Sasha Levin1-2/+2
percpu_pagelist_fraction_sysctl_handler() has only considered -EINVAL as a possible error from proc_dointvec_minmax(). If any other error is returned, it would proceed to divide by zero since percpu_pagelist_fraction wasn't getting initialized at any point. For example, writing 0 bytes into the proc file would trigger the issue. Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Reviewed-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10proc/pid/pagemap: correctly report non-present ptes and holes between vmasKonstantin Khlebnikov1-2/+10
Reset the current pagemap-entry if the current pte isn't present, or if current vma is over. Otherwise pagemap reports last entry again and again. Non-present pte reporting was broken in commit 092b50bacd1c ("pagemap: introduce data structure for pagemap entry") Reporting for holes was broken in commit 5aaabe831eb5 ("pagemap: avoid splitting thp when reading /proc/pid/pagemap") Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> Reported-by: Pavel Emelyanov <xemul@parallels.com> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Andi Kleen <ak@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10Merge branch 'for-3.4-fixes' of ↵Linus Torvalds1-0/+12
git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu Pull percpu fixes from Tejun Heo: "This pull request contains two patches. One is kmemleak annotation fix which isn't critical. The other is kinda serious. Depending on NUMA topology, percpu allocator may end up assigning overlapping regions for the static percpu areas for different CPUs. While critical, the bug has been there for a very long time and only few configurations seem to be affected (NUMA configurations w/ no memory nodes for example) - so, while it's critical, it isn't exactly urgent." * 'for-3.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: kmemleak: Fix the kmemleak tracking of the percpu areas with !SMP percpu: pcpu_embed_first_chunk() should free unused parts after all allocs are complete
2012-05-10Merge git://git.samba.org/sfrench/cifs-2.6Linus Torvalds1-1/+1
Pull cifs fix from Steve French. * git://git.samba.org/sfrench/cifs-2.6: cifs: fix revalidation test in cifs_llseek()
2012-05-10sparc64: Do not clobber %g2 in xcall_fetch_glob_regs().David S. Miller2-4/+4
%g2 is meant to hold the CPUID number throughout this routine, since at the very beginning, and at the very end, we use %g2 to calculate indexes into per-cpu arrays. However we erroneously clobber it in order to hold the %cwp register value mid-stream. Fix this code to use %g3 for the %cwp read and related calulcations instead. Reported-by: Meelis Roos <mroos@linux.ee> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-10Merge tag 'nfs-for-3.4-5' of git://git.linux-nfs.org/projects/trondmy/linux-nfsLinus Torvalds1-3/+4
Pull a NFS client bugfix from Trond Myklebust: "Fix for the NFSv4 security negotiation: ensure that the security negotiation tries all registered security flavours" * tag 'nfs-for-3.4-5' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: auth_gss: the list of pseudoflavors not being parsed correctly
2012-05-10Merge tag 'sound-3.4' of ↵Linus Torvalds6-15/+30
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Slightly more than expected as rc7, but all are reasonablly small fixes. A few additions of HD-audio fixup entries, a couple of other regression fixes including a revert, and a few other trivial oneliners." * tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ASoC: sh: fix migor.c compilation ALSA: HDA: Lessen CPU usage when waiting for chip to respond Revert "ALSA: hda - Set codec to D3 forcibly even if not used" ALSA: hda/realtek - Call alc_auto_parse_customize_define() always after fixup ALSA: hdsp - Provide ioctl_compat ALSA: hda/realtek - Add missing CD-input pin for MSI-7350 mobo ALSA: hda/realtek - Add a fixup for Acer Aspire 5739G ALSA: echoaudio: Remove incorrect part of assertion
2012-05-10compat: Fix RT signal mask corruption via sigprocmaskJan Kiszka1-17/+46
compat_sys_sigprocmask reads a smaller signal mask from userspace than sigprogmask accepts for setting. So the high word of blocked.sig[0] will be cleared, releasing any potentially blocked RT signal. This was discovered via userspace code that relies on get/setcontext. glibc's i386 versions of those functions use sigprogmask instead of rt_sigprogmask to save/restore signal mask and caused RT signal unblocking this way. As suggested by Linus, this replaces the sys_sigprocmask based compat version with one that open-codes the required logic, including the merge of the existing blocked set with the new one provided on SIG_SETMASK. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-10gpio/omap: fix incorrect initialization of omap_gpio_mod_initTarun Kanti DebBarma1-6/+3
Initialization of irqenable, irqstatus registers is the common operation done in this function for all OMAP platforms, viz. OMAP1, OMAP2+. The latter _gpio_rmw()'s which supposedly got introduced wrongly to take care of OMAP2+ platforms were overwriting initially programmed OMAP1 value breaking functionality on OMAP1. Somehow incorrect assumption was made that each _gpio_rmw()'s were mutually exclusive. On close observation it is found that the first _gpio_rmw() which is supposedly done to take care of OMAP1 platform is generic enough and takes care of OMAP2+ platform as well. Therefore remove the latter _gpio_rmw() to irqenable as they are redundant now. Writing to ctrl and debounce_en registers for OMAP2+ platforms are modified to match the original(pre-cleanup) code where the registers are initialized with 0. In the cleanup series since we are using _gpio_rmw(reg, 0, 1), instead of __raw_writel(), we are just reading and writing the same values to ctrl and debounce_en. This is not an issue for debounce_en register because it has 0x0 as the default value. But in the case of ctrl register the default value is 0x2 (GATINGRATIO = 0x1) so that we end up writing 0x2 instead of intended 0 value. Therefore changing back to __raw_writel() as this is sufficient for this case besides simpler to understand. Also, change irqstatus initalization logic that avoids comparison with bool, besides making it fit in a single line. Cc: stable@vger.kernel.org Cc: Tony Lindgren <tony@atomide.com> Cc: Kevin Hilman <khilman@ti.com> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Grant Likely <grant.likely@secretlab.ca> Reported-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-05-10[SCSI] virtio_scsi: fix TMF use-after-freePaolo Bonzini1-11/+13
Fix a use-after-free in the TMF path, where cmd may have been already freed by virtscsi_complete_free when wait_for_completion restarts executing virtscsi_tmf. Technically a race, but in practice the command will always be freed long before the completion waiter is awoken. The fix is to make callers specifying a completion responsible for freeing the command in all cases. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10[SCSI] fix oops in all legacy host adapters caused by 6f381faJames Bottomley1-0/+3
Commit 6f381fa344911d5a234b13574433cf23036f9467 Author: Lin Ming <ming.m.lin@intel.com> [SCSI] scsi_lib: use correct DMA device in __scsi_alloc_queue Caused a regression where we oops in every legacy mode SCSI host driver because they supply a NULL pointer to scsi_add_host(). Fix this by checking for the NULL in scsi_add_host_with_dma() and changing the DMA device to being the platform_bus in that case (which replicates the original behaviour). Reported-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10[SCSI] qla2xxx: Update version number to 8.04.00.03-k.Chad Dupuis1-3/+3
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10[SCSI] qla2xxx: Properly check for current state after the fabric-login request.Saurav Kashyap1-1/+17
[jejb: checkpatch fixes] Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10[SCSI] qla2xxx: Proper completion to scsi-ml for scsi status task_set_full ↵Giridhar Malavali2-3/+14
and busy. In case of firmmware detected under-run condition and scsi status of task_set_full or busy_condition, return that to the mid layer for proper error handling instead of DID_ERROR (which causes error handler activation and a full retry). Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10[SCSI] qla2xxx: Block flash access from application when device is ↵Giridhar Malavali2-0/+6
initialized for ISP82xx. Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10[SCSI] qla2xxx: Fix reset time out as qla2xxx not ack to reset request.Vikas Chaudhary1-0/+1
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-09Merge branch 'sfc-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfcDavid S. Miller1-1/+1
2012-05-09cifs: fix revalidation test in cifs_llseek()Dan Carpenter1-1/+1
This test is always true so it means we revalidate the length every time, which generates more network traffic. When it is SEEK_SET or SEEK_CUR, then we don't need to revalidate. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2012-05-09Merge tag 'fixes-for-linus' of ↵Linus Torvalds5-8/+9
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM: SoC fixes from Olof Johansson: "Things have slowed down a lot for us, but we have five more fixes for omap and kirkwood below. Three are for boards setup issues, two are SoC-level fixes." * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: ARM: OMAP: igep0020: fix smsc911x dummy regulator id ARM: orion5x: Fix GPIO enable bits for MPP9 ARM: kirkwood: add missing kexec.h include ARM: OMAP: Revert "ARM: OMAP: ctrl: Fix CONTROL_DSIPHY register fields" ARM: OMAP1: Amstrad Delta: Fix wrong IRQ base in FIQ handler
2012-05-09Merge tag 'regmap-3.4' of ↵Linus Torvalds1-1/+3
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull last minute regman bug fix from Mark Brown: "This is a last minute bug fix that was only just noticed since the code path that's being exercised here is one that is fairly rarely used. The changelog for the change itself is extremely clear and the code itself is obvious to inspection so should be pretty safe." * tag 'regmap-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: fix possible memory corruption in regmap_bulk_read()
2012-05-09Merge git://git.kernel.org/pub/scm/virt/kvm/kvmLinus Torvalds5-20/+16
Pull KVM fixes from Avi Kivity: "Two asynchronous page fault fixes (one guest, one host), a powerpc page refcount fix, and an ia64 build fix." * git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: ia64: fix build due to typo KVM: PPC: Book3S HV: Fix refcounting of hugepages KVM: Do not take reference to mm during async #PF KVM: ensure async PF event wakes up vcpu from halt
2012-05-09Merge branch 'merge' of ↵Linus Torvalds5-29/+16
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc Pull powerpc fixes from Benjamin Herrenschmidt: "Here are a couple of last minute fixes for 3.4 for regressions introduced by my rewrite of the lazy irq masking code." * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: powerpc/irq: Make alignment & program interrupt behave the same powerpc/irq: Fix bug with new lazy IRQ handling code
2012-05-09kmemleak: Fix the kmemleak tracking of the percpu areas with !SMPCatalin Marinas1-0/+2
Kmemleak tracks the percpu allocations via a specific API and the originally allocated areas must be removed from kmemleak (via kmemleak_free). The code was already doing this for SMP systems. Reported-by: Sami Liedes <sami.liedes@iki.fi> Cc: Tejun Heo <tj@kernel.org> Cc: Christoph Lameter <cl@linux-foundation.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2012-05-09percpu: pcpu_embed_first_chunk() should free unused parts after all allocs ↵Tejun Heo1-0/+10
are complete pcpu_embed_first_chunk() allocates memory for each node, copies percpu data and frees unused portions of it before proceeding to the next group. This assumes that allocations for different nodes doesn't overlap; however, depending on memory topology, the bootmem allocator may end up allocating memory from a different node than the requested one which may overlap with the portion freed from one of the previous percpu areas. This leads to percpu groups for different nodes overlapping which is a serious bug. This patch separates out copy & partial free from the allocation loop such that all allocations are complete before partial frees happen. This also fixes overlapping frees which could happen on allocation failure path - out_free_areas path frees whole groups but the groups could have portions freed at that point. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: stable@vger.kernel.org Reported-by: "Pavel V. Panteleev" <pp_84@mail.ru> Tested-by: "Pavel V. Panteleev" <pp_84@mail.ru> LKML-Reference: <E1SNhwY-0007ui-V7.pp_84-mail-ru@f220.mail.ru>
2012-05-09Merge tag 'omap-fixes-for-v3.4-rc6-take-2' of ↵Olof Johansson3-6/+6
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes Fix two board spefific regressions and one regression caused by bad documentation By Archit Taneja (1) and others via Tony Lindgren * tag 'omap-fixes-for-v3.4-rc6-take-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP: igep0020: fix smsc911x dummy regulator id ARM: OMAP: Revert "ARM: OMAP: ctrl: Fix CONTROL_DSIPHY register fields" ARM: OMAP1: Amstrad Delta: Fix wrong IRQ base in FIQ handler
2012-05-09ARM: OMAP: igep0020: fix smsc911x dummy regulator idEnrico Butera1-1/+1
id 0 is already used and causes errors at boot: WARNING: at fs/sysfs/dir.c:508 sysfs_add_one+0x9c/0xac() sysfs: cannot create duplicate filename '/devices/platform/reg-fixed-voltage.0' Fix it by using the next available one (id=1). This was caused by 5b3689f4 (ARM: OMAP2+: smsc911x: Add fixed board regulators) that did not account for some regulators already being used. Signed-off-by: Enrico Butera <ebutera@users.berlios.de> [tony@atomide.com: updated comments for regression causing commit] Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-05-09regmap: fix possible memory corruption in regmap_bulk_read()Laxman Dewangan1-1/+3
The function regmap_bulk_read() calls the regmap_read() for each register if set of register has volatile and cache is enabled. In this case, last few register read makes the memory corruption if the register size is not the size of unsigned int. The regam_read() takes argument as unsigned int for returning value and it update the value as *val = map->format.parse_val(map->work_buf); This causes complete 4 bytes (size of unsigned int) to get written. Now if client pass the memory pointer for value which is equal to the required size of register count in regmap_bulk_read() then last few register read actually update the memory beyond passed pointer size. Avoid this by using local variable for read and then do memcpy() for actual byte copy to passed pointer based on register size. I allocated one pointer ptr and take first 16 bytes dump of that pointer then call regmap_bulk_read() with pointer which is just on top of this allocated pointer and register count of 128. Here register size is 1 byte. The memory trace of last 5 register read are as follows: [ 5.438589] regmap_bulk_read after regamp_read() for register 122 [ 5.447421] 0xef993c20 0xef993c00 0x00000000 0x00000001 [ 5.467535] regmap_bulk_read after regamp_read() for register 123 [ 5.476374] 0xef993c20 0xef993c00 0x00000000 0x00000001 [ 5.496425] regmap_bulk_read after regamp_read() for register 124 [ 5.505260] 0xef993c20 0xef993c00 0x00000000 0x00000001 [ 5.525372] regmap_bulk_read after regamp_read() for register 125 [ 5.534205] 0xef993c00 0xef993c00 0x00000000 0x00000001 [ 5.554258] regmap_bulk_read after regamp_read() for register 126 [ 5.563100] 0xef990000 0xef993c00 0x00000000 0x00000001 [ 5.554258] regmap_bulk_read after regamp_read() for register 127 [ 5.587108] 0xef000000 0xef993c00 0x00000000 0x00000001 Here it is observed that the memory content at first word started changing on last 3 regmap_read() and so corruption happened. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-09Merge tag 'asoc-3.4' of ↵Takashi Iwai1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Build fix for SH in 3.4 An API update which wasn't sufficiently thorough in updating the tree...
2012-05-09ASoC: sh: fix migor.c compilationGuennadi Liakhovetski1-1/+1
Fix a recent compilation breakage, caused by a change in SH clock API. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-09KVM: ia64: fix build due to typoAvi Kivity1-1/+1
s/kcm/kvm/. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2012-05-09ALSA: HDA: Lessen CPU usage when waiting for chip to respondDavid Henningsson1-2/+4
When an IRQ for some reason gets lost, we wait up to a second using udelay, which is CPU intensive. This patch improves the situation by waiting about 30 ms in the CPU intensive mode, then stepping down to using msleep(2) instead. In essence, we trade some granularity in exchange for less CPU consumption when the waiting time is a bit longer. As a result, PulseAudio should no longer be killed by the kernel for taking up to much RT-prio CPU time. At least not for *this* reason. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Tested-by: Arun Raghavan <arun.raghavan@collabora.co.uk> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-09Merge branch 'kirkwood_fixes_for_v3.4' of ↵Olof Johansson2-2/+3
git://git.infradead.org/users/jcooper/linux-kirkwood into fixes By Ben Hutchings (1) and Ian Campbell (1) via Jason Cooper: "ARM: kirkwood: fixes for v3.4" * 'kirkwood_fixes_for_v3.4' of git://git.infradead.org/users/jcooper/linux-kirkwood: ARM: orion5x: Fix GPIO enable bits for MPP9 ARM: kirkwood: add missing kexec.h include
2012-05-09powerpc/irq: Make alignment & program interrupt behave the sameBenjamin Herrenschmidt3-10/+9
Alignment was the last user of the ENABLE_INTS macro, which we can now remove. All non-syscall exceptions now disable interrupts on entry, they get re-enabled conditionally from C code. Don't unconditionally re-enable in program check either, check the original context. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-05-09powerpc/irq: Fix bug with new lazy IRQ handling codeBenjamin Herrenschmidt2-19/+7
We had a case where we could turn on hard interrupts while leaving the PACA_IRQ_HARD_DIS bit set in the PACA. This can in turn cause a BUG_ON() to hit in __check_irq_replay() due to interrupt state getting out of sync. The assembly code was also way too convoluted. Instead, we now leave it to the C code to do the right thing which ends up being smaller and more readable. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-05-08r8169: fix unsigned int wraparound with TSOJulien Ducourthial1-6/+10
The r8169 may get stuck or show bad behaviour after activating TSO : the net_device is not stopped when it has no more TX descriptors. This problem comes from TX_BUFS_AVAIL which may reach -1 when all transmit descriptors are in use. The patch simply tries to keep positive values. Tested with 8111d(onboard) on a D510MO, and with 8111e(onboard) on a Zotac 890GXITX. Signed-off-by: Julien Ducourthial <jducourt@free.fr> Acked-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-08Merge branch 'fixes' of ↵David S. Miller2-11/+19
git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch
2012-05-08ARM: orion5x: Fix GPIO enable bits for MPP9Ben Hutchings1-2/+2
Commit 554cdaefd1cf7bb54b209c4e68c7cec87ce442a9 ('ARM: orion5x: Refactor mpp code to use common orion platform mpp.') seems to have accidentally inverted the GPIO valid bits for MPP9 (only). For the mv2120 platform which uses MPP9 as a GPIO LED device, this results in the error: [ 12.711476] leds-gpio: probe of leds-gpio failed with error -22 Reported-by: Henry von Tresckow <hvontres@gmail.com> References: http://bugs.debian.org/667446 Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: stable@vger.kernel.org [v3.0+] Tested-by: Hans Henry von Tresckow <hvontres@gmail.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2012-05-08Merge tag 'regulator-3.4' of ↵Linus Torvalds2-2/+5
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fixes from Mark Brown: "One small fix for an edge condition in the max8997 driver and a fix for a surprise in the devres API which caused devm_regulator_put() to not actually put the regulator - a nicer version of this based on an improvement of the devres API is queued for 3.5." * tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: Actually free the regulator in devm_regulator_put() regulator: Fix the logic to ensure new voltage setting in valid range
2012-05-08ARM: kirkwood: add missing kexec.h includeIan Campbell1-0/+1
Fixes the following build error when CONFIG_KEXEC is enabled: CC arch/arm/mach-kirkwood/board-dt.o arch/arm/mach-kirkwood/board-dt.c: In function 'kirkwood_dt_init': arch/arm/mach-kirkwood/board-dt.c:52:2: error: 'kexec_reinit' undeclared (first use in this function) arch/arm/mach-kirkwood/board-dt.c:52:2: note: each undeclared identifier is reported only once for each function it appears in Signed-off-by: Ian Campbell <ijc@hellion.org.uk> [v4, rebase onto recent Linus for repost] [v3, speak actual English in the commit message, thanks Sergei Shtylyov] [v2, using linux/kexec.h not asm/kexec.h] Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2012-05-08Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds4-181/+34
Pull drm fixes from Dave Airlie: "Two fixes from Intel, one a regression, one because I merged an early version of a fix. Also the nouveau revert of the i2c code that was tested on the list." * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: drm/nouveau/i2c: resume use of i2c-algo-bit, rather than custom stack drm/i915: Do no set Stencil Cache eviction LRA w/a on gen7+ drm/i915: disable sdvo hotplug on i945g/gm
2012-05-08Merge tag 'stable/for-linus-3.4-rc6-tag' of ↵Linus Torvalds4-25/+73
git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen Pull xen fixes from Konrad Rzeszutek Wilk: - fix to Kconfig to make it fit within 80 line characters, - two bootup fixes (AMD 8-core and with PCI BIOS), - cleanup code in a Xen PV fb driver, - and a crash fix when trying to see non-existent PTE's * tag 'stable/for-linus-3.4-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen/Kconfig: fix Kconfig layout xen/pci: don't use PCI BIOS service for configuration space accesses xen/pte: Fix crashes when trying to see non-existent PGD/PMD/PUD/PTEs xen/apic: Return the APIC ID (and version) for CPU 0. drivers/video/xen-fbfront.c: add missing cleanup code
2012-05-08Merge branch 'for-3.4-fixes' of ↵Linus Torvalds2-6/+18
git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu Pull two percpu fixes from Tejun Heo: "One adds missing KERN_CONT on split printk()s and the other makes the percpu allocator avoid using PMD_SIZE as atom_size on x86_32. Using PMD_SIZE led to vmalloc area exhaustion on certain configurations (x86_32 android) and the only cost of using PAGE_SIZE instead is static percpu area not being aligned to large page mapping." * 'for-3.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: percpu, x86: don't use PMD_SIZE as embedded atom_size on 32bit percpu: use KERN_CONT in pcpu_dump_alloc_info()
2012-05-08Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-armLinus Torvalds3-18/+12
Pull ARM fixes from Russell King: "This is mainly audit fixes, found by folks who happened to enable this feature and then found it broke their user applications." * 'fixes' of git://git.linaro.org/people/rmk/linux-arm: ARM: 7414/1: SMP: prevent use of the console when using idmap_pgd ARM: 7412/1: audit: use only AUDIT_ARCH_ARM regardless of endianness ARM: 7411/1: audit: fix treatment of saved ip register during syscall tracing ARM: 7410/1: Add extra clobber registers for assembly in kernel_execve
2012-05-08sfc: Fix division by zero when using one RX channel and no SR-IOVBen Hutchings1-1/+1
If RSS is disabled on the PF (efx->n_rx_channels == 1) we try to set up the indirection table so that VFs can use it, setting efx->rss_spread = efx_vf_size(efx). But if SR-IOV was disabled at compile time, this evaluates to 0 and we end up dividing by zero when initialising the table. I considered changing the fallback definition of efx_vf_size() to return 1, but its value is really meaningless if we are not going to enable VFs. Therefore add a condition of efx_sriov_wanted(efx) in efx_probe_interrupts(). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-05-08percpu, x86: don't use PMD_SIZE as embedded atom_size on 32bitTejun Heo1-1/+13
With the embed percpu first chunk allocator, x86 uses either PAGE_SIZE or PMD_SIZE for atom_size. PMD_SIZE is used when CPU supports PSE so that percpu areas are aligned to PMD mappings and possibly allow using PMD mappings in vmalloc areas in the future. Using larger atom_size doesn't waste actual memory; however, it does require larger vmalloc space allocation later on for !first chunks. With reasonably sized vmalloc area, PMD_SIZE shouldn't be a problem but x86_32 at this point is anything but reasonable in terms of address space and using larger atom_size reportedly leads to frequent percpu allocation failures on certain setups. As there is no reason to not use PMD_SIZE on x86_64 as vmalloc space is aplenty and most x86_64 configurations support PSE, fix the issue by always using PMD_SIZE on x86_64 and PAGE_SIZE on x86_32. v2: drop cpu_has_pse test and make x86_64 always use PMD_SIZE and x86_32 PAGE_SIZE as suggested by hpa. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Yanmin Zhang <yanmin.zhang@intel.com> Reported-by: ShuoX Liu <shuox.liu@intel.com> Acked-by: H. Peter Anvin <hpa@zytor.com> LKML-Reference: <4F97BA98.6010001@intel.com> Cc: stable@vger.kernel.org
2012-05-08KVM: PPC: Book3S HV: Fix refcounting of hugepagesDavid Gibson2-11/+13
The H_REGISTER_VPA hcall implementation in HV Power KVM needs to pin some guest memory pages into host memory so that they can be safely accessed from usermode. It does this used get_user_pages_fast(). When the VPA is unregistered, or the VCPUs are cleaned up, these pages are released using put_page(). However, the get_user_pages() is invoked on the specific memory are of the VPA which could lie within hugepages. In case the pinned page is huge, we explicitly find the head page of the compound page before calling put_page() on it. At least with the latest kernel, this is not correct. put_page() already handles finding the correct head page of a compound, and also deals with various counts on the individual tail page which are important for transparent huge pages. We don't support transparent hugepages on Power, but even so, bypassing this count maintenance can lead (when the VM ends) to a hugepage being released back to the pool with a non-zero mapcount on one of the tail pages. This can then lead to a bad_page() when the page is released from the hugepage pool. This removes the explicit compound_head() call to correct this bug. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>