summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2016-12-14nfc: change driver from neard interface to legacy sec-nfcJihoon Jung
This enable the legacy nfc driver instead of neard interface. It is required for nfc-manager and lsi nfc plugin implementation. Change-Id: Ia77f105262e5c4899806e6310be6ae9cbc013ec9 Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2016-12-14signal: move the "sig < SIGRTMIN" check into siginmask(sig)Oleg Nesterov
All the users of siginmask() must ensure that sig < SIGRTMIN. sig_fatal() doesn't and this is wrong: UBSAN: Undefined behaviour in kernel/signal.c:911:6 shift exponent 32 is too large for 32-bit type 'long unsigned int' the patch doesn't add the neccesary check to sig_fatal(), it moves the check into siginmask() and updates other callers. Link: http://lkml.kernel.org/r/20160517195052.GA15187@redhat.com Reported-by: Meelis Roos <mroos@linux.ee> Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> [Backport from mainline to remove UBSAN warning in sending signal] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: Icb12de70772b563ba112f5f6e490731e4db119d1
2016-12-14[media] include: lirc: add set length and frequency ioctl optionsAndi Shyti
The Lirc framework works mainly with receivers, but there is nothing that prevents us from using it for transmitters as well. For that we need to have more control on the device frequency to set (which is a new concept fro LIRC) and we also need to provide to userspace, as feedback, the values of the used frequency and length. Add the LIRC_SET_LENGTH, LIRC_GET_FREQUENCY and LIRC_SET_FREQUENCY ioctl commands in order to allow the above mentioned operations. Change-Id: I50b08e4da89a61f4b14f8a2752b905bc9e4a1d34 Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
2016-12-14spi: s3c64xx: add the BROKEN_CS case when setting up the transferAndi Shyti
The CS line might be disconneced ("broken"), therefore unused. In this case, the device doesn't need to wait for the user to handle the CS line for selecting the slave. The data will then be automatically transferred without taking the CS line status into account. Change-Id: Ibddf87721b7d882efbdad9c978b79a3e19189b3e Signed-off-by: Andi Shyti <andi.shyti@samsung.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2016-12-14bitops.h: correctly handle rol32 with 0 byte shiftSasha Levin
ROL on a 32 bit integer with a shift of 32 or more is undefined and the result is arch-dependent. Avoid this by handling the trivial case of roling by 0 correctly. The trivial solution of checking if shift is 0 breaks gcc's detection of this code as a ROL instruction, which is unacceptable. This bug was reported and fixed in GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57157): The standard rotate idiom, (x << n) | (x >> (32 - n)) is recognized by gcc (for concreteness, I discuss only the case that x is an uint32_t here). However, this is portable C only for n in the range 0 < n < 32. For n == 0, we get x >> 32 which gives undefined behaviour according to the C standard (6.5.7, Bitwise shift operators). To portably support n == 0, one has to write the rotate as something like (x << n) | (x >> ((-n) & 31)) And this is apparently not recognized by gcc. Note that this is broken on older GCCs and will result in slower ROL. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> [Backport from mainline to fix ubsan report] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: I47fcb9807778615fff4972fa92dc7b3143e0ef3d
2016-12-14UBSAN: run-time undefined behavior sanity checkerAndrey Ryabinin
UBSAN uses compile-time instrumentation to catch undefined behavior (UB). Compiler inserts code that perform certain kinds of checks before operations that could cause UB. If check fails (i.e. UB detected) __ubsan_handle_* function called to print error message. So the most of the work is done by compiler. This patch just implements ubsan handlers printing errors. GCC has this capability since 4.9.x [1] (see -fsanitize=undefined option and its suboptions). However GCC 5.x has more checkers implemented [2]. Article [3] has a bit more details about UBSAN in the GCC. [1] - https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Debugging-Options.html [2] - https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html [3] - http://developerblog.redhat.com/2014/10/16/gcc-undefined-behavior-sanitizer-ubsan/ Issues which UBSAN has found thus far are: Found bugs: * out-of-bounds access - 97840cb67ff5 ("netfilter: nfnetlink: fix insufficient validation in nfnetlink_bind") undefined shifts: * d48458d4a768 ("jbd2: use a better hash function for the revoke table") * 10632008b9e1 ("clockevents: Prevent shift out of bounds") * 'x << -1' shift in ext4 - http://lkml.kernel.org/r/<5444EF21.8020501@samsung.com> * undefined rol32(0) - http://lkml.kernel.org/r/<1449198241-20654-1-git-send-email-sasha.levin@oracle.com> * undefined dirty_ratelimit calculation - http://lkml.kernel.org/r/<566594E2.3050306@odin.com> * undefined roundown_pow_of_two(0) - http://lkml.kernel.org/r/<1449156616-11474-1-git-send-email-sasha.levin@oracle.com> * [WONTFIX] undefined shift in __bpf_prog_run - http://lkml.kernel.org/r/<CACT4Y+ZxoR3UjLgcNdUm4fECLMx2VdtfrENMtRRCdgHB2n0bJA@mail.gmail.com> WONTFIX here because it should be fixed in bpf program, not in kernel. signed overflows: * 32a8df4e0b33f ("sched: Fix odd values in effective_load() calculations") * mul overflow in ntp - http://lkml.kernel.org/r/<1449175608-1146-1-git-send-email-sasha.levin@oracle.com> * incorrect conversion into rtc_time in rtc_time64_to_tm() - http://lkml.kernel.org/r/<1449187944-11730-1-git-send-email-sasha.levin@oracle.com> * unvalidated timespec in io_getevents() - http://lkml.kernel.org/r/<CACT4Y+bBxVYLQ6LtOKrKtnLthqLHcw-BMp3aqP3mjdAvr9FULQ@mail.gmail.com> * [NOTABUG] signed overflow in ktime_add_safe() - http://lkml.kernel.org/r/<CACT4Y+aJ4muRnWxsUe1CMnA6P8nooO33kwG-c8YZg=0Xc8rJqw@mail.gmail.com> [akpm@linux-foundation.org: fix unused local warning] [akpm@linux-foundation.org: fix __int128 build woes] Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sasha Levin <sasha.levin@oracle.com> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Michal Marek <mmarek@suse.cz> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Yury Gribov <y.gribov@samsung.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Cc: Kostya Serebryany <kcc@google.com> Cc: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> [backport from mainline for UBSAN] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: I216cb2d9dbfd9fc9e70b8e4515a0e34fcb68822f
2016-12-14clk: samsung: exynos5420: Add pll_rate_table and clock id for EPLLChanwoo Choi
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>
2016-12-14clk: samsung: exynos5422: add missing parent GSCL block clocksMarek Szyprowski
This patch adds clocks, which are required for preserving parent clock configuration on GSCALLER power domain on/off. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2016-12-14clk: samsung: Add bindings for 32kHz clocks from s2mps11Markus Reichl
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>
2016-12-14clk: samsung: exynos3250: Add MMC2 clockChanwoo Choi
This patch add the MMC2 clocks (mux, divider, gate) of Exynos3250 SoC. Change-Id: Ib0c194e09f6ed171ba1a84a35a96f651b615666f Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-12-14clk: samsung: exynos3250: Add UART2 clockChanwoo Choi
This patch add the UART2 clocks (mux, divider, gate) of Exynos3250 SoC. Change-Id: I5b013ed835a3985659f956b2bd3e64dbeeca7369 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-12-14clk: samsung: exynos5420: add cpu clock configuration data and instantiate ↵Thomas Abraham
cpu clock With the addition of the new Samsung specific cpu-clock type, the arm clock can be represented as a cpu-clock type. Add the CPU clock configuration data and instantiate the CPU clock type for Exynos5420. Changes by Bartlomiej: - split Exynos5420 support from the original patches - moved E5420_[EGL,KFC]_DIV0() macros to clk-exynos5420.c Cc: Tomasz Figa <tomasz.figa@gmail.com> Cc: Mike Turquette <mturquette@linaro.org> Cc: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2016-12-14clk: samsung: exynos5250: add cpu clock configuration data and instantiate ↵Thomas Abraham
cpu clock With the addition of the new Samsung specific cpu-clock type, the arm clock can be represented as a cpu-clock type. Add the CPU clock configuration data and instantiate the CPU clock type for Exynos5250. Changes by Bartlomiej: - split Exynos5250 support from the original patch - moved E5250_CPU_DIV[0,1]() macros to clk-exynos5250.c Cc: Tomasz Figa <tomasz.figa@gmail.com> Cc: Mike Turquette <mturquette@linaro.org> Cc: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2016-12-14cpufreq-dt: add 'boost' mode frequencies supportBartlomiej Zolnierkiewicz
Add 'boost' mode frequencies support: - add boost-opps binding to cpufreq-dt driver bindings - make cpufreq_init() adjust freq_table accordingly - fix set_target() to handle boost frequencies - add boost_supported field to struct cpufreq_dt_platform_data - set dt_cpufreq_driver.boost_supported in dt_cpufreq_probe() This patch makes cpufreq-dt driver aware of 'boost' mode frequencies and prepares it for adding support for Exynos4x12 'boost' support. boost-opps binding is currently limited to cpufreq-dt but once there is a need for cpufreq wide and/or generic Linux device support for 'boost' mode cpufreq-dt can be updated to handle the new code without changing the binding itself. The decision to make 'boost' mode support limited to cpufreq-dt driver for now was taken because 'boost' mode is currently a niche feature and code needed for parsing boost-opps binding is minimal and simple. More generic (i.e. separate 'boost' OPPs list in struct device and generic cpufreq convertion of them to freq_table format) support would need far more code and effort to make it work. Doing it without a demonstrated real need would be on overengineering IMHO. Cc: Tomasz Figa <tomasz.figa@gmail.com> Cc: Mike Turquette <mturquette@linaro.org> Cc: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Cc: Thomas Abraham <thomas.ab@samsung.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2016-12-14cpufreq / OPP: allow allocation of extra table entries in freq_tableBartlomiej Zolnierkiewicz
Prefix dev_pm_opp_init_cpufreq_table() with "__" and add a wrapper for it to keep current users unchanged. Then add an extra_opps parameter to __dev_pm_opp_init_cpufreq_table() to allow allocation of extra table entries in freq_table. This patch is a preparation for adding 'boost' mode frequencies support to cpufreq-dt driver. Cc: Tomasz Figa <tomasz.figa@gmail.com> Cc: Mike Turquette <mturquette@linaro.org> Cc: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Cc: Thomas Abraham <thomas.ab@samsung.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2016-12-14clk: add CLK_RECALC_NEW_RATES clock flag for Exynos cpu clock supportBartlomiej Zolnierkiewicz
This flag is needed to fix the issue with wrong dividers being setup by Common Clock Framework when using the new Exynos cpu clock support. The issue happens because clk_core_set_rate_nolock() calls clk_calc_new_rates(clk, rate) before both pre/post clock notifiers have a chance to run. In case of Exynos cpu clock support pre/post clock notifiers are registered for mout_apll clock which is a parent of armclk cpu clock and dividers are modified in both pre and post clock notifier. This results in wrong dividers values being later programmed by clk_change_rate(top). To workaround the problem CLK_RECALC_NEW_RATES flag is added and it is set for mout_apll clock later so the correct divider values are re-calculated after both pre and post clock notifiers had run. For example when using "performance" governor on Exynos4210 Origen board the cpufreq-dt driver requests to change the frequency from 1000MHz to 1200MHz and after the change state of the relevant clocks is following: Without use of CLK_GET_RATE_NOCACHE flag: fout_apll rate: 1200000000 fout_apll_div_2 rate: 600000000 mout_clkout_cpu rate: 600000000 div_clkout_cpu rate: 600000000 clkout_cpu rate: 600000000 mout_apll rate: 1200000000 armclk rate: 1200000000 mout_hpm rate: 1200000000 div_copy rate: 300000000 div_hpm rate: 300000000 mout_core rate: 1200000000 div_core rate: 1200000000 div_core2 rate: 1200000000 arm_clk_div_2 rate: 600000000 div_corem0 rate: 300000000 div_corem1 rate: 150000000 div_periph rate: 300000000 div_atb rate: 300000000 div_pclk_dbg rate: 150000000 sclk_apll rate: 1200000000 sclk_apll_div_2 rate: 600000000 With use of CLK_GET_RATE_NOCACHE flag: fout_apll rate: 1200000000 fout_apll_div_2 rate: 600000000 mout_clkout_cpu rate: 600000000 div_clkout_cpu rate: 600000000 clkout_cpu rate: 600000000 mout_apll rate: 1200000000 armclk rate: 1200000000 mout_hpm rate: 1200000000 div_copy rate: 200000000 div_hpm rate: 200000000 mout_core rate: 1200000000 div_core rate: 1200000000 div_core2 rate: 1200000000 arm_clk_div_2 rate: 600000000 div_corem0 rate: 300000000 div_corem1 rate: 150000000 div_periph rate: 300000000 div_atb rate: 240000000 div_pclk_dbg rate: 120000000 sclk_apll rate: 150000000 sclk_apll_div_2 rate: 75000000 Without this change cpufreq-dt driver showed ~10 mA larger energy consumption when compared to cpufreq-exynos one when "performance" cpufreq governor was used on Exynos4210 SoC based Origen board. This issue was probably meant to be workarounded by use of CLK_GET_RATE_NOCACHE and CLK_DIVIDER_READ_ONLY clock flags in the original Exynos cpu clock patchset (in "[PATCH v12 6/6] clk: samsung: remove unused clock aliases and update clock flags" patch) but usage of these flags is not sufficient to fix the issue observed. Cc: Thomas Abraham <thomas.ab@samsung.com> Cc: Tomasz Figa <tomasz.figa@gmail.com> Cc: Mike Turquette <mturquette@linaro.org> Cc: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2016-12-14netfilter: nfnetlink_queue: add security context informationRoman Kubiak
This patch adds an additional attribute when sending packet information via netlink in netfilter_queue module. It will send additional security context data, so that userspace applications can verify this context against their own security databases. Signed-off-by: Roman Kubiak <r.kubiak@samsung.com> Acked-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> [backport from mainline for security nether service] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2016-12-14x86/kasan, mm: introduce generic kasan_populate_zero_shadow()Andrey Ryabinin
Introduce generic kasan_populate_zero_shadow(shadow_start, shadow_end). This function maps kasan_zero_page to the [shadow_start, shadow_end] addresses. This replaces x86_64 specific populate_zero_shadow() and will be used for ARM64 in follow on patches. Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
2016-12-14x86/kasan: define KASAN_SHADOW_OFFSET per architectureAndrey Ryabinin
Current definition of KASAN_SHADOW_OFFSET in include/linux/kasan.h will not work for upcomming arm64, so move it to the arch header. Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
2016-12-14drm/bridge: Make (pre/post) enable/disable callbacks optionalLaurent Pinchart
Instead of forcing bridges to implement empty callbacks make them all optional. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2016-12-14drm/bridge: Improve kerneldocDaniel Vetter
Especially document the assumptions and semantics of the callbacks carefully. Just a warm-up excercise really. v2: Spelling fixes (Eric). v3: Consolidate more with existing docs: - Remove the overview section explaining the bridge funcs, that's now all in the drm_bridge_funcs kerneldoc in much more detail. - Use & to reference structs so that kerneldoc automatically inserts hyperlinks. v4: Review from Thierry. Cc: Eric Anholt <eric@anholt.net> Cc: Archit Taneja <architt@codeaurora.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Archit Taneja <architt@codeaurora.org> (v3) Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-7-git-send-email-daniel.vetter@ffwll.ch Reviewed-by: Thierry Reding <treding@nvidia.com>
2016-12-14drm: bridge: Allow daisy chaining of bridgesArchit Taneja
Allow drm_bridge objects to link to each other in order to form an encoder chain. The requirement for creating a chain of bridges comes because the MSM drm driver uses up its encoder and bridge objects for blocks within the SoC itself. There isn't anything left to use if the SoC display output is connected to an external encoder IC. Having an additional bridge connected to the existing bridge helps here. In general, it is possible for platforms to have multiple devices between the encoder and the connector/panel that require some sort of configuration. We create drm bridge helper functions corresponding to each op in 'drm_bridge_funcs'. These helpers call the corresponding 'drm_bridge_funcs' op for the entire chain of bridges. These helpers are used internally by drm_atomic_helper.c and drm_crtc_helper.c. The drm_bridge_enable/pre_enable helpers execute enable/pre_enable ops of the bridge closet to the encoder, and proceed until the last bridge in the chain is enabled. The same holds for drm_bridge_mode_set/mode_fixup helpers. The drm_bridge_disable/post_disable helpers disable the last bridge in the chain first, and proceed until the first bridge in the chain is disabled. drm_bridge_attach() remains the same. As before, the driver calling this function should make sure it has set the links correctly. The order in which the bridges are connected to each other determines the order in which the calls are made. One requirement is that every bridge in the chain should point the parent encoder object. This is required since bridge drivers expect a valid encoder pointer in drm_bridge. For example, consider a chain where an encoder's output is connected to bridge1, and bridge1's output is connected to bridge2: /* Like before, attach bridge to an encoder */ bridge1->encoder = encoder; ret = drm_bridge_attach(dev, bridge1); .. /* * set the first bridge's 'next' bridge to bridge2, set its encoder * as bridge1's encoder */ bridge1->next = bridge2 bridge2->encoder = bridge1->encoder; ret = drm_bridge_attach(dev, bridge2); ... ... This method of bridge chaining isn't intrusive and existing drivers that use drm_bridge will behave the same way as before. The bridge helpers also cleans up the atomic and crtc helper files a bit. Reviewed-by: Jani Nikula <jani.nikula@linux.intel.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-12-14input: touchscreen: fts: added touch key functionalityAndi Shyti
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>
2016-12-14kmsg: add ioctl for kmsg* devices operating on buffersMarcin Niesluchowski
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>
2016-12-14kmsg: add ioctl for adding and deleting kmsg* devicesMarcin Niesluchowski
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>
2016-12-14kmsg: add function for adding and deleting additional buffersMarcin Niesluchowski
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>
2016-12-14kmsg: add additional buffers support to memory classMarcin Niesluchowski
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>
2016-12-14printk: guard the amount written per line by devkmsg_read()Tejun Heo
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>
2016-12-14lsm: kdbus security hooksPaul Osmialowski
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>
2016-12-14kdbus: uapi: Fix kernel-doc for enum kdbus_send_flagsSergei Zviagintsev
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>
2016-12-14kdbus: fix header guard nameLucas De Marchi
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>
2016-12-14kdbus: add node and filesystem implementationDaniel Mack
kdbusfs is a filesystem that will expose a fresh kdbus domain context each time it is mounted. Per mount point, there will be a 'control' node, which can be used to create buses. fs.c contains the implementation of that pseudo-fs. Exported inodes of 'file' type have their i_fop set to either kdbus_handle_control_ops or kdbus_handle_ep_ops, depending on their type. The actual dispatching of file operations is done from handle.c node.c is an implementation of a kdbus object that has an id and children, organized in an R/B tree. The tree is used by the filesystem code for lookup and iterator functions, and to deactivate children once the parent is deactivated. Every inode exported by kdbusfs is backed by a kdbus_node, hence it is embedded in struct kdbus_ep, struct kdbus_bus and struct kdbus_domain. 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>
2016-12-14kdbus: add uapi header fileDaniel Mack
This patch adds the header file which describes the low-level transport protocol used by various ioctls. The header file is located in include/uapi/linux/ as it is shared between kernel and userspace, and it only contains data structure definitions, enums and defines for constants. The low-level kernel API of kdbus is exposed through ioctls, employed on nodes exposed by kdbusfs. We've chosen a ioctl-based implementation over syscalls for various reaons: * The ioctls kdbus offers are completely specific to nodes exposed by kdbusfs and can not be applied to any other file descriptor in a system. * The file descriptors derived from opening nodes in kdbusfs can only be used for poll(), close() and the ioctls described in kdbus.h. * Not all systems will make use of kdbus eventually, and we want to make as many parts of the kernel optional at build time. * We want to build the kdbus code as module, which is impossible to do when implemented with syscalls. * The ioctl dispatching logic does not show up in our performance graphs; its overhead is negligible. * For development, being able to build, load and unload a separate module with a versioned name suffix is essential. 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>
2016-12-14drm/exynos: add DRM_EXYNOS_GEM_MAP ioctlJoonyoung Shim
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>
2016-12-14mfd: sec-core: Disable buck voltage reset on watchdog falling edgeKrzysztof Kozlowski
The WRSTBI bit (disabled by default but enabled by bootloader), when set, is responsible for resetting voltages to default values of certain bucks on falling edge of Warm Reset Input pin from AP. However on some boards (with S2MPS13) the pin is pulled down so any suspend will effectively trigger the reset of bucks supplying the power to the little and big cores. In the same time when resuming, these bucks must provide voltage greater or equal to voltage before suspend to match the frequency chosen by cpufreq. If voltage (default value of voltage after reset) is lower than one set by cpufreq before suspend, then system will hang during resuming. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2016-12-14thermal: consistently use int for trip tempWei Ni
The commit 17e8351a7739 consistently use int for temperature, however it missed a few in trip temperature and thermal_core. In current codes, the trip->temperature used "unsigned long" and zone->temperature used"int", if the temperature is negative value, it will get wrong result when compare temperature with trip temperature. This patch can fix it. Signed-off-by: Wei Ni <wni@nvidia.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com> [backport from mainline to fix previous backported commit] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2016-12-14thermal: consistently use int for temperaturesSascha Hauer
The thermal code uses int, long and unsigned long for temperatures in different places. Using an unsigned type limits the thermal framework to positive temperatures without need. Also several drivers currently will report temperatures near UINT_MAX for temperatures below 0°C. This will probably immediately shut the machine down due to overtemperature if started below 0°C. 'long' is 64bit on several architectures. This is not needed since INT_MAX °mC is above the melting point of all known materials. Consistently use a plain 'int' for temperatures throughout the thermal code and the drivers. This only changes the places in the drivers where the temperature is passed around as pointer, when drivers internally use another type this is not changed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Peter Feuerer <peter@piie.net> Cc: Punit Agrawal <punit.agrawal@arm.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Jean Delvare <jdelvare@suse.de> Cc: Peter Feuerer <peter@piie.net> Cc: Heiko Stuebner <heiko@sntech.de> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: linux-acpi@vger.kernel.org Cc: platform-driver-x86@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Darren Hart <dvhart@infradead.org> Cc: lm-sensors@lm-sensors.org Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-12-14NFC: nci: export nci_core_reset and nci_core_initRobert Baldyga
Some drivers needs to have ability to reinit NCI core, for example after updating firmware in setup() of post_setup() callback. This patch makes nci_core_reset() and nci_core_init() functions public, to make it possible. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
2016-12-14NFC: nci: Add post_setup handlerRobert Baldyga
Some drivers require non-standard configuration after NCI_CORE_INIT request, because they need to know ndev->manufact_specific_info or ndev->manufact_id. This patch adds post_setup handler allowing to do such custom configuration. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
2016-12-14NFC: nci: Handle proprietary response and notificationsSamuel Ortiz
Allow for drivers to explicitly define handlers for each proprietary notifications and responses they expect to support. Reviewed-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2016-12-14NFC: nci: Add nci_prop_cmd allowing to send proprietary nci cmdChristophe Ricard
Handle allowing to send proprietary nci commands anywhere in the nci state machine. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2016-12-14fimc-is: fix includes and make the code to compile on ARM64Marek Szyprowski
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2016-12-14fimc-is: add code from arch/arm/mach-exynos and missing headersMarek Szyprowski
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2016-12-14spi: backport spi driver from android-ll, now isp-spi worksMarek Szyprowski
remove spi isp dead code Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2016-12-14clk: samsung: exynos5433: Add ISP/CAM IP gate clocksSylwester Nawrocki
clk: samsung: exynos5433: Add CLK_ISP_SPIx gate clocks clk: samsung: exynos5433: Add more clock definitions for gate clocks clk: samsung: exynos5433: Fix CAM0_NR_CLK macro definition value Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14clk: samsung: exynos5433: Fix typos in *_ISP_MPWM clock namesSylwester Nawrocki
Change-Id: I83ae4420ce171c58271d0a0222ef9bae3def831a Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14soc: samsung: pm_domain: Support pm_domain creation notification.Jonghwa Lee
For some drivers which is probed earlier than pm_domain creation, it provides a interface to get notification. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2016-12-14arm64: dma-iommu: rebase dma-iommu to kernel 4.1Hyungwon Hwang
In Linux kernel 4.1, iommu_domain_alloc() is introduced.This patch rebases dma-iommu codes to make the driver use the function. Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
2016-12-14trace: ramdump: add to support ramdump mode for exynos5433sungguk.na
This patch adds to support ramdump mode for exynos5433. Change-Id: I7e833273315dab3116a5e6100c01f1f7ce965067 Signed-off-by: sungguk.na <sungguk.na@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2016-12-14thermal: devfreq_cooling: Add generic devfreq cooling device implementaionChanwoo Choi
This patch add the generic devfreq cooling device based on devfreq framework. The devfreq device is used as cooling device. Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>