platform/kernel/linux-exynos.git
7 years agoregulator: s2mps11: add shutdown function
Jaehoon Chung [Fri, 23 Jan 2015 09:16:54 +0000 (18:16 +0900)]
regulator: s2mps11: add shutdown function

This needs for poweroff on odroid xu3 board.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agoARM: dts: exynos542x: move mfc device into own bus with limited dma-range
Marek Szyprowski [Wed, 21 Jan 2015 07:57:44 +0000 (08:57 +0100)]
ARM: dts: exynos542x: move mfc device into own bus with limited dma-range

MFC block does not support setting address base to 0, what is the default
value when using generic iommu based dma-mapping. This patch adds
additional virtual bus (with dma ranges limited to 0x10000000..0x20000000)
only for MFC device, so it gets proper dma mapping configuration. This is
a workaround until proper configuration of default dma window gets
implemented.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
7 years agogpu: arm : mali400: replace CONFIG_PM_RUNTIME to CONFIG_PM
Seung-Woo Kim [Fri, 27 Mar 2015 05:10:47 +0000 (14:10 +0900)]
gpu: arm : mali400: replace CONFIG_PM_RUNTIME to CONFIG_PM

After commit 464ed18ebdb6 ("PM: Eliminate CONFIG_PM_RUNTIME") which
is applied kernel version 3.19, PM_RUNTIME is eliminated. So this
patch replaces CONFIG_PM_RUNTIME to CONFIG_PM for kernel version
larger than 3.19.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoARM: dts: odroidxu3: add mali node
Joonyoung Shim [Tue, 20 Jan 2015 08:46:16 +0000 (17:46 +0900)]
ARM: dts: odroidxu3: add mali node

Support mali for odroid xu3 board.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: dts: exynos5420: add mali node
Joonyoung Shim [Tue, 20 Jan 2015 08:45:06 +0000 (17:45 +0900)]
ARM: dts: exynos5420: add mali node

Support mali node for exynos542x.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: odroidxu3_defconfig: add defconfig file odroid XU3
Joonyoung Shim [Tue, 6 Jan 2015 05:52:08 +0000 (14:52 +0900)]
ARM: odroidxu3_defconfig: add defconfig file odroid XU3

This was copied from exynos_defconfig.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: dts: add bootargs for odroid XU3
Joonyoung Shim [Mon, 5 Jan 2015 05:29:07 +0000 (14:29 +0900)]
ARM: dts: add bootargs for odroid XU3

Add to use bootargs of dtb.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: exynos: fix UART address selection for DEBUG_LL
Joonyoung Shim [Fri, 26 Sep 2014 10:04:46 +0000 (19:04 +0900)]
ARM: exynos: fix UART address selection for DEBUG_LL

The exynos5 SoCs using A15+A7 can boot to A15 or A7. If it boots using
A7, it can't detect right UART physical address only the part number of
CP15. It's possible to solve as checking Cluster ID additionally.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agonetfilter: nfnetlink_queue: add security context information
Roman Kubiak [Fri, 12 Jun 2015 10:32:57 +0000 (12:32 +0200)]
netfilter: nfnetlink_queue: add security context information

This patch adds an additional attribute when sending
packet information via netlink in netfilter_queue module.
It will send additional security context data, so that
userspace applications can verify this context against
their own security databases.

Signed-off-by: Roman Kubiak <r.kubiak@samsung.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[backport from mainline for security nether service]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agogator: Version 5.24
Drew Richardson [Fri, 1 Apr 2016 19:00:00 +0000 (12:00 -0700)]
gator: Version 5.24

Signed-off-by: Drew Richardson <drew.richardson@arm.com>
[Ported from https://github.com/ARM-software/gator.git to kernel tree, out of tree files are removed]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agogator: The walk_stackframe function has a new argument for arm64 only starting with...
Drew Richardson [Thu, 25 Feb 2016 22:28:20 +0000 (14:28 -0800)]
gator: The walk_stackframe function has a new argument for arm64 only starting with Linux 4.5

Signed-off-by: Drew Richardson <drew.richardson@arm.com>
[Ported from https://github.com/ARM-software/gator.git to kernel tree]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agogator: Fix minor Linux 4.5 issues
Drew Richardson [Fri, 29 Jan 2016 16:58:43 +0000 (08:58 -0800)]
gator: Fix minor Linux 4.5 issues

Signed-off-by: Drew Richardson <drew.richardson@arm.com>
[Ported from https://github.com/ARM-software/gator.git to kernel tree]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agogator: Version 5.23.1
Drew Richardson [Wed, 16 Dec 2015 20:00:00 +0000 (12:00 -0800)]
gator: Version 5.23.1

Signed-off-by: Drew Richardson <drew.richardson@arm.com>
[Ported from https://github.com/ARM-software/gator.git to kernel tree, out of tree files are removed]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agogator: fix in-tree build for mali midgard
Seung-Woo Kim [Mon, 25 Apr 2016 10:05:30 +0000 (19:05 +0900)]
gator: fix in-tree build for mali midgard

Because Makefile does not recognize quote string as path, so the
quotes should be removed from path string. This patch fix in-tree
build for mali midgard by removing quotes from the path in config.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agogator: Version 5.23
Drew Richardson [Wed, 18 Nov 2015 20:00:00 +0000 (12:00 -0800)]
gator: Version 5.23

Signed-off-by: Drew Richardson <drew.richardson@arm.com>
[Ported from https://github.com/ARM-software/gator.git to kernel tree, out of tree files are removed]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agogator: Version 5.22
Drew Richardson [Wed, 22 Jul 2015 19:00:00 +0000 (12:00 -0700)]
gator: Version 5.22

Signed-off-by: Drew Richardson <drew.richardson@arm.com>
[Ported from https://github.com/ARM-software/gator.git to kernel tree, out of tree files are removed]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agogator: Version 5.21.1
Drew Richardson [Tue, 28 Apr 2015 19:00:00 +0000 (12:00 -0700)]
gator: Version 5.21.1

Signed-off-by: Drew Richardson <drew.richardson@arm.com>
[Ported from https://github.com/ARM-software/gator.git to kernel tree, out of tree files are removed]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agogator: Version 5.21
Drew Richardson [Sat, 28 Mar 2015 19:00:00 +0000 (12:00 -0700)]
gator: Version 5.21

Signed-off-by: Drew Richardson <drew.richardson@arm.com>
[Ported from https://github.com/ARM-software/gator.git to kernel tree, out of tree files are removed]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agogator: Version 5.20.2
Drew Richardson [Thu, 20 Feb 2014 20:00:00 +0000 (12:00 -0800)]
gator: Version 5.20.2

Signed-off-by: Drew Richardson <drew.richardson@arm.com>
[Ported from https://github.com/ARM-software/gator.git to kernel tree]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoARM64: kasan: print memory assignment
Linus Walleij [Tue, 11 Aug 2015 02:18:19 +0000 (05:18 +0300)]
ARM64: kasan: print memory assignment

This prints out the virtual memory assigned to KASan in the
boot crawl along with other memory assignments, if and only
if KASan is activated.

Example dmesg from the Juno Development board:

Memory: 1691156K/2080768K available (5465K kernel code, 444K rwdata,
2160K rodata, 340K init, 217K bss, 373228K reserved, 16384K cma-reserved)
Virtual kernel memory layout:
    kasan   : 0xffffff8000000000 - 0xffffff9000000000   (    64 GB)
    vmalloc : 0xffffff9000000000 - 0xffffffbdbfff0000   (   182 GB)
    vmemmap : 0xffffffbdc0000000 - 0xffffffbfc0000000   (     8 GB maximum)
              0xffffffbdc2000000 - 0xffffffbdc3fc0000   (    31 MB actual)
    fixed   : 0xffffffbffabfd000 - 0xffffffbffac00000   (    12 KB)
    PCI I/O : 0xffffffbffae00000 - 0xffffffbffbe00000   (    16 MB)
    modules : 0xffffffbffc000000 - 0xffffffc000000000   (    64 MB)
    memory  : 0xffffffc000000000 - 0xffffffc07f000000   (  2032 MB)
      .init : 0xffffffc0007f5000 - 0xffffffc00084a000   (   340 KB)
      .text : 0xffffffc000080000 - 0xffffffc0007f45b4   (  7634 KB)
      .data : 0xffffffc000850000 - 0xffffffc0008bf200   (   445 KB)

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
7 years agoarm64: add KASAN support
Andrey Ryabinin [Tue, 11 Aug 2015 02:18:18 +0000 (05:18 +0300)]
arm64: add KASAN support

This patch adds arch specific code for kernel address sanitizer
(see Documentation/kasan.txt).

1/8 of kernel addresses reserved for shadow memory. There was no
big enough hole for this, so virtual addresses for shadow were
stolen from vmalloc area.

At early boot stage the whole shadow region populated with just
one physical page (kasan_zero_page). Later, this page reused
as readonly zero shadow for some memory that KASan currently
don't track (vmalloc).
After mapping the physical memory, pages for shadow memory are
allocated and mapped.

Functions like memset/memmove/memcpy do a lot of memory accesses.
If bad pointer passed to one of these function it is important
to catch this. Compiler's instrumentation cannot do this since
these functions are written in assembly.
KASan replaces memory functions with manually instrumented variants.
Original functions declared as weak symbols so strong definitions
in mm/kasan/kasan.c could replace them. Original functions have aliases
with '__' prefix in name, so we could call non-instrumented variant
if needed.
Some files built without kasan instrumentation (e.g. mm/slub.c).
Original mem* function replaced (via #define) with prefixed variants
to disable memory access checks for such files.

Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
7 years agoarm64: move PGD_SIZE definition to pgalloc.h
Andrey Ryabinin [Tue, 11 Aug 2015 02:18:17 +0000 (05:18 +0300)]
arm64: move PGD_SIZE definition to pgalloc.h

This will be used by KASAN latter.

Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
7 years agoarm64: introduce VA_START macro - the first kernel virtual address.
Andrey Ryabinin [Tue, 11 Aug 2015 02:18:16 +0000 (05:18 +0300)]
arm64: introduce VA_START macro - the first kernel virtual address.

In order to not use lengthy (UL(0xffffffffffffffff) << VA_BITS) everywhere,
replace it with VA_START.

Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
7 years agox86/kasan, mm: introduce generic kasan_populate_zero_shadow()
Andrey Ryabinin [Tue, 11 Aug 2015 02:18:15 +0000 (05:18 +0300)]
x86/kasan, mm: introduce generic kasan_populate_zero_shadow()

Introduce generic kasan_populate_zero_shadow(shadow_start, shadow_end).
This function maps kasan_zero_page to the [shadow_start, shadow_end]
addresses.

This replaces x86_64 specific populate_zero_shadow() and will
be used for ARM64 in follow on patches.

Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
7 years agox86/kasan: define KASAN_SHADOW_OFFSET per architecture
Andrey Ryabinin [Tue, 11 Aug 2015 02:18:14 +0000 (05:18 +0300)]
x86/kasan: define KASAN_SHADOW_OFFSET per architecture

Current definition of  KASAN_SHADOW_OFFSET in include/linux/kasan.h
will not work for upcomming arm64, so move it to the arch header.

Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
7 years agox86/kasan: Add message about KASAN being initialized
Andrey Ryabinin [Thu, 2 Jul 2015 09:09:37 +0000 (12:09 +0300)]
x86/kasan: Add message about KASAN being initialized

Print informational message to tell user that kernel
runs with KASAN enabled.

Add a "kasan: " prefix to all messages in kasan_init_64.c.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Cc: Alexander Popov <alpopov@ptsecurity.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <adech.fo@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1435828178-10975-6-git-send-email-a.ryabinin@samsung.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
7 years agoLOCAL / arm64: defconfig: enable dm_crypt
Seung-Woo Kim [Wed, 20 Apr 2016 06:49:49 +0000 (15:49 +0900)]
LOCAL / arm64: defconfig: enable dm_crypt

This patch enables dm_crypt config instead of building as a
module to manage encrypted disk.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoLOCAL: arm64: dts: exynos5433-tm2e: enable mic device node
Inki Dae [Mon, 18 Apr 2016 08:11:52 +0000 (17:11 +0900)]
LOCAL: arm64: dts: exynos5433-tm2e: enable mic device node

Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos: decon: use deferred Trigger mode change
Inki Dae [Mon, 18 Apr 2016 07:57:08 +0000 (16:57 +0900)]
drm/exynos: decon: use deferred Trigger mode change

In case of DECON Display, the controller should work with SW trigger mode
even default mode is HW trigger because trigger mode should be changed
on PSR mode of Panel device - there might be some Panel not supported
for the PSR mode.

So this patch makes SW trigger mode to be used until dpms going off
to on again.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/bridge: Make (pre/post) enable/disable callbacks optional
Laurent Pinchart [Fri, 26 Feb 2016 09:51:06 +0000 (11:51 +0200)]
drm/bridge: Make (pre/post) enable/disable callbacks optional

Instead of forcing bridges to implement empty callbacks make them all
optional.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/bridge: Improve kerneldoc
Daniel Vetter [Fri, 4 Dec 2015 08:45:47 +0000 (09:45 +0100)]
drm/bridge: Improve kerneldoc

Especially document the assumptions and semantics of the callbacks
carefully. Just a warm-up excercise really.

v2: Spelling fixes (Eric).

v3: Consolidate more with existing docs:

- Remove the overview section explaining the bridge funcs, that's
  now all in the drm_bridge_funcs kerneldoc in much more detail.

- Use & to reference structs so that kerneldoc automatically inserts
  hyperlinks.

v4: Review from Thierry.

Cc: Eric Anholt <eric@anholt.net>
Cc: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Archit Taneja <architt@codeaurora.org> (v3)
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-7-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/DocBook: Add more drm_bridge documentation
Archit Taneja [Thu, 21 May 2015 05:33:17 +0000 (11:03 +0530)]
drm/DocBook: Add more drm_bridge documentation

Add DOC sections giving an overview of drm_bridge and how to fill up the
drm_bridge_funcs ops. Add these to drm.tpml in DocBook.

Add headerdocs for funcs in drm_bridge.c that don't have them yet.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
[danvet: Amend kerneldoc as discussed with Archit.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
7 years agodrm: bridge: Allow daisy chaining of bridges
Archit Taneja [Thu, 14 Apr 2016 05:50:15 +0000 (14:50 +0900)]
drm: bridge: Allow daisy chaining of bridges

Allow drm_bridge objects to link to each other in order to form an encoder
chain. The requirement for creating a chain of bridges comes because the
MSM drm driver uses up its encoder and bridge objects for blocks within
the SoC itself. There isn't anything left to use if the SoC display output
is connected to an external encoder IC. Having an additional bridge
connected to the existing bridge helps here. In general, it is possible for
platforms to have  multiple devices between the encoder and the
connector/panel that require some sort of configuration.

We create drm bridge helper functions corresponding to each op in
'drm_bridge_funcs'. These helpers call the corresponding
'drm_bridge_funcs' op for the entire chain of bridges. These helpers are
used internally by drm_atomic_helper.c and drm_crtc_helper.c.

The drm_bridge_enable/pre_enable helpers execute enable/pre_enable ops of
the bridge closet to the encoder, and proceed until the last bridge in the
chain is enabled. The same holds for drm_bridge_mode_set/mode_fixup
helpers. The drm_bridge_disable/post_disable helpers disable the last
bridge in the chain first, and proceed until the first bridge in the chain
is disabled.

drm_bridge_attach() remains the same. As before, the driver calling this
function should make sure it has set the links correctly. The order in
which the bridges are connected to each other determines the order in which
the calls are made. One requirement is that every bridge in the chain
should point the parent encoder object. This is required since bridge
drivers expect a valid encoder pointer in drm_bridge. For example, consider
a chain where an encoder's output is connected to bridge1, and bridge1's
output is connected to bridge2:

/* Like before, attach bridge to an encoder */
bridge1->encoder = encoder;
ret = drm_bridge_attach(dev, bridge1);
..

/*
 * set the first bridge's 'next' bridge to bridge2, set its encoder
 * as bridge1's encoder
 */
bridge1->next = bridge2
bridge2->encoder = bridge1->encoder;
ret = drm_bridge_attach(dev, bridge2);

...
...

This method of bridge chaining isn't intrusive and existing drivers that
use drm_bridge will behave the same way as before. The bridge helpers also
cleans up the atomic and crtc helper files a bit.

Reviewed-by: Jani Nikula <jani.nikula@linux.intel.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agoLocal: arm64: dts: exynos5433-tm2: enable mic device node
Inki Dae [Tue, 12 Apr 2016 08:43:22 +0000 (17:43 +0900)]
Local: arm64: dts: exynos5433-tm2: enable mic device node

Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos: mic: add component support
Inki Dae [Tue, 12 Apr 2016 08:42:30 +0000 (17:42 +0900)]
drm/exynos: mic: add component support

Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos: decon: wait for vsync after dma channel clear
Inki Dae [Tue, 12 Apr 2016 02:31:21 +0000 (11:31 +0900)]
drm/exynos: decon: wait for vsync after dma channel clear

This patch removes temparary codes which used sleep function
to wait for the completion of vsync, and uses wait_event_timeout
function instead.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agoARM: dts: exynos5433: add sysreg property for display block
Inki Dae [Wed, 30 Mar 2016 08:49:51 +0000 (17:49 +0900)]
ARM: dts: exynos5433: add sysreg property for display block

This patch adds a property for display block sysreg.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos: decon: add sysreg support
Inki Dae [Wed, 30 Mar 2016 08:46:22 +0000 (17:46 +0900)]
drm/exynos: decon: add sysreg support

This patch adds sysreg support to control display block,
and makes te unmask bit of display block to be set
according to trigger mode defined already.

This is required for HW trigger mode support.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos: decon: add HW trigger mode support
Inki Dae [Tue, 12 Apr 2016 02:27:50 +0000 (11:27 +0900)]
drm/exynos: decon: add HW trigger mode support

This patch adds hardware trigger mode support on command mode.
And also it cleans up decon_setup_trigger function which identifed
trigger mode checking display type.

However, the trigger mode is a common part of two types - DISPLAY and HDMI
so it can be set according to trigger mode type given.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos: decon: make sure to complete scanout before released
Inki Dae [Wed, 30 Mar 2016 08:03:52 +0000 (17:03 +0900)]
drm/exynos: decon: make sure to complete scanout before released

This patch makes framebuffer to be scaned out completely
before drm driver is released. This resolves the page fault issue
with IOMMU when released.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos: decon: do not call decon_setup_trigger function unnecessary
Inki Dae [Wed, 30 Mar 2016 07:54:57 +0000 (16:54 +0900)]
drm/exynos: decon: do not call decon_setup_trigger function unnecessary

This patch makes decon_setup_trigger function to be called only at
decon_commit function and remove the calls from other functions.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agoLOCAL / arm64: defconfig: enable joystick interface and dev
Seung-Woo Kim [Thu, 24 Mar 2016 05:19:13 +0000 (14:19 +0900)]
LOCAL / arm64: defconfig: enable joystick interface and dev

This enables joystick interface and dev config options from
defconfig.

It is requested from windows input and bt part.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoLOCAL / arm64: defconfig: sync with 4.1 kernel
Seung-Woo Kim [Thu, 24 Mar 2016 05:17:36 +0000 (14:17 +0900)]
LOCAL / arm64: defconfig: sync with 4.1 kernel

This patch makes sync for defconfig with 4.1 kernel.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agofimc-is: Rename "is fail" to "failed"
Sylwester Nawrocki [Thu, 3 Mar 2016 15:27:59 +0000 (16:27 +0100)]
fimc-is: Rename "is fail" to "failed"

Let's correct these phrases before I start believing they are
proper grammatical constructs...

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agofimc-is: Add proper implementation of fimc_is_ischain_forcedown()
Sylwester Nawrocki [Fri, 11 Mar 2016 15:08:37 +0000 (16:08 +0100)]
fimc-is: Add proper implementation of fimc_is_ischain_forcedown()

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agofimc-is: MCUCTL register definition cleanup
Sylwester Nawrocki [Thu, 10 Mar 2016 16:46:47 +0000 (17:46 +0100)]
fimc-is: MCUCTL register definition cleanup

Lots of (mostly unused) postfix-indexed macro definitions
are now replaced with parametric definitions.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agofimc-is: Remove unused data structure declaration
Sylwester Nawrocki [Thu, 10 Mar 2016 16:24:27 +0000 (17:24 +0100)]
fimc-is: Remove unused data structure declaration

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agofimc-is: Clear all MCUCTL register in the power up sequence
Sylwester Nawrocki [Thu, 10 Mar 2016 16:43:00 +0000 (17:43 +0100)]
fimc-is: Clear all MCUCTL register in the power up sequence

When the ISP, CAM{0,1} power domains are always on it is required
to clear MCUCTL registers in the ISP power up sequence, otherwise
the front camera is not working properly if previously the rear
camera pipeline was used. The original code relied on the MCUCTL
registers being reset to default values after the ISP power domain
switch off/on cycle.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agofimc-is: Reconfigure more muxes to oscclk in the power off sequence
Sylwester Nawrocki [Fri, 4 Mar 2016 16:56:32 +0000 (17:56 +0100)]
fimc-is: Reconfigure more muxes to oscclk in the power off sequence

We don't switch off CAM1, CAM0, ISP power domain so reconfigure
more muxes to their default after reset state duriong power off
sequence.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agofimc-is: Workaround for ACLK_CAM1_552_USER configuration issues
Sylwester Nawrocki [Mon, 29 Feb 2016 15:03:26 +0000 (16:03 +0100)]
fimc-is: Workaround for ACLK_CAM1_552_USER configuration issues

For some reason "mout_aclk_cam1_552_user" clock reconfiguration from
"oscclk" to "aclk_cam1_552" breaks the front camera operation (often
only empty buffer are dequeued). But it is required for the rear
camera. Until the root cause is found reconfigure the mux conditionally
only for the rear sensor operation.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agofimc-is: Fix compiler warning
Sylwester Nawrocki [Thu, 3 Mar 2016 15:30:54 +0000 (16:30 +0100)]
fimc-is: Fix compiler warning

n file included from drivers/media/platform/exynos/fimc-is/fimc-is-companion-dt.c:23:0:
drivers/media/platform/exynos/fimc-is/fimc-is-dt.h:36:58: warning: 'struct fimc_is_core' declared inside parameter list
 int fimc_is_parse_children_dt(struct device *dev, struct fimc_is_core *core);
                                                          ^
drivers/media/platform/exynos/fimc-is/fimc-is-dt.h:36:58: warning: its scope is only this definition or declaration, which is probably not what you want

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agospi: exynos5433-isp: Add H/W initialization in runtime_resume callback
Sylwester Nawrocki [Wed, 2 Mar 2016 14:39:51 +0000 (15:39 +0100)]
spi: exynos5433-isp: Add H/W initialization in runtime_resume callback

Not sure what the FIMC-IS firmware does but without these changes
SPI is not working on the second run of the rear sensor processing
pipeline. Also the controler's state may be lost when ISP power
domain is switched off so it must be reinitialized in runtime_resume
callback.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agoi2c: i2c-s3c2401: hack for for ISP_I2C controllers
Sylwester Nawrocki [Wed, 2 Mar 2016 14:41:06 +0000 (15:41 +0100)]
i2c: i2c-s3c2401: hack for for ISP_I2C controllers

This is required to ensure proper operation of the ISP I2C
controller from the Linux driver and the FIMC-IS firmware
level.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agofimc-is: Add setting of vendorSpecific2[0] metadata structure field
Sylwester Nawrocki [Fri, 26 Feb 2016 16:33:50 +0000 (17:33 +0100)]
fimc-is: Add setting of vendorSpecific2[0] metadata structure field

vendorSpecific2[0] value pattern depends on the fimc-is firmware
revision. Move setting up of this field to the kernel as there is
all information required for this.
The driver will update the field accordingly only if user space
leaves it cleared.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agofimc-is: Workaround for CLK_MOUT_ACLK_CAM1_552_USER clock
Sylwester Nawrocki [Fri, 26 Feb 2016 16:02:46 +0000 (17:02 +0100)]
fimc-is: Workaround for CLK_MOUT_ACLK_CAM1_552_USER clock

When CLK_MOUT_ACLK_CAM1_552_USER clock is properly defined
in clk-exynos5433.c re-parenting commented out in this patch
causes that only empty buffers can be dequeued from the scaler
for front camera. So re-parenting is disabled for now until
we can address this issue in a better way.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agoFix: bug that allows adding more dev than max minor number
Kazimierz Krosman [Tue, 16 Feb 2016 16:32:15 +0000 (17:32 +0100)]
Fix: bug that allows adding more dev than max minor number

Signed-off-by: Kazimierz Krosman <k.krosman@samsung.com>
7 years agoinput: touchscreen: fts: added touch key functionality
Andi Shyti [Wed, 3 Feb 2016 09:50:32 +0000 (18:50 +0900)]
input: touchscreen: fts: added touch key functionality

The ST Microelectronics FTM3BD56 touch screen device has a key
functinality to simulate the "phone" and the "back" button from
Android phone devices.

This patch adds this functionality as boards like TM2E are
using it instead of having separate device for the touch key.

The patch adds in the device tree a boolean property
"touch-key-connected" that, if present, enables the touch
property in the device and in the driver.

The driver, itself, when "touch-key-connected" present, generates
an input event that reports actions on the "phone" and on the
"back" key:

when the phone button is pressed or released:

type  EV_KEY
code  KEY_PHONE (169)
value 1/0 (pressed or released)

when the back button is pressed or released:

type  EV_KEY
code  KEY_BACK (158)
value 1/0 (pressed or released)

When discovering the deice, look for event name "sec_touchkey".

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
7 years agodts: exynos5433: TM2E: remove cypress touchkey
Andi Shyti [Wed, 3 Feb 2016 09:47:39 +0000 (18:47 +0900)]
dts: exynos5433: TM2E: remove cypress touchkey

Remove cypress touchkey as the device is not present on TM2E
board.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
7 years agoinput: fts_ts: remove redundant event counting
Andi Shyti [Wed, 3 Feb 2016 09:45:01 +0000 (18:45 +0900)]
input: fts_ts: remove redundant event counting

... as it is not useful for anything.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
7 years agokmsg: selftests
Paul Osmialowski [Wed, 23 Sep 2015 16:04:13 +0000 (18:04 +0200)]
kmsg: selftests

This patch adds selftests framework and four test scenarios for kmsg.

The framework shape and code was inspired by similar selftests framework
for kdbus.

Change-Id: I4453105186c90430dcdb59d592392fbac05b42f5
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
7 years agokmsg: add ioctl for kmsg* devices operating on buffers
Marcin Niesluchowski [Thu, 21 May 2015 14:24:30 +0000 (16:24 +0200)]
kmsg: add ioctl for kmsg* devices operating on buffers

There is no possibility to clear additional kmsg buffers,
get size of them or know what size should be passed to read
file operation (too small size causes it to retrun -EINVAL).

Add following ioctls which solve those issues:
* KMSG_CMD_GET_BUF_SIZE
* KMSG_CMD_GET_READ_SIZE_MAX
* KMSG_CMD_CLEAR

Change-Id: I7ee4c54495f6c4fd1458fd2998ffae0f3a8866c0
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
7 years agokmsg: add ioctl for adding and deleting kmsg* devices
Marcin Niesluchowski [Thu, 18 Jun 2015 09:31:00 +0000 (11:31 +0200)]
kmsg: add ioctl for adding and deleting kmsg* devices

There is no possibility to add/delete kmsg* buffers from userspace.

Adds following ioctl for main kmsg device adding and deleting
additional kmsg devices:
* KMSG_CMD_BUFFER_ADD
* KMSG_CMD_BUFFER_DEL

Change-Id: Ibc3c959957a545b09de4bbcb35533b690ba31fb5
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
7 years agokmsg: add predefined _PID, _TID, _COMM keywords to kmsg* log dict
Marcin Niesluchowski [Mon, 27 Apr 2015 09:20:34 +0000 (11:20 +0200)]
kmsg: add predefined _PID, _TID, _COMM keywords to kmsg* log dict

kmsg* devices write operation wrote no dict along with message
Due to usage of kmsg devices in userspace dict has been added
identifying pid, tid and comm of writing process.

Change-Id: I82fec61b012d3df5a5d5e4bd5c9999d92c32496d
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 years agokmsg: add function for adding and deleting additional buffers
Marcin Niesluchowski [Mon, 20 Apr 2015 11:03:10 +0000 (13:03 +0200)]
kmsg: add function for adding and deleting additional buffers

Additional kmsg buffers should be created and deleted dynamically.

Adding two functions
* kmsg_sys_buffer_add() creates additional kmsg buffer returning minor
* kmsg_sys_buffer_del() deletes one based on provided minor

Change-Id: Ibb85543b830ecd186e8cf7ebdf560f72c0bba83c
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
7 years agokmsg: add additional buffers support to memory class
Marcin Niesluchowski [Mon, 20 Jul 2015 12:52:06 +0000 (14:52 +0200)]
kmsg: add additional buffers support to memory class

Memory class does not support additional kmsg buffers.

Add additional kmsg buffers support to:
* devnode() callback of "mem" class
* file operations of major "mem" character device

Change-Id: I15b6c79435b4dc18422a9bd6836bd9c7a87ad60a
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 years agokmsg: introduce additional kmsg devices support
Marcin Niesluchowski [Wed, 29 Apr 2015 17:37:05 +0000 (19:37 +0200)]
kmsg: introduce additional kmsg devices support

kmsg device provides operations on cyclic logging buffer used mainly
by kernel but also in userspace by privileged processes.

Additional kmsg devices keep the same log format but may be added
dynamically with custom size.

Change-Id: I52c28310197594888621000bb5be933173c3031d
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
7 years agoprintk: add one function for storing log in proper format
Marcin Niesluchowski [Thu, 2 Jul 2015 14:54:51 +0000 (16:54 +0200)]
printk: add one function for storing log in proper format

Preparation commit for future changes purpose.

Separate code responsible for storing log message in proper format
from operations on consoles by putting it in another function.

Change-Id: I6d744bb83f8dd0e4ae5afe05bd082092e28082a9
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
7 years agoprintk: move code regarding log message storing format
Marcin Niesluchowski [Thu, 2 Jul 2015 14:32:28 +0000 (16:32 +0200)]
printk: move code regarding log message storing format

Preparation commit for future changes purpose.

Moves some code responsible for storing log messages in proper format.

Change-Id: I1df4bb2c1f2e7643129ba73e7355a0cfb7d511ca
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
7 years agoprintk: guard the amount written per line by devkmsg_read()
Tejun Heo [Thu, 14 May 2015 15:36:36 +0000 (11:36 -0400)]
printk: guard the amount written per line by devkmsg_read()

devkmsg_read() uses 8k buffer and assumes that the formatted output
message won't overrun which seems safe given LOG_LINE_MAX, the current
use of dict and the escaping method being used; however, we're
planning to use devkmsg formatting wider and accounting for the buffer
size properly isn't that complicated.

This patch defines CONSOLE_EXT_LOG_MAX as 8192 and updates
devkmsg_read() so that it limits output accordingly.

Change-Id: Ic8579ddcd55294a38561e9e8b28449c067600db1
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Kay Sievers <kay@vrfy.org>
Cc: Petr Mladek <pmladek@suse.cz>
7 years agokdbus: disable all internal policy checks
Lukasz Skalski [Mon, 4 Jan 2016 14:59:07 +0000 (15:59 +0100)]
kdbus: disable all internal policy checks

Change-Id: I5ef09ea4e4389ca41a6ef7afda31fe3a8d9bc507
Signed-off-by: Lukasz Skalski <l.skalski@samsung.com>
7 years agotools/build: fix build script to set proper kernel version to output
Seung-Woo Kim [Thu, 28 Jan 2016 00:50:33 +0000 (09:50 +0900)]
tools/build: fix build script to set proper kernel version to output

This patch fixes build script to set proper kernel version to output
image tar file.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoarm64: dts: exynos-5433-tm2e: fix touch resolution
Inki Dae [Wed, 27 Jan 2016 11:56:37 +0000 (20:56 +0900)]
arm64: dts: exynos-5433-tm2e: fix touch resolution

This patch fixes horizontal resolution to be suitable
to Note 4 edge Display.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agoarm64: dts: exynos5433-tm2e: Modify the different pmic setting from TM2
Chanwoo Choi [Wed, 27 Jan 2016 06:41:57 +0000 (15:41 +0900)]
arm64: dts: exynos5433-tm2e: Modify the different pmic setting from TM2

This patch modifies the different PMIC setting from TM2 board.
The following differences is trivial:
- Change the maximum voltage of LDO23, LDO31 and LDO38
- Don't use the LDO25

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoarm64: dts: Add new Exynos5433-based TM2E board dts
Chanwoo Choi [Wed, 27 Jan 2016 06:15:41 +0000 (15:15 +0900)]
arm64: dts: Add new Exynos5433-based TM2E board dts

This patch adds the new Exynos5433-based TM2E board which is Samsung Galaxy
Note4-Edge (SM-N915S).

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoRevert "local/rtc: s5m: Add support for S2MPS13 RTC"
Krzysztof Kozlowski [Wed, 30 Dec 2015 04:00:36 +0000 (13:00 +0900)]
Revert "local/rtc: s5m: Add support for S2MPS13 RTC"

This reverts commit 70deaddc2d5a8b3efed014f577473d24bedbfb96.

The offending commit was actually an invalid automatic resolution of
conflict (after rebasing on v4.1) and it is duplicating existing device
id entry.

7 years agovb2: Fix compilation breakage when !CONFIG_BUG
Laurent Pinchart [Sun, 12 Jul 2015 23:08:34 +0000 (20:08 -0300)]
vb2: Fix compilation breakage when !CONFIG_BUG

Commit 77a3c6fd90c9 ("[media] vb2: Don't WARN when v4l2_buffer.bytesused
is 0 for multiplanar buffers") uses the __WARN() macro which isn't
defined when CONFIG_BUG isn't set. This introduces a compilation
breakage. Fix it by using WARN_ON() instead.

The commit was also broken in that it merged v1 of the patch while a new
v2 version had been submitted, reviewed and acked. Fix it by
incorporating the changes from v1 to v2.

Fixes: 77a3c6fd90c9 ("[media] vb2: Don't WARN when v4l2_buffer.bytesused is 0 for multiplanar buffers")

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years agov4l2-ioctl: log buffer type 0 correctly
Hans Verkuil [Fri, 5 Jun 2015 14:28:51 +0000 (11:28 -0300)]
v4l2-ioctl: log buffer type 0 correctly

If userspace passed the invalid buffer type 0 to the kernel, then the
kernel log would show 'type=(null)' since there was no string defined
for type 0. Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
7 years agousb: gadget: composite: fill bcdUSB for any gadget max speed
Igor Kotrasinski [Thu, 20 Aug 2015 08:00:01 +0000 (10:00 +0200)]
usb: gadget: composite: fill bcdUSB for any gadget max speed

When handling device GET_DESCRIPTOR, composite gadget driver fills
the bcdUSB field only if the gadget supports USB 3.0. Otherwise
the field is left unfilled.

For consistency, set bcdUSB to 0x0200 for gadgets that don't
support superspeed.

It's correct to use 0x0200 for any setting that doesn't use
superspeed, since USB 2.0 devices can restrict themselves to
full speed only. It is NOT correct to use 0x0210, since BOS
descriptors are handled only if gadget_is_superspeed() is
satisfied, otherwise it results in a stall.

Signed-off-by: Igor Kotrasinski <i.kotrasinsk@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[Backported from mainline commit
5527e73305e8a9958b00331902a27514e62d539b]
Change-Id: Icd543a5b83c6b915be4ba54343ce979145f7e15d
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agodrm/exynos: fix imported dma-buf to be mapped
Joonyoung Shim [Tue, 22 Dec 2015 00:54:31 +0000 (09:54 +0900)]
drm/exynos: fix imported dma-buf to be mapped

The imported dma-buf should be mapped by sub-system exporting it.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[jy0922.shim: Be backported from upstream but not posted]

7 years agodrm/exynos: support mmap from dma-buf
Joonyoung Shim [Tue, 22 Dec 2015 00:50:10 +0000 (09:50 +0900)]
drm/exynos: support mmap from dma-buf

This allows exported dma-bufs to be mapped in exynos drm.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[jy0922.shim: Be backported from upstream but not posted]

7 years agodrm/exynos: remove call to drm_gem_free_mmap_offset()
Joonyoung Shim [Tue, 22 Dec 2015 00:35:55 +0000 (09:35 +0900)]
drm/exynos: remove call to drm_gem_free_mmap_offset()

The drm_gem_object_release() function already performs this cleanup,
so there is no reason to do it explicitly.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
[jy0922.shim: Be backported from upstream]

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agophy: Fix reset_reg offset for S5PV210 in phy-exynos-mipi-video.c
Sylwester Nawrocki [Thu, 5 Nov 2015 16:29:59 +0000 (17:29 +0100)]
phy: Fix reset_reg offset for S5PV210 in phy-exynos-mipi-video.c

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agofimc-is: Eliminate some BUG_ON() from fimc_is_group_buffer_finish()
Sylwester Nawrocki [Fri, 6 Nov 2015 13:33:22 +0000 (14:33 +0100)]
fimc-is: Eliminate some BUG_ON() from fimc_is_group_buffer_finish()

This prevents kernel panic caused by wrong sequences in user space.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agoclk: exynos5433: Fix mout_aclk_cam1*_user clocks definition
Sylwester Nawrocki [Fri, 6 Nov 2015 11:55:30 +0000 (12:55 +0100)]
clk: exynos5433: Fix mout_aclk_cam1*_user clocks definition

Control bits for the ACLK_CAM1_552_USER and ACLK_CAM1_400_USER
mux clocks are in MUX_SEL_CAM10, not MUX_SEL_CAM01 register.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agoSmack: type confusion in smak sendmsg() handler
Roman Kubiak [Thu, 17 Dec 2015 12:24:35 +0000 (13:24 +0100)]
Smack: type confusion in smak sendmsg() handler

Smack security handler for sendmsg() syscall
is vulnerable to type confusion issue what
can allow to privilege escalation into root
or cause denial of service.

A malicious attacker can create socket of one
type for example AF_UNIX and pass is into
sendmsg() function ensuring that this is
AF_INET socket.

Remedy
Do not trust user supplied data.
Proposed fix below.

Signed-off-by: Roman Kubiak <r.kubiak@samsung.com>
Signed-off-by: Mateusz Fruba <m.fruba@samsung.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
7 years agoSmack: File receive for sockets
Casey Schaufler [Mon, 7 Dec 2015 22:34:32 +0000 (14:34 -0800)]
Smack: File receive for sockets

The existing file receive hook checks for access on
the file inode even for UDS. This is not right, as
the inode is not used by Smack to make access checks
for sockets. This change checks for an appropriate
access relationship between the receiving (current)
process and the socket. If the process can't write
to the socket's send label or the socket's receive
label can't write to the process fail.

This will allow the legitimate cases, where the
socket sender and socket receiver can freely communicate.
Only strangly set socket labels should cause a problem.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
7 years agoBluetooth: hci_uart: Fix dereferencing of ERR_PTR
Chan-yeol Park [Wed, 17 Jun 2015 12:10:39 +0000 (21:10 +0900)]
Bluetooth: hci_uart: Fix dereferencing of ERR_PTR

If h4_recv_buf() return ERR_PTR instead sk_buff pointer, it should be
cleared once PTR_ERR is completed for the further dereference such as
h4_recv(), or h4_close().

Signed-off-by: Chan-yeol Park <chanyeol.park@samsung.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
7 years agoLOCAL / arm64: defconfig: enable zram feature
Seung-Woo Kim [Tue, 8 Dec 2015 01:11:28 +0000 (10:11 +0900)]
LOCAL / arm64: defconfig: enable zram feature

This patch enables zram feature which is used by Tizen resourced.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agos5p-mfc: remove volatile attribute from MFC register addresses
Andrzej Hajda [Tue, 1 Dec 2015 10:31:19 +0000 (11:31 +0100)]
s5p-mfc: remove volatile attribute from MFC register addresses

MFC register addresses are used only by writel/readl macros which already
takes care of proper register accessing.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agos5p-mfc: merge together s5p_mfc_hw_call and s5p_mfc_hw_call_void
Andrzej Hajda [Tue, 1 Dec 2015 09:24:23 +0000 (10:24 +0100)]
s5p-mfc: merge together s5p_mfc_hw_call and s5p_mfc_hw_call_void

Both macros can be merged into one.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agos5p-mfc: use spinlock to protect MFC context
Andrzej Hajda [Mon, 30 Nov 2015 13:02:52 +0000 (14:02 +0100)]
s5p-mfc: use spinlock to protect MFC context

MFC driver uses dev->irqlock spinlock to protect queues only, but many context
fields requires protection also - they can be accessed concurrently
from IOCTLs and IRQ handler. The patch increases protection range of irqlock
to those fields also.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agos5p-mfc: remove unnecessary callbacks
Andrzej Hajda [Fri, 20 Nov 2015 06:50:10 +0000 (07:50 +0100)]
s5p-mfc: remove unnecessary callbacks

Many version specific functions are not called by common code, so there
is no need to use callbacks. Additionally some of them are not used at all,
so they can be safely removed.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agos5p-mfc: make queue cleanup code common
Andrzej Hajda [Tue, 10 Nov 2015 11:48:25 +0000 (12:48 +0100)]
s5p-mfc: make queue cleanup code common

Code for queue cleanup has nothing specific to hardware version.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agos5p-mfc: use one implementation of s5p_mfc_get_new_ctx
Andrzej Hajda [Tue, 10 Nov 2015 11:35:12 +0000 (12:35 +0100)]
s5p-mfc: use one implementation of s5p_mfc_get_new_ctx

Both version of MFC driver uses functions with the same body and name.
The patch moves them to common location. It also simplifies it.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agomedia: s5p-mfc: remove double declared temporary variable
Marek Szyprowski [Tue, 24 Nov 2015 09:34:31 +0000 (10:34 +0100)]
media: s5p-mfc: remove double declared temporary variable

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
7 years agomedia: fimc-is: fix code issues pointed by CPPTest tool
Marek Szyprowski [Tue, 24 Nov 2015 09:33:57 +0000 (10:33 +0100)]
media: fimc-is: fix code issues pointed by CPPTest tool

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
7 years agosii8620: fix edid memory leak
Andrzej Hajda [Mon, 23 Nov 2015 13:30:51 +0000 (14:30 +0100)]
sii8620: fix edid memory leak

In case of error during edid retrieval, allocated memory should be freed.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrivers: soc/samsung: fix possible memory leak in pm_domains code
Marek Szyprowski [Mon, 23 Nov 2015 13:09:44 +0000 (14:09 +0100)]
drivers: soc/samsung: fix possible memory leak in pm_domains code

This patch fixes the issue pointed by Klocwork static analysis tool.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
7 years agomedia: fimc-is: fix possible memory leak found by static analysis
Marek Szyprowski [Mon, 23 Nov 2015 12:55:49 +0000 (13:55 +0100)]
media: fimc-is: fix possible memory leak found by static analysis

This patch fixes all issues pointed by Klocwork static analysis tool.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
7 years agokdbus: pool: use __vfs_read()
Sergei Zviagintsev [Thu, 23 Apr 2015 13:06:17 +0000 (15:06 +0200)]
kdbus: pool: use __vfs_read()

After commit 5d5d56897530 ("make new_sync_{read,write}() static")
->read() cannot be called directly.

kdbus_pool_slice_copy() leads to oops, which can be reproduced by
launching tools/testing/selftests/kdbus/kdbus-test -t message-quota:

[ 1167.146793] BUG: unable to handle kernel NULL pointer dereference at           (null)
[ 1167.147554] IP: [<          (null)>]           (null)
[ 1167.148670] PGD 3a9dd067 PUD 3a841067 PMD 0
[ 1167.149611] Oops: 0010 [#1] SMP
[ 1167.150088] Modules linked in: nfsv3 nfs kdbus lockd grace sunrpc
[ 1167.150771] CPU: 0 PID: 518 Comm: kdbus-test Not tainted 4.0.0-next-20150420-kdbus #62
[ 1167.150771] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[ 1167.150771] task: ffff88003daed120 ti: ffff88003a800000 task.ti: ffff88003a800000
[ 1167.150771] RIP: 0010:[<0000000000000000>]  [<          (null)>]           (null)
[ 1167.150771] RSP: 0018:ffff88003a803bc0  EFLAGS: 00010286
[ 1167.150771] RAX: ffff8800377fb000 RBX: 00000000000201e8 RCX: ffff88003a803c00
[ 1167.150771] RDX: 0000000000000b40 RSI: ffff8800377fb4c0 RDI: ffff88003d815700
[ 1167.150771] RBP: ffff88003a803c48 R08: ffffffff8139e380 R09: ffff880039d80490
[ 1167.150771] R10: ffff88003a803a90 R11: 00000000000004c0 R12: 00000000002a24c0
[ 1167.150771] R13: 0000000000000b40 R14: ffff88003d815700 R15: ffffffff8139e460
[ 1167.150771] FS:  00007f41dccd4740(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
[ 1167.150771] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1167.150771] CR2: 0000000000000000 CR3: 000000003ccdf000 CR4: 00000000000007b0
[ 1167.150771] Stack:
[ 1167.150771]  ffffffffa0065497 ffff88003a803c10 00007ffffffff000 ffff88003aaa67c0
[ 1167.150771]  00000000000004c0 ffff88003aaa6870 ffff88003ca83300 ffffffffa006537d
[ 1167.150771]  00000000000201e8 ffffea0000ddfec0 ffff88003a803c20 0000000000000018
[ 1167.150771] Call Trace:
[ 1167.150771]  [<ffffffffa0065497>] ? kdbus_pool_slice_copy+0x127/0x200 [kdbus]
[ 1167.150771]  [<ffffffffa006537d>] ? kdbus_pool_slice_copy+0xd/0x200 [kdbus]
[ 1167.150771]  [<ffffffffa006670a>] kdbus_queue_entry_move+0xaa/0x180 [kdbus]
[ 1167.150771]  [<ffffffffa0059e64>] kdbus_conn_move_messages+0x1e4/0x2c0 [kdbus]
[ 1167.150771]  [<ffffffffa006234e>] kdbus_name_acquire+0x31e/0x390 [kdbus]
[ 1167.150771]  [<ffffffffa00625c5>] kdbus_cmd_name_acquire+0x125/0x130 [kdbus]
[ 1167.150771]  [<ffffffffa005db5d>] kdbus_handle_ioctl+0x4ed/0x610 [kdbus]
[ 1167.150771]  [<ffffffff811040e0>] do_vfs_ioctl+0x2e0/0x4e0
[ 1167.150771]  [<ffffffff81389750>] ? preempt_schedule_common+0x1f/0x3f
[ 1167.150771]  [<ffffffff8110431c>] SyS_ioctl+0x3c/0x80
[ 1167.150771]  [<ffffffff8138c36e>] system_call_fastpath+0x12/0x71
[ 1167.150771] Code:  Bad RIP value.
[ 1167.150771] RIP  [<          (null)>]           (null)
[ 1167.150771]  RSP <ffff88003a803bc0>
[ 1167.150771] CR2: 0000000000000000
[ 1167.168756] ---[ end trace a676bcfa75db5a96 ]---

Use __vfs_read() instead.

Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>