Commit Graph

300402 Commits (53f2d02898755d1b24bde1975e202815d29fdb81)

Author SHA1 Message Date
Linus Torvalds f3b26922ec Merge branch 'for-3.4-fixes' of 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-10 14:59:50 -07:00
Linus Torvalds fda27bed90 Merge git://git.samba.org/sfrench/cifs-2.6
Pull cifs fix from Steve French.

* git://git.samba.org/sfrench/cifs-2.6:
  cifs: fix revalidation test in cifs_llseek()
2012-05-10 14:59:02 -07:00
Steven Rostedt 9b63776fa3 tracing: Do not enable function event with enable
With the adding of function tracing event to perf, it caused a
side effect that produces the following warning when enabling all
events in ftrace:

 # echo 1 > /sys/kernel/debug/tracing/events/enable

[console]
event trace: Could not enable event function

This is because when enabling all events via the debugfs system
it ignores events that do not have a ->reg() function assigned.
This was to skip over the ftrace internal events (as they are
not TRACE_EVENTs). But as the ftrace function event now has
a ->reg() function attached to it for use with perf, it is no
longer ignored.

Worse yet, this ->reg() function is being called when it should
not be. It returns an error and causes the above warning to
be printed.

By adding a new event_call flag (TRACE_EVENT_FL_IGNORE_ENABLE)
and have all ftrace internel event structures have it set,
setting the events/enable will no longe try to incorrectly enable
the function event and does not warn.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2012-05-10 15:55:43 -04:00
David S. Miller a5a737e090 sparc64: Do not clobber %g2 in xcall_fetch_glob_regs().
%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-10 11:00:46 -07:00
Linus Torvalds bc46f9375a NFS client bugfix for Linux 3.4
Fix for the NFSv4 security negotiation:
 - Ensure that the security negotiation tries all registered security flavours
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPq/REAAoJEGcL54qWCgDypFMP/jPWKCsMn2IlzQhlBXOR6bny
 WB4JhV3ieFvVYBiBMCIdqbWITrQ/6vo/vhMLcG2UztvPG+9Oc70z1Hy/zoCy8Ctn
 O4clRbLQtyvHoQQiWY9aHmqB0GUlxqcwpwDJAg2arUjD4pqJRsHVCw+mtLk3W+zO
 39/qIo6//sgHeJCMJ48EyLYUcwJgru9qtfbj4kOqB/0zBYdznv+lWTaXm5yWx9e2
 olZBAdABE0Oa219PdN7toUdE/CCPrayCXtKY7WEk7MvFC7qjvniaDXqWK4xtHnxy
 17caFLRmZNlmBSf6hiZyumPtIlOyaE5O63zzYripSmMWjBZ2YKZwXOdL8PoN8Tue
 3EQyR5lAxGejYX5Ja1r743EE41pPAGa5ZnJPZdv9SAJvMq2rbgQIQteCj6VJnEzv
 k/IvbHoQK+hVQHXnlXYcquhWnFMBVTWJJKcw8Z5OFF8lRtCC8Azs7mqIaHbZXqSA
 ow/up+y77vYWhD7p8VAovZ1YmT2cPBZ4wjA1XnUz4Xa+rAr8JFpzLA0hu8qYwytg
 Se3f1JfSaSTg/V1b2t7jP5p+8b72AFrjrQ0uFAdEKCJkQ90H+SCrOunlaek/x83S
 VSBAhe9MopGvs/SXltDUGUv38yzE5wuJZnnPcH5MDSAwBknH4noOYtIJpkiihkpM
 MOKDs0ASYU2Hnt+HYPmH
 =xNqW
 -----END PGP SIGNATURE-----

Merge tag 'nfs-for-3.4-5' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

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-10 10:05:19 -07:00
Linus Torvalds ed3ac021e5 sound fixes for 3.4-rc7
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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQIcBAABAgAGBQJPq2sLAAoJEGwxgFQ9KSmk4ZMP/jC9XLQpn3Y95+/id/D+54R5
 dU4aIQYNo1vheODv9hToN6Zvyd+FrouU7mikKwFnyJ1iuPfsxKrsaY+ifbfqXuQo
 L0CuWDnwSDutDf5D3s8G+jg0VQHoYu+Dv7MgLqKs/DGYe3iNZKD34QtgOq0BVio0
 9PP6bQCVB48TeTte3b0KD4O8rWBfSreDJj+UEewFy0V81f8P/e/ILJnkPW144FXy
 1DaR70wE/1wvhW4GWvc+WGM+iH5mUWLaE49K7wdXqcTgR7XRejG4BjWAJBKEoHVc
 o3AmFMTfidMzHokXdU6YgV16I8IXRmlEWFnlEGA5dxVsh0JP0t2d3mIQpcVJMm3E
 Gpz5OMSjRvuOcW3wkNWYYgcm+npHtiRcXYKr+azFymsPoTSA0xlDoi7HQsVbMzG+
 Jz5AwtsyZcp2BIolLvAJTXmBiHuRHNjHW2huqV+G2OI37A5YZWRIfD2vEF07MxXH
 FMRCUEHOMVbRuvZtUnSGbcpdVuSMS2hjwsOdBcO03oPVrc/gp224oQvG2iNxsCHu
 iH0s114j1mIYxVZX4dx+sjMyD9h3lVSghNQcz9Z7jShWdJBiQuiIneTd3y0FVbh1
 l0Nq9A/oPbIYK9kbSb9z4J13WmXeS7rFYdFSPNJJ7XAKwIsZdqEMbxZM3fLHoi7b
 dF95KKVJ7VwCeLjrDVZ4
 =7Zz7
 -----END PGP SIGNATURE-----

Merge tag 'sound-3.4' of 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-10 09:26:58 -07:00
Jan Kiszka b7dafa0ef3 compat: Fix RT signal mask corruption via sigprocmask
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-10 08:58:33 -07:00
Tarun Kanti DebBarma 6edd94db25 gpio/omap: fix incorrect initialization of omap_gpio_mod_init
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 07:16:15 -07:00
Paolo Bonzini e4594bb505 [SCSI] virtio_scsi: fix TMF use-after-free
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 08:27:06 +01:00
James Bottomley 3c8d9a957d [SCSI] fix oops in all legacy host adapters caused by 6f381fa
Commit 6f381fa344
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 08:24:13 +01:00
Chad Dupuis 6abd7f132a [SCSI] qla2xxx: Update version number to 8.04.00.03-k.
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 08:19:10 +01:00
Saurav Kashyap aaf4d3e2c6 [SCSI] qla2xxx: Properly check for current state after the fabric-login request.
[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 08:18:04 +01:00
Giridhar Malavali 4aee57667e [SCSI] qla2xxx: Proper completion to scsi-ml for scsi status task_set_full 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 08:15:19 +01:00
Giridhar Malavali a49393f2ae [SCSI] qla2xxx: Block flash access from application when device is 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 08:10:58 +01:00
Vikas Chaudhary f4e1648a4f [SCSI] qla2xxx: Fix reset time out as qla2xxx not ack to reset request.
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-10 08:07:49 +01:00
David S. Miller 0e0c55165b Merge branch 'sfc-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc 2012-05-09 22:49:57 -04:00
Dan Carpenter 48a5730e5b cifs: fix revalidation test in cifs_llseek()
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-09 15:16:22 -05:00
Linus Torvalds 7ee94d97aa ARM: SoC fixes for 3.4-rc
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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPqpiAAAoJEIwa5zzehBx36WcP/A3yfgwccYQPAGiazDWMoxj+
 bLdr49L4tgFf8dwRno+IeAKjhhBDYUJgNoz46Tnqfh1L7ImIvGUlPDtqfQGb5+HK
 HZ+mz46ZUoJPdvBS8CY7Xf5lP/5iiMI+wBeE33bu+EyKhgbD8wYmQDCsJJhjjRLW
 TqR/a74Mz/yX9sCL5pZ/ktKhxV/FvBMT3pqpU8Eb50hDtStTouf25EmyLv0iVmJx
 45pwG3+nx6R+/Lu2rwCroKUTl/cNR95L9+EGMzb99aZXSsGS5zmiAEQ2TNcp0lxb
 JMR3bB9zTDWmY1VZ83os2NI1GDOj1Zdvqns/iiBRKLUBvFN447tMdRvZMomvM3VQ
 whiKd5R0aFa42KROZq7V+t540FeLqgDvHY4zeOPDRGrh1Y9ElgCJnciX4Hxm779n
 KH9VlnHrUW3tNHqlLKXTJ1tuvNSbNUE2FtG/m+oJLyUyH4CJzNi1R1rofZEEHEH/
 8zeJzw6amwpSWyLEi1HjyhFOJ8WqOnY17LMWilQeeYbqHGwXGKTOmm9P8PKPk4cx
 dFlwCeJgd7VL+L5rn8LVOjvov7j1iakKZhtSjLMjF4k088MejDVOfTj21Qs5MiHI
 nl03BOvtmwEGXUbYHKromzeHMvoXXWuQyK13cWmgBXAiAGgX76mNU9GukwXU3rqm
 TGrRTsiuGzYQn9w3EVFL
 =GX6x
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-linus' of 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-09 11:27:00 -07:00
Linus Torvalds 22b6dd78ae regmap: Last minute bug fix for 3.4
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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPqoQhAAoJEBus8iNuMP3dj1kP/0Z1yIk1ME0KzSy42/qbGKsp
 +2mrAASkh7DbbWU2hSmwTpEgAAiY2ws0A/Uyj/Al4f/gJW6bZvlxK4mbf1i+P1LG
 ab3ohhUOqexHVaIKMTnYKhnHWuzU25mnf2vW8IOr6jccu6h7X4orDmw1uEPVgsbs
 P7fThQa0BPRkiLIUWGmg0oMY6IXJlzsStDK2Npw47EypY4FZCZucJgXkmYZLt0Nk
 mhLPsznD5GqHNSmCqrUI3j/s3R0sd/Xc63pvznBU9D8RAbSRgi2vGL8UenEtIQgt
 bVXOKe5H8ZzXYNYpzpGeJm3dTE2pZWmT1hfRSf0kBOkLhEpt/Oy9WBj1kfoTg9n9
 fNH6OJYn12uG0qQomiAT96Qm3qrslF5y9S64ZyHT6BAkJT87wnEqTmaQkoAevDEr
 hldzT+dTPAk2Pspge8m910+kQA72YyE1z6/PikvkEepYDFrqffZcBFWqjW8aQjGj
 /5r7F5fLC7zJku0FjYUMRYDgYc9z0lk6tDt8QL7E7j+55ntrhYR8IuTQA7g2asal
 yeQSTqa/NkJcch+aULgyOU0W9U1z2i04mdGI74iJnf3DSGGmvJ95IYLJA4tfnIOw
 63xo2BhmHVGyRqTN5l7o5Zlgf5FdcUt+5EBLudSqqZynB/tMZNgb0PEzfIRFBuRq
 GSIm5dwIqKgtymCEOUmp
 =xcal
 -----END PGP SIGNATURE-----

Merge tag 'regmap-3.4' of 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-09 11:25:45 -07:00
Linus Torvalds 63f4711aec Merge git://git.kernel.org/pub/scm/virt/kvm/kvm
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-09 11:14:13 -07:00
Linus Torvalds 6a5beacca8 Merge branch 'merge' of 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-09 11:07:29 -07:00
David Ahern 20d23aaa31 perf stat: handle ENXIO error for perf_event_open
perf stat on PPC currently fails to run:

$ perf stat -- sleep 1
  Error: open_counter returned with 6 (No such device or address). /bin/dmesg may provide additional information.

  Fatal: Not all events could be opened.

The problem is that until 2.6.37 (behavior changed with commit b0a873e)
perf on PPC returns ENXIO when hw_perf_event_init() fails. With this
patch we get the expected behavior:

$ perf stat -v -- sleep 1
cycles event is not supported by the kernel.
stalled-cycles-frontend event is not supported by the kernel.
stalled-cycles-backend event is not supported by the kernel.
instructions event is not supported by the kernel.
branches event is not supported by the kernel.
branch-misses event is not supported by the kernel.

...

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1336490956-57145-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-09 14:14:41 -03:00
Catalin Marinas 100d13c3b5 kmemleak: Fix the kmemleak tracking of the percpu areas with !SMP
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-09 10:13:29 -07:00
Tejun Heo 42b6428145 percpu: pcpu_embed_first_chunk() should free unused parts after all allocs 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-09 10:08:16 -07:00
Olof Johansson e396dbd4ed Fix two board spefific regressions and one regression caused by bad documentation
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPqowwAAoJEBvUPslcq6VzDPQP/1LBOfJb6OMdK+lfDA49tMtU
 q/Qzq5GvgKA7+Opb3n5TVpnXh1cT7tSrvDtYI/ol8KaCVkLLoxdIO1dJekPyX81H
 +W4JoUYOLDAKfJ7FP44K7MJu/TsXsQ22Hyv6hYKw9lfm9rzIQwp/ofD08g9HDubc
 j6BbrIH/mBEIheJPor1Iz1j+A50EImKpkixrfD9ttJfJkwu3FmzDp+KvLNhzDX7H
 VCCYatJIkJPXEqIwaVjOyAqSvU3ZHFLxkFVjzRwkLpd2bNA1KX/FjOzv4lrK4jf3
 A2eEce/YSPrNn8KhM+mB/UKLLJ3ifgUvDS6IsvVkxwsPUyGpEwFL1KBEiAlVfApq
 WWxC/WZcZgHlXs4WRH/FS5ERLuPhaom+YkSs8bZRqAGxtA8RO1E6yNG6fzlp84/B
 LFxKa7TXEMCmSoRye6rZ4gmndCQ+8q0OQv1M89aHvn/iv7arS8XtWLGzp01qAQzQ
 OX8CCRxiRxJd9g3nCLhGq77UTI89ZiP86562Df50Akc2SYPCrw2hPR1rYjzU1TCl
 2nVQsDhSJDcGTuIVClTUmbUMM34RJQxlxAgxBJkDPshNjXiV0qMzYe+U1t4HjArE
 IBfshxY0qL6x8y2cdoeDkSpSyhjbeHZqPHYJ/nGFCkTNCQF1+c6o3NqYmdtd+bsF
 bAF1qF3FGhjXubgzpOzM
 =k8QU
 -----END PGP SIGNATURE-----

Merge tag 'omap-fixes-for-v3.4-rc6-take-2' of 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-09 09:03:34 -07:00
Enrico Butera 1a21932edc ARM: OMAP: igep0020: fix smsc911x dummy regulator id
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-09 08:12:05 -07:00
Laxman Dewangan 6560ffd1cc regmap: fix possible memory corruption in regmap_bulk_read()
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-09 15:44:11 +01:00
Takashi Iwai 9ea3356d79 ASoC: Build fix for SH in 3.4
An API update which wasn't sufficiently thorough in updating the tree...
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIbBAABAgAGBQJPqlf6AAoJEBus8iNuMP3duOcP+MUkL8T/PMaehNqqcLW6tJCE
 vxmS5RzpRcsGBzc5MYGpuzItpNiqEZGjHsp+2RAGTY3P5ACIJ04jzrwFxCrkoFB4
 w4tro6dz8uFA+gWAFqd+/D/UQXE7bDfxy2mZ0PYjgZtA8C2aVaQuIt0Btkt4jcqo
 42LioL2JM0OERHPf2cacuownf3YU8O1srVfhTXpbgKjUU4llkIzA6UMOjAZuTf6W
 z0dmXet5DHs19f7PM8PnRxTUkCuMM5KtzCUPhENxf/mTb8RWc/rS6iJrhWTkzVYg
 Kn41YDXElcjakoOiM/T8kaUe25Y3d1YSKgy/4OiFvn8fdb/icXai+3Z2eEk7Tnye
 ZEzSEheSuNw/6IHEcdw8wxy0Dh/Cal6oDUSANk3d3+vVGjxMGK7IpuKdJ3vk353f
 +MRwTxlfRQUlwRlv2Wp4J6TQ13nJKksalvGTcsDfmtcAQTP0s+8xtXG0gzWNuqJo
 tGTt4sLTMjLsJawH7fLqsUVRzrFqJaFSQ0fkxU3sVnomREDTQkaIPFDXJPS1id2C
 E4VIHkYi3mA9ki0TH67HcCvKnNm765oUAiqovZiu4LdH9vJpM+yAnG0Hc8SrM7AQ
 9jK6z9YOdHV7KyGpBUq8LM2+lLTLZRsFLPQ/d2xiJw2JxCYZD9YykQv90ZGMtTaR
 Ks8T4KioUZinkCSB4eg=
 =HF38
 -----END PGP SIGNATURE-----

Merge tag 'asoc-3.4' of 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-09 14:03:29 +02:00
Guennadi Liakhovetski c8587193ba ASoC: sh: fix migor.c compilation
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-09 12:41:05 +01:00
Avi Kivity 331b646d60 KVM: ia64: fix build due to typo
s/kcm/kvm/.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2012-05-09 13:53:28 +03:00
Igor Mammedov 30b4e9eb78 sched: Fix KVM and ia64 boot crash due to sched_groups circular linked list assumption
If we have one cpu that failed to boot and boot cpu gave up on
waiting for it and then another cpu is being booted, kernel
might crash with following OOPS:

   BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
   IP: [<ffffffff812c3630>] __bitmap_weight+0x30/0x80
   Call Trace:
       [<ffffffff8108b9b6>] build_sched_domains+0x7b6/0xa50

The crash happens in init_sched_groups_power() that expects
sched_groups to be circular linked list. However it is not
always true, since sched_groups preallocated in __sdt_alloc are
initialized in build_sched_groups and it may exit early

        if (cpu != cpumask_first(sched_domain_span(sd)))
                return 0;

without initializing sd->groups->next field.

Fix bug by initializing next field right after sched_group was
allocated.

Also-Reported-by: Jiang Liu <liuj97@gmail.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Cc: a.p.zijlstra@chello.nl
Cc: pjt@google.com
Cc: seto.hidetoshi@jp.fujitsu.com
Link: http://lkml.kernel.org/r/1336559908-32533-1-git-send-email-imammedo@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-05-09 12:27:35 +02:00
David Henningsson 32cf4023e6 ALSA: HDA: Lessen CPU usage when waiting for chip to respond
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-09 10:22:06 +02:00
Olof Johansson 973076ae0a Merge branch 'kirkwood_fixes_for_v3.4' of 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-09 00:05:25 -07:00
Benjamin Herrenschmidt a3512b2dd5 powerpc/irq: Make alignment & program interrupt behave the same
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-09 09:42:33 +10:00
Benjamin Herrenschmidt 56dfa7fa19 powerpc/irq: Fix bug with new lazy IRQ handling code
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-09 09:42:21 +10:00
Julien Ducourthial 477206a018 r8169: fix unsigned int wraparound with TSO
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-08 19:34:10 -04:00
David S. Miller c5baa80ac8 Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch 2012-05-08 19:31:32 -04:00
Janusz Krzysztofik b027274d2e mtd: ams-delta: fix request_mem_region() failure
A call to request_mem_region() has been introduced in the omap-gpio
driver recently (commit 96751fcbe5,
"gpio/omap: Use devm_ API and add request_mem_region"). This change
prevented the Amstrad Delta NAND driver, which was doing the same in
order to take control over OMAP MPU I/O lines that the NAND device hangs
off, from loading successfully.

The I/O lines and corresponding registers used by the NAND driver are a
subset of those used for the GPIO function. Then, to avoid run time
collisions, all MPUIO GPIO lines should be marked as requested while
initializing the NAND driver, and vice versa, a single MPUIO GPIO line
already requested before the NAND driver initialization is attempted
should prevent the NAND device from being started successfully.

There is another driver, omap-keypad, which also manipulates MPUIO
registers, but has never been calling request_mem_region() on startup,
so it's not affected by the change in the gpio-omap and works correctly.
It uses the depreciated omap_read/write functions for accessing MPUIO
registers. Unlike the NAND driver, these I/O lines and registers are
separate from those used by the GPIO driver. However, both register sets
are non-contiguous and overlapping, so it would be impractical to
request the two sets separately, one from the gpio-omap, the other form
the omap-keypad driver.

In order to solve all these issues correctly, a solution first suggested
by Artem Bityutskiy, then closer specified by Tony Lindgren while they
commented the initial version of this fix, should be implemented. The
gpio-omap driver should export a few functions which would allow the
other two drivers to access MPUIO registers in a safe manner instead of
trying to manage them in parallel to the GPIO driver.  However, such a
big change, affecting 3 drivers all together, is not suitable for the rc
cycle, and should be prepared for the merge window.  Then, an
alternative solution is proposed as a regression fix.

For the ams-delta NAND driver to initialize correctly in coexistence
with the changed GPIO driver, drop the request_mem_region() call from
the former, especially as this call is going to be removed while the
long-term solution is implemented.

Tested on Amstrad Delta.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-05-08 16:24:33 -05:00
Ben Hutchings 48d99f47a8 ARM: orion5x: Fix GPIO enable bits for MPP9
Commit 554cdaefd1 ('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-08 18:57:21 +00:00
Linus Torvalds 1eef1600af regulator: A couple of fixes for 3.4
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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPp99CAAoJEBus8iNuMP3d7VwP/387BkvdNpC0UwWKomSJ9G2+
 bwRXqKGUcRX2yB1EBs+jPyx1kUk1J/a2iVeJ3oC54gPWLOB/lbMvld9wRMqziplq
 0bTR+Hjeflh+WAAhnGHHvKZR+lxT3oz8FjESq9xVQYroB6ZLSCfbf9FWO2wcfyzo
 Pc/qa0UOV98UPYPvcAG2ixBn/VLL6jAZNupnwPcWb9tVlGWeyHakLMS46oJnESGw
 wUUYSWaxEQzvNx91DqeRdJmvINh9WjT4nwQMeoiUGnAXc2wpm0mUu9Ac+c0fMcd5
 NG/ojZX7kLB8sgjWNG9IQrYaxz53F7LaqyOwmOAI/ld16hp/6SPT+fgIBR64cR3s
 4UmjLnr5EYjiumzztz5QyGs+BlbVSgUy5z615c4vGpwxfPL/MQ54K8ngW3hQWZiH
 GH6TvQncxigoPjwB3OJwxXozCCEmYOqRDAP9C7CvKcZzVehUyaDCRPSwCr0NRnj2
 /bZXRlVOeWmXO2eN9Tr/l1kLY6S13gMkldLDcbJFykko1DD422bV3nsXU24EF0uD
 Rxb+S1WA1Hd435DYYTEnh727LLvECO8bOQQ0f7hqEO5Dv+pfqzd8afVn+KQdNK7v
 wN4w2MdgtvoEfTy6ciVDXBJR1/NR5uJsA6ryzo7N092e3vn7f8DQOHFyk4slHHBp
 23gCXM7LYO6cUdJqMv9K
 =Q7eh
 -----END PGP SIGNATURE-----

Merge tag 'regulator-3.4' of 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-08 11:49:30 -07:00
Ian Campbell a7ac56de83 ARM: kirkwood: add missing kexec.h include
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-08 18:43:25 +00:00
Linus Torvalds 789505b057 Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
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-08 11:20:47 -07:00
Linus Torvalds 4ed6cedeef Innocuous fixes:
* 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
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQEcBAABAgAGBQJPp/iaAAoJEFjIrFwIi8fJAFsH/1NVxvOAHyzyczU49U/1vi8T
 d67kIb8fFHni6HO7BiBkuM8DricGQnDhP7uC1n9waWf8jRiYsPTAbesyedTLbQos
 SLfzpsLWKilJOxWCf17cBnm6i9ScQn1ioJ6h3jFzHgNCXnvvAVYqfKHW0V6HTErH
 JL0eb4+asiZgXNSeac1gabQlai6LuBzMWaFgzRGY+hDnCQhkdQfDkD7X5zEhUUmH
 jUmtSxRx+5LkfelwRb2kHhI5j58ilOEa7YLZFQc3C+2+bUvgsG9vJDsQ3jwFaGDn
 cryfRY9WJXxgcXqk1ClOnk9U9PGzRc48gdLVLhYuLsIvUWN7RzgRlBMsH33Gq9M=
 =kjvX
 -----END PGP SIGNATURE-----

Merge tag 'stable/for-linus-3.4-rc6-tag' of 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-08 11:07:29 -07:00
Linus Torvalds e9b19cd43f Merge branch 'for-3.4-fixes' of 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-08 11:06:07 -07:00
Linus Torvalds 301cdf5c75 Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm
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-08 11:05:05 -07:00
Ben Hutchings 3132d2827d sfc: Fix division by zero when using one RX channel and no SR-IOV
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-08 18:26:40 +01:00
Jean-François Moine 788ab1bb03 [media] gspca - sonixj: Fix a zero divide in isoc interrupt
In case of short marker, the number of received packets was not
incremented doing a zero divide when computing the filling rate.

Reported-by: Hans Petter Selasky <hans.petter.selasky@bitfrost.no>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-08 13:42:33 -03:00
Tejun Heo d5e28005a1 percpu, x86: don't use PMD_SIZE as embedded atom_size on 32bit
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-08 09:42:18 -07:00
David Gibson de6c0b02d4 KVM: PPC: Book3S HV: Fix refcounting of hugepages
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>
2012-05-08 17:54:08 +03:00
Jan Beulich b2a3477727 x86: Fix section annotation of acpi_map_cpu2node()
Commit 943bc7e110 ("x86: Fix section warnings") added
__cpuinitdata here, while for functions __cpuinit should be
used.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: <sp@numascale.com>
Link: http://lkml.kernel.org/r/4FA947910200007800082470@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Steffen Persvold <sp@numascale.com>
2012-05-08 16:40:26 +02:00