platform/kernel/linux-exynos.git
9 years agodrm/exynos: mixer: add experimental support for 1024x600@43Hz mode 54/57954/2 old/tizen_20160405
Marek Szyprowski [Tue, 26 Jan 2016 08:45:13 +0000 (09:45 +0100)]
drm/exynos: mixer: add experimental support for 1024x600@43Hz mode

This patch adds experimental configuration data for HDMI PHY for 32MHz
pixel clock modes. This enables support for WaveShare 7inch HDMI LCD (C)
HDMI panel.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I2f711ef21ce21da58b8efaf6f6dd28c5e2d2e8fc

9 years agoKEYS: Fix keyring ref leak in join_session_keyring() 23/58423/1
Yevgeny Pats [Tue, 19 Jan 2016 22:09:04 +0000 (22:09 +0000)]
KEYS: Fix keyring ref leak in join_session_keyring()

This fixes CVE-2016-0728.

If a thread is asked to join as a session keyring the keyring that's already
set as its session, we leak a keyring reference.

This can be tested with the following program:

#include <stddef.h>
#include <stdio.h>
#include <sys/types.h>
#include <keyutils.h>

int main(int argc, const char *argv[])
{
int i = 0;
key_serial_t serial;

serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING,
"leaked-keyring");
if (serial < 0) {
perror("keyctl");
return -1;
}

if (keyctl(KEYCTL_SETPERM, serial,
   KEY_POS_ALL | KEY_USR_ALL) < 0) {
perror("keyctl");
return -1;
}

for (i = 0; i < 100; i++) {
serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING,
"leaked-keyring");
if (serial < 0) {
perror("keyctl");
return -1;
}
}

return 0;
}

If, after the program has run, there something like the following line in
/proc/keys:

3f3d898f I--Q---   100 perm 3f3f0000     0     0 keyring   leaked-keyring: empty

with a usage count of 100 * the number of times the program has been run,
then the kernel is malfunctioning.  If leaked-keyring has zero usages or
has been garbage collected, then the problem is fixed.

Change-Id: I08e8b8e929575583a94b6c84826c8f05e4dca075
Reported-by: Yevgeny Pats <yevgeny@perception-point.io>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Acked-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
[Backport from mainline commit 23567fd052a9abb6d67fe8e7a9ccdd9800a540f2 to resolve CVE-2016-0728]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agokdbus: disable all internal policy checks 22/56122/1 accepted/tizen/ivi/20160218.024248 accepted/tizen/mobile/20160107.101829 accepted/tizen/tv/20160107.101850 accepted/tizen/wearable/20160107.101858 submit/tizen/20160107.053914 submit/tizen_common/20160218.142243 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000004
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>
9 years agoclk: samsung: exynos5420: Add pll_rate_table and clock id for EPLL 18/55718/2
Chanwoo Choi [Tue, 29 Dec 2015 01:42:39 +0000 (10:42 +0900)]
clk: samsung: exynos5420: Add pll_rate_table and clock id for EPLL

This patch add the clock id of EPLL to handle it on devicetree file
and the rate tables. EPLL is used as root clock of ASS (Audio Subsystem).

Change-Id: Iefcbd5ea4cb911a3b5d75888286926773a98af54
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
9 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>
9 years agousb: gadget: f_fs: do not set cancel function on synchronous {read,write}
Rui Miguel Silva [Mon, 18 May 2015 15:02:07 +0000 (16:02 +0100)]
usb: gadget: f_fs: do not set cancel function on synchronous {read,write}

do not try to set cancel function in synchronous operations in
ffs_epfile_{read,write}_iter.

Cc: <stable@vger.kernel.org> # v4.0+
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[Backported from mainline commit
4088acf1e845aba35f30fb91dee10649edbd0e84]
Change-Id: Icd247a1b83a6b905be4aa54343ce979165f7e17d
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
9 years agodrm/exynos: fix imported dma-buf to be mapped 11/55111/1 accepted/tizen/mobile/20151222.085824 accepted/tizen/tv/20151222.085848 accepted/tizen/wearable/20151222.085907 submit/tizen/20151222.042943 submit/tizen_common/20151229.144031 submit/tizen_common/20151229.154718
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]

Change-Id: I59984d8111f058decf83afbda4d2df2e1edf305e

9 years agodrm/exynos: support mmap from dma-buf 10/55110/1
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]

Change-Id: Ic3bf3153707e2e57c1d930487428b6a83b96d658

9 years agodrm/exynos: remove call to drm_gem_free_mmap_offset() 09/55109/1
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]

Change-Id: I8dcac341340dd8dc31dbf528df2c537f22c6a701

9 years agoARM: odroidxu3_defconfig: enable zram feature 99/53499/3 accepted/tizen/mobile/20151210.230413 accepted/tizen/tv/20151210.230433 accepted/tizen/wearable/20151210.230453 submit/tizen/20151210.084319
Seung-Woo Kim [Mon, 7 Dec 2015 09:45:35 +0000 (18:45 +0900)]
ARM: odroidxu3_defconfig: enable zram feature

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

Change-Id: I3f35f1c53ce60d64263064ed9b5b8221e1b63bb4
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agomedia: s5p-mfc: set src_bufs_cnt with requested buffer for DMABUF and USERPTR 98/50798/1 accepted/tizen/mobile/20151103.105519 accepted/tizen/tv/20151103.105555 accepted/tizen/wearable/20151103.105620 submit/tizen/20151103.071105
Seung-Woo Kim [Sat, 31 Oct 2015 08:24:54 +0000 (17:24 +0900)]
media: s5p-mfc: set src_bufs_cnt with requested buffer for DMABUF and USERPTR

During start_streaming of output, it checks src_bufs_cnt compared
with pb_count. But it is only meaningful for MMAP memory. So this
patch fixes to set src_bufs_cnt with requested buffer for non MMAP
memory.

Change-Id: Icd447f1b82a6b805be4aa54843ce979265f7e17d
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agodrm: permit DRM_RENDER_ALLOW on DRM_IOCTL_GEM_FLINK 76/49076/1 accepted/tizen/mobile/20151029.085812 accepted/tizen/tv/20151029.085829 accepted/tizen/wearable/20151029.085840 submit/tizen/20151029.055133
Joonyoung Shim [Tue, 6 Oct 2015 07:34:51 +0000 (16:34 +0900)]
drm: permit DRM_RENDER_ALLOW on DRM_IOCTL_GEM_FLINK

This permits DRM_RENDER_ALLOW on DRM_IOCTL_GEM_FLINK temporarily by
request of tizen platform until tizen platform uses dma-buf feature
fully.

Change-Id: I0431dba35655871c734611a9b53c39ec4f1bb26a
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agodrm/exynos: add DRM_EXYNOS_GEM_MAP ioctl 75/49075/1
Joonyoung Shim [Fri, 2 Oct 2015 07:38:34 +0000 (16:38 +0900)]
drm/exynos: add DRM_EXYNOS_GEM_MAP ioctl

The commit d931589c01a2 ("drm/exynos: remove DRM_EXYNOS_GEM_MAP_OFFSET
ioctl") removed it same with the ioctl that this patch adds. The reason
that removed DRM_EXYNOS_GEM_MAP_OFFSET was we could use
DRM_IOCTL_MODE_MAP_DUMB. Both did exactly same thing.

Now we again will revive it as DRM_EXYNOS_GEM_MAP because of render
node. DRM_IOCTL_MODE_MAP_DUMB isn't permitted in render node.

Change-Id: I6900f89aa1f14ab06f56e257c4e77639cba8d5c7
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoARM: dts: Fix wrong clock binding for sysmmu_fimd1_1 on exynos5420 74/49074/1
Joonyoung Shim [Wed, 23 Sep 2015 07:41:55 +0000 (16:41 +0900)]
ARM: dts: Fix wrong clock binding for sysmmu_fimd1_1 on exynos5420

The sysmmu_fimd1_1 should bind the clock CLK_SMMU_FIMD1M1, not the clock
CLK_SMMU_FIMD1M0. CLK_SMMU_FIMD1M0 is a clock for the sysmmu_fimd1_0.

This wrong clock binding causes the problem that is blocked in iommu_map
function when IOMMU is enabled and exynos-drm driver tries to allocate
buffer via DMA mapping API on Odroid-XU3 board.

Change-Id: I030bbdad233446df59732a41260631dbdade0493
Fixes: b70045167815 ("ARM: dts: add sysmmu nodes for exynos5420")
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: <stable@vger.kernel.org> # v4.2
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
9 years agokdbus: Eliminate warning caused by lack of uapi/linux/kdbus.h inclusion 76/47476/4
Paul Osmialowski [Thu, 3 Sep 2015 14:38:42 +0000 (16:38 +0200)]
kdbus: Eliminate warning caused by lack of uapi/linux/kdbus.h inclusion

metadata.h references struct kdbus_pids which is defined in
uapi/linux/kdbus.h

Normally, kdbus/metadata.h is included as one of many other headers
that eventually include uapi/linux/kdbus.h at some point.

When included alone, it causes warning. Also when kdbus/connection.h
is included alone (e.g. in smack_lsm.c) , the same warning is shown
as it includes kdbus/metadata.h.

This patch adds missing inclusion.

Change-Id: Id099e3e2f9e3389571ea9a2b21b1f901898960cd
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agokdbus: Ability to run kdbus test by executable binary name 26/41226/14
Paul Osmialowski [Wed, 29 Apr 2015 10:00:19 +0000 (12:00 +0200)]
kdbus: Ability to run kdbus test by executable binary name

With this applied, you can do following:

$ cp kdbus-test daemon
$ cp kdbus-test send

Then run 'daemon' in one shell session:

$ ./daemon --bus test

...and 'send' in another:

$ ./send --bus test

Useful for testing features introduced by previous patches.

Change-Id: Ic66355e664b7920736a0063b0ae6b456706d7d8d
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agokdbus: selftests extended 25/41225/14
Paul Osmialowski [Tue, 14 Apr 2015 13:55:09 +0000 (15:55 +0200)]
kdbus: selftests extended

The 'test-send' test case should connect to an already running test-daemon
which creates a bus with known name.

The main goal of this test case is to verify that messages as well as
file descriptors (opened with different open modes) can be transferred
properly.

In order to achieve its goals, this test case opens three files
(/tmp/kdbus-test-send.rd, /tmp/kdbus-test-send.wr,
/tmp/kdbus-test-send.rdwr) with three different open modes (O_RDONLY,
O_WRONLY, O_RDWR). If any of these files exists it is used 'as is',
otherwise it is created with some default content. Then this test tries
to send simple message followed by three messages each one of them
containing an array of opened file descriptors (single element array in the
first message, two element array in the second, three element array in the
third).

The ability to send array of file descriptors required changes in almost
all of the test case files.

Change-Id: I8b516458d8e8b786086b976aa2582ebeb4b173dc
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agokdbus: TEST_CREATE_CONN now does no depend on TEST_CREATE_BUS 24/41224/13
Paul Osmialowski [Wed, 29 Apr 2015 14:55:39 +0000 (16:55 +0200)]
kdbus: TEST_CREATE_CONN now does no depend on TEST_CREATE_BUS

Without this patch, it is impossible to specify test case able to
connect to a bus already created (e.g. by 'test-daemon' test case), you can
only specify:

1) TEST_CREATE_BUS which creates new bus, or
2) TEST_CREATE_CONN OR'ed with TEST_CREATE_BUS which creates new bus and
creates connection to it.

This patch adds the missing ability to specify TEST_CREATE_CONN alone.

It will be used by a new test case (will be added by separate commit) which
is supposed to connect to already started test-daemon case.

Change-Id: I10a4ccb76fa50a3b5f454f8e18031339f2f7d3d1
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agolsm: smack: smack callbacks for kdbus security hooks 44/42144/12
Paul Osmialowski [Tue, 23 Jun 2015 14:11:46 +0000 (16:11 +0200)]
lsm: smack: smack callbacks for kdbus security hooks

This adds implementation of three smack callbacks sitting behind kdbus
security hooks as proposed by Karol Lewandowski.

Originates from:

git://git.infradead.org/users/pcmoore/selinux (branch: working-kdbus)
commit: fc3505d058c001fe72a6f66b833e0be5b2d118f3

https://github.com/lmctl/linux.git (branch: kdbus-lsm-v4.for-systemd-v212)
commit: 103c26fd27d1ec8c32d85dd3d85681f936ac66fb

Change-Id: I8f850ffdc8f2a5f38abde47f2996b6ff8defdc1f
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agokdbus: use LSM hooks in kdbus code 23/41223/12
Paul Osmialowski [Tue, 26 May 2015 10:00:33 +0000 (12:00 +0200)]
kdbus: use LSM hooks in kdbus code

Originates from:

https://github.com/lmctl/kdbus.git (branch: kdbus-lsm-v4.for-systemd-v212)
commit: aa0885489d19be92fa41c6f0a71df28763228a40

Change-Id: Ibcba82b35d22846c2593a42a0c66feda6a115a0f
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agolsm: kdbus security hooks 22/41222/12
Paul Osmialowski [Tue, 26 May 2015 09:58:06 +0000 (11:58 +0200)]
lsm: kdbus security hooks

This is combination of work by Karol Lewandowski and Paul Moore
on LSM hooks for kdbus.

Originates from:

git://git.infradead.org/users/pcmoore/selinux (branch: working-kdbus)
commit: 7050f206a79564886938d0edc4e1e9da5972c72d

https://github.com/lmctl/linux.git (branch: kdbus-lsm-v4.for-systemd-v212)
commit: a9fe4c33b6e5ab25a243e0590df406aabb6add12

Change-Id: Ie55cd3eb6427542856d15ded7ba986712c2b9453
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agolsm: smack: Make ipc/kdbus includes visible so smack callbacks could see them 21/41221/7
Paul Osmialowski [Tue, 26 May 2015 09:38:53 +0000 (11:38 +0200)]
lsm: smack: Make ipc/kdbus includes visible so smack callbacks could see them

Change-Id: I025bd8622a2667c0fe75736b16c7d3beae83f888
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agolsm: make security_file_receive available for external modules 20/41220/7
Karol Lewandowski [Thu, 20 Feb 2014 16:54:38 +0000 (17:54 +0100)]
lsm: make security_file_receive available for external modules

This is required for using filedesc related LSM hooks in kdbus code
if it is built as a module.

Change-Id: I980b1938756761b260f88037e1073b26574bb37e
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
9 years agoARM: odroidxu3_defconfig: enable UACCESS_WITH_MEMCPY 09/48209/2
Junghak Sung [Wed, 16 Sep 2015 06:23:34 +0000 (15:23 +0900)]
ARM: odroidxu3_defconfig: enable UACCESS_WITH_MEMCPY

Enable CONFIG_UACCESS_WITH_MEMCPY for odroid-xu3.
Fix an issue that sometimes TS data is broken when DVB demux pass the data
to user-space by using copy_to_user.

Change-Id: I7994f193871e70afe31df9c7abdd75b8909b587d
Signed-off-by: Junghak Sung <jh1009.sung@samsung.com>
9 years agoRevert "drm/exynos: get event time from ktime" 06/48206/1
Joonyoung Shim [Wed, 16 Sep 2015 05:43:19 +0000 (14:43 +0900)]
Revert "drm/exynos: get event time from ktime"

Commit f71a7f0e31f5 ("drm/exynos: get event time from ktime") causes
build errors.

This reverts commit f71a7f0e31f5dc6f6ed39a80e6c36ee03ea9a6c2.

Change-Id: I18dfe8db270f193e64311c9fec3c0af80cf3fca5
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agodrm/exynos: get event time from ktime 76/48076/2
Joonyoung Shim [Mon, 14 Sep 2015 02:39:01 +0000 (11:39 +0900)]
drm/exynos: get event time from ktime

G2D and IPP drivers gets event time from do_gettimeofday(), but drm
vblank event gets it from ktime. Use ktime for consistency.

Change-Id: I9b2f4c74540c4a15845f5de67ffcd537ba57afeb
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoARM: odroidxu3_defconfig: disable smack permissive mode 62/47862/1 tizen_3.0.m1_mobile tizen_3.0.m1_tv accepted/tizen/mobile/20150909.140905 accepted/tizen/tv/20150909.140218 accepted/tizen/wearable/20150909.135232 submit/tizen/20150909.110847 submit/tizen_common/20151023.083358 submit/tizen_common/20151026.085049 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
Seung-Woo Kim [Wed, 9 Sep 2015 11:04:20 +0000 (20:04 +0900)]
ARM: odroidxu3_defconfig: disable smack permissive mode

Tizen platform is finished for smack bringup, so this patch
disables smack permissive mode.

Change-Id: Ic0e1b7a182134da9d99102914adbf6a2bdb298e6
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agoWORKAROUND/Smack: ignore socket and pipe inods for smack_file_receive 61/47861/1
Seung-Woo Kim [Wed, 9 Sep 2015 05:21:49 +0000 (14:21 +0900)]
WORKAROUND/Smack: ignore socket and pipe inods for smack_file_receive

This patch fixes to ignore socket and pipe inode for smack_file_receive as
workaround. It will be fixed on mainline smack and at that time this patch
should be reverted.

Change-Id: If5211b22b39c77e70597704fa06ae3f6276d0b8c
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agokdbus: disable internal kdbus policy 73/46673/3 accepted/tizen/mobile/20150903.233503 accepted/tizen/tv/20150903.233515 accepted/tizen/wearable/20150903.233529 submit/tizen/20150903.131924
Lukasz Skalski [Mon, 24 Aug 2015 16:54:46 +0000 (18:54 +0200)]
kdbus: disable internal kdbus policy

Possibilities of connections to own, see and talk to well-known names
are already restricted by LSM hooks.

Change-Id: I62d86a506a85e6c48bdd3e0f8b11f1aa5a918c75
Signed-off-by: Lukasz Skalski <l.skalski@samsung.com>
9 years agodrm/exynos: rotator: remove unnecessary cur_buf_id 18/47118/2 accepted/tizen/mobile/20150902.004628 accepted/tizen/tv/20150902.004649 accepted/tizen/wearable/20150902.004712 submit/tizen/20150901.112943
Seung-Woo Kim [Mon, 31 Aug 2015 03:59:17 +0000 (12:59 +0900)]
drm/exynos: rotator: remove unnecessary cur_buf_id

After commit 2af026584c81faa37f26b86713d6331ddf70e3f3,
'drm/exynos: ipp: introduce last_buf_id', each driver do not need
to handler buf_id for the event. So this patch removes unnecessary
cur_buf_id from rotator.

Change-Id: Idd80765c41260ae6ce4488e56b0d4beaea76229a
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agodrm/exynos: fimc: fix wrong buf_id access for dma channel 17/47117/2
Seung-Woo Kim [Mon, 31 Aug 2015 03:07:55 +0000 (12:07 +0900)]
drm/exynos: fimc: fix wrong buf_id access for dma channel

For destination buffers, buf_id is valid only less than maximum
dest buffer count. So this patch fixes wrong buf_id access to
dma_channel.

Change-Id: I4c73ab90a2fc8e57ecb82f277d3d53c2e91b910a
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agoARM: DTS: exynos5420: add GSCL block parent clock management to pm domain 45/47245/1
Marek Szyprowski [Tue, 1 Sep 2015 09:23:09 +0000 (11:23 +0200)]
ARM: DTS: exynos5420: add GSCL block parent clock management to pm domain

Add support for restoring GSCALLER parent clocks configuration when GSCL
power domain is turned on.

Change-id: Id9e43306a59e930c6068e82bc55850dbb0440672
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agoclk: samsung: exynos5422: add missing parent GSCL block clocks 44/47244/1
Marek Szyprowski [Tue, 1 Sep 2015 09:22:18 +0000 (11:22 +0200)]
clk: samsung: exynos5422: add missing parent GSCL block clocks

This patch adds clocks, which are required for preserving parent clock
configuration on GSCALLER power domain on/off.

Change-id: I98fd0d78ceb263b0b78960b2704e25b14386316b
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agoclk: samsung: exynos5422: fix MFC clock hierarchy parent 43/47243/1
Marek Szyprowski [Mon, 31 Aug 2015 11:52:43 +0000 (13:52 +0200)]
clk: samsung: exynos5422: fix MFC clock hierarchy parent

Proper source for MFC block is mout_user_aclk333 (in datasheet named
USER_MUX_ACLK_333), not the output of CLKDIV_ACLK_333 MUX.

Change-id: I291a53c5e7668eed0a83eed04b67c4a139852fa0
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agoARM: dma-mapping: add support for offset parameter in dma_mmap()
Marek Szyprowski [Fri, 28 Aug 2015 08:25:02 +0000 (10:25 +0200)]
ARM: dma-mapping: add support for offset parameter in dma_mmap()

IOMMU-based dma_mmap() implementation lacked proper support for offset
parameter used in mmap call (it always assumed that mapping starts from
offset zero). This patch adds support for offset parameter to IOMMU-based
implementation.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: stable@vger.kernel.org # v3.6+
9 years agoARM: dma-mapping: add missing range check in dma_mmap()
Marek Szyprowski [Fri, 28 Aug 2015 08:24:11 +0000 (10:24 +0200)]
ARM: dma-mapping: add missing range check in dma_mmap()

dma_mmap() function in IOMMU-based dma-mapping implementation lacked
a check for valid range of mmap parameters (offset and buffer size), what
might have caused access beyond the allocated buffer. This patch fixes
this issue.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: stable@vger.kernel.org # v3.6+
9 years agopackaging: enable KDBUS for odroidxu3 72/46672/2
Paul Osmialowski [Thu, 9 Jul 2015 16:27:32 +0000 (18:27 +0200)]
packaging: enable KDBUS for odroidxu3

CONFIG_KDBUS=y line added to odroidxu3_defconfig in the exact spot where it is
usually placed in .config file.

Change-Id: I019070af680aa8f1316cd2c2d069731d19f7c5b4
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agodrm/exynos: gsc: normalize invalid buf idx from userspace 01/46701/6
Hyungwon Hwang [Mon, 24 Aug 2015 10:33:27 +0000 (19:33 +0900)]
drm/exynos: gsc: normalize invalid buf idx from userspace

At least in the one frame processing mode which is the only mode supported
by the current gsc driver, the buf idx is not meaningful for the driver.
Because only one address in the buffer is valid at a time, so it is OK to
convert the invalid buf idx from userspace to a valid idx, process the
frame, and return the result with original buf idx.

Change-Id: Ia56449498e90ae211d7ad0aaede5d48bdfec2d8b
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
9 years agodrm/exynos: ipp: introduce last_buf_id 68/46768/3
Hyungwon Hwang [Wed, 26 Aug 2015 02:11:07 +0000 (11:11 +0900)]
drm/exynos: ipp: introduce last_buf_id

There is no reason to tie the buf idx from userspace and the real HW DMA
channel. So to separate them, the buf idx from userspace must be stored
to return the idx when the processing is done. This patch introduces
last_buf_id to store the current processing buf id for that purpose.

Change-Id: I74dd0c4c1ba59d3b94e6532dade6b5744c36b860
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
9 years agos5p-mfc: end-of-stream handling for newer encoders 37/46737/2
Andrzej Hajda [Thu, 20 Aug 2015 12:35:23 +0000 (14:35 +0200)]
s5p-mfc: end-of-stream handling for newer encoders

MFC encoder supports end-of-stream handling for encoder
in version 5 of hardware. This patch adds it also for newer version.
It was successfully tested on MFC-v8.

Change-Id: I3b8c4eb93649c29d99693f585aa0c519541d7226
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agoARM: odroidxu3_defconfig: enable CONFIG_USB_RTL8152 23/46723/1
Joonyoung Shim [Tue, 25 Aug 2015 09:17:16 +0000 (18:17 +0900)]
ARM: odroidxu3_defconfig: enable CONFIG_USB_RTL8152

Enable CONFIG_USB_RTL8152 for Odroid-XU4.

Change-Id: Iab87b058f01c0b8cd376d1fa4d84099ab412ba9a
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoARM: dts: Add Odroid-XU4 support 22/46722/1
Joonyoung Shim [Tue, 25 Aug 2015 09:08:29 +0000 (18:08 +0900)]
ARM: dts: Add Odroid-XU4 support

The Odroid-XU4 is almost the same as XU3, except usb otg, DP, audio
codec and power monitoring sensors. This patch makes common dtsi file
and dts file for XU4.

We will add more features on dts for XU4 later.

Change-Id: I6536b9cfa4a4441e392bfe17011968be64c97b3e
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoARM: odroidxu3_defconfig: disable CONFIG_RTC_DRV_S3C 35/46635/1 accepted/tizen/mobile/20150824.134655 accepted/tizen/tv/20150824.134712 accepted/tizen/wearable/20150824.134728 submit/tizen/20150824.094308
Joonyoung Shim [Mon, 24 Aug 2015 07:52:32 +0000 (16:52 +0900)]
ARM: odroidxu3_defconfig: disable CONFIG_RTC_DRV_S3C

Odroid-XU3 board has two rtc devices - SoC rtc(rtc-s3c) and pmic rtc
(rtc-s5m), so two device nodes for rtc like /dev/rtc0 and /dev/rtc1 will
be created.

The pmic rtc can keep time via rtc backup battery, so tizen platform
will want to use pmic rtc than SoC rtc but it can't know which device
node is for pmic rtc.

This patch disables CONFIG_RTC_DRV_S3C, then tizen platform can use only
pmic rtc.

Change-Id: Ie4256d547c9263c6bcb0302aacd7fbd3b47a4048
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agortc: s5m: fix to update ctrl register 34/46634/1
Joonyoung Shim [Fri, 21 Aug 2015 09:43:41 +0000 (18:43 +0900)]
rtc: s5m: fix to update ctrl register

According to datasheet, the S2MPS13X and S2MPS14X should update write
buffer via setting WUDR bit to high after ctrl register is written.

If not, ALARM interrupt of rtc-s5m doesn't happen first time when i use
tools/testing/selftests/timers/rtctest.c test program and hour format is
used to 12 hour mode in Odroid-XU3 board.

One more issue is the RTC doesn't keep time on Odroid-XU3 board when i
turn on board after power off even if RTC battery is connected. It can
be solved as setting WUDR & RUDR bits to high at the same time after
RTC_CTRL register is written. It's same with condition of only writing
ALARM registers, so this is for only S2MPS14 and we should set WUDR &
A_UDR bits to high on S2MPS13.

I can't find any reasonable description about this like fix from
datasheet, but can find similar codes from rtc driver source of
hardkernel kernel and vendor kernel.

Change-Id: I2ac1759847cb17c851ae297a19ded355ae90c4ce
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: <stable@vger.kernel.org> # v3.16
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
9 years agoRevert "rtc: s5m: fix to update ctrl register" 33/46633/1
Joonyoung Shim [Mon, 24 Aug 2015 07:36:07 +0000 (16:36 +0900)]
Revert "rtc: s5m: fix to update ctrl register"

This reverts commit 5e7b8e2696b65eac8b8aa891c5aadd53ca5e600f.

To apply updated patch from upstream.

Change-Id: I0f62f73000272ff7fc7a98af35cb1d768d5d0589
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoARM: EXYNOS: use PS_HOLD based poweroff for all supported SoCs 28/46328/2
Marek Szyprowski [Mon, 9 Feb 2015 07:25:41 +0000 (08:25 +0100)]
ARM: EXYNOS: use PS_HOLD based poweroff for all supported SoCs

PS_HOLD based power off procedure is common for all Exynos SoCs,
so use it for every Exynos SoCs.

Change-Id: I4c71a13430f088c9709fa6067b47a8da34f5da5e
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agokdbus: do not append the same connection to the queue twice 81/41881/5
Paul Osmialowski [Thu, 18 Jun 2015 15:29:11 +0000 (17:29 +0200)]
kdbus: do not append the same connection to the queue twice

As it was discussed on systemd ML [1], the same connection should be
queued up only once for a given well-known name.

[1] http://lists.freedesktop.org/archives/systemd-devel/2015-April/030494.html

This commit fixes following issue:

[  243.364270] ------------[ cut here ]------------
[  243.364352] WARNING: CPU: 1 PID: 223 at ../ipc/kdbus/names.c:137 kdbus_name_entry_replace_owner+0x88/0x8c()
[  243.364408] Modules linked in:
[  243.364474] CPU: 1 PID: 223 Comm: kdbus-test Not tainted 4.0.0+ #1
[  243.364526] Hardware name: Foundation-v8A (DT)
[  243.364569] Call trace:
[  243.364639] [<ffff800000089d38>] dump_backtrace+0x0/0x12c
[  243.364718] [<ffff800000089e74>] show_stack+0x10/0x1c
[  243.364798] [<ffff8000006642f4>] dump_stack+0x74/0x98
[  243.364874] [<ffff8000000b282c>] warn_slowpath_common+0x98/0xd0
[  243.364951] [<ffff8000000b2928>] warn_slowpath_null+0x14/0x20
[  243.365026] [<ffff8000003cf7a4>] kdbus_name_entry_replace_owner+0x84/0x8c
[  243.365105] [<ffff8000003cf7e0>] kdbus_name_release_unlocked.isra.5+0x34/0x170
[  243.365183] [<ffff8000003d0554>] kdbus_cmd_name_release+0x1b8/0x1c8
[  243.365270] [<ffff8000003cbd28>] kdbus_handle_ioctl+0x5e0/0x690
[  243.365347] [<ffff8000001b3520>] do_vfs_ioctl+0x31c/0x5c0
[  243.365423] [<ffff8000001b3844>] SyS_ioctl+0x80/0x98
[  243.365473] ---[ end trace 5bf3630c98408d38 ]---

Change-Id: I469242f51c9b15e1701fc80962833e61575f360c
Signed-off-by: Lukasz Skalski <l.skalski@samsung.com>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agodrm/exynos: enable render node 07/46207/1 accepted/tizen/mobile/20150819.072441 accepted/tizen/tv/20150819.072447 accepted/tizen/wearable/20150819.072519 submit/tizen/20150819.053504
Joonyoung Shim [Tue, 18 Aug 2015 04:42:09 +0000 (13:42 +0900)]
drm/exynos: enable render node

Enable render node by user side request.

Change-Id: I1436d9f8be6d9677244338f10087502bc63d5733
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agortc: s5m: fix to update ctrl register 32/46032/2
Joonyoung Shim [Thu, 13 Aug 2015 07:25:49 +0000 (16:25 +0900)]
rtc: s5m: fix to update ctrl register

According to datasheet, the S2MPS13X and S2MPS14X should update write
buffer via setting WUDR bit to high after ctrl register is updated.

If not, ALARM interrupt of rtc-s5m doesn't happen first time when i use
tools/testing/selftests/timers/rtctest.c test program and hour format is
used to 12 hour mode in Odroid-XU3 board.

Change-Id: I330bea966bdcfbe85aa56f8b4ce91e7b291cdc37
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: <stable@vger.kernel.org>
9 years agortc: s3c: fix disabled clocks for alarm 31/46031/2
Joonyoung Shim [Tue, 11 Aug 2015 09:28:33 +0000 (18:28 +0900)]
rtc: s3c: fix disabled clocks for alarm

The clock enable/disable codes for alarm have been removed from
commit 24e1455493da ("drivers/rtc/rtc-s3c.c: delete duplicate clock
control") and the clocks are disabled even if alarm is set, so alarm
interrupt can't happen.

The s3c_rtc_setaie function can be called several times with 'enabled'
argument having same value, so it needs to check whether clocks are
enabled or not.

Change-Id: Ib8a59ae5f5e3409c8383ca3c8e4413bb625d6d44
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: <stable@vger.kernel.org> # v4.1
9 years agortc: s3c: remove unnecessary NULL assignment 30/46030/2
Joonyoung Shim [Tue, 11 Aug 2015 10:29:11 +0000 (19:29 +0900)]
rtc: s3c: remove unnecessary NULL assignment

It's unnecessary the code that assigns info->rtc_clk to NULL in
s3c_rtc_remove.

Change-Id: I6a735e4fc010a208068305ee8ccd9c5f0cdaa6ad
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
9 years agortc: s3c: add missing clk control 29/46029/2
Joonyoung Shim [Tue, 11 Aug 2015 07:15:53 +0000 (16:15 +0900)]
rtc: s3c: add missing clk control

It's missed to call clk_unprepare() about info->rtc_src_clk in
s3c_rtc_remove and to call clk_disable_unprepare about info->rtc_clk in
error routine of s3c_rtc_probe.

Change-Id: Ia338db2dd1be2d9fc21d3455f91fba1dbff01a89
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
9 years agomfd: sec: Fix RTC alarm interrupt number on S2MPS11 28/46028/2
Krzysztof Kozlowski [Thu, 2 Apr 2015 14:36:15 +0000 (16:36 +0200)]
mfd: sec: Fix RTC alarm interrupt number on S2MPS11

The RTC on S2MPS11 is the same as S2MPS14. However interrupt numbers of
RTC alarms 0 and 1 were inversed between these two devices. So when
rtc-s5m driver requested S2MPS14_IRQ_RTCA0 interrupt, it matched to
S2MPS11_IRQ_RTCA1, not RTCA0.

Fix this by using consistent RTC alarm interrupt numbers and adding a
BUILD_BUG_ON for future generations.

Change-Id: I90f8e936d6b12ae7d702b9c94d5c935cd378d729
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
9 years agoARM: dts: odroidxu3: Enable wake alarm of S2MPS11 RTC 27/46027/2
Krzysztof Kozlowski [Sat, 30 May 2015 06:33:21 +0000 (15:33 +0900)]
ARM: dts: odroidxu3: Enable wake alarm of S2MPS11 RTC

The IRQB of S2MPS11 PMIC is wired to XEINT4 (GPX0-4) through pull-up
resistor.

Add interrupt properties and pinctrl configuration to enable RTC wake
alarm of rtc-s5m driver. This also removes a warning:
sec_pmic 4-0066: No interrupt specified, no interrupts

Change-Id: I3aa4d802ca9ff19f7b9cda2bbb178476aca19a9a
Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
9 years agomfd: sec-core: Enable RTC on S2MPS11 PMIC 26/46026/2
Krzysztof Kozlowski [Tue, 17 Mar 2015 12:36:17 +0000 (13:36 +0100)]
mfd: sec-core: Enable RTC on S2MPS11 PMIC

The S2MPS11 PMIC (present on Arndale Octa board) has the same RTC module
as S2MPS14 device. Add respective mfd cell to enable it.

Change-Id: I2bd04e78884b29bfb871147f1bcd26964c3b5c8d
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
9 years agodrivers/rtc/rtc-s5m.c: allow usage on device type different than main MFD type 25/46025/2
Krzysztof Kozlowski [Thu, 16 Apr 2015 19:49:27 +0000 (12:49 -0700)]
drivers/rtc/rtc-s5m.c: allow usage on device type different than main MFD type

The RTC driver supports two flavors of S5M devices: S5M8767-like and
S2MPS14-like.

On S2MPS13 and S2MPS14 devices the RTC module is the same so we want to
re-use the existing support of S2MPS14.  However device type was passed
from parent MFD driver in platform data structure.  This way for the
S2MPS13 device the main MFD driver passed device type of 'S2MPS13X'.

Instead decouple detecting of device type between main MFD and RTC driver.
 This allows adding support for other S2MPS14 variations (like S2MPS11 and
S2MPS13) easily by adding to mfd/sec-core.c:

static const struct mfd_cell s2mps13_devs[] = {
{ .name = "s2mps14-rtc", }
};

Change-Id: I46347706ccd0f17a2e3379505c182a3185b66a24
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agodrivers/rtc/rtc-s5m.c: add support for S2MPS13 RTC 24/46024/2
Krzysztof Kozlowski [Thu, 16 Apr 2015 19:45:45 +0000 (12:45 -0700)]
drivers/rtc/rtc-s5m.c: add support for S2MPS13 RTC

The S2MPS13 RTC is almost the same as S2MPS14. The differences when
updating alarm are:
1. Set WUDR+AUDR field instead of WUDR+RUDR.
2. Clear the AUDR field later (it is not auto-cleared).

Change-Id: I1f483cb9cd792a53af5e79931493ec5d7a0d5248
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agortc: s5m: Remove unused watchdog and sudden momentary power loss 23/46023/2
Krzysztof Kozlowski [Fri, 6 Feb 2015 11:24:47 +0000 (12:24 +0100)]
rtc: s5m: Remove unused watchdog and sudden momentary power loss

The WTSR (Watchdog Timer Software Reset) and SMPL (Sudden Momentary
Power Loss) are never enabled. These are left-overs from board files.
After removing them the driver's shutdown callback is empty so get rid
of it as well.

Change-Id: I8c1e7f655f7d36e486aea2123041b4d09523a0dc
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
9 years agodrivers/rtc/rtc-s3c.c: remove one superfluous rtc_valid_tm() check 22/46022/2
Krzysztof Kozlowski [Thu, 16 Apr 2015 19:46:08 +0000 (12:46 -0700)]
drivers/rtc/rtc-s3c.c: remove one superfluous rtc_valid_tm() check

s3c_rtc_gettime() already returns the result of rtc_valid_tm() on the
obtained time so get rid of another call to rtc_valid_tm().

Change-Id: I256905f20e4dfc95ad5dac17234ccd4c1df1b460
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agodrivers/rtc/rtc-s3c.c: fix failed first read of RTC time 21/46021/2
Krzysztof Kozlowski [Thu, 16 Apr 2015 19:45:57 +0000 (12:45 -0700)]
drivers/rtc/rtc-s3c.c: fix failed first read of RTC time

Initialize the device time (if it is wrong) before registering RTC device
to fix following error message during rtc-s3c probe:

[    2.215414] rtc (null): read_time: fail to read
[    2.216322] s3c-rtc 10070000.rtc: rtc core: registered s3c as rtc1

Change-Id: I899534a7c1036604a389801e94d834340595f288
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agodrivers/rtc/rtc-s3c.c: delete duplicate clock control 20/46020/2
Chanwoo Choi [Thu, 16 Apr 2015 19:45:15 +0000 (12:45 -0700)]
drivers/rtc/rtc-s3c.c: delete duplicate clock control

The current functions in s3c-rtc driver execute clk_enable/disable() to
control clocks and some functions execute s3c_rtc_alarm_clk_enable()
unnecessarily.  So this patch deletes the duplicate clock control and
spilts s3c_rtc_alarm_clk_enable() out as
s3c_rtc_enable_clk()/s3c_rtc_disable_clk() to improve readability.

Change-Id: If43f697e096490f7e008d6167f818d15e1208af5
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoARM: dts: add 'rtc_src' clock to rtc node for exynos5422-odroidxu3 19/46019/2
Markus Reichl [Sun, 3 May 2015 16:34:29 +0000 (18:34 +0200)]
ARM: dts: add 'rtc_src' clock to rtc node for exynos5422-odroidxu3

The Exynos5422 SoC has a s3c6410 RTC where the source clock
is now a mandatory property.

This patch fixes probe failure of s3c-rtc on Odroid-XU3 boards.

Change-Id: Ie197965fb99f980deffddb96821f4c8a00bf69b8
Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
9 years agoclk: samsung: Add bindings for 32kHz clocks from s2mps11 18/46018/2
Markus Reichl [Tue, 31 Mar 2015 11:57:20 +0000 (13:57 +0200)]
clk: samsung: Add bindings for 32kHz clocks from s2mps11

This creates include/dt-bindings/clock/samsung,s2mps11.h with
the three 32kHz clock outputs from the s2mps11 mfd.

Change-Id: I2e6de74e55b980d56f192344d712f1caca1a7ed9
Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
9 years agos5p-mfc: correct scratch buffer size of H.263 decoder 15/46115/2
Andrzej Hajda [Thu, 13 Aug 2015 10:25:37 +0000 (12:25 +0200)]
s5p-mfc: correct scratch buffer size of H.263 decoder

Driver complains about too small scratch buffer size. After adjusting
it according to vendor code, decoding works.

Change-Id: I79c0153b2813ceebcb17d4fa2175663b736346f3
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
9 years agomedia: s5p-mfc: fix mfc context buffer size 40/45840/4 accepted/tizen/mobile/20150812.145050 accepted/tizen/tv/20150812.145158 accepted/tizen/wearable/20150812.144818 submit/tizen/20150812.120946
Ingi Kim [Wed, 12 Aug 2015 00:09:35 +0000 (09:09 +0900)]
media: s5p-mfc: fix mfc context buffer size

When video file was decoded by H/W MFCv8. It occured IOMMU page fault
because of accessing abnormal memory of mfc ctx buf

So this patch supports buffer size of mfc context more.
Relevant page fault error is below.

[ 3524.617147] PAGE FAULT occurred at 0x10108000 by 11200000.sysmmu(Page table base: 0x6d86c000)
[ 3524.624192]  Lv1 entry: 0x6c27d001
[ 3524.627567]   Lv2 entry: 0x0
[ 3524.630482] ------------[ cut here ]------------
[ 3524.635020] kernel BUG at drivers/iommu/exynos-iommu.c:358!
[ 3524.640567] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[ 3524.646373] Modules linked in:
[ 3524.649410] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.0.0-00001-g0ff9b87-dirty #18
[ 3524.657117] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[ 3524.663184] task: c0e4aff0 ti: c0e3c000 task.ti: c0e3c000
[ 3524.668566] PC is at exynos_sysmmu_irq+0x1b8/0x2c4
[ 3524.673330] LR is at vprintk_emit+0x2b8/0x58c
[ 3524.677657] pc : [<c037cc78>]    lr : [<c00704a4>]    psr: 600d0193
[ 3524.677657] sp : c0e3dd90  ip : 00000000  fp : c0e3ddcc
[ 3524.689092] r10: ee29a110  r9 : 00000000  r8 : ee29a128
[ 3524.694292] r7 : ed812810  r6 : 10108000  r5 : ed86c000  r4 : 00000000
[ 3524.700791] r3 : c0ec9bd8  r2 : 00000000  r1 : 00000000  r0 : ed82ff00
[ 3524.707292] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[ 3524.714656] Control: 10c5387d  Table: 6b08c06a  DAC: 00000015
[ 3524.720375] Process swapper/0 (pid: 0, stack limit = 0xc0e3c210)
[ 3524.726354] Stack: (0xc0e3dd90 to 0xc0e3e000)
[ 3524.730689] dd80:                                     c0e3dd9c c0069d68 ee58c338 6d86c000
[ 3524.738836] dda0: ee58c338 ee298c40 ee2915a0 0000003b c0e64ef4 c0e3c000 00000000 00000000
[ 3524.746981] ddc0: c0e3de14 c0e3ddd0 c0071ef4 c037cacc ffffffff a00d0193 c0e3ddf4 ee291540
[ 3524.755126] dde0: c0ec793c c0ec7928 7fffffff ee291540 ee2915a0 ee298c40 c0e64ef4 ee004660
[ 3524.763272] de00: ee010800 c0e3df00 c0e3de34 c0e3de18 c0072138 c0071e9c 00020000 ee291540
[ 3524.771418] de20: ee2915a0 00000016 c0e3de4c c0e3de38 c0075130 c00720f8 0000003b ee028300
[ 3524.779563] de40: c0e3de64 c0e3de50 c0071450 c0075068 00000100 00000012 c0e3de8c c0e3de68
[ 3524.787708] de60: c030d240 c0071420 c030d19c 00000016 00000000 00000016 00000000 00000001
[ 3524.795854] de80: c0e3dea4 c0e3de90 c0071450 c030d1a8 00000092 c0e37a1c c0e3ded4 c0e3dea8
[ 3524.804000] dea0: c0071790 c0071420 c0e3df00 f000200c 00000016 c0e440a8 c0e3df00 f0002000
[ 3524.812145] dec0: c095bc8c 00000001 c0e3defc c0e3ded8 c0008730 c0071710 c0010d88 c0010d8c
[ 3524.820290] dee0: 600d0013 ffffffff c0e3df34 c0ec7eb4 c0e3df54 c0e3df00 c0014780 c00086fc
[ 3524.828436] df00: 00000001 00000000 00000000 c0020780 c0e3c000 c0e43530 00000000 00000000
[ 3524.836581] df20: c0ec7eb4 c095bc8c 00000001 c0e3df54 c0e3df58 c0e3df48 c0010d88 c0010d8c
[ 3524.844727] df40: 600d0013 ffffffff c0e3df94 c0e3df58 c0062690 c0010d50 c0ec75f0 00000001
[ 3524.852872] df60: c0e3df84 c0e4353c c0e39580 c0e43e84 c0e3c000 00000002 c0e3df58 c0e38b88
[ 3524.861018] df80: c0952b9c ffffffff c0e3dfac c0e3df98 c094d1b8 c00622d4 c0e3c000 c0e43e10
[ 3524.869163] dfa0: c0e3dff4 c0e3dfb0 c0d86d30 c094d130 ffffffff ffffffff c0d866f0 00000000
[ 3524.877309] dfc0: 00000000 c0df06d8 00000000 c0ee3f14 c0e434c0 c0df06d4 c0e4c20c 4000406a
[ 3524.885454] dfe0: 410fc073 00000000 00000000 c0e3dff8 40008074 c0d86970 00000000 00000000
[ 3524.893610] [<c037cc78>] (exynos_sysmmu_irq) from [<c0071ef4>] (handle_irq_event_percpu+0x64/0x25c)
[ 3524.902615] [<c0071ef4>] (handle_irq_event_percpu) from [<c0072138>] (handle_irq_event+0x4c/0x6c)
[ 3524.911454] [<c0072138>] (handle_irq_event) from [<c0075130>] (handle_level_irq+0xd4/0x14c)
[ 3524.919773] [<c0075130>] (handle_level_irq) from [<c0071450>] (generic_handle_irq+0x3c/0x4c)
[ 3524.928180] [<c0071450>] (generic_handle_irq) from [<c030d240>] (combiner_handle_cascade_irq+0xa4/0x110)
[ 3524.937624] [<c030d240>] (combiner_handle_cascade_irq) from [<c0071450>] (generic_handle_irq+0x3c/0x4c)
[ 3524.946981] [<c0071450>] (generic_handle_irq) from [<c0071790>] (__handle_domain_irq+0x8c/0xfc)
[ 3524.955646] [<c0071790>] (__handle_domain_irq) from [<c0008730>] (gic_handle_irq+0x40/0x78)
[ 3524.963966] [<c0008730>] (gic_handle_irq) from [<c0014780>] (__irq_svc+0x40/0x74)
[ 3524.971412] Exception stack(0xc0e3df00 to 0xc0e3df48)
[ 3524.976441] df00: 00000001 00000000 00000000 c0020780 c0e3c000 c0e43530 00000000 00000000
[ 3524.984586] df20: c0ec7eb4 c095bc8c 00000001 c0e3df54 c0e3df58 c0e3df48 c0010d88 c0010d8c
[ 3524.992729] df40: 600d0013 ffffffff
[ 3524.996205] [<c0014780>] (__irq_svc) from [<c0010d8c>] (arch_cpu_idle+0x48/0x4c)
[ 3525.003567] [<c0010d8c>] (arch_cpu_idle) from [<c0062690>] (cpu_startup_entry+0x3c8/0x4a4)
[ 3525.011805] [<c0062690>] (cpu_startup_entry) from [<c094d1b8>] (rest_init+0x94/0x98)
[ 3525.019516] [<c094d1b8>] (rest_init) from [<c0d86d30>] (start_kernel+0x3cc/0x3d8)
[ 3525.026963] Code: e34c30ec e5932004 e3520000 ca000018 (e7f001f2)
[ 3525.033028] ---[ end trace 71ed544f653b4d46 ]---

Change-Id: I5a65d9814dd79c1b62b89cf9f75929e122552d8e
Signed-off-by: Ingi Kim <ingi2.kim@samsung.com>
9 years agoARM: dts: Add MSHC2 dt node for Exynos3250 SoC 00/45700/1
Chanwoo Choi [Fri, 17 Jul 2015 11:22:27 +0000 (20:22 +0900)]
ARM: dts: Add MSHC2 dt node for Exynos3250 SoC

This patch add the MSHC2 (Mobile Storage Host Controller) devicetree node for
Exynos3250 SoC.

Change-Id: Ia8850063ad90b986b1371952c879676a608fe3f1
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
9 years agoARM: dts: Add UART2 dt node for Exynos3250 SoC 99/45699/1
Chanwoo Choi [Fri, 17 Jul 2015 05:49:08 +0000 (14:49 +0900)]
ARM: dts: Add UART2 dt node for Exynos3250 SoC

This patch add the uart2 devicetree node for Exynos3250 SoC.

Change-Id: I28dd84bc645e26f14b7d0c7d630870cc812dccd8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
9 years agoclk: samsung: exynos3250: Add MMC2 clock 79/45679/1
Chanwoo Choi [Fri, 17 Jul 2015 11:48:38 +0000 (20:48 +0900)]
clk: samsung: exynos3250: Add MMC2 clock

This patch add the MMC2 clocks (mux, divider, gate) of Exynos3250 SoC.

Change-Id: Ib0c194e09f6ed171ba1a84a35a96f651b615666f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
9 years agoclk: samsung: exynos3250: Add UART2 clock 78/45678/1
Chanwoo Choi [Fri, 17 Jul 2015 05:51:01 +0000 (14:51 +0900)]
clk: samsung: exynos3250: Add UART2 clock

This patch add the UART2 clocks (mux, divider, gate) of Exynos3250 SoC.

Change-Id: I5b013ed835a3985659f956b2bd3e64dbeeca7369
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
9 years agomedia: s5p-mfc: skip incomeplete frame 60/44760/2 accepted/tizen/mobile/20150728.000023 accepted/tizen/tv/20150728.000113 accepted/tizen/wearable/20150728.000159 submit/tizen/20150727.115311
Donghwa Lee [Thu, 31 Jul 2014 06:01:59 +0000 (15:01 +0900)]
media: s5p-mfc: skip incomeplete frame

Currently, when incomplete frame is recieved in the middle of
decoding, driver have treated it to error, so src/dst queue and
clock are cleaned. Although it is obviously error case, it is need
to maintain video decoding in case of necessity. This patch
supports skip incomplete frame to next.

Change-Id: I328275a01d9f4bdfda55daf08a0e8b238ed7da5d
Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agodrm/exynos: move order to register vidi kms driver 88/43888/1 accepted/tizen/mobile/20150717.103244 accepted/tizen/tv/20150717.103406 accepted/tizen/wearable/20150717.103530 submit/tizen/20150717.090857
Joonyoung Shim [Wed, 15 Jul 2015 01:48:06 +0000 (10:48 +0900)]
drm/exynos: move order to register vidi kms driver

The vidi is virtual kms driver and now it is registered earlier than
actual hw kms drivers, so it will occupy crtc index 0. Some users
assume the condition yet that actual hw kms driver has crtc index 0.
It may or may not be matter but let's arrange register order.

Change-Id: Id3bbd0eeaf7ba2e584c21e39bb6971a483365ac9
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agodrm/exynos: remove SoC checking code 87/43887/1
Andrzej Hajda [Mon, 8 Jun 2015 10:15:42 +0000 (12:15 +0200)]
drm/exynos: remove SoC checking code

SoC checking code is not necessary anymore, as exynos_drm_match_add and
exynos_drm_platform_probe already properly handles situation when there are
no Exynos DRM components.

Change-Id: Ifa313c98b5e6903dd8f8843fb9b861334bbdfe79
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Tested-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: fix broken component binding in case of multiple pipelines 86/43886/1
Andrzej Hajda [Thu, 11 Jun 2015 14:23:37 +0000 (23:23 +0900)]
drm/exynos: fix broken component binding in case of multiple pipelines

In case there are multiple pipelines and deferred probe occurs, only components
of the first pipeline were bound. As a result only one pipeline was available.
The main cause of this issue was dynamic generation of component match table -
every component driver during probe registered itself on helper list, if there
was at least one pipeline present on this list component match table were
created without deferred components.
This patch removes this helper list, instead it creates match table from
existing devices requiring exynos_drm KMS drivers. This way match table do not
depend on probe/deferral order and contains all KMS components.
As a side effect patch makes the code cleaner and significantly smaller.

Change-Id: I9f09a22f1d1f54e989044b2a45c4344f4904261d
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: consolidate driver/device initialization code 85/43885/1
Andrzej Hajda [Thu, 11 Jun 2015 14:20:52 +0000 (23:20 +0900)]
drm/exynos: consolidate driver/device initialization code

Code registering different drivers and simple platform devices was dispersed
across multiple sub-modules. This patch moves it to one place. As a result
initialization code is shorter and cleaner and should simplify further
development.

Change-Id: I4b9c2063d8bb85569538c0a00648f0d218057410
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agoARM: odroidxu3_defconfig: enable rt2x00 wifi usb drivers 48/42948/1 accepted/tizen/mobile/20150707.003514 accepted/tizen/tv/20150707.003519 accepted/tizen/wearable/20150707.003531 submit/tizen/20150706.105058
Seung-Woo Kim [Mon, 6 Jul 2015 07:39:25 +0000 (16:39 +0900)]
ARM: odroidxu3_defconfig: enable rt2x00 wifi usb drivers

This patch enables rt2x00 wifi usb drivers to support rt5572n.

Change-Id: I1d7f9c71e9cb60c83986f4e90cb1edd7557333df
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agoarm: dma-mapping: fix off-by-one error in bitmap size check 82/42682/2
Marek Szyprowski [Wed, 1 Jul 2015 13:33:03 +0000 (15:33 +0200)]
arm: dma-mapping: fix off-by-one error in bitmap size check

nr_bitmaps member of mapping structure stores the number of already
allocated bitmaps and it is interpreted as loop iterator (it starts from
0 not from 1), so a comparison against number of possible bitmap
extensions should include this fact. This patch fixes this by changing
the extension failure condition.

Reported-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Id929785a802790c9ab8500a50cd2496ab69545eb

9 years agodrm/exynos: fix vsync interrupt clear rountine of mixer 38/42638/1 accepted/tizen/mobile/20150701.121014 accepted/tizen/tv/20150701.121409 accepted/tizen/wearable/20150701.122908 submit/tizen/20150701.072642
Joonyoung Shim [Wed, 1 Jul 2015 04:14:57 +0000 (13:14 +0900)]
drm/exynos: fix vsync interrupt clear rountine of mixer

INT_EN_VSYNC bit is not used when we clear vsync interrupt but
INT_STATUS_VSYNC bit should be related.

Also, if we want to enable vsync interrupt, we should write 1 in
INT_CLEAR_VSYNC bit before we set INT_EN_VSYNC bit. It will clear prior
vsync interrupt. You can check it from exynos mixer user manual.

Change-Id: Ide955d5cb966e49883c51d8fab0eba51897bac7a
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agodrm/exynos: gsc: Handles the combination of rotation and flip 48/42548/3
Hyungwon Hwang [Mon, 29 Jun 2015 13:37:27 +0000 (22:37 +0900)]
drm/exynos: gsc: Handles the combination of rotation and flip

The unique results of all the combination of rotation and flip can
be represented by just 8 states. This patch handles all the combination
correctly.

Change-Id: I27d8c96f012b30d4d628a0eba9ca6f15b903a981
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
9 years agodrm/exynos: gsc: fix wrong bitwise operation for swap detection 47/42547/4
Hyungwon Hwang [Mon, 29 Jun 2015 11:42:17 +0000 (20:42 +0900)]
drm/exynos: gsc: fix wrong bitwise operation for swap detection

The bits for rotation are not used as exclusively. So GSC_IN_ROT_270 can
not be used for swap detection. The definition of it is same with
GSC_IN_ROT_MASK. It is enough to check GSC_IN_ROT_90 bit is set or not to
check whether width / height size swapping is needed.

Change-Id: I69a98c170b4d31ee68dfd816dfecfd6045d84a44
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
9 years agokdbus: avoid the use of struct timespec accepted/tizen/mobile/20150630.002357 accepted/tizen/tv/20150630.002420 accepted/tizen/wearable/20150630.002430 submit/tizen/20150629.113101
Arnd Bergmann [Fri, 10 Apr 2015 11:43:37 +0000 (13:43 +0200)]
kdbus: avoid the use of struct timespec

I did a routine check for new users of 'timespec', which we are trying to remove
from the kernel in order to survive y2038. kdbus came up and looks particularly
trivial to clean up.

This changes the three ktime_get_ts() variants used in kdbus to ktime_get_ns(),
which aside from removing timespec also simplifies the code and makes it
slightly more efficient by avoiding a two-way conversion.

Change-Id: Ia9a2da376609d8e0ec6e311e4c9f27ed3702350e
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agoblackfin: Wire up missing syscalls
Chen Gang [Mon, 13 Apr 2015 14:02:58 +0000 (22:02 +0800)]
blackfin: Wire up missing syscalls

The related syscalls are below which may cause samples/kdbus building
break in next-20150401 tree, the related information and error:

    CALL    scripts/checksyscalls.sh
  <stdin>:1223:2: warning: #warning syscall kcmp not implemented [-Wcpp]
  <stdin>:1226:2: warning: #warning syscall finit_module not implemented [-Wcpp]
  <stdin>:1229:2: warning: #warning syscall sched_setattr not implemented [-Wcpp]
  <stdin>:1232:2: warning: #warning syscall sched_getattr not implemented [-Wcpp]
  <stdin>:1235:2: warning: #warning syscall renameat2 not implemented [-Wcpp]
  <stdin>:1238:2: warning: #warning syscall seccomp not implemented [-Wcpp]
  <stdin>:1241:2: warning: #warning syscall getrandom not implemented [-Wcpp]
  <stdin>:1244:2: warning: #warning syscall memfd_create not implemented [-Wcpp]
  <stdin>:1247:2: warning: #warning syscall bpf not implemented [-Wcpp]
  <stdin>:1250:2: warning: #warning syscall execveat not implemented [-Wcpp]
  [...]
    HOSTCC  samples/kdbus/kdbus-workers
  samples/kdbus/kdbus-workers.c: In function ‘prime_new’:
  samples/kdbus/kdbus-workers.c:930:18: error: ‘__NR_memfd_create’ undeclared (first use in this function)
    p->fd = syscall(__NR_memfd_create, "prime-area", MFD_CLOEXEC);
                    ^
  samples/kdbus/kdbus-workers.c:930:18: note: each undeclared identifier is reported only once for each function it appears in

Change-Id: Iceb9f6f376c8ea91208779ef904ed8d2c1374d5c
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agoDocumentation: kdbus: Fix typos
Sergei Zviagintsev [Thu, 9 Apr 2015 10:08:04 +0000 (13:08 +0300)]
Documentation: kdbus: Fix typos

Change-Id: Ie6272332da4189c3ea9ab851694307dd3abb2b99
Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
Acked-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agoDocumentation: kdbus: Fix description of KDBUS_SEND_SYNC_REPLY flag
Sergei Zviagintsev [Thu, 9 Apr 2015 10:08:05 +0000 (13:08 +0300)]
Documentation: kdbus: Fix description of KDBUS_SEND_SYNC_REPLY flag

Change-Id: I6f27bfb84682d278fdf0b76b84e65c5521be43d0
Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
Acked-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agoDocumentation: kdbus: Update list of ioctls which cause writing to receiver's pool
Sergei Zviagintsev [Thu, 9 Apr 2015 10:08:06 +0000 (13:08 +0300)]
Documentation: kdbus: Update list of ioctls which cause writing to receiver's pool

Add KDBUS_CMD_BUS_CREATOR_INFO.

Change-Id: I113c71482896d0a8490c105472110d5fac0b65d0
Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
Acked-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agoDocumentation: kdbus: Fix list of KDBUS_CMD_ENDPOINT_UPDATE errors
Sergei Zviagintsev [Thu, 9 Apr 2015 10:08:07 +0000 (13:08 +0300)]
Documentation: kdbus: Fix list of KDBUS_CMD_ENDPOINT_UPDATE errors

Remove EEXIST.

Change-Id: Ibb8ae36e822c436a384ef5d318befa9113405901
Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
Acked-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agokdbus: uapi: Fix kernel-doc for enum kdbus_send_flags
Sergei Zviagintsev [Thu, 9 Apr 2015 10:11:01 +0000 (13:11 +0300)]
kdbus: uapi: Fix kernel-doc for enum kdbus_send_flags

Change-Id: Ie275fee2b7964190bffd86d63dbaaad07b45170d
Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
Acked-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agoselftest/kdbus: enable cross compilation
Tyler Baker [Wed, 1 Apr 2015 23:20:16 +0000 (16:20 -0700)]
selftest/kdbus: enable cross compilation

Use the CC variable instead of hard coding gcc and include lib.mk.

Change-Id: Id77bffaf573e2ae9ded83fdc84d54c78b1188218
Signed-off-by: Tyler Baker <tyler.baker@linaro.org>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agosamples: kdbus: build kdbus-workers conditionally
Daniel Mack [Tue, 31 Mar 2015 13:11:34 +0000 (15:11 +0200)]
samples: kdbus: build kdbus-workers conditionally

Give the kdbus sample its own config switch and only build it if it's
explicitly switched on.

Change-Id: Ib51ce99a1800a07b2e14d8ed3076f6e9556bc981
Signed-off-by: Daniel Mack <daniel@zonque.org>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Reported-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agokdbus: Fix CONFIG_KDBUS help text
Daniel Mack [Tue, 24 Mar 2015 18:51:55 +0000 (19:51 +0100)]
kdbus: Fix CONFIG_KDBUS help text

Drop a left-over from the times when documentation lived in a
simple text file, which is no longer the case. Mention the
auto-generated man-pages and HTML files instead.

Change-Id: I9c2c665536149b7e171facdd8976c6d1dff6d132
Reported-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Daniel Mack <daniel@zonque.org>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agokdbus: connection: fix handling of failed fget()
Daniel Mack [Tue, 17 Mar 2015 18:48:24 +0000 (19:48 +0100)]
kdbus: connection: fix handling of failed fget()

The patch 5fc8dd5c84fc: "kdbus: add connection, queue handling and
message validation code" from Sep 11, 2014, leads to the following
static checker warning:

ipc/kdbus/connection.c:2000 kdbus_cmd_send()
warn: 'cancel_fd' isn't an ERR_PTR

Fix this by checking for NULL pointers returned from fget().

Change-Id: Ibedba0331153b41ef535b79154ef5432e4bf0409
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agokdbus: fix header guard name
Lucas De Marchi [Tue, 17 Mar 2015 12:21:42 +0000 (09:21 -0300)]
kdbus: fix header guard name

UAPI headers have a _UAPI_ as prefix, which is removed during
headers_install. If it's put as a suffix it will not be removed and will
be the only header with UAPI in the header guard macro.

Change-Id: I865bf183844d1df797ec99a3fffc95e4229a2504
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agoDocumentation/kdbus: replace 'reply_cookie' with 'cookie_reply'
Lukasz Skalski [Mon, 16 Mar 2015 09:35:08 +0000 (10:35 +0100)]
Documentation/kdbus: replace 'reply_cookie' with 'cookie_reply'

The member field is called 'cookie_reply', fix the documentation which
incorrectly used 'reply_cookie'.

Change-Id: I429e6f874dbf8519b7fa236537f4ad0d0401af75
Signed-off-by: Lukasz Skalski <l.skalski@samsung.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agoDocumentation/kdbus: support quiet builds
David Herrmann [Mon, 16 Mar 2015 09:17:12 +0000 (10:17 +0100)]
Documentation/kdbus: support quiet builds

Add support for quiet builds, just like Documentation/DocBook/Makefile
supports.

Change-Id: I88b209a29159828b50afd29d284dfd263cdbcdd0
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agoDocumentation/kdbus: fix out-of-tree builds
David Herrmann [Mon, 16 Mar 2015 09:17:11 +0000 (10:17 +0100)]
Documentation/kdbus: fix out-of-tree builds

Don't use $(obj) to access source files, but use $(srctree)/$(src)/
instead. This fixes build issues if you use O= with a directory other than
the source directory.

Change-Id: I7704357ae063b93a8902f4abdc6014ff497bd363
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agosamples/kdbus: drop wrong include
David Herrmann [Mon, 16 Mar 2015 09:17:10 +0000 (10:17 +0100)]
samples/kdbus: drop wrong include

There is no reason to use ./include/uapi/ directly from samples. If your
system headers are not up-to-date, you _need_ to run "make
headers-install" (which will install them to ./usr/ in your kernel tree)
before building the examples. Otherwise, you will get warnings and build
failures.

Once ./usr/ is updated with the correct headers, it contains everything we
need, so drop -Iinclude/uapi from the kdbus-workers CFLAGS.

Change-Id: I05517c534f46b2362e3eedccbf4043484541d600
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agokdbus: fix minor typo in the walk-through example
Nicolas Iooss [Sun, 15 Mar 2015 05:13:08 +0000 (13:13 +0800)]
kdbus: fix minor typo in the walk-through example

s/receveiver/receiver/

Change-Id: Ibc3985ca9aae9cea69e1c3bc3236bb1d00ef308d
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agokdbus: samples/kdbus: add -lrt
David Herrmann [Thu, 12 Mar 2015 16:27:31 +0000 (17:27 +0100)]
kdbus: samples/kdbus: add -lrt

On older systems -lrt is needed for clock_gettime(). Add it to
HOSTLOADLIBES of kdbus-workers so it builds fine on those systems.

Change-Id: I98d7f94b83ce37b77d85a79e6c14ff24110a4bd8
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agoDocumentation: kdbus: fix location for generated files
Daniel Mack [Mon, 9 Mar 2015 17:00:46 +0000 (18:00 +0100)]
Documentation: kdbus: fix location for generated files

The generated files should reside in Documentation/kdbus, not in the
top-level of the source tree. Also add a .gitignore file and ignore
everything that was built from the XML files.

Change-Id: Iedb5f988fd7f539f8557e1fecb85d6ccf17f10ff
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agokdbus: add selftests
Daniel Mack [Sat, 13 Sep 2014 21:15:02 +0000 (23:15 +0200)]
kdbus: add selftests

This patch adds an extensive test suite for kdbus that checks the most
important code paths in the driver. The idea is to extend the test
suite over time.

Also, this code can serve as another example for how to use the kernel
API from userspace.

The code in the kdbus test suite makes use of the ioctl wrappers
provided by samples/kdbus/kdbus-api.h.

Change-Id: I9cac6c29c31faa5432b0f431a2f4e949b5e6422d
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
9 years agokdbus: add walk-through user space example
Daniel Mack [Thu, 26 Feb 2015 20:06:38 +0000 (21:06 +0100)]
kdbus: add walk-through user space example

Provide a walk-through example that explains how to use the low-level
ioctl API that kdbus offers. This example is meant to be useful for
developers who want to gain a in-depth understanding of how the kdbus
API works by reading a well-documented real-world example.

This program computes prime-numbers based on the sieve of Eratosthenes.
The master sets up a shared memory region and spawns workers which clear
out the non-primes. The master reacts to keyboard input and to
client-requests to control what each worker does. Note that this is in
no way meant as efficient way to compute primes. It should only serve as
example how a master/worker concept can be implemented with kdbus used
as control messages.

The main process is called the 'master'. It creates a new, private bus
which will be used between the master and its workers to communicate.
The master then spawns a fixed number of workers. Whenever a worker dies
(detected via SIGCHLD), the master spawns a new worker. When done, the
master waits for all workers to exit, prints a status report and exits
itself.

The master process does *not* keep track of its workers. Instead, this
example implements a PULL model. That is, the master acquires a
well-known name on the bus which each worker uses to request tasks from
the master. If there are no more tasks, the master will return an empty
task-list, which casues a worker to exit immediately.

As tasks can be computationally expensive, we support cancellation.
Whenever the master process is interrupted, it will drop its well-known
name on the bus. This causes kdbus to broadcast a name-change
notification. The workers check for broadcast messages regularly and
will exit if they receive one.

Change-Id: I67322b06f7e0b9e28126947a474d235d7791a01c
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>