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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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>
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]
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]
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Karol Lewandowski [Thu, 29 Oct 2015 12:06:19 +0000 (13:06 +0100)]
local / arm64: tm2: Enable kdbus driver
kdbus IPC will be only used when appropriate userspace is installed.
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
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.
Signed-off-by: Lukasz Skalski <l.skalski@samsung.com>
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.
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
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.
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
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.
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
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.
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
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
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
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
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
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
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>
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
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
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.
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
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 ]---
Signed-off-by: Lukasz Skalski <l.skalski@samsung.com>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
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.
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>
Sergei Zviagintsev [Thu, 9 Apr 2015 10:08:04 +0000 (13:08 +0300)]
Documentation: kdbus: Fix typos
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>
Sergei Zviagintsev [Thu, 9 Apr 2015 10:08:05 +0000 (13:08 +0300)]
Documentation: kdbus: Fix description of KDBUS_SEND_SYNC_REPLY flag
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>
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.
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>
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.
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>
Sergei Zviagintsev [Thu, 9 Apr 2015 10:11:01 +0000 (13:11 +0300)]
kdbus: uapi: Fix kernel-doc for enum kdbus_send_flags
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>
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.
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>
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.
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>
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.
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>
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().
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>
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.
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>
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'.
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>
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.
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>
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.
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>
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.
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>
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/
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>
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.
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>
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.
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>
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.
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>
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.
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>
Daniel Mack [Thu, 11 Sep 2014 16:48:06 +0000 (18:48 +0200)]
kdbus: add Makefile, Kconfig and MAINTAINERS entry
This patch hooks up the build system to actually compile the files
added by previous patches. It also adds an entry to MAINTAINERS to
direct people to Greg KH, David Herrmann, Djalal Harouni and me for
questions and patches.
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>
Daniel Mack [Thu, 11 Sep 2014 17:00:43 +0000 (19:00 +0200)]
kdbus: add policy database implementation
This patch adds the policy database implementation.
A policy database restricts the possibilities of connections to own,
see and talk to well-known names. It can be associated with a bus
(through a policy holder connection) or a custom endpoint.
By default, buses have an empty policy database that is augmented on
demand when a policy holder connection is instantiated.
Policies are set through KDBUS_CMD_HELLO (when creating a policy
holder connection), KDBUS_CMD_CONN_UPDATE (when updating a policy
holder connection), KDBUS_CMD_EP_MAKE (creating a custom endpoint)
or KDBUS_CMD_EP_UPDATE (updating a custom endpoint). In all cases,
the name and policy access information is stored in items of type
KDBUS_ITEM_NAME and KDBUS_ITEM_POLICY_ACCESS.
See kdbus.policy(7) for more details.
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>
Daniel Mack [Thu, 11 Sep 2014 17:00:00 +0000 (19:00 +0200)]
kdbus: add name registry implementation
This patch adds the name registry implementation.
Each bus instantiates a name registry to resolve well-known names
into unique connection IDs for message delivery. The registry will
be queried when a message is sent with kdbus_msg.dst_id set to
KDBUS_DST_ID_NAME, or when a registry dump is requested.
It's important to have this registry implemented in the kernel to
implement lookups and take-overs in a race-free way.
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>
Daniel Mack [Thu, 11 Sep 2014 16:59:39 +0000 (18:59 +0200)]
kdbus: add code for buses, domains and endpoints
Add the logic to handle the following entities:
Domain:
A domain is an unamed object containing a number of buses. A
domain is automatically created when an instance of kdbusfs
is mounted, and destroyed when it is unmounted.
Every domain offers its own 'control' device node to create
buses. Domains are isolated from each other.
Bus:
A bus is a named object inside a domain. Clients exchange messages
over a bus. Multiple buses themselves have no connection to each
other; messages can only be exchanged on the same bus. The default
entry point to a bus, where clients establish the connection to, is
the "bus" device node /sys/fs/kdbus/<bus name>/bus. Common operating
system setups create one "system bus" per system, and one "user
bus" for every logged-in user. Applications or services may create
their own private named buses.
Endpoint:
An endpoint provides the device node to talk to a bus. Opening an
endpoint creates a new connection to the bus to which the endpoint
belongs. Every bus has a default endpoint called "bus". A bus can
optionally offer additional endpoints with custom names to provide
a restricted access to the same bus. Custom endpoints carry
additional policy which can be used to give sandboxed processes
only a locked-down, limited, filtered access to the same bus.
See kdbus(7), kdbus.bus(7), kdbus.endpoint(7) and kdbus.fs(7)
for more details.
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>
Daniel Mack [Thu, 11 Sep 2014 16:59:16 +0000 (18:59 +0200)]
kdbus: add code for notifications and matches
This patch adds code for matches and notifications.
Notifications are broadcast messages generated by the kernel, which
notify subscribes when connections are created or destroyed, when
well-known-names have been claimed, released or changed ownership,
or when reply messages have timed out.
Matches are used to tell the kernel driver which broadcast messages
a connection is interested in. Matches can either be specific on one
of the kernel-generated notification types, or carry a bloom filter
mask to match against a message from userspace. The latter is a way
to pre-filter messages from other connections in order to mitigate
unnecessary wakeups.
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>