Commit Graph

505815 Commits

Author SHA1 Message Date
Catalin Marinas 9d42d48a34 arm64: compat Fix siginfo_t -> compat_siginfo_t conversion on big endian
The native (64-bit) sigval_t union contains sival_int (32-bit) and
sival_ptr (64-bit). When a compat application invokes a syscall that
takes a sigval_t value (as part of a larger structure, e.g.
compat_sys_mq_notify, compat_sys_timer_create), the compat_sigval_t
union is converted to the native sigval_t with sival_int overlapping
with either the least or the most significant half of sival_ptr,
depending on endianness. When the corresponding signal is delivered to a
compat application, on big endian the current (compat_uptr_t)sival_ptr
cast always returns 0 since sival_int corresponds to the top part of
sival_ptr. This patch fixes copy_siginfo_to_user32() so that sival_int
is copied to the compat_siginfo_t structure.

Cc: <stable@vger.kernel.org>
Reported-by: Bamvor Jian Zhang <bamvor.zhangjian@huawei.com>
Tested-by: Bamvor Jian Zhang <bamvor.zhangjian@huawei.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2015-02-27 18:05:56 +00:00
Catalin Marinas a1e50a8225 arm64: Increase the swiotlb buffer size 64MB
With commit 3690951fc6 (arm64: Use swiotlb late initialisation), the
swiotlb buffer size is limited to MAX_ORDER_NR_PAGES. However, there are
platforms with 32-bit only devices that require bounce buffering via
swiotlb. This patch changes the swiotlb initialisation to an early 64MB
memblock allocation. In order to get the swiotlb buffer correctly
allocated (via memblock_virt_alloc_low_nopanic), this patch also defines
ARCH_LOW_ADDRESS_LIMIT to the maximum physical address capable of 32-bit
DMA.

Reported-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2015-02-27 18:05:55 +00:00
Dave Airlie 21689a440b Merge branch 'drm-atmel-hlcdc-fixes' of git://github.com/bbrezillon/linux-at91 into drm-fixes
minor atmel hclcdc fixes.

* 'drm-atmel-hlcdc-fixes' of git://github.com/bbrezillon/linux-at91:
  drm: atmel-hlcdc: remove clock polarity from crtc driver
  drm: atmel-hlcdc: remove useless pm_runtime_put_sync in probe
  drm: atmel-hlcdc: reset layer A2Q and UPDATE bits when disabling it
2015-02-27 10:31:40 +10:00
Dave Airlie d1e488fda8 Merge tag 'drm-intel-fixes-2015-02-26' of git://anongit.freedesktop.org/drm-intel into drm-fixes
First batch of fixes for v4.0-rc, plenty of cc: stable material.

* tag 'drm-intel-fixes-2015-02-26' of git://anongit.freedesktop.org/drm-intel:
  drm/i915: Fix frontbuffer false positve.
  drm/i915: Align initial plane backing objects correctly
  drm/i915: avoid processing spurious/shared interrupts in low-power states
  drm/i915: Check obj->vma_list under the struct_mutex
  drm/i915: Fix a use after free, and unbalanced refcounting
  drm/i915: Dell Chromebook 11 has PWM backlight
  drm/i915/skl: handle all pixel formats in skylake_update_primary_plane()
  drm/i915/bdw: PCI IDs ending in 0xb are ULT.
2015-02-27 10:30:07 +10:00
Dave Airlie a795e4e9dd Merge branch 'drm-fixes-4.0' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
misc radeon fixes.

* 'drm-fixes-4.0' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: only enable DP audio if the monitor supports it
  drm/radeon: fix atom aux payload size check for writes (v2)
  drm/radeon: fix 1 RB harvest config setup for TN/RL
  drm/radeon: enable SRBM timeout interrupt on EG/NI
  drm/radeon: enable SRBM timeout interrupt on SI
  drm/radeon: enable SRBM timeout interrupt on CIK v2
  drm/radeon: dump full IB if we hit a packet error
  drm/radeon: disable mclk switching with 120hz+ monitors
  drm/radeon: use drm_mode_vrefresh() rather than mode->vrefresh
  drm/radeon: enable native backlight control on old macs
2015-02-27 10:29:14 +10:00
Linus Torvalds 4f671fe2f9 - Add missing return value check to ads7828 driver
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJU7mwjAAoJEMsfJm/On5mBLU8P/2v7sSc+H560kM26vRBJybV3
 ITKthoW6DlrKHh4VCb+x5Fm2ShCWHNi1SkYRNBMOsYc61EkofIynzsH1ccPExGp2
 L6l0OJKxPVltdnNP78mvi3lfu4uLyft/GxCcCohoWh4P4TB03oGnU/soty0W/6W0
 WvGP9MIjd8YDK2+XyN3lLldxtRKGfAUfHYREJN6DRHQ/ryXDNph/qUYwLPJ1CtAv
 VfBBmAZNbvGc6tiZ8OypYdtFjmtmrcBkq3Zki4usyefe3kQxzsM7HzQiD8dhMZNe
 Bf+W5N2Ol4K8W9Kj5WSNBFddD5XL1ahb5xVHsGw/nuFuVuqNIPWkw39D1qNB/X2u
 4YSIV5TN/MISjUiWxx/PdMtebSv8a3iAP4t5tiOWyyyjKT0Sd27x5wZS8vijopXo
 kkpOM1LtCKMnMvP97aP2sKMezlArgLohN5zaQDWL3LMSUlYn5j/6dtWXtG//4CAN
 BqqAzaXpFFjo+9sQFCYeSDeQvcGp2grNHzk6J0WTi2wAaD890ndylqd71gXa6ZVe
 7vezY6oMFW3FDA2WFtrK7IMxJdmraxmDeoMpOhMlQyibmD/37E0qWFqW42YJT8Ya
 E9QQgzfa0XHckAp7JsH+EGC4zsKM8jExCvsDlGR3xSTWtQZvuSx5e4Ae/5BA+AyA
 tBiTBszffvcP4Dz5+go8
 =hM14
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-linus-v4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fix from Guenter Roeck:
 "Add missing return value check to ads7828 driver"

* tag 'hwmon-for-linus-v4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (ads7828) Check return value of devm_regmap_init_i2c
2015-02-26 15:23:02 -08:00
Linus Torvalds ed42e71acc sound fixes for 4.0-rc2
Most of changes in this pull request are about the fixes of crash of
 FireWire drivers at hot-unplugging.  In addition, there are a few
 HD-audio fixes (removal of wrong static, a pin quirk for an ASUS mobo,
 a regression fix for runtime PM on Panther Point) and a long-standing
 (but fairly minor) bug of PCM core.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJU70aGAAoJEGwxgFQ9KSmkddUQAJoTKjYh10iKfI8Qy3zXfqOo
 ExiPD83NwHZmtfJ+Qiv1uHxQNSTyqNmYRjN1Im3LW8MXe5uoUo9aRbRM3gXzCgCz
 kD6kgmnn03CeKYtCChL1J5eFWXw0YMJ/0jcu7Tlf8V0wOfntcjAng1t9G6uTGl+8
 95ZFHkI6RSODmsEMP3pmu8YsFzRkbz372eWIymzp7iw754MvVR0u3cnZ6evZBXKA
 5mtCqT5B0RoXyl1iVrXa/Jzgap4VN4U3YoxrCnlpIlhNHyCQwouD4tD6jK5gyWTb
 1GcyK8A2N1vmC5gRcP6h75/OPblm7jLyVVupM4P/7Jw4Leug6p17mxrCEDvaehUH
 aJCa6iXjsyEwBeugvOYvcQ46gBL/wayR2mKwIgzc6ktqnxFbzVUGEaMkmDdbM14i
 5/lINtremJQYtKTPtEPp3bRprwmGLt3WSqncS0rlFzf0PaPwBtaZeyu2lkp3oGq7
 SlFLrEc3CN/+OURGUNcwyn9SiK0NmjDFoGROPduRXP6rYvFxTa8IuAQnOO5taL8V
 qcyjBLETUU6gTPQbeAYGE4LU0MWywXbiAFi88OeZ/FysUQa7WupQLU9F2DCoaQa0
 fU+P4kbNDcpm6sawMux6IfqoSJCNM5ojy6aVGuDNV7LKmC9Ons1eYroBLrRTld0f
 QW9QvbpCpafz1vP8wT5G
 =lgJD
 -----END PGP SIGNATURE-----

Merge tag 'sound-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Most of changes in this pull request are about the fixes of crash of
  FireWire drivers at hot-unplugging.  In addition, there are a few
  HD-audio fixes (removal of wrong static, a pin quirk for an ASUS mobo,
  a regression fix for runtime PM on Panther Point) and a long-standing
  (but fairly minor) bug of PCM core"

* tag 'sound-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Disable runtime PM for Panther Point again
  ALSA: hda: controller code - do not export static functions
  ALSA: pcm: Don't leave PREPARED state after draining
  ALSA: fireworks/bebob/dice/oxfw: make it possible to shutdown safely
  ALSA: fireworks/bebob/dice/oxfw: allow stream destructor after releasing runtime
  ALSA: firewire-lib: remove reference counting
  ALSA: fireworks/bebob/dice/oxfw: add reference-counting for FireWire unit
  ALSA: hda - Add pin configs for ASUS mobo with IDT 92HD73XX codec
  ALSA: firewire-lib: fix an unexpected byte sequence for micro sign
2015-02-26 10:55:19 -08:00
Marc Zyngier f6242cac10 arm64: Fix text patching logic when using fixmap
Patch 2f896d5866 ("arm64: use fixmap for text patching") changed
the way we patch the kernel text, using a fixmap when the kernel or
modules are flagged as read only.

Unfortunately, a flaw in the logic makes it fall over when patching
modules without CONFIG_DEBUG_SET_MODULE_RONX enabled:

[...]
[   32.032636] Call trace:
[   32.032716] [<fffffe00003da0dc>] __copy_to_user+0x2c/0x60
[   32.032837] [<fffffe0000099f08>] __aarch64_insn_write+0x94/0xf8
[   32.033027] [<fffffe000009a0a0>] aarch64_insn_patch_text_nosync+0x18/0x58
[   32.033200] [<fffffe000009c3ec>] ftrace_modify_code+0x58/0x84
[   32.033363] [<fffffe000009c4e4>] ftrace_make_nop+0x3c/0x58
[   32.033532] [<fffffe0000164420>] ftrace_process_locs+0x3d0/0x5c8
[   32.033709] [<fffffe00001661cc>] ftrace_module_init+0x28/0x34
[   32.033882] [<fffffe0000135148>] load_module+0xbb8/0xfc4
[   32.034044] [<fffffe0000135714>] SyS_finit_module+0x94/0xc4
[...]

This is triggered by the use of virt_to_page() on a module address,
which ends to pointing to Nowhereland if you're lucky, or corrupt
your precious data if not.

This patch fixes the logic by mimicking what is done on arm:
- If we're patching a module and CONFIG_DEBUG_SET_MODULE_RONX is set,
  use vmalloc_to_page().
- If we're patching the kernel and CONFIG_DEBUG_RODATA is set,
  use virt_to_page().
- Otherwise, use the provided address, as we can write to it directly.

Tested on 4.0-rc1 as a KVM guest.

Reported-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Laura Abbott <lauraa@codeaurora.org>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2015-02-26 18:34:27 +00:00
Linus Torvalds 7dac5cb1bc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Pull btrfs fix from Chris Mason:
 "I'm still testing more fixes, but I wanted to get out the fix for the
  btrfs raid5/6 memory corruption I mentioned in my merge window pull"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: fix allocation size calculations in alloc_btrfs_bio
2015-02-26 10:34:24 -08:00
Ard Biesheuvel 0eee0fbd41 arm64: crypto: increase AES interleave to 4x
This patch increases the interleave factor for parallel AES modes
to 4x. This improves performance on Cortex-A57 by ~35%. This is
due to the 3-cycle latency of AES instructions on the A57's
relatively deep pipeline (compared to Cortex-A53 where the AES
instruction latency is only 2 cycles).

At the same time, disable inline expansion of the core AES functions,
as the performance benefit of this feature is negligible.

  Measured on AMD Seattle (using tcrypt.ko mode=500 sec=1):

  Baseline (2x interleave, inline expansion)
  ------------------------------------------
  testing speed of async cbc(aes) (cbc-aes-ce) decryption
  test 4 (128 bit key, 8192 byte blocks): 95545 operations in 1 seconds
  test 14 (256 bit key, 8192 byte blocks): 68496 operations in 1 seconds

  This patch (4x interleave, no inline expansion)
  -----------------------------------------------
  testing speed of async cbc(aes) (cbc-aes-ce) decryption
  test 4 (128 bit key, 8192 byte blocks): 124735 operations in 1 seconds
  test 14 (256 bit key, 8192 byte blocks): 92328 operations in 1 seconds

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2015-02-26 18:31:46 +00:00
Feng Kan 6910fa16db arm64: enable PTE type bit in the mask for pte_modify
Caught during Trinity testing. The pte_modify does not allow
modification for PTE type bit. This cause the test to hang
the system. It is found that the PTE can't transit from an
inaccessible page (b00) to a valid page (b11) because the mask
does not allow it. This happens when a big block of mmaped
memory is set the PROT_NONE, then the a small piece is broken
off and set to PROT_WRITE | PROT_READ cause a huge page split.

Signed-off-by: Feng Kan <fkan@apm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2015-02-26 18:30:12 +00:00
Yingjoe Chen 06ff87bae8 arm64: mm: remove unused functions and variable protoypes
The functions __cpu_flush_user_tlb_range and __cpu_flush_kern_tlb_range
were removed in commit fa48e6f780 'arm64: mm: Optimise tlb flush logic
where we have >4K granule'. Global variable cpu_tlb was never used in
arm64.

Remove them.

Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2015-02-26 18:25:38 +00:00
Will Deacon f5e0a12ca2 arm64: psci: move psci firmware calls out of line
An arm64 allmodconfig fails to build with GCC 5 due to __asmeq
assertions in the PSCI firmware calling code firing due to mcount
preambles breaking our assumptions about register allocation of function
arguments:

  /tmp/ccDqJsJ6.s: Assembler messages:
  /tmp/ccDqJsJ6.s:60: Error: .err encountered
  /tmp/ccDqJsJ6.s:61: Error: .err encountered
  /tmp/ccDqJsJ6.s:62: Error: .err encountered
  /tmp/ccDqJsJ6.s:99: Error: .err encountered
  /tmp/ccDqJsJ6.s💯 Error: .err encountered
  /tmp/ccDqJsJ6.s:101: Error: .err encountered

This patch fixes the issue by moving the PSCI calls out-of-line into
their own assembly files, which are safe from the compiler's meddling
fingers.

Reported-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2015-02-26 18:23:53 +00:00
Nathan Lynch e1b6b6ce55 arm64: vdso: minor ABI fix for clock_getres
The vdso implementation of clock_getres currently returns 0 (success)
whenever a null timespec is provided by the caller, regardless of the
clock id supplied.

This behavior is incorrect.  It should fall back to syscall when an
unrecognized clock id is passed, even when the timespec argument is
null.  This ensures that clock_getres always returns an error for
invalid clock ids.

Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2015-02-26 18:13:51 +00:00
Geert Uytterhoeven 4a3a6f8669 ARM: multi_v7_defconfig: Enable shmobile platforms
Enable support for shmobile platforms that became multi-platform aware.
Several non-critical drivers and subsystems are built as modules, to keep
kernel size reasonable.

Tested on:
  - r8a73a4/ape6evm:
      - U-Boot fails with "Error: unrecognized/unsupported machine ID",
      - kexec works.
  - r8a7740/armadillo:
      - Hermit boot loader fails (larger image, more memory corruption),
      - kexec works.
  - r8a7791/koelsch,
  - sh73a0/kzm9g:
      - zImage+DTB from U-Boot needs CONFIG_ARM_ATAG_DTB_COMPAT=n,
      - kexec works.
  - am335x/boneblack.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2015-02-26 16:36:09 +01:00
Nicolas Ferre 0bb59cb00e drm: atmel-hlcdc: remove clock polarity from crtc driver
Remove this configuration bit in crtc driver as the rising edge clock is widely
used.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-02-26 14:19:13 +01:00
Alex Deucher 3473f542ab drm/radeon: only enable DP audio if the monitor supports it
We were enabling DP secondary streams even if the monitor
didn't support them.  Fixes display problems on some DP
monitors.

Tested-by: Jim Boz <jim876@xs4all.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-25 16:06:10 -05:00
Alex Deucher 94a47c49fe drm/radeon: fix atom aux payload size check for writes (v2)
The atom aux param interface only supports 4 bits for
the total write transfer size (header + payload).  This
limits us to 12 bytes of payload rather than 16.  Add a
check for this. Reads are not affected.

v2: switch to WARN_ON_ONCE

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-25 16:06:10 -05:00
Alex Deucher dbfb00c3e7 drm/radeon: fix 1 RB harvest config setup for TN/RL
The logic was reversed from what the hw actually exposed.
Fixes graphics corruption in certain harvest configurations.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-02-25 16:06:09 -05:00
Christian König acc1522a54 drm/radeon: enable SRBM timeout interrupt on EG/NI
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-25 16:06:08 -05:00
Christian König 18ad01effe drm/radeon: enable SRBM timeout interrupt on SI
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-25 16:06:08 -05:00
Leo Liu dc12a3ec71 drm/radeon: enable SRBM timeout interrupt on CIK v2
v2: disable it on suspend

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-25 16:06:07 -05:00
Alex Deucher e1b4e722f7 drm/radeon: dump full IB if we hit a packet error
Dump the whole IB if we run into an invalid packet.
This makes things much easier to debug.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=89148

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-25 16:06:06 -05:00
Alex Deucher 951caa6acf drm/radeon: disable mclk switching with 120hz+ monitors
These tend to be problematic even if the vblank period is
long enough.  This needs more investigation across a wider
range of displays.  Disable for now.

bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=87796
https://bugs.freedesktop.org/show_bug.cgi?id=89198

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-02-25 16:06:06 -05:00
Alex Deucher 3d2d98ee1a drm/radeon: use drm_mode_vrefresh() rather than mode->vrefresh
Just in case it hasn't been calculated for the mode.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-02-25 16:06:05 -05:00
Nathan-J. Hirschauer 7a26f9ad1b drm/radeon: enable native backlight control on old macs
Commit b7bc596ebb ("drm/radeon: disable native
backlight control on pre-r6xx asics (v2)") accidently
broke backlight control on old mac laptops that use the
on-GPU backlight controller.

Signed-off-by: Nathan-J. Hirschauer <nathanhi@deepserve.info>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-02-25 16:05:53 -05:00
David Ahern 4861f87cd3 perf tools: Make sparc64 arch point to sparc
The recent build changes cause perf to not compile for sparc64 since the
arch/sparc64/Build file does not exist:

/home/dahern/kernels/linux.git/tools/build/Makefile.build:40: arch/sparc64/Build: No such file or directory

Fix by converting the sparc64 RAW_ARCH to sparc ARCH -- similar to what
is done for x86_64.

Signed-off-by: David Ahern <david.ahern@oracle.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1424306222-96843-1-git-send-email-david.ahern@oracle.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-02-25 17:39:17 -03:00
David Ahern e370a3d576 perf symbols: Define EM_AARCH64 for older OSes
4886f2ca19 added an arm-64 check, but the EM_AARCH64 macro is not
defined in older releases (e.g., RHEL6). Define if it is not defined.

Signed-off-by: David Ahern <david.ahern@oracle.com>
Cc: Victor Kamensky <victor.kamensky@linaro.org>
Link: http://lkml.kernel.org/r/1424306017-96797-1-git-send-email-david.ahern@oracle.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-02-25 17:39:17 -03:00
David Ahern a73b6c199a perf top: Fix SIGBUS on sparc64
perf-top is terminating due to SIGBUS on sparc64. git bisect points to:

    commit 8239698603
    Author: Arnaldo Carvalho de Melo <acme@redhat.com>
    Date:   Mon Sep 8 13:26:35 2014 -0300

        perf evlist: Refcount mmaps

        We need to know how many fds are using a perf mmap via
        PERF_EVENT_IOC_SET_OUTPUT, so that we can know when to ditch an mmap,
        refcount it.

This commit added 'int refcnt' to struct perf_mmap and the addition makes the
event_copy element no longer 8-byte aligned.

Fix by adding __attribute__((aligned(8))) to the event_copy struct
member.

Signed-off-by: David Ahern <david.ahern@oracle.com>
Link: http://lkml.kernel.org/r/1424304198-92028-1-git-send-email-david.ahern@oracle.com
[ Switched from 'int pad;' to using __attribute__, David tested/acked that ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-02-25 17:37:44 -03:00
Adrian Hunter 48536c9195 perf tools: Fix probing for PERF_FLAG_FD_CLOEXEC flag
Commit f6edb53c49 converted the probe to
a CPU wide event first (pid == -1). For kernels that do not support
the PERF_FLAG_FD_CLOEXEC flag the probe fails with EINVAL. Since this
errno is not handled pid is not reset to 0 and the subsequent use of
pid = -1 as an argument brings in an additional failure path if
perf_event_paranoid > 0:

$ perf record -- sleep 1
perf_event_open(..., 0) failed unexpectedly with error 13 (Permission denied)
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.007 MB /tmp/perf.data (11 samples) ]

Also, ensure the fd of the confirmation check is closed and comment why
pid = -1 is used.

Needs to go to 3.18 stable tree as well.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Based-on-patch-by: David Ahern <david.ahern@oracle.com>
Acked-by: David Ahern <david.ahern@oracle.com>
Cc: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/54EC610C.8000403@intel.com
Cc: stable@vger.kernel.org  # v3.18+
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-02-25 16:40:13 -03:00
Arnd Bergmann 6af714b069 Fixes for various omap devices. It's all dts and defconfig
changes for this set:
 
 - Fix wrong DMA properties for dma to avoid them getting
   copied wrong again before we start actually using them
 
 - USB fixes to revert the extcon changes as the driver did not
   get merged yet and cause issues
 
 - Omap5 and dra7 fixes to boot from sata
 
 - Fix few am437x issues for i2c and pinctrl
 
 - Fix beaglebone for hardwared USB configuration
 
 - Defconfig changes for NAND, SATA and TPS62362
 
 - Fix n900 i2c numbering for legacy user space and smc91x
   register offset so it works also for qemu
 
 - Fix incomplete USB configuration for dm816x
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJU7NU9AAoJEBvUPslcq6VzGHYP/j815CZXRptbhdWFBg/Sv2UX
 l5hpnP1lW667yEmb4haNfFUyBYPHrzk0U78WB8IsEMR9C4ZJGfaiZdSv/BDAYH5z
 AHBjOb21K+q4+830i4sWT6LsCWPaCcJ5LxBNtvPtcpFltUjJzraC9a3vtrEXLRvY
 ALij2+3epcxKeR1BO7Sy+cnFShNMXTbSIr82MQsPIX5wFOn/vzytj+/4+OBac8vY
 OhGneKsvGHGv2jvoOOhkpjFCWrojaKkdS75XIrdBp7JPKjRREr08LeoqdZMJu6BQ
 xzIVkDnSojw4Vn+R+glekDP+ldPh+HGzf6OQabyCa1o4D1hriKiauON9Odk0z8Vr
 qLnh2UwRRbNSGaGYR0OLSXUy6sZX1eBfaeoe+691t0UHLylm81ZPTuSfd7MVGElp
 sFq0Jq6dw+Ech2A1lbMAl8d8aO0CQlr5uF2+9HfoIkZxjktKmJMNuNvL3M4b4kPS
 uUgcch40vqdOyrV5qz3/Nwn/e7/hk/i23vbNgsuYauV0CxGA0c6/Nk+TP8hH8fYW
 XSFacaEEaK2Sj40Lyw6o/15Fr5rfG51vX/jNz2NgDbdJUYT42KK/Hr3AZrXQPyBf
 YQWjrL6NgcwdX2v2KhsCLyo2ABp8RgPYQVDAC8LNZNCUBar9+l6+a1e1lMfPnNKq
 4IAZO4ftH3x71V+nQMVS
 =oG7A
 -----END PGP SIGNATURE-----

Merge tag 'fixes-v4.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes

Fixes for various omap devices. It's all dts and defconfig
changes for this set:

- Fix wrong DMA properties for dma to avoid them getting
  copied wrong again before we start actually using them

- USB fixes to revert the extcon changes as the driver did not
  get merged yet and cause issues

- Omap5 and dra7 fixes to boot from sata

- Fix few am437x issues for i2c and pinctrl

- Fix beaglebone for hardwared USB configuration

- Defconfig changes for NAND, SATA and TPS62362

- Fix n900 i2c numbering for legacy user space and smc91x
  register offset so it works also for qemu

- Fix incomplete USB configuration for dm816x

* tag 'fixes-v4.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: dts: am335x-bone*: usb0 is hardwired for peripheral
  ARM: dts: dra7x-evm: beagle-x15: Fix USB Host
  ARM: omap2plus_defconfig: Fix SATA boot
  ARM: omap2plus_defconfig: Enable OMAP NAND BCH driver
  ARM: dts: dra7: Correct the dma controller's property names
  ARM: dts: omap5: Correct the dma controller's property names
  ARM: dts: omap4: Correct the dma controller's property names
  ARM: dts: omap3: Correct the dma controller's property names
  ARM: dts: omap2: Correct the dma controller's property names
  ARM: dts: am437x-idk: fix sleep pinctrl state
  ARM: omap2plus_defconfig: enable TPS62362 regulator
  ARM: dts: am437x-idk: fix TPS62362 i2c bus
  ARM: dts: n900: Fix offset for smc91x ethernet
  ARM: dts: n900: fix i2c bus numbering
  ARM: dts: Fix USB dts configuration for dm816x
  ARM: dts: OMAP5: Fix SATA PHY node
  ARM: dts: DRA7: Fix SATA PHY node
2015-02-25 17:12:35 +01:00
Sudeep Holla 7934d69abf arm64: Add L2 cache topology to ARM Ltd boards/models
Commit 5d425c1865 ("arm64: kernel: add support for cpu cache
information") adds cacheinfo support for ARM64. Since there's no
architectural way of detecting the cpus that share particular cache,
device tree can be used and the core cacheinfo already supports the
same.

This patch adds the L2 cache topology on Juno board, FVP/RTSM and
foundation models.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2015-02-25 17:12:21 +01:00
Adrian Hunter 95a09cfa3c perf tools: Fix pthread_attr_setaffinity_np build error
Feature detection for pthread_attr_setaffinity_np was failing, producing
this error:

  In file included from bench/futex-hash.c:17:0:
  bench/futex.h:73:19: error: conflicting types for ‘pthread_attr_setaffinity_np’
   static inline int pthread_attr_setaffinity_np(pthread_attr_t *attr,
                   ^
  In file included from bench/futex.h:72:0,
                   from bench/futex-hash.c:17:
  /usr/include/pthread.h:407:12: note: previous declaration of ‘pthread_attr_setaffinity_np’ was here
   extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
            ^
  make[3]: *** [bench/futex-hash.o] Error 1
  make[2]: *** [bench] Error 2
  make[2]: *** Waiting for unfinished jobs....

  This was because compiling test-pthread-attr-setaffinity-np.c
  failed due to the function arguments:

  test-pthread-attr-setaffinity-np.c: In function ‘main’:
  test-pthread-attr-setaffinity-np.c:11:2: warning: null argument where non-null required (argument 3) [-Wnonnull]
    ret = pthread_attr_setaffinity_np(&thread_attr, 0, NULL);
    ^
  So fix the arguments.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Stephane Eranian <eranian@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1424774766-24194-1-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-02-25 12:18:03 -03:00
Josh Boyer 8eb733829c perf tools: Define _GNU_SOURCE on pthread_attr_setaffinity_np feature check
The man page for pthread_attr_set_affinity_np states that _GNU_SOURCE
must be defined before pthread.h is included in order to get the proper
function declaration.  Define this in the Makefile.

Without this defined, the feature check fails on a Fedora system with
gcc5 and then the perf build later fails with conflicting prototypes for
the function.

Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Link: http://lkml.kernel.org/r/20150211162404.GA15522@hansolo.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-02-25 12:17:38 -03:00
Ingo Molnar e3eff6fe7d Merge branch 'clockevents/4.0-rc1' of git://git.linaro.org/people/daniel.lezcano/linux into timers/urgent
Pull clockevents driver fixes from Daniel Lezcano:

  - Fix the Kconfig to prevent the asm9260 timer to be compiled with
    allyesconfig with sparc/sparc64 (Daniel Lezcano)

  - Reorder the mtk driver init sequence in order to prevent a potential race
    when the clock is registered before the irq handler is set (Matthias Brugger)

  - Fix a section mismatch for the pxa driver (Robert Jarzmik)

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-02-25 14:44:45 +01:00
Robert Jarzmik 6f2116ebe2 clocksource: pxa: Fix section mismatch
As pxa_timer_common_init() is only called in init context, mark it as
such, and quiesce the compiler warnings :
WARNING: vmlinux.o(.text.unlikely+0x45d4): Section mismatch in reference
from the function pxa_timer_common_init() to the function
.init.text:sched_clock_register()

WARNING: vmlinux.o(.text.unlikely+0x4610): Section mismatch in reference
from the function pxa_timer_common_init() to the function
.init.text:clocksource_mmio_init()

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-02-25 10:28:55 +01:00
Matthias Brugger d4a19eb3b1 clocksource: mtk: Fix race conditions in probe code
We have two race conditions in the probe code which could lead to a null
pointer dereference in the interrupt handler.

The interrupt handler accesses the clockevent device, which may not yet be
registered.

First race condition happens when the interrupt handler gets registered before
the interrupts get disabled. The second race condition happens when the
interrupts get enabled, but the clockevent device is not yet registered.

Fix that by disabling the interrupts before we register the interrupt and enable
the interrupts after the clockevent device got registered.

Reported-by: Gongbae Park <yongbae2@gmail.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-02-25 10:28:49 +01:00
Daniel Lezcano a8b1b9fc92 clockevents: asm9260: Fix compilation error with sparc/sparc64 allyesconfig
The Kconfig options for the asm9260 timer is wrong as it can be selected by
another platform with allyes config and thus leading to a compilation failure
as some non arch related code is pulled by the compilation.

Fix this by having the platform Kconfig to select the timer as it is done for
the others drivers.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Oleksij Rempel <linux@rempel-privat.de>

Conflicts:
	drivers/clocksource/Kconfig
2015-02-25 10:28:22 +01:00
Rodrigo Vivi 62e537f8d5 drm/i915: Fix frontbuffer false positve.
This return 0 without setting atomic bits on fb == crtc->cursor->fb
where causing frontbuffer false positives.

According to Daniel:

The original regression seems to have been introduced in the original
check/commit split:

commit 757f9a3e5b
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date:   Wed Sep 24 14:20:24 2014 -0300

    drm/i915: move check of intel_crtc_cursor_set_obj() out

Which already cause other trouble, resulting in the check getting moved in

commit e391ea882b
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date:   Wed Sep 24 14:20:25 2014 -0300

    drm/i915: Fix not checking cursor and object sizes

The frontbuffer tracking itself only was broken when we shifted it into
the check/commit logic with:

commit 32b7eeec4d
Author: Matt Roper <matthew.d.roper@intel.com>
Date:   Wed Dec 24 07:59:06 2014 -0800

    drm/i915: Refactor work that can sleep out of commit (v7)

v2: When putting more debug prints I notice the solution was simpler
than I thought. AMS design is solid, just this return was wrong.
Sorry for the noise.

v3: Remove the entire chunck that would probably
    be removed by gcc anyway. (by Daniel)

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-02-25 10:08:15 +02:00
Takashi Iwai de5d0ad506 ALSA: hda - Disable runtime PM for Panther Point again
This is essentially a partial revert of the commit [b1920c21102a:
'ALSA: hda - Enable runtime PM on Panther Point'].  There was a bug
report showing the HD-audio bus hang during runtime PM on HP Spectre
XT.

Reported-by: Dang Sananikone <dang.sananikone@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-25 07:53:31 +01:00
NeilBrown 750f199ee8 md: mark some attributes as pre-alloc
Since __ATTR_PREALLOC was introduced in v3.19-rc1~78^2~18
it can now be used by md.

This ensure that writing to these sysfs attributes will never
block due to a memory allocation.
Such blocking could become a deadlock if mdmon is trying to
reconfigure an array after a failure prior to re-enabling writes.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-02-25 11:38:46 +11:00
Eric Mei 16d9cfab93 raid5: check faulty flag for array status during recovery.
When we have more than 1 drive failure, it's possible we start
rebuild one drive while leaving another faulty drive in array.
To determine whether array will be optimal after building, current
code only check whether a drive is missing, which could potentially
lead to data corruption. This patch is to add checking Faulty flag.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-02-25 11:38:26 +11:00
Tomáš Hodek d1901ef099 md/raid1: fix read balance when a drive is write-mostly.
When a drive is marked write-mostly it should only be the
target of reads if there is no other option.

This behaviour was broken by

commit 9dedf60313
    md/raid1: read balance chooses idlest disk for SSD

which causes a write-mostly device to be *preferred* is some cases.

Restore correct behaviour by checking and setting
best_dist_disk and best_pending_disk rather than best_disk.

We only need to test one of these as they are both changed
from -1 or >=0 at the same time.

As we leave min_pending and best_dist unchanged, any non-write-mostly
device will appear better than the write-mostly device.

Reported-by: Tomáš Hodek <tomas.hodek@volny.cz>
Reported-by: Dark Penguin <darkpenguin@yandex.ru>
Signed-off-by: NeilBrown <neilb@suse.de>
Link: http://marc.info/?l=linux-raid&m=135982797322422
Fixes: 9dedf60313
Cc: stable@vger.kernel.org (3.6+)
2015-02-25 11:37:02 +11:00
Chanwoo Choi b71d399c7f thermal: exynos: Clean-up code to use oneline entry for exynos compatible table
This patch cleanup the code to use oneline for entry of exynos compatible
table.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2015-02-24 15:00:00 -04:00
Geert Uytterhoeven ac71c7025e thermal: rcar: Make error and remove paths symmetrical with init
Swap interrupt disable and thermal zone unregistration in the error and
remove paths, to make them more symmetrical with the initialization
path.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2015-02-24 14:58:05 -04:00
Geert Uytterhoeven 0b37a83a91 thermal: rcar: Fix race condition between init and interrupt
As soon as the interrupt has been enabled by devm_request_irq(), the
interrupt routine may be called, depending on the current status of the
hardware.

However, at that point rcar_thermal_common hasn't been initialized
complely yet. E.g. rcar_thermal_common.base is still NULL, causing a
NULL pointer dereference:

    Unable to handle kernel NULL pointer dereference at virtual address 0000000c
    pgd = c0004000
    [0000000c] *pgd=00000000
    Internal error: Oops: 5 [#1] SMP ARM
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.19.0-rc7-ape6evm-04564-gb6e46cb7cbe82389 #30
    Hardware name: Generic R8A73A4 (Flattened Device Tree)
    task: ee8953c0 ti: ee896000 task.ti: ee896000
    PC is at rcar_thermal_irq+0x1c/0xf0
    LR is at _raw_spin_lock_irqsave+0x48/0x54

Postpone the call to devm_request_irq() until all initialization has
been done to fix this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2015-02-24 14:56:42 -04:00
Nishanth Menon 12ca718846 thermal: Introduce dummy functions when thermal is not defined
When CONFIG_THERMAL is not enabled, it is better to introduce
equivalent dummy functions in the exported header than to
introduce #ifdeffery in drivers using the function.

This will prevent issues such as that reported in:
http://www.spinics.net/lists/linux-next/msg31573.html

While at it switch over to IS_ENABLED for thermal macros
to allow for thermal framework to be built as framework
and relevant APIs be usable by relevant drivers as a result.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2015-02-24 14:40:42 -04:00
Robert Nelson 67fd14b3ec ARM: dts: am335x-bone*: usb0 is hardwired for peripheral
Fixes: http://bugs.elinux.org/issues/127

the bb.org community was seeing random reboots before this change.

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2015-02-24 10:35:44 -08:00
Roger Quadros addfcde7c4 ARM: dts: dra7x-evm: beagle-x15: Fix USB Host
In commit 87517d26d8 ("ARM: dts: dra7-evm: Add extcon nodes for USB")
we enabled Extcon USB gpio to tackle the USB ID pin and get
peripheral mode to work.

But the extcon-gpio-usb driver [1] didn't make it into v4.0
and this makes the USB driver defer probe indefinitely breaking
USB Host functionality.

As a temporary fix we remove the extcon handle from the
USB controller and add it back when the extcon driver
merges in v4.1.

[1] - https://lkml.org/lkml/2015/2/2/187

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2015-02-24 10:35:43 -08:00
Roger Quadros acd83a1652 ARM: omap2plus_defconfig: Fix SATA boot
SATA operation depends on PIPE3 PHY and if we want
to boot from SATA drives, we have to have the PIPE3 PHY
driver built-in.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2015-02-24 10:35:43 -08:00