Andrey Kazmin [Thu, 8 Apr 2021 12:37:12 +0000 (15:37 +0300)]
Fixed hwasan build
Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
Seung-Woo Kim [Wed, 3 Mar 2021 13:03:21 +0000 (22:03 +0900)]
packaging: make headers for user tools
The user tools requires uapi headers. Make headers for user tools
in odroid packaging.
Change-Id: I8243b06fe0c0295aa0e3578650c8bf3d446a8027
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Seung-Woo Kim [Tue, 10 Nov 2020 01:20:34 +0000 (10:20 +0900)]
packaging: remove build dependency for u-boot from odroid
The odroid kernel does not have build dependency to u-boot.
Remove the unnecessary build dependency.
Change-Id: I7b88c3dbb54e0a3a4a2f0c7d6fc43bb81ad8f360
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Seung-Woo Kim [Thu, 11 Jun 2020 03:33:17 +0000 (12:33 +0900)]
arm64: configs: tizen_tm2_defconfig: Enable max77843 led driver
Enable max77843 led driver.
Change-Id: Ie8576f9d451ab29412fc0e73e74e62cd82c4c281
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Seung-Woo Kim [Thu, 11 Jun 2020 02:45:40 +0000 (11:45 +0900)]
arm64: dts: exynos5433-tm2-common: add max77843 rgb led node
Add max77843 rgb led node.
Note: pick the rgb led node from below commit of 4.1 kernel of tizen_5.0 branch:
commit
69568faa649c ("LOCAL / arm64: dts: Add Exynos5433-based TM2 board")
Change-Id: Ica77c62c58928a78429e97ce7c2f7d5d949d7bcd
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Seung-Woo Kim [Thu, 11 Jun 2020 02:39:01 +0000 (11:39 +0900)]
leds: add support for MAX77843 led control driver
Maxim max77843 has 4-channel led controller on max77843 multi
function device. Add max77843 led driver for the device.
Note: this ports below commits in 4.1 kernel in tizen_5.0 branch:
commit
dd11bc28be60 ("mfd: max77843: Add led of_compatible in mfd_cell")
commit
ab013630b285 ("leds: add support for MAX77843 led control driver")
Change-Id: I48c778addba06d1070284e4fc6b8e3ca500c089a
Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Roman Gushchin [Fri, 17 Nov 2017 23:26:45 +0000 (15:26 -0800)]
proc, coredump: add CoreDumping flag to /proc/pid/status
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
Seung-Woo Kim [Mon, 25 May 2020 08:21:13 +0000 (17:21 +0900)]
packaging: Add _wrong_version_format_terminate_build macro
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>
Nathan Chancellor [Tue, 11 Jun 2019 17:19:32 +0000 (10:19 -0700)]
arm64: Don't unconditionally add -Wno-psabi to KBUILD_CFLAGS
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
Dave Martin [Thu, 6 Jun 2019 10:33:43 +0000 (11:33 +0100)]
arm64: Silence gcc warnings about arch ABI drift
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
Miguel Ojeda [Thu, 23 May 2019 12:45:35 +0000 (14:45 +0200)]
tracing: Silence GCC 9 array bounds warning
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
Arnd Bergmann [Wed, 28 Mar 2018 22:06:10 +0000 (00:06 +0200)]
ath10k: avoid possible string overflow
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
Linus Torvalds [Wed, 1 May 2019 18:05:41 +0000 (11:05 -0700)]
gcc-9: silence 'address-of-packed-member' warning
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
Miguel Ojeda [Sat, 19 Jan 2019 19:59:34 +0000 (20:59 +0100)]
include/linux/module.h: copy __init/__exit attrs to init/cleanup_module
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
Miguel Ojeda [Fri, 8 Feb 2019 22:51:05 +0000 (23:51 +0100)]
Compiler Attributes: add support for __copy (gcc >= 9)
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
Seung-Woo Kim [Thu, 5 Dec 2019 10:16:13 +0000 (19:16 +0900)]
drm/exynos: add debugfs interface and gem_info node
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>
Seung-Woo Kim [Mon, 4 Nov 2019 09:46:32 +0000 (10:46 +0100)]
media: exynos4-is: fix wrong mdev and v4l2 dev order in error path
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
Seung-Woo Kim [Fri, 18 Oct 2019 10:20:52 +0000 (07:20 -0300)]
media: exynos4-is: Fix recursive locking in isp_video_release()
>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
Seung-Woo Kim [Thu, 31 Oct 2019 02:20:26 +0000 (11:20 +0900)]
clk: samsung: exynos5433: add missing slab.h header
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>
Bartlomiej Zolnierkiewicz [Thu, 26 Apr 2018 11:51:33 +0000 (13:51 +0200)]
thermal: exynos: remove trip reporting to user-space
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
Marek Szyprowski [Wed, 2 Oct 2019 08:53:09 +0000 (10:53 +0200)]
clk: samsung: exynos5433: Fix error paths
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
Arnd Bergmann [Tue, 14 May 2019 22:41:48 +0000 (15:41 -0700)]
ARM: prevent tracing IPI_CPU_BACKTRACE
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
Adrian Szyndela [Fri, 30 Aug 2019 12:56:05 +0000 (14:56 +0200)]
ARM: configs: tizen_odroid_defconfig: enable kdbus
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>
Konrad Lipinski [Wed, 11 Sep 2019 13:42:10 +0000 (15:42 +0200)]
kdbus: test suite changed to common format
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>
Adrian Szyndela [Wed, 11 Sep 2019 13:34:33 +0000 (15:34 +0200)]
kdbus: porting to 4.14
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>
Adrian Szyndela [Fri, 9 Sep 2016 11:35:49 +0000 (13:35 +0200)]
kdbus: the driver, original and non-working
[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>
Marek Szyprowski [Fri, 6 Sep 2019 11:43:57 +0000 (13:43 +0200)]
ARM: exynos: Fix boot with CONFIG_SUSPEND disabled
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
Seung-Woo Kim [Fri, 6 Sep 2019 08:04:23 +0000 (17:04 +0900)]
drm/exynos: fix to build suspend/resume callback functions always
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>
Seung-Woo Kim [Wed, 31 Jul 2019 07:56:06 +0000 (16:56 +0900)]
ARM: configs: tizen_odroid_defconfig: Enable NETFILTER_XT_MATCH_OWNER config
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>
Seung-Woo Kim [Wed, 31 Jul 2019 07:53:58 +0000 (16:53 +0900)]
ARM: configs: tizen_odroid: sync with savedefconfig
After few changes, it is different from savedefconfig, so sync.
Change-Id: I50759332ef3660cf57090d65e78e7fc95d945342
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Seung-Woo Kim [Wed, 31 Jul 2019 07:54:52 +0000 (16:54 +0900)]
arm64: configs: tizen_tm2_defconfig: Enable NETFILTER_XT_MATCH_OWNER config
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>
Pablo Neira Ayuso [Fri, 7 Jun 2019 14:37:30 +0000 (16:37 +0200)]
netfilter: xt_owner: bail out with EINVAL in case of unsupported flags
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
Lukasz Pawelczyk [Fri, 10 May 2019 11:46:22 +0000 (13:46 +0200)]
netfilter: xt_owner: Add supplementary groups option
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
Marek Szyprowski [Wed, 15 May 2019 10:58:27 +0000 (12:58 +0200)]
ARM: defconfig: enable I-Cache line size workaround on Exynos systems
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
Marek Szyprowski [Wed, 15 May 2019 07:53:55 +0000 (09:53 +0200)]
ARM: Add workaround for I-Cache line size mismatch between CPU cores
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
Dongwoo Lee [Tue, 17 Oct 2017 23:21:05 +0000 (08:21 +0900)]
gpu: drm: exynos: Add extcon notification for hdmi connection
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
Seung-Woo Kim [Fri, 26 Apr 2019 05:05:27 +0000 (14:05 +0900)]
ARM: configs: tizen_odroid: enable squashfs
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>
Seung-Woo Kim [Fri, 26 Apr 2019 05:03:43 +0000 (14:03 +0900)]
arm64: configs: tizen_tm2_defconfig: enable squashfs
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>
Mark Rutland [Mon, 16 Oct 2017 15:28:39 +0000 (16:28 +0100)]
clocksource/drivers/arm_arch_timer: Fix DEFINE_PER_CPU expansion
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
Sylwester Nawrocki [Thu, 28 Mar 2019 11:07:49 +0000 (12:07 +0100)]
soc: samsung: Split ASV drivers into ARM and ARM64 parts
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>
Sylwester Nawrocki [Wed, 27 Mar 2019 11:39:55 +0000 (12:39 +0100)]
arm64: configs: tizen_tm2_defconfig: Enable MTD_EXYNOS_OTP
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>
Sylwester Nawrocki [Wed, 30 Jan 2019 15:55:01 +0000 (16:55 +0100)]
arm64: exynos: Enable ASV driver for ARCH_EXYNOS
Enable ASV driver for Exynos5433 SoC.
Change-Id: I2870b83f909425356be2391ac5e534a773cd8db8
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Wed, 30 Jan 2019 17:16:08 +0000 (18:16 +0100)]
soc: samsung: Add ASV support for Exynos5433 SoC
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>
Sylwester Nawrocki [Fri, 1 Mar 2019 14:19:43 +0000 (15:19 +0100)]
arm64: dts: Add Exynos5433 SoC OTP device node
Change-Id: I8bcd9955c3cff940150bff10da564c3b9f477952
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Wed, 30 Jan 2019 15:53:06 +0000 (16:53 +0100)]
arm64: dts: exynos: Update Exynos5433 CHIPID node
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>
Sylwester Nawrocki [Fri, 1 Mar 2019 14:18:15 +0000 (15:18 +0100)]
mtd: Add exynos OTP memory driver
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>
Sylwester Nawrocki [Wed, 30 Jan 2019 15:24:13 +0000 (16:24 +0100)]
soc: samsung: chipid: Add ABB register region read helper
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>
Sylwester Nawrocki [Mon, 18 Feb 2019 16:37:38 +0000 (17:37 +0100)]
soc: samsung: chipid: Update DT bindings documentation
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>
Sylwester Nawrocki [Wed, 30 Jan 2019 14:57:56 +0000 (15:57 +0100)]
soc: samsung: chipid: Add exynos_chipid_read_bits() function
Add register read helper function needed by the ASV driver.
Change-Id: I90ec78cff58ac7ff424a50309e83d37605e7cbc7
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 1 Mar 2019 15:44:21 +0000 (16:44 +0100)]
clk: samsung: Add CLK_IGNORE_UNUSED for Exynos5433 ABB, ASV_TB clocks
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>
Sylwester Nawrocki [Wed, 30 Jan 2019 17:17:23 +0000 (18:17 +0100)]
soc: samsung: asv: Print error code when adding an OPP fails
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>
Sylwester Nawrocki [Fri, 1 Mar 2019 15:30:16 +0000 (16:30 +0100)]
soc: samsung: asv: Wait until OPP gets released before adding new one
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>
Andrzej Hajda [Tue, 19 Mar 2019 13:05:11 +0000 (14:05 +0100)]
drm/exynos/mixer: fix MIXER shadow registry synchronisation code
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
Andrzej Hajda [Fri, 2 Feb 2018 15:11:22 +0000 (16:11 +0100)]
drm/exynos/mixer: fix synchronization check in interlaced mode
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
Marek Szyprowski [Tue, 19 Mar 2019 12:58:06 +0000 (13:58 +0100)]
ARM: dts: exynos: Increase minimal ACLK400_DISP1 frequency on Exynos542x
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
Jaechul Lee [Thu, 7 Mar 2019 23:42:55 +0000 (08:42 +0900)]
ASoC: samsung: odroid: Change rfs value to 256
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>
Sylwester Nawrocki [Fri, 8 Mar 2019 15:36:38 +0000 (16:36 +0100)]
ASoS: samsung: odroid: Fix clock configuration for 44100 sample rate
After commit
fbeec965b8d1c ("ASoC: samsung: odroid: Fix 32000 sample
rate handling") due to clock rounding error CODEC master clock frequency
is being set to
20070401 Hz instead of
22579000 Hz.
This results in too fast actual sample rate for fs=44100, e.g. 2 kHz tone
has really 3555 Hz frequency (2000 Hz *
20070401/
22579000 * 2).
Fix this by increasing correction passed to clk_set_rate() to take into
account inaccuracy of EPLL frequency properly.
Change-Id: I8d08bec8e70394421c115bde1d511b730885bbe2
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Mon, 4 Mar 2019 16:18:32 +0000 (17:18 +0100)]
ARM: dts: exynos: Fix audio routing on exynos5422-odroidxu3
Add missing audio routing entry for the capture stream, this change
is required to fix audio recording on Odroid XU3.
Change-Id: I8db68ab3e097a0f3cfd07224016e4704e57c6635
Fixes:
885b005d232c ("ARM: dts: exynos: Add support for secondary DAI to Odroid XU3")
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Mon, 4 Mar 2019 16:17:14 +0000 (17:17 +0100)]
ASoC: samsung: i2s: Fix DAPM routes for capture stream
This patch sets missing stream_name of capture part of the DAI driver
so we can define DAPM routing properly also for the capture stream.
Fixes:
64aba9bca5bd ("ASoC: samsung: i2s: Add widgets and routes for DPCM support")
Change-Id: I7ac244afcd74d92cf92da1d9d7d9606285ea0360
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Tue, 12 Feb 2019 18:03:42 +0000 (19:03 +0100)]
ARM: dts: exynos: Add support for secondary DAI to Odroid XU4
This patch extends DAPM routing and adds secondary CPU DAI entry
to support the secondary audio PCM interface on Odroid XU4.
Change-Id: Id20d2a064f5d29c4edf349e9a968864a48a11b46
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Sylwester Nawrocki [Tue, 12 Feb 2019 18:03:41 +0000 (19:03 +0100)]
ARM: dts: exynos: Add support for secondary DAI to Odroid XU3
This patch extends DAPM routing and adds secondary CPU DAI entry
to support the secondary audio PCM interface on Odroid XU3.
Change-Id: I2efb8eca9418554482194a2c54aa6b6ca674d5c2
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Marek Szyprowski [Wed, 27 Feb 2019 10:47:39 +0000 (11:47 +0100)]
LOCAL: ASoC: temporary workaround for i2s/prepare_lock deadlock
This reverts commit
00ffa8a3b1a60a89ab0ef5ae1d8e41269c30a3bd.
Change-Id: I396b1250a748fdb8219abf6d0bf71c5fab119658
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Sylwester Nawrocki [Thu, 14 Feb 2019 15:45:55 +0000 (16:45 +0100)]
ASoC: dmaengine: Remove unused SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag
There is now no users of this flag so remove it together with
related code. The chan_name field of snd_dmaengine_dai_dma_data
data structure is not removed as it is still in use by the PXA
platform.
Change-Id: Ia8bb6022ce7c5e85abb7c5410459130666785f45
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 21 Feb 2019 09:42:28 +0000 (10:42 +0100)]
ASoC: samsung: odroid: Prevent uninitialized variable use
This addresses an issue pointed out by compiler warning:
sound/soc/samsung/odroid.c: In function ‘odroid_audio_probe’:
sound/soc/samsung/odroid.c:298:22: warning: ‘cpu_dai’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
priv->clk_i2s_bus = of_clk_get_by_name(cpu_dai, "iis");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: I39c6dd0a1aa5ec68bfc17c895988c21a1a34733e
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Wed, 20 Feb 2019 11:06:07 +0000 (12:06 +0100)]
ASoC: samsung: odroid: Fix of_node refcount unbalance
In odroid_audio_probe() some OF nodes are left without reference count
decrease after use. Fix it by ensuring required of_node_calls() are done
before exiting probe.
Change-Id: Ifbcb6294331acc59028e675d8ab1143394508d66
Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Tue, 19 Feb 2019 15:19:41 +0000 (16:19 +0100)]
ASoC: samsung: i2s: Fix multiple "IIS multi" devices initialization
On some SoCs (e.g. Exynos5433) there are multiple "IIS multi audio
interfaces" and the driver will try to register there multiple times
same platform device for the secondary FIFO, which of course fails
miserably. To fix this we derive the secondary platform device name
from the primary device name. The secondary device name will now
be <primary_dev_name>-sec instead of fixed "samsung-i2s-sec".
The fixed platform_device_id table entry is removed as the secondary
device name is now dynamic and device/driver matching is done through
driver_override.
Change-Id: I49ed3e20279af198cdce11c08cc11bd6536dddad
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Tue, 19 Feb 2019 15:19:40 +0000 (16:19 +0100)]
ASoC: samsung: i2s: Fix secondary platform device unregistration
This fixes unregistration of the secondary platform device so all
resources are properly released. Additionally the removal sequence
is corrected so it is in reverse order comparing to probe sequence.
The test against NULL priv->pdev_sec is removed as it is not necessary.
Change-Id: If325e11b4109fbc61fbb2df3ac012f2c1e9f0cb5
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Fri, 15 Feb 2019 12:04:22 +0000 (13:04 +0100)]
ASoC: samsung: odroid: Add missing DAPM routes
With old DTS there will be missing DAPM routes linking BE with CODECs.
Add those routes in the card driver so sound works properly on Odroid
XU3/4 also without DTS updates enabling the secondary PCM.
Change-Id: I0a2a8e59859cdaf46da0563e30278dc9a8fe2376
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 16:00:11 +0000 (17:00 +0100)]
ASoC: samsung: odroid: Ensure proper sample rate on pri/sec PCM
Currently when playing sound with different sample rates actual
sample rate will be determined by audio stream which starts first
on either primary or secondary PCM. The audio root clock will be
configured appropriately only for the first stream. As the hardware
is limited to same sample rate on both interfaces we need to disallow
streams with different sample rates. It is done by this patch by
returning error in FE hw_params if there is already active stream
running with different sample rate.
Change-Id: I643d02d38acf20a7711ba5930e6bceceeaafc087
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 15:58:40 +0000 (16:58 +0100)]
ASoC: samsung: i2s: Prevent potential NULL platform data dereference
When np is NULL i2s_pdata could also be NULL but i2s_pdata is now being
dereferenced without proper check. Fix this and shorten the error message
so we don't exceed 80 characters limit.
Change-Id: I5d5b14ff953d4a2617500f50e81eb459d56a6e4f
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 09:37:47 +0000 (10:37 +0100)]
ASoC: samsung: i2s: Convert to SPDX License Indentifier
Replace GPL v2.0 license statements with SPDX license identifier.
Change-Id: Iaf0ae489d7d55dc949ba70e956afe3642cdfaeb4
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 09:37:46 +0000 (10:37 +0100)]
ASoC: samsung: i2s: Comments clean up
Spelling error fixes, upper/lower case letter changes.
Change-Id: Id1060cbb859c6da4480a0dd6f676a6614b64da8c
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Gustavo A. R. Silva [Fri, 3 Aug 2018 16:33:57 +0000 (11:33 -0500)]
ASoC: samsung: i2s: Mark expected switch fall-through
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Change-Id: I030b163708ab40f17cf500cff7a8f326b890b7f5
Addresses-Coverity-ID: 1381093 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 09:37:45 +0000 (10:37 +0100)]
ASoC: samsung: i2s: Change indentation in SAMSUNG_I2S_FMTS definition
Change indentation so this macro definition spans 2 rows and looks
more consistent with surrounding code.
Change-Id: I747acdce454a660c637d29ab34450081e02084d2
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 09:37:44 +0000 (10:37 +0100)]
ASoC: samsung: i2s: Simplify pri_dai, sec_dai pointers usage
If the probe call is on the primary DAI we can use 'other' in place of
i2s->sec_dai, if the probe call is on the secondary DAI we can use 'i2s'
in place of other->sec_dai.
While at it fix one whitespace issue.
Change-Id: Idbe9190d87f628f4d8fab77dbdbe433c8cd7825d
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 09:37:41 +0000 (10:37 +0100)]
ASoC: samsung: Specify DMA channel names through custom DMA config
This is a part of conversion of Samsung platforms to use the custom DMA
config for specifying DMA channel names, in addition to passing custom
DMA device for the secondary CPU DAI's "PCM" component for some variants
of the I2S controller.
We also don't set the SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME any more
as setting it wouldn't allow to specify DMA channels through the custom
DMA config.
Change-Id: Ia7e4da88746788c6fd56e1781160328bdaa224b8
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 09:37:39 +0000 (10:37 +0100)]
ASoC: samsung: i2s: Get rid of a static spinlock
This patch makes the spinlock serializing access to the primary/secondary
PCM a per I2S controller lock, rather than a global one. There is no need
to have a global lock across multiple I2S controllers in the SoC.
Change-Id: I6b56296ce45e219ed5f37af85fd352ff51af617a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 09:37:40 +0000 (10:37 +0100)]
ASoC: samsung: odroid: Add support for secondary CPU DAI
This patch adds DPCM links in order to support the secondary I2S interface.
For the secondary PCM interface to be actually available one more entry
should be added to the sound-dai property in sound/cpu node in DT.
The changes in driver are done in a way so we are backwards compatible
with existing DTS/DTB, i.e. if the cpu sound-dai property contains only
one entry only one PCM will be registered.
Change-Id: I7bc789cf1d025b168fd3411f24f4015016025bb2
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 09:37:38 +0000 (10:37 +0100)]
ASoC: samsung: i2s: Move quirks data to common driver data structure
The quirk flags are common for the primary and the secondary DAI
so move respective field from struct i2s_dai to common driver data
structure.
Change-Id: I27506c48b3faa8c344535c6749b534c6c11901e7
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 09:37:37 +0000 (10:37 +0100)]
ASoC: samsung: i2s: Move IP variant data to common driver data structure
The IP variant data is another thing common for both DAIs, move it
to the driver's common data structure.
Change-Id: Id83d14a38d6c5d0d4d25dfd0ca8332e88315d271
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 09:37:36 +0000 (10:37 +0100)]
ASoC: samsung: i2s: Drop spinlock pointer from i2s_dai data structure
As we now have the 'priv' pointer in most of the places we can use
priv->lock directly, dropping extra indirection in the SFR region
spinlock access.
Change-Id: Ic137ee120aa1871a9d2142eaee9f9292e2c0f25f
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 14 Feb 2019 09:37:35 +0000 (10:37 +0100)]
ASoC: samsung: i2s: Move SFR pointer to common driver data structure
The SFR region is common for both DAIs so move related data structure
field from struct i2s_dai to the common driver data structure.
Change-Id: I2080a75f0a49f431ee37fa4488ed13ae8fd26b12
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Tue, 12 Feb 2019 18:03:27 +0000 (19:03 +0100)]
ASoC: samsung: i2s: Move registers cache to common driver data structure
There is no need to keep the PM suspend/resume register cache separate
for each DAI as those registers are common, move related i2s_dai data
structure to the driver's common data structure. This will allow us
to simplify the code a little eventually and to make it easier to follow.
Change-Id: I91919c337611dc69983d2ee346e988f2e93d0695
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Tue, 12 Feb 2019 18:03:26 +0000 (19:03 +0100)]
ASoC: samsung: i2s: Move opclk data to common driver data structure
The clock for generating I2S signals is also common for both CPU DAIs
so move it to the driver's common data structure.
Change-Id: Ia8320f1e9ab0c02d113bb73002cd4ae98caec7e8
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Tue, 12 Feb 2019 18:03:25 +0000 (19:03 +0100)]
ASoC: samsung: i2s: Move core clk to the driver common data structure
The core clock is also common for both CPU DAIs so move it to
the driver's private data structure.
Change-Id: Ib6f2975bd34a8cfba20faaa9e51be88b6a41bc30
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Tue, 12 Feb 2019 18:03:24 +0000 (19:03 +0100)]
ASoC: samsung: i2s: Add widgets and routes for DPCM support
This patch adds DAPM widgets required to model the internal mixer
of the I2S controller merging audio streams from the primary and
from the secondary PCM interface.
Change-Id: I3cb7b1b17f0c6891f6edb638db97ca6a482cec4b
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Tue, 12 Feb 2019 18:03:23 +0000 (19:03 +0100)]
ASoC: samsung: i2s: Move clk supplier data to common driver data structure
Having the clocks provider data in struct samsung_i2s_priv, i.e. per the I2S
controller instance, rather than per CPU DAI better models the hardware and
simplifies the code a little. The clock provider is common for both DAIs.
Change-Id: I76db45001d8303263405b2cc40526e4101f35d16
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Tue, 12 Feb 2019 18:03:22 +0000 (19:03 +0100)]
ASoC: samsung: i2s: Restore support for the secondary PCM
This patch introduces again registration of additional platform device as
we still need it for registering the secondary dmaengine PCM component.
This patch in most part is a revert of changes done in commit
be2c92eb64023e ("ASoC: samsung: i2s: Remove virtual device for secondary DAI")
Change-Id: Ib7a47c83511403b32e04c41edf8148d77481abb3
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 7 Feb 2019 17:00:13 +0000 (18:00 +0100)]
ASoC: samsung: i2s: Convert to single component with multiple DAIs
This patch includes minimal changes as a prerequisite for adding support
for the Exynos secondary I2S interface as second DAI of the I2S component.
Doing it that way allows to avoid problems as indicated in commmit
6b01e0365b1689 ("ASoC: samsung: i2s: disable secondary DAI until it gets fixed")
The samsung_i2s_get_pri_dai() helper added in this patch is temporary and
will be removed in one of subsequent patches.
Change-Id: I5cb8ff7cb13a144bc6944752081b93a847080f94
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 7 Feb 2019 17:00:11 +0000 (18:00 +0100)]
ASoC: samsung: dmaengine: Allow to specify custom DMA device
The additional function argument will allow to select proper DMA device
for requesting DMA channel for the secondary CPU DAI.
Change-Id: I3848594e393bcf55770020857ee5f2d0271b779b
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 7 Feb 2019 17:00:10 +0000 (18:00 +0100)]
ASoC: dmaengine: Extend use of chan_names provided in custom DMA config
There are currently two ways to specify custom DMA channel names:
- through the SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag and
snd_dmaengine_dai_dma_data data structure,
- through chan_names field of struct snd_dmaengine_pcm_config.
In order to replace the DAI DMA data method with the custom DMA config
one on non-DT platforms the dmaengine_pcm_new() function is extended
to also consider channel names specified in the custom DMA config.
If both config->chan_names and dma_data->chan_name are provided
the former will be used.
Change-Id: I6a325754971c7d4daf3141f3cfeede9280d9941c
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 7 Feb 2019 17:00:09 +0000 (18:00 +0100)]
ASoC: dmaengine: Improve of_node test in dmaengine_pcm_request_chan_of()
Currently when of_node of the "PCM" device is null
dmaengine_pcm_request_chan_of() function will bail out, including cases
when custom DMA device is intended to be used. To have the channels
properly requested when custom DMA device is provided extend the of_node
test to also consider dma_dev->of_node.
Change-Id: Icac9da759fdefa367492f5d0ad0ff031a7b0bb62
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 7 Feb 2019 17:00:12 +0000 (18:00 +0100)]
ASoC: samsung: i2s: Fix prescaler setting for the secondary DAI
Make sure i2s->rclk_srcrate is properly initialized also during
playback through the secondary DAI.
Change-Id: Ic27fe0b834379a95485668137eee1e7d22d93952
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Thu, 7 Feb 2019 14:20:41 +0000 (15:20 +0100)]
ASoC: samsung: Prevent clk_get_rate() calls in atomic context
This patch moves clk_get_rate() call from trigger() to hw_params()
callback to avoid calling sleeping clk API from atomic context
and prevent deadlock as indicated below.
Before this change clk_get_rate() was being called with same
spinlock held as the one passed to the clk API when registering
clocks exposed by the I2S driver.
[ 82.109780] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:908
[ 82.117009] in_atomic(): 1, irqs_disabled(): 128, pid: 1554, name: speaker-test
[ 82.124235] 3 locks held by speaker-test/1554:
[ 82.128653] #0:
cc8c5328 (snd_pcm_link_rwlock){...-}, at: snd_pcm_stream_lock_irq+0x20/0x38
[ 82.137058] #1:
ec9eda17 (&(&substream->self_group.lock)->rlock){..-.}, at: snd_pcm_ioctl+0x900/0x1268
[ 82.146417] #2:
6ac279bf (&(&pri_dai->spinlock)->rlock){..-.}, at: i2s_trigger+0x64/0x6d4
[ 82.154650] irq event stamp: 8144
[ 82.157949] hardirqs last enabled at (8143): [<
c0a0f574>] _raw_read_unlock_irq+0x24/0x5c
[ 82.166089] hardirqs last disabled at (8144): [<
c0a0f6a8>] _raw_read_lock_irq+0x18/0x58
[ 82.174063] softirqs last enabled at (8004): [<
c01024e4>] __do_softirq+0x3a4/0x66c
[ 82.181688] softirqs last disabled at (7997): [<
c012d730>] irq_exit+0x140/0x168
[ 82.188964] Preemption disabled at:
[ 82.188967] [<
00000000>] (null)
[ 82.195728] CPU: 6 PID: 1554 Comm: speaker-test Not tainted 5.0.0-rc5-00192-ga6e6caca8f03 #191
[ 82.204302] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[ 82.210376] [<
c0111a54>] (unwind_backtrace) from [<
c010d8f4>] (show_stack+0x10/0x14)
[ 82.218084] [<
c010d8f4>] (show_stack) from [<
c09ef004>] (dump_stack+0x90/0xc8)
[ 82.225278] [<
c09ef004>] (dump_stack) from [<
c0152980>] (___might_sleep+0x22c/0x2c8)
[ 82.232990] [<
c0152980>] (___might_sleep) from [<
c0a0a2e4>] (__mutex_lock+0x28/0xa3c)
[ 82.240788] [<
c0a0a2e4>] (__mutex_lock) from [<
c0a0ad80>] (mutex_lock_nested+0x1c/0x24)
[ 82.248763] [<
c0a0ad80>] (mutex_lock_nested) from [<
c04923dc>] (clk_prepare_lock+0x78/0xec)
[ 82.257079] [<
c04923dc>] (clk_prepare_lock) from [<
c049538c>] (clk_core_get_rate+0xc/0x5c)
[ 82.265309] [<
c049538c>] (clk_core_get_rate) from [<
c0766b18>] (i2s_trigger+0x490/0x6d4)
[ 82.273369] [<
c0766b18>] (i2s_trigger) from [<
c074fec4>] (soc_pcm_trigger+0x100/0x140)
[ 82.281254] [<
c074fec4>] (soc_pcm_trigger) from [<
c07378a0>] (snd_pcm_do_start+0x2c/0x30)
[ 82.289400] [<
c07378a0>] (snd_pcm_do_start) from [<
c07376cc>] (snd_pcm_action_single+0x38/0x78)
[ 82.298065] [<
c07376cc>] (snd_pcm_action_single) from [<
c073a450>] (snd_pcm_ioctl+0x910/0x1268)
[ 82.306734] [<
c073a450>] (snd_pcm_ioctl) from [<
c0292344>] (do_vfs_ioctl+0x90/0x9ec)
[ 82.314443] [<
c0292344>] (do_vfs_ioctl) from [<
c0292cd4>] (ksys_ioctl+0x34/0x60)
[ 82.321808] [<
c0292cd4>] (ksys_ioctl) from [<
c0101000>] (ret_fast_syscall+0x0/0x28)
[ 82.329431] Exception stack(0xeb875fa8 to 0xeb875ff0)
[ 82.334459] 5fa0:
00033c18 b6e31000 00000004 00004142 00033d80 00033d80
[ 82.342605] 5fc0:
00033c18 b6e31000 00008000 00000036 00008000 00000000 beea38a8 00008000
[ 82.350748] 5fe0:
b6e3142c beea384c b6da9a30 b6c9212c
[ 82.355789]
[ 82.357245] ======================================================
[ 82.363397] WARNING: possible circular locking dependency detected
[ 82.369551] 5.0.0-rc5-00192-ga6e6caca8f03 #191 Tainted: G W
[ 82.376395] ------------------------------------------------------
[ 82.382548] speaker-test/1554 is trying to acquire lock:
[ 82.387834]
6d2007f4 (prepare_lock){+.+.}, at: clk_prepare_lock+0x78/0xec
[ 82.394593]
[ 82.394593] but task is already holding lock:
[ 82.400398]
6ac279bf (&(&pri_dai->spinlock)->rlock){..-.}, at: i2s_trigger+0x64/0x6d4
[ 82.408197]
[ 82.408197] which lock already depends on the new lock.
[ 82.416343]
[ 82.416343] the existing dependency chain (in reverse order) is:
[ 82.423795]
[ 82.423795] -> #1 (&(&pri_dai->spinlock)->rlock){..-.}:
[ 82.430472] clk_mux_set_parent+0x34/0xb8
[ 82.434975] clk_core_set_parent_nolock+0x1c4/0x52c
[ 82.440347] clk_set_parent+0x38/0x6c
[ 82.444509] of_clk_set_defaults+0xc8/0x308
[ 82.449186] of_clk_add_provider+0x84/0xd0
[ 82.453779] samsung_i2s_probe+0x408/0x5f8
[ 82.458376] platform_drv_probe+0x48/0x98
[ 82.462879] really_probe+0x224/0x3f4
[ 82.467037] driver_probe_device+0x70/0x1c4
[ 82.471716] bus_for_each_drv+0x44/0x8c
[ 82.476049] __device_attach+0xa0/0x138
[ 82.480382] bus_probe_device+0x88/0x90
[ 82.484715] deferred_probe_work_func+0x6c/0xbc
[ 82.489741] process_one_work+0x200/0x740
[ 82.494246] worker_thread+0x2c/0x4c8
[ 82.498408] kthread+0x128/0x164
[ 82.502131] ret_from_fork+0x14/0x20
[ 82.506204] (null)
[ 82.508976]
[ 82.508976] -> #0 (prepare_lock){+.+.}:
[ 82.514264] __mutex_lock+0x60/0xa3c
[ 82.518336] mutex_lock_nested+0x1c/0x24
[ 82.522756] clk_prepare_lock+0x78/0xec
[ 82.527088] clk_core_get_rate+0xc/0x5c
[ 82.531421] i2s_trigger+0x490/0x6d4
[ 82.535494] soc_pcm_trigger+0x100/0x140
[ 82.539913] snd_pcm_do_start+0x2c/0x30
[ 82.544246] snd_pcm_action_single+0x38/0x78
[ 82.549012] snd_pcm_ioctl+0x910/0x1268
[ 82.553345] do_vfs_ioctl+0x90/0x9ec
[ 82.557417] ksys_ioctl+0x34/0x60
[ 82.561229] ret_fast_syscall+0x0/0x28
[ 82.565477] 0xbeea384c
[ 82.568421]
[ 82.568421] other info that might help us debug this:
[ 82.568421]
[ 82.576394] Possible unsafe locking scenario:
[ 82.576394]
[ 82.582285] CPU0 CPU1
[ 82.586792] ---- ----
[ 82.591297] lock(&(&pri_dai->spinlock)->rlock);
[ 82.595977] lock(prepare_lock);
[ 82.601782] lock(&(&pri_dai->spinlock)->rlock);
[ 82.608975] lock(prepare_lock);
[ 82.612268]
[ 82.612268] *** DEADLOCK ***
Fixes:
647d04f8e07a ("ASoC: samsung: i2s: Ensure the RCLK rate is properly determined")
Change-Id: I1b8100d4e65a1d9964aa92d2ac56965a01359791
Reported-by: Krzysztof Kozłowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Sylwester Nawrocki [Wed, 27 Feb 2019 09:54:37 +0000 (10:54 +0100)]
ASoC: Revert "LOCAL / temporary workaround for i2s/prepare_lock deadlock"
This reverts commit
a146d53312cc7151d7aa5d517b808d2d1fdfd6c1.
Revert temporarily in order to apply patches from the mainline
cleanly.
Change-Id: I2cce77968974c36d8ccbe4b2df75b77113e6d5bf
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tetsuo Handa [Thu, 10 Jan 2019 10:19:31 +0000 (19:19 +0900)]
gpu/drm: Fix lock held when returning to user space.
We need to call drm_modeset_acquire_fini() when drm_atomic_state_alloc()
failed or call drm_modeset_acquire_init() after drm_atomic_state_alloc()
succeeded.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: syzbot <syzbot+6ea337c427f5083ebdf2@syzkaller.appspotmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1547115571-21219-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp
[hoegeun.kwon: this patch from the mainline
4089e272ac61 and it has been
modified to be able to backport linux-v4.14.]
Change-Id: Iaa0d6e104054abc11181c43bdb6283a8bd30eb19
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Sylwester Nawrocki [Wed, 27 Feb 2019 13:50:08 +0000 (14:50 +0100)]
ARM: configs: tizen_odroid: Increase CMA size to 256 MB
This change is required for video decoding through gst-omx plugin.
Change-Id: I1b13280bb94bb0314c7f5c7bd1d8a4f77d829a36
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Christoph Manszewski [Fri, 15 Feb 2019 14:50:00 +0000 (15:50 +0100)]
base/firmware retry firmware load after rootfs mount
Return -EPROBE_DEFER for request_firmware() until root filesystem is
mounted. In case of request_firmware_nowait() create a list of deferred
firmware load requests, and retry firmware load after root filesytem is
mounted.
This allows to have wifi drivers build into the kernel, but
the firmware files shipped on the root filesystem.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Christoph Manszewski <c.manszewski@samsung.com>
Change-Id: I40c0a2a98ca9b1a95fb743a848d2366250cae839
Christoph Manszewski [Fri, 15 Feb 2019 14:35:26 +0000 (15:35 +0100)]
Revert "[LOCAL] base/firmware: return -EPROBE_DEFER until rootfs is available"
This reverts commit
1733ede82e9e964a3d5234ef61979ca523e7ba5a.
Signed-off-by: Christoph Manszewski <c.manszewski@samsung.com>
Change-Id: I30441cbd9b4933cab7e1cb6e80d767e4fca65f41
Marek Szyprowski [Fri, 22 Feb 2019 15:16:31 +0000 (16:16 +0100)]
ARM: dts: Disable UHS-I modes for SD card on Odroid XU3/XU4/HC1
Ultra High Speed DDR50+ modes doesn't work stable on the tested Odroid XU3
and XU4 boards, so disable them until the proper solution is developed.
This is equal to the revert of the following commits:
"ARM: dts: exynos: Update maximum frequency for SD card to 200MHz on Odroid XU3/XU4/HC1"
"ARM: dts: exynos: Add UHS-I bus speed support to Odroid XU3/XU4/HC1"
This reverts commit
6d92b6cece561306a707e40a264b802b51d4264c.
This reverts commit
f3e8e10898d0efee73ad0108dec9f3a0947da752.
Tested-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I210c64cb5d34597132341caa6b98a01fa6a8397c