summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-05-26proc, coredump: add CoreDumping flag to /proc/pid/statussubmit/tizen/20200529.040605accepted/tizen/unified/20200529.124048Roman Gushchin2-0/+9
Right now there is no convenient way to check if a process is being coredumped at the moment. It might be necessary to recognize such state to prevent killing the process and getting a broken coredump. Writing a large core might take significant time, and the process is unresponsive during it, so it might be killed by timeout, if another process is monitoring and killing/restarting hanging tasks. We're getting a significant number of corrupted coredump files on machines in our fleet, just because processes are being killed by timeout in the middle of the core writing process. We do have a process health check, and some agent is responsible for restarting processes which are not responding for health check requests. Writing a large coredump to the disk can easily exceed the reasonable timeout (especially on an overloaded machine). This flag will allow the agent to distinguish processes which are being coredumped, extend the timeout for them, and let them produce a full coredump file. To provide an ability to detect if a process is in the state of being coredumped, we can expose a boolean CoreDumping flag in /proc/pid/status. Example: $ cat core.sh #!/bin/sh echo "|/usr/bin/sleep 10" > /proc/sys/kernel/core_pattern sleep 1000 & PID=$! cat /proc/$PID/status | grep CoreDumping kill -ABRT $PID sleep 1 cat /proc/$PID/status | grep CoreDumping $ ./core.sh CoreDumping: 0 CoreDumping: 1 [guro@fb.com: document CoreDumping flag in /proc/<pid>/status] Link: http://lkml.kernel.org/r/20170928135357.GA8470@castle.DHCP.thefacebook.com Link: http://lkml.kernel.org/r/20170920230634.31572-1-guro@fb.com Signed-off-by: Roman Gushchin <guro@fb.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Ingo Molnar <mingo@kernel.org> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> [k.lewandowsk: backport mainline commit c643401218 for userspace process managers (eg. resourced) to be able to avoid killing dead processes, breaking crash reports] Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com> Change-Id: I7a7588752a24392d16963a7b3f78764d9bce1e2b
2020-05-25packaging: Add _wrong_version_format_terminate_build macrosubmit/tizen/20200526.073613accepted/tizen/unified/20200528.132931Seung-Woo Kim2-0/+6
Newer version of rpmbuild rejects double dash, "-", in version. To support the style, add _worng_version_format_terminate_build as 0 for docker gbs build. Change-Id: If15c81cea640ff63d3443207a8963b76412201a5 Reference: https://github.com/rpm-software-management/rpm/commit/5e94633660d0e2b97 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2019-12-31arm64: Don't unconditionally add -Wno-psabi to KBUILD_CFLAGSsubmit/tizen/20200102.014302accepted/tizen/unified/20200102.220844Nathan Chancellor1-1/+1
This is a GCC only option, which warns about ABI changes within GCC, so unconditionally adding it breaks Clang with tons of: warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option] and link time failures: ld.lld: error: undefined symbol: __efistub___stack_chk_guard >>> referenced by arm-stub.c:73 (/home/nathan/cbl/linux/drivers/firmware/efi/libstub/arm-stub.c:73) >>> arm-stub.stub.o:(__efistub_install_memreserve_table) in archive ./drivers/firmware/efi/libstub/lib.a These failures come from the lack of -fno-stack-protector, which is added via cc-option in drivers/firmware/efi/libstub/Makefile. When an unknown flag is added to KBUILD_CFLAGS, clang will noisily warn that it is ignoring the option like above, unlike gcc, who will just error. $ echo "int main() { return 0; }" > tmp.c $ clang -Wno-psabi tmp.c; echo $? warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option] 1 warning generated. 0 $ gcc -Wsometimes-uninitialized tmp.c; echo $? gcc: error: unrecognized command line option ‘-Wsometimes-uninitialized’; did you mean ‘-Wmaybe-uninitialized’? 1 For cc-option to work properly with clang and behave like gcc, -Werror is needed, which was done in commit c3f0d0bc5b01 ("kbuild, LLVMLinux: Add -Werror to cc-option to support clang"). $ clang -Werror -Wno-psabi tmp.c; echo $? error: unknown warning option '-Wno-psabi' [-Werror,-Wunknown-warning-option] 1 As a consequence of this, when an unknown flag is unconditionally added to KBUILD_CFLAGS, it will cause cc-option to always fail and those flags will never get added: $ clang -Werror -Wno-psabi -fno-stack-protector tmp.c; echo $? error: unknown warning option '-Wno-psabi' [-Werror,-Wunknown-warning-option] 1 This can be seen when compiling the whole kernel as some warnings that are normally disabled (see below) show up. The full list of flags missing from drivers/firmware/efi/libstub are the following (gathered from diffing .arm64-stub.o.cmd): -fno-delete-null-pointer-checks -Wno-address-of-packed-member -Wframe-larger-than=2048 -Wno-unused-const-variable -fno-strict-overflow -fno-merge-all-constants -fno-stack-check -Werror=date-time -Werror=incompatible-pointer-types -ffreestanding -fno-stack-protector Use cc-disable-warning so that it gets disabled for GCC and does nothing for Clang. Fixes: ebcc5928c5d9 ("arm64: Silence gcc warnings about arch ABI drift") Link: https://github.com/ClangBuiltLinux/linux/issues/511 Reported-by: Qian Cai <cai@lca.pw> Acked-by: Dave Martin <Dave.Martin@arm.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Will Deacon <will.deacon@arm.com> [sw0312.kim: backport mainline commit fa63da2ab046 for gcc 9 build] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: I0fb6fb81abe69ba8c1d4228608f361a3a6ce3800
2019-12-31arm64: Silence gcc warnings about arch ABI driftDave Martin1-0/+1
Since GCC 9, the compiler warns about evolution of the platform-specific ABI, in particular relating for the marshaling of certain structures involving bitfields. The kernel is a standalone binary, and of course nobody would be so stupid as to expose structs containing bitfields as function arguments in ABI. (Passing a pointer to such a struct, however inadvisable, should be unaffected by this change. perf and various drivers rely on that.) So these warnings do more harm than good: turn them off. We may miss warnings about future ABI drift, but that's too bad. Future ABI breaks of this class will have to be debugged and fixed the traditional way unless the compiler evolves finer-grained diagnostics. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> [sw0312.kim: backport mainline commit ebcc5928c5d9 for gcc 9 build] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: I42f221ba946ed70fe770eb3d501a48e837f0377d
2019-12-31tracing: Silence GCC 9 array bounds warningMiguel Ojeda3-10/+20
commit 0c97bf863efce63d6ab7971dad811601e6171d2f upstream. Starting with GCC 9, -Warray-bounds detects cases when memset is called starting on a member of a struct but the size to be cleared ends up writing over further members. Such a call happens in the trace code to clear, at once, all members after and including `seq` on struct trace_iterator: In function 'memset', inlined from 'ftrace_dump' at kernel/trace/trace.c:8914:3: ./include/linux/string.h:344:9: warning: '__builtin_memset' offset [8505, 8560] from the object at 'iter' is out of the bounds of referenced subobject 'seq' with type 'struct trace_seq' at offset 4368 [-Warray-bounds] 344 | return __builtin_memset(p, c, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In order to avoid GCC complaining about it, we compute the address ourselves by adding the offsetof distance instead of referring directly to the member. Since there are two places doing this clear (trace.c and trace_kdb.c), take the chance to move the workaround into a single place in the internal header. Link: http://lkml.kernel.org/r/20190523124535.GA12931@gmail.com Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> [ Removed unnecessary parenthesis around "iter" ] Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [sw0312.kim: cherry-pick from stable linux-4.14.y commit 50bbae7dad92 for gcc 9 build] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: I9f9b22003b8d13267b0f0b1d2b00f66bdd9af5f6
2019-12-30ath10k: avoid possible string overflowArnd Bergmann1-1/+1
commit 6707ba0105a2d350710bc0a537a98f49eb4b895d upstream. The way that 'strncat' is used here raised a warning in gcc-8: drivers/net/wireless/ath/ath10k/wmi.c: In function 'ath10k_wmi_tpc_stats_final_disp_tables': drivers/net/wireless/ath/ath10k/wmi.c:4649:4: error: 'strncat' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] Effectively, this is simply a strcat() but the use of strncat() suggests some form of overflow check. Regardless of whether this might actually overflow, using strlcat() instead of strncat() avoids the warning and makes the code more robust. Fixes: bc64d05220f3 ("ath10k: debugfs support to get final TPC stats for 10.4 variants") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [sw0312.kim: cherry-pick from stable linux-4.14.y commit 0cc17a7a3203 for gcc 9 build] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: I9e104bff8046c7ffa7f50b047dc4cd2e9fdb83e6
2019-12-30gcc-9: silence 'address-of-packed-member' warningLinus Torvalds1-1/+1
commit 6f303d60534c46aa1a239f29c321f95c83dda748 upstream. We already did this for clang, but now gcc has that warning too. Yes, yes, the address may be unaligned. And that's kind of the point. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [sw0312.kim: cherry-pick from stable linux-4.14.y commit 8e69458509d2 for gcc 9 build] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: Iec954dfa4fd8bf3ea7e1db3da2e421b8f58bbb32
2019-12-30include/linux/module.h: copy __init/__exit attrs to init/cleanup_moduleMiguel Ojeda1-2/+2
commit a6e60d84989fa0e91db7f236eda40453b0e44afa upstream. The upcoming GCC 9 release extends the -Wmissing-attributes warnings (enabled by -Wall) to C and aliases: it warns when particular function attributes are missing in the aliases but not in their target. In particular, it triggers for all the init/cleanup_module aliases in the kernel (defined by the module_init/exit macros), ending up being very noisy. These aliases point to the __init/__exit functions of a module, which are defined as __cold (among other attributes). However, the aliases themselves do not have the __cold attribute. Since the compiler behaves differently when compiling a __cold function as well as when compiling paths leading to calls to __cold functions, the warning is trying to point out the possibly-forgotten attribute in the alias. In order to keep the warning enabled, we decided to silence this case. Ideally, we would mark the aliases directly as __init/__exit. However, there are currently around 132 modules in the kernel which are missing __init/__exit in their init/cleanup functions (either because they are missing, or for other reasons, e.g. the functions being called from somewhere else); and a section mismatch is a hard error. A conservative alternative was to mark the aliases as __cold only. However, since we would like to eventually enforce __init/__exit to be always marked, we chose to use the new __copy function attribute (introduced by GCC 9 as well to deal with this). With it, we copy the attributes used by the target functions into the aliases. This way, functions that were not marked as __init/__exit won't have their aliases marked either, and therefore there won't be a section mismatch. Note that the warning would go away marking either the extern declaration, the definition, or both. However, we only mark the definition of the alias, since we do not want callers (which only see the declaration) to be compiled as if the function was __cold (and therefore the paths leading to those calls would be assumed to be unlikely). Link: https://lore.kernel.org/lkml/20190123173707.GA16603@gmail.com/ Link: https://lore.kernel.org/lkml/20190206175627.GA20399@gmail.com/ Suggested-by: Martin Sebor <msebor@gcc.gnu.org> Acked-by: Jessica Yu <jeyu@kernel.org> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [sw0312.kim: cherry-pick from stable linux-4.14.y commit 08aaa79ba25b for gcc 9 build] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: If5f04446d064b3daf6532852d5193a47fffb0d30
2019-12-30Compiler Attributes: add support for __copy (gcc >= 9)Miguel Ojeda2-0/+8
commit c0d9782f5b6d7157635ae2fd782a4b27d55a6013 upstream. From the GCC manual: copy copy(function) The copy attribute applies the set of attributes with which function has been declared to the declaration of the function to which the attribute is applied. The attribute is designed for libraries that define aliases or function resolvers that are expected to specify the same set of attributes as their targets. The copy attribute can be used with functions, variables, or types. However, the kind of symbol to which the attribute is applied (either function or variable) must match the kind of symbol to which the argument refers. The copy attribute copies only syntactic and semantic attributes but not attributes that affect a symbol’s linkage or visibility such as alias, visibility, or weak. The deprecated attribute is also not copied. https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html The upcoming GCC 9 release extends the -Wmissing-attributes warnings (enabled by -Wall) to C and aliases: it warns when particular function attributes are missing in the aliases but not in their target, e.g.: void __cold f(void) {} void __alias("f") g(void); diagnoses: warning: 'g' specifies less restrictive attribute than its target 'f': 'cold' [-Wmissing-attributes] Using __copy(f) we can copy the __cold attribute from f to g: void __cold f(void) {} void __copy(f) __alias("f") g(void); This attribute is most useful to deal with situations where an alias is declared but we don't know the exact attributes the target has. For instance, in the kernel, the widely used module_init/exit macros define the init/cleanup_module aliases, but those cannot be marked always as __init/__exit since some modules do not have their functions marked as such. Suggested-by: Martin Sebor <msebor@gcc.gnu.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [sw0312.kim: cherry-pick from stable linux-4.14.y commit b00c958ceb6c for gcc 9 build] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: Ie34d9679530b16ea8da7bc3ea109b546710f2b1b
2019-12-05drm/exynos: add debugfs interface and gem_info nodesubmit/tizen/20191206.054449accepted/tizen/unified/20191206.121231Seung-Woo Kim5-0/+120
The memps requires gem_info with gem_names to analyze graphics shared memory, so this patch adds gem_info node with debugfs interface. Change-Id: I467527da85978b7a07ec638139cec02ea29b6297 Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2019-11-12media: exynos4-is: fix wrong mdev and v4l2 dev order in error pathSeung-Woo Kim1-3/+4
When driver is built as module and probe during insmod is deferred because of sensor subdevs, there is NULL pointer deference because mdev is cleaned up and then access it from v4l2_device_unregister(). Fix the wrong mdev and v4l2 dev order in error path of probe. This fixes below null pointer deference: Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = ca026f68 [00000000] *pgd=00000000 Internal error: Oops: 5 [#1] PREEMPT SMP ARM [...] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) PC is at ida_free+0x7c/0x160 LR is at xas_start+0x44/0x204 [...] [<c0dafd60>] (ida_free) from [<c083c20c>] (__media_device_unregister_entity+0x18/0xc0) [<c083c20c>] (__media_device_unregister_entity) from [<c083c2e0>] (media_device_unregister_entity+0x2c/0x38) [<c083c2e0>] (media_device_unregister_entity) from [<c0843404>] (v4l2_device_release+0xd0/0x104) [<c0843404>] (v4l2_device_release) from [<c0632558>] (device_release+0x28/0x98) [<c0632558>] (device_release) from [<c0db1204>] (kobject_put+0xa4/0x208) [<c0db1204>] (kct_put) from [<bf00bac4>] (fimc_capture_subdev_unregistered+0x58/0x6c [s5p_fimc]) [<bf00bac4>] (fimc_capture_subdev_unregistered [s5p_fimc]) from [<c084a1cc>] (v4l2_device_unregister_subdev+0x6c/0xa8) [<c084a1cc>] (v4l2_device_unregister_subdev) from [<c084a350>] (v4l2_device_unregister+0x64/0x94) [<c084a350>] (v4l2_device_unregister) from [<bf0101ac>] (fimc_md_probe+0x4ec/0xaf8 [s5p_fimc]) [...] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Fixes: 9832e155f1ed ("[media] media-device: split media initialization and registration") Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> [sw0312.kim: cherry-pick mainline commit 4d741cbd58bf to handle exynos4-is issue] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: Ib2f757574a180145d4972b861057f090a19d5f8f
2019-11-12media: exynos4-is: Fix recursive locking in isp_video_release()Seung-Woo Kim1-1/+1
>From isp_video_release(), &isp->video_lock is held and subsequent vb2_fop_release() tries to lock vdev->lock which is same with the previous one. Replace vb2_fop_release() with _vb2_fop_release() to fix the recursive locking. Fixes: 1380f5754cb0 ("[media] videobuf2: Add missing lock held on vb2_fop_release") Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> [sw0312.kim: cherry-pick mainline commit 704c6c80fb47 to handle exynos4-is issue] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: Ibbfbc33b83dc17e86d8b030c0f7f7e101d6293c7
2019-10-31clk: samsung: exynos5433: add missing slab.h headersubmit/tizen/20191031.111959submit/tizen/20191031.023155accepted/tizen/unified/20191101.042035tizen_5.5Seung-Woo Kim1-0/+1
After the commit ee9bfe5eb9de9a ("clk: samsung: exynos5433: Fix error paths"), missing slab.h header causes build issue for using kfree(). Add missing header as like mainline commit faac3604d05e which is upstream version of ee9bfe5eb9de9a. Change-Id: Ib47a3fe79a049fca11d6ac3f2a626156dd5696a7 Fixes: ee9bfe5eb9de9a ("clk: samsung: exynos5433: Fix error paths") Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2019-10-25thermal: exynos: remove trip reporting to user-spacesubmit/tizen/20191031.012258Bartlomiej Zolnierkiewicz1-28/+2
Remove trip reporting to user-space - I'm not aware of any user-space program which relies on it and there is a thermal user-space governor which does it in proper way nowadays. Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com> [sw0312.kim: apply mainline commit b43e3cfe232a to remove unnecessary overhead uevent] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: I618b1c0c2285f823ecad527b76d38153068a6d32
2019-10-08clk: samsung: exynos5433: Fix error pathsMarek Szyprowski1-2/+11
Add checking the value returned by samsung_clk_alloc_reg_dump() and devm_kcalloc(). While fixing this, also release all gathered clocks. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Change-Id: I08e35e458e51f07e4c05c4101ffb4b86d187aded
2019-10-01ARM: prevent tracing IPI_CPU_BACKTRACEArnd Bergmann2-1/+6
Patch series "compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING", v3. This patch (of 11): When function tracing for IPIs is enabled, we get a warning for an overflow of the ipi_types array with the IPI_CPU_BACKTRACE type as triggered by raise_nmi(): arch/arm/kernel/smp.c: In function 'raise_nmi': arch/arm/kernel/smp.c:489:2: error: array subscript is above array bounds [-Werror=array-bounds] trace_ipi_raise(target, ipi_types[ipinr]); This is a correct warning as we actually overflow the array here. This patch raise_nmi() to call __smp_cross_call() instead of smp_cross_call(), to avoid calling into ftrace. For clarification, I'm also adding a two new code comments describing how this one is special. The warning appears to have shown up after commit e7273ff49acf ("ARM: 8488/1: Make IPI_CPU_BACKTRACE a "non-secure" SGI"), which changed the number assignment from '15' to '8', but as far as I can tell has existed since the IPI tracepoints were first introduced. If we decide to backport this patch to stable kernels, we probably need to backport e7273ff49acf as well. [yamada.masahiro@socionext.com: rebase on v5.1-rc1] Link: http://lkml.kernel.org/r/20190423034959.13525-2-yamada.masahiro@socionext.com Fixes: e7273ff49acf ("ARM: 8488/1: Make IPI_CPU_BACKTRACE a "non-secure" SGI") Fixes: 365ec7b17327 ("ARM: add IPI tracepoints") # v3.17 Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Christophe Leroy <christophe.leroy@c-s.fr> Cc: Mathieu Malaterre <malat@debian.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Stefan Agner <stefan@agner.ch> Cc: Boris Brezillon <bbrezillon@kernel.org> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Richard Weinberger <richard@nod.at> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Brian Norris <computersforpeace@gmail.com> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Borislav Petkov <bp@suse.de> Cc: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> [backport of mainline commit be167862ae7dd85c56d385209a4890678e1b0488] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I9597ba8e31dc5b9e714c5703259af65eae9361d1
2019-09-30ARM: configs: tizen_odroid_defconfig: enable kdbustizen_5.5.m2_releasesubmit/tizen_5.5_wearable_hotfix/20201026.184306submit/tizen_5.5_mobile_hotfix/20201026.185106submit/tizen_5.5/20191031.000010submit/tizen/20190930.080320accepted/tizen/unified/20191004.003457accepted/tizen/5.5/unified/wearable/hotfix/20201027.102546accepted/tizen/5.5/unified/mobile/hotfix/20201027.063551accepted/tizen/5.5/unified/20191031.004317tizen_5.5_wearable_hotfixtizen_5.5_tvtizen_5.5_mobile_hotfixaccepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unified_mobile_hotfixaccepted/tizen_5.5_unifiedAdrian Szyndela1-0/+1
Enable kdbus driver to use it for Odroid, as in tizen 5.0. Change-Id: Ifcee653f25599f9261905c10aa1bfe5a387bfc58 Signed-off-by: Adrian Szyndela <adrian.s@samsung.com>
2019-09-30kdbus: test suite changed to common formatKonrad Lipinski31-3762/+3075
This commit adapts the kdbus test suite to use with dbus-integration-tests. Change-Id: Ifee21253f4e3c732b27517a0c566d4b9a569d5af Signed-off-by: Adrian Szyndela <adrian.s@samsung.com>
2019-09-30kdbus: porting to 4.14Adrian Szyndela12-30/+54
This commit makes kdbus driver working with kernel 4.14. It also enabled compilation of the driver if enabled in config. The list of changes needed to make it compile with kernel 4.14: - Add missing includes for <linux/cred.h> - put inode_lock()/inode_unlock() in place of explicit mutex locking - replace CURRENT_TIME with proper call to current_time() - replace PAGE_CACHE_* with PAGE_* - replace GFP_TEMPORARY with GFP_KERNEL - use kvecs for kernel memory, iovec for user memory instead of only iovec for both - fix usage of task_cgroup_path() - replace GROUP_AT usage with 'gid' field dereference - add 0 as an argument to init_name_hash - add 0 as flags as an argument to vfs_iter_write - replace __vfs_read with kernel_read to allow compilation into module Change-Id: I3dd066ab531d0d3f7082556e4d38381961998015 Signed-off-by: Adrian Szyndela <adrian.s@samsung.com>
2019-09-30kdbus: the driver, original and non-workingAdrian Szyndela91-1/+34532
[based on commit 216823ac83c0ab89348e2ed6f66179f53626586e] Introduce the kdbus driver again. This driver worked previously on kernel 4.1. This is the source code taken from the working driver. It is non-working and disabled. It is a base for porting. The documentation is moved from Documentation to ipc/kdbus/Documentation. The references to kdbus source code are commented out or removed in Makefiles. Original authors of the files are those from commit 216823ac83c0ab8934. Change-Id: Id60af5faf794fc4ae7122976621076f1021f6c38 Signed-off-by: Adrian Szyndela <adrian.s@samsung.com> Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2019-09-06ARM: exynos: Fix boot with CONFIG_SUSPEND disabledMarek Szyprowski2-15/+8
Exynos SMP code relies on PMU registers to be mapped via pmu_base_addr. Those mapping is done in suspend.c:exynos_pmu_irq_init(), which is not called if CONFIG_SUSPEND is disabled. Fix this by moving PMU mapping creation to exynos.c:exynos_map_pmu(), which is called in all cases. Reported-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: Ic9dc37b18b63827b612fbc91e0f84509d4e8723b
2019-09-06drm/exynos: fix to build suspend/resume callback functions alwaysSeung-Woo Kim1-2/+0
When CONFIG_SUSPEND is disabled, conditional build for suspend and resume callbcak functions causes build error after the commit ae1c75eeaa19 ("drm/exynos: Suspend/resume display pipeline as early/late as possible"). So fix to build the callbacks always like mainline applied version, the commit dc684af6fc8d. Change-Id: I226ef3279df0b3ed646f5c532a0093b34e877723 CC: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2019-07-31ARM: configs: tizen_odroid_defconfig: Enable NETFILTER_XT_MATCH_OWNER configsubmit/tizen/20190801.010047accepted/tizen/unified/20190801.113438Seung-Woo Kim1-0/+1
Enable the NETFILTER_XT_MATCH_OWNER config option to use xt_owner supplementary groups. Change-Id: I715a8e360152f4f46d3ea7daeef5c6bcbc895e2f Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2019-07-31ARM: configs: tizen_odroid: sync with savedefconfigSeung-Woo Kim1-2/+1
After few changes, it is different from savedefconfig, so sync. Change-Id: I50759332ef3660cf57090d65e78e7fc95d945342 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2019-07-31arm64: configs: tizen_tm2_defconfig: Enable NETFILTER_XT_MATCH_OWNER configSeung-Woo Kim1-0/+1
Enable the NETFILTER_XT_MATCH_OWNER config option to use xt_owner supplementary groups. Change-Id: I3719c6fb2d2f12014889e88002fd7ac9f67f4d94 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2019-07-03netfilter: xt_owner: bail out with EINVAL in case of unsupported flagssubmit/tizen/20190705.061120accepted/tizen/unified/20190705.110609Pablo Neira Ayuso2-0/+8
Reject flags that are not supported with EINVAL. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> [sw0312.kim: backport from mainline to apply supplementary groups on netfilter] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: I92f1bd37788cc71088112770bb1b4071dfe8f3fd
2019-07-03netfilter: xt_owner: Add supplementary groups optionLukasz Pawelczyk2-6/+24
The XT_OWNER_SUPPL_GROUPS flag causes GIDs specified with XT_OWNER_GID to be also checked in the supplementary groups of a process. f_cred->group_info cannot be modified during its lifetime and f_cred holds a reference to it so it's safe to use. Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@samsung.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> [sw0312.kim: backport from mainline to apply supplementary groups on netfilter] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: Ie2e4c64388b4c64794ebc73de9bacf206eb46173
2019-05-15ARM: defconfig: enable I-Cache line size workaround on Exynos systemssubmit/tizen/20190611.014400accepted/tizen/unified/20190611.110428Marek Szyprowski2-0/+2
All Exynos big.LITTLE system suffer from I-Cache line size mismatch between CPU cores, so enable workaround for it in exynos_defconfig and tizen_odroid_defconfig. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I0f324a5832e1ef47999f7b8d4ddd4a29db0ee176
2019-05-15ARM: Add workaround for I-Cache line size mismatch between CPU coresMarek Szyprowski6-0/+47
Some big.LITTLE systems have mismatch of I-Cache line size between LITTLE and big cores. This patch adds workaround for proper I-Cache support on such systems. Without it, some code (typically self-modifying) might suffer from random SIGILL failures. Similar workaround exists for ARM64 architecture, added by commit 116c81f427ff ("arm64: Work around systems with mismatched cache line sizes"). Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I76e1cb24cde91dbfd5a16bd8d5dc97c7953767ff
2019-05-07gpu: drm: exynos: Add extcon notification for hdmi connectionsubmit/tizen/20190507.092632accepted/tizen/unified/20190508.111058Dongwoo Lee2-0/+48
Currently, hdmi connection generates only uevent by drm core. In addition, it has no information about connection state. But, Tizen starts TV-out behavior along with extcon uevent. To this end, this patch will add extcon notification for hdmi connection. Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com> [sw0312.kim: port to v4.14] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: I20a2d13deff07e566ce4f50c7fc64600ce10ca9f
2019-04-26ARM: configs: tizen_odroid: enable squashfssubmit/tizen/20190426.054810accepted/tizen/unified/20190426.110522Seung-Woo Kim1-0/+4
Tizen web engine uses squashfs for its libraray update. Enable squashfs and related options. Change-Id: Id9a25c46642598d0927a4304f6813dbbd64f68b1 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2019-04-26arm64: configs: tizen_tm2_defconfig: enable squashfsSeung-Woo Kim1-0/+4
Tizen web engine uses squashfs for its libraray update. Enable squashfs and related options. Change-Id: Id2f7640cf6007b280bb6daef3c42484e8b4a04ef Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2019-04-11clocksource/drivers/arm_arch_timer: Fix DEFINE_PER_CPU expansionMark Rutland1-2/+1
Our ctags mangling script can't handle newlines inside of a DEFINE_PER_CPU(), leading to an annoying message whenever tags are built: ctags: Warning: drivers/clocksource/arm_arch_timer.c:302: null expansion of name pattern "\1" This was dealt with elsewhere in commit: 25528213fe9f75f4 ("tags: Fix DEFINE_PER_CPU expansions") ... by ensuring each DEFINE_PER_CPU() was contained on a single line, even where this would violate the usual code style (checkpatch warnings and all). Let's do the same for the arch timer driver, and get rid of the distraction. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> [sw0312.kim: cherry-pick mainline commit a7fb4577bbe3 to resolve warning on ctags build] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: Id79bac4d2450f30c21b50cdf0de1be7fb3b1bbec
2019-03-28soc: samsung: Split ASV drivers into ARM and ARM64 partssubmit/tizen/20190329.020226accepted/tizen/unified/20190330.030053Sylwester Nawrocki4-5/+37
This fixes build error with tizen_odroid_defconfig related to missing MTD symbols required by exynos5433-asv.c driver. The Exynos5433 ASV driver has dependency on MTD, to avoid inheriting this dependency by the Exynos5422 ASV driver split Exynos ASV drivers into ARM and ARM64 parts, similarly as it is done for the PMU. This also has an advantage that we don't need to include ARM ASV drivers on ARM64 SoCs and we can build only ARM ASV drivers for ARM SoCs. Change-Id: I3d647b784f936dcb535632e4ee15a7d571d7a131 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-27arm64: configs: tizen_tm2_defconfig: Enable MTD_EXYNOS_OTPSylwester Nawrocki1-0/+2
Enable MTD_EXYNOS_OTP which is required for the ASV driver on Exynos5433. Change-Id: I6b176856405ea38c51436e73d5aa4df80c79f6b1 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-27arm64: exynos: Enable ASV driver for ARCH_EXYNOSSylwester Nawrocki1-0/+1
Enable ASV driver for Exynos5433 SoC. Change-Id: I2870b83f909425356be2391ac5e534a773cd8db8 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-27soc: samsung: Add ASV support for Exynos5433 SoCSylwester Nawrocki4-1/+529
This patch adds Adaptive Supply Voltage support or the Cortex A53 and the Cortex A57 clusters. There is no Adaptive Body Bias handling added yet. Change-Id: I07190bf3614428292594b42bb8a1fb60a7b3ae63 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-27arm64: dts: Add Exynos5433 SoC OTP device nodeSylwester Nawrocki1-0/+9
Change-Id: I8bcd9955c3cff940150bff10da564c3b9f477952 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-27arm64: dts: exynos: Update Exynos5433 CHIPID nodeSylwester Nawrocki1-2/+3
Extend the register region to also cover the ASV table region and add reg entries for the ABB registers region. Change-Id: I64704397a0cd12cb9a019b83f45fd23890da458b Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-27mtd: Add exynos OTP memory driverSylwester Nawrocki3-0/+277
This patch adds driver for Exynos5433 OTP memory. Access to the OTP memory is required, among others, to support the Adaptive Supply Voltage feature. Partially based on code from Android SM-N910C_LL_Opensource kernel. Change-Id: If85363f1626d622f1559757eb06fd950e214e5ab Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-27soc: samsung: chipid: Add ABB register region read helperSylwester Nawrocki2-3/+22
This patch adds helper functions for accessing the ABB block registers needed by the ASV driver. Change-Id: Ida2ea622136c1abea2caffaee00b5400a8efba7d Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-27soc: samsung: chipid: Update DT bindings documentationSylwester Nawrocki1-3/+7
Document "samsung,exynos5433-chipid" compatible and add description of 'reg' property for Exynos5433. Change-Id: I9f22c76aabd46ea7aa31cfbecbb64131914e9938 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-27soc: samsung: chipid: Add exynos_chipid_read_bits() functionSylwester Nawrocki2-0/+8
Add register read helper function needed by the ASV driver. Change-Id: I90ec78cff58ac7ff424a50309e83d37605e7cbc7 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-27clk: samsung: Add CLK_IGNORE_UNUSED for Exynos5433 ABB, ASV_TB clocksSylwester Nawrocki1-2/+2
Prevent disabling these clocks by the kernel until proper support is added to the ASV driver. With current code this patch is not necessarily required, because exynos_asv_init() is being called before unused clocks get disabled by clk core. However, things may break when the timings change for any reason. This patch has been tested after changing initcall type in exynos-asv.c: -late_initcall(exynos_asv_init) +late_initcall_sync(exynos_asv_init) Change-Id: I513ff391bece219318020c0bcca07e2a7938a175 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-27soc: samsung: asv: Print error code when adding an OPP failsSylwester Nawrocki1-2/+2
Log error code from devm_pm_opp_add() to make any errors easier to debug. Change-Id: If418320565f1efc14d16242d8b166bea07353c54 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-27soc: samsung: asv: Wait until OPP gets released before adding new oneSylwester Nawrocki1-0/+10
There is currently no check whether an OPP is actually removed before attempting to add an replacement OPP. In situations when and OPP is referenced when we try to remove it and it is not already removed at the time of return from the dev_pm_opp_remove() call subsequent dev_pm_opp_add() invocation will fail. To avoid that add a polling loop with timeout as a barrier before adding new OPP. This patch should also prevent related cpufreq core issues as indicated by logs as follows. exynos_asv_update_cpu_opp cpu4 opp5, freq: 2000 missing exynos5433_asv_opp_get_voltage: arm,cortex-a57: [6] freq: 1900, voltage: 1262500 -> 1187500 cpu cpu4: _opp_add: duplicate OPPs detected. Existing: freq: 1900000000, volt: 1262500, enabled: 1. New: freq: 1900000000, volt: 1187500, enabled: 1 exynos_asv_update_cpu_opp: Failed to add OPP 1900000000 Hz/1187500 uV for cpu4 (-17) cpu cpu4: dev_pm_opp_set_rate: failed to find OPP for freq 1900000000 (-34) exynos5433_asv_opp_get_voltage: arm,cortex-a57: [9] freq: 1600, voltage: 1137500 -> 1062500 cpufreq: __target_index: Failed to change cpu frequency: -34 Change-Id: Ibf6a568cabbd5380952d97f93d27ac59f1db125b Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-19drm/exynos/mixer: fix MIXER shadow registry synchronisation codeAndrzej Hajda1-44/+66
MIXER on Exynos5 SoCs uses different synchronisation method than Exynos4 to update internal state (shadow registers). Apparently the driver implements it incorrectly. The rule should be as follows: - do not request updating registers until previous request was finished, ie. MXR_CFG_LAYER_UPDATE_COUNT must be 0. - before setting registers synchronisation on VSYNC should be turned off, ie. MXR_STATUS_SYNC_ENABLE should be reset, - after finishing MXR_STATUS_SYNC_ENABLE should be set again. The patch hopefully implements it correctly. Below sample kernel log from page fault caused by the bug: [ 25.670038] exynos-sysmmu 14650000.sysmmu: 14450000.mixer: PAGE FAULT occurred at 0x2247b800 [ 25.677888] ------------[ cut here ]------------ [ 25.682164] kernel BUG at ../drivers/iommu/exynos-iommu.c:450! [ 25.687971] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM [ 25.693778] Modules linked in: [ 25.696816] CPU: 5 PID: 1553 Comm: fb-release_test Not tainted 5.0.0-rc7-01157-g5f86b1566bdd #136 [ 25.705646] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) [ 25.711710] PC is at exynos_sysmmu_irq+0x1c0/0x264 [ 25.716470] LR is at lock_is_held_type+0x44/0x64 v2: added missing MXR_CFG_LAYER_UPDATE bit setting in mixer_enable_sync Reported-by: Marian Mihailescu <mihailescu2m@gmail.com> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Change-Id: Idd49412e699350a7ea3a98ef7f925924e0ddf1ff
2019-03-19drm/exynos/mixer: fix synchronization check in interlaced modeAndrzej Hajda2-0/+11
In case of interlace mode video processor registers and mixer config register must be check to ensure internal state is in sync with shadow registers. This patch fixes page-faults in interlaced mode. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> [backport of mainline commit 2eced8e917b060587fc8ed46df41c364957a5050] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I8b09ed165101a7dcccd1d6e7338e0216a27f4481
2019-03-19ARM: dts: exynos: Increase minimal ACLK400_DISP1 frequency on Exynos542xMarek Szyprowski1-1/+1
ACLK400_DISP1 bus feeds some internal buses of the display subsystem, some of which are also related to TV/Mixer hardware modules. When that bus is set to 120MHz, Exynos Mixer is not able to properly handle two XRGB display planes at FullHD-60MHz. DMA underrun happens, which in turn might result in reading data out of the configured buffer, what causes IOMMU page fault and kernel panic. This change fixes the following IOMMU fault, observed, when 2 Mixer planes were enabled: exynos-sysmmu 14650000.sysmmu: 14450000.mixer: PAGE FAULT occurred at 0x20fe9000 ------------[ cut here ]------------ kernel BUG at ../drivers/iommu/exynos-iommu.c:450! Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM Modules linked in: CPU: 5 PID: 0 Comm: swapper/5 Not tainted 5.0.0-00003-g1b03088168ea #149 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) PC is at exynos_sysmmu_irq+0x1c0/0x264 LR is at lock_is_held_type+0x44/0x64 ... Reported-by: Marian Mihailescu <mihailescu2m@gmail.com> Fixes: 5d99cc59a3c6 ("ARM: dts: exynos: Move Exynos5250 and Exynos5420 nodes under soc") Fixes: b04a62d3ade3 ("ARM: dts: exynos: Add bus nodes using VDD_INT for Exynos542x SoC") Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I3d2f341f5e89d4631401f653d0ad9e36f26f45ad
2019-03-12ASoC: samsung: odroid: Change rfs value to 256Jaechul Lee1-2/+5
rfs is set 256 as a default value in I2S module. Due to clock rate setting rounding errors with rfs=512 playback is almost twice faster than original speed when the device is opened with 44.1k samplerate. pulseaudio that uses 44.1k sinks can't play the sound properly. Change-Id: I21d5553e36dcbf00802230cf1c60f5fb7df1056d Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>