(commit ef8c4ed9db upstream)
When using a GCC cross toolchain which is not in a compiled in
Clang search path, Clang reverts to the system assembler and
linker. This leads to assembler or linker errors, depending on
which tool is first used for a given architecture.
It seems that Clang is not searching $PATH for a matching
assembler or linker.
Make sure that Clang picks up the correct assembler or linker by
passing the cross compilers bin directory as search path.
This allows to use Clang provided by distributions with GCC
toolchains not in /usr/bin.
Link: https://github.com/ClangBuiltLinux/linux/issues/78
Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-and-tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[ND: adjusted to context, due to adjusting the context of my previous
backport of upstream's ae6b289a37]
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(commit ae6b289a37 upstream)
Set the clang KBUILD_CFLAGS up before including arch/ Makefiles,
so that ld-options (etc.) can work correctly.
This fixes errors with clang such as ld-options trying to CC
against your host architecture, but LD trying to link against
your target architecture.
Signed-off-by: Chris Fries <cfries@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[ND: adjusted context due to upstream having removed code above where I
placed this block in this backport]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 8c97023cf0 upstream.
Commit 971a69db7d ("Xen: don't warn about 2-byte wchar_t in efi")
added the --no-wchar-size-warning to the Makefile to avoid this
harmless warning:
arm-linux-gnueabi-ld: warning: drivers/xen/efi.o uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
Changing kbuild to use thin archives instead of recursive linking
unfortunately brings the same warning back during the final link.
The kernel does not use wchar_t string literals at this point, and
xen does not use wchar_t at all (only efi_char16_t), so the flag
has no effect, but as pointed out by Jan Beulich, adding a wchar_t
string literal would be bad here.
Since wchar_t is always defined as u16, independent of the toolchain
default, always passing -fshort-wchar is correct and lets us
remove the Xen specific hack along with fixing the warning.
Link: https://patchwork.kernel.org/patch/9275217/
Fixes: 971a69db7d ("Xen: don't warn about 2-byte wchar_t in efi")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add configuration option CONFIG_CC_WERROR to prevent warnings
from creeping in.
Signed-off-by: Chris Fries <cfries@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Change-Id: I323b5c3ddee31278da0e6d18b278a2c1327ebd04
commit 6f303d6053 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>
Starting with gcc-8.1, we get a warning about all system call definitions,
which use an alias between functions with incompatible prototypes, e.g.:
In file included from ../mm/process_vm_access.c:19:
../include/linux/syscalls.h:211:18: warning: 'sys_process_vm_readv' alias between functions of incompatible types 'long int(pid_t, const struct iovec *, long unsigned int, const struct iovec *, long unsigned int, long unsigned int)' {aka 'long int(int, const struct iovec *, long unsigned int, const struct iovec *, long unsigned int, long unsigned int)'} and 'long int(long int, long int, long int, long int, long int, long int)' [-Wattribute-alias]
asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
^~~
../include/linux/syscalls.h:207:2: note: in expansion of macro '__SYSCALL_DEFINEx'
__SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
^~~~~~~~~~~~~~~~~
../include/linux/syscalls.h:201:36: note: in expansion of macro 'SYSCALL_DEFINEx'
#define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
^~~~~~~~~~~~~~~
../mm/process_vm_access.c:300:1: note: in expansion of macro 'SYSCALL_DEFINE6'
SYSCALL_DEFINE6(process_vm_readv, pid_t, pid, const struct iovec __user *, lvec,
^~~~~~~~~~~~~~~
../include/linux/syscalls.h:215:18: note: aliased declaration here
asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
^~~
../include/linux/syscalls.h:207:2: note: in expansion of macro '__SYSCALL_DEFINEx'
__SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
^~~~~~~~~~~~~~~~~
../include/linux/syscalls.h:201:36: note: in expansion of macro 'SYSCALL_DEFINEx'
#define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
^~~~~~~~~~~~~~~
../mm/process_vm_access.c:300:1: note: in expansion of macro 'SYSCALL_DEFINE6'
SYSCALL_DEFINE6(process_vm_readv, pid_t, pid, const struct iovec __user *, lvec,
This is really noisy and does not indicate a real problem. In the latest
mainline kernel, this was addressed by commit bee2003177 ("disable
-Wattribute-alias warning for SYSCALL_DEFINEx()"), which seems too invasive
to backport.
This takes a much simpler approach and just disables the warning across the
kernel.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
PD#OTT-10492
Problem:
function of aml_vecm_init Initialization bug.
Solution:
Add support for G12B chips
Verify:
on W400
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
Change-Id: I8398676a99d0957daf1fbc4fbb207d1c39e2e320
PD#SWPL-58839
Problem:
Pdm mic level is low. The noise level gets worse
when add software gain.
Solution:
1) remove software gain
2) add kcontrol of pdm hw gain, this gain range is 0-24dB.
0.5dB/step.
3) if user uses pdm mic of loopback,
add "mic-src = <&pdm>;" in dts.
Verify:
u202
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
Change-Id: Ifd0f9dfd6d2077b323f3d54f98bb648c725ddb91
PD#SWPL-44152
Problem:
Pdm mic level is low. The noise level gets worse
when add software gain.
Solution:
1) remove software gain
2) add kcontrol of pdm hw gain, this gain range is 0-24dB.
0.5dB/step.
3) if user uses pdm mic of loopback,
add "mic-src = <&pdm>;" in dts.
Verify:
T5
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
Change-Id: Icd0915cc63f5dd302979e741354baf62d04d6daa
PD#SWPL-37734
Problem:
crash in fs if put page reference count
Solution:
1, remove modify of put page;
2, revert following changes introduced by google:
commit 60cc09a9e3
Author: Adrien Schildknecht <adriens@google.com>
Date: Thu Sep 29 15:25:30 2016 -0700
ANDROID: Squashfs: optimize reading uncompressed data
When dealing with uncompressed data, there is no need to read a whole
block (default 128K) to get the desired page: the pages are
independent from each others.
This patch change the readpages logic so that reading uncompressed
data only read the number of pages advised by the readahead algorithm.
Moreover, if the page actor contains holes (i.e. pages that are already
up-to-date), squashfs skips the buffer_head associated to those pages.
This patch greatly improve the performance of random reads for
uncompressed files because squashfs only read what is needed. It also
reduces the number of unnecessary reads.
Change-Id: I90a77343bb994a1de7482eb43eaf6d2021502c22
Signed-off-by: Adrien Schildknecht <adriens@google.com>
---------------------------------------------------
commit d840c1d772
Author: Adrien Schildknecht <adrien+dev@schischi.me>
Date: Fri Oct 14 21:03:54 2016 -0700
ANDROID: Squashfs: implement .readpages()
Squashfs does not implement .readpages(), so the kernel just repeatedly
calls .readpage().
The readpages function tries to pack as much pages as possible in the
same page actor so that only 1 read request is issued.
Now that the read requests are asynchronous, the kernel can truly
prefetch pages using its readahead algorithm.
Change-Id: I65b9aa2ddc9444aaf9ccf60781172ccca0f3f518
Signed-off-by: Adrien Schildknecht <adriens@google.com>
---------------------------------------------------
ANDROID: Squashfs: replace buffer_head with BIO
The 'll_rw_block' has been deprecated and BIO is now the basic container
for block I/O within the kernel.
Switching to BIO offers 2 advantages:
1/ It removes synchronous wait for the up-to-date buffers: SquashFS
now deals with decompressions/copies asynchronously.
Implementing an asynchronous mechanism to read data is needed to
efficiently implement .readpages().
2/ Prior to this patch, merging the read requests entirely depends on
the IO scheduler. SquashFS has more information than the IO
scheduler about what could be merged. Moreover, merging the reads
at the FS level means that we rely less on the IO scheduler.
Change-Id: I668812cc1e78e2f92497f9ebe0157cb8eec725ba
Signed-off-by: Adrien Schildknecht <adriens@google.com>
Verify:
t318
Change-Id: I9ea62393066122cd720f41d50bde6cdf925fb06a
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
PD#SWPL-37459
Problem:
[AVA][Askey][AndroidQ][s905x4]console hang after
executing performance mode to 2 boxes.
Solution:
unlock mutex when set rate failed
Verify:
SC2 AH212
Change-Id: Ia097721ebe07e7a2c049921d5f7efddd356ebf58
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
PD#SWPL-37734
Problem:
cma allocation failed when work with squashfs.
Solution:
release page ref# for squashfs to work with CMA
Verify:
t318
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I5d3b8afcc917d83472eeba70f131fd6b8f8f4836
PD#SWPL-22052
Problem:
mclk is not right value on sm1
Solution:
delete mclk_pad flag on dts
Verify:
SM1
Change-Id: I75bae1b41d78c4391d3b385cc615bf0da0bda7cf
Signed-off-by: jian.zhou <jian.zhou@amlogic.com>
PD#SWPL-37010
Problem:
yv12 u & v output error if plane_number is set 1
Solution:
every plane offset is not used
use offset when getting plane paddr
Verify:
w400
Change-Id: I489e9730024659e4aea0dfb0ba2ca33f22d04338
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
PD#SWPL-33136
Problem:
unify power on off macro for powerdomain interface
Solution:
unify the macro
Verify:
t5 & sm1
Change-Id: I7306ae089ec9fd72f7da6d45ab6e8911a1e9c4cf
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
PD#SWPL-32146
Problem:
need add ge2d support for t5
Solution:
add ge2d support
Verify:
on PTM
Change-Id: Iacb6771df7b349530b6f1913fcc51aa6532f837f
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
PD#SWPL-32539
Problem:
on a64_32 platform
green screen if GE2D_STRIDE_CUSTOM is set
Solution:
add member copying in CONFIG_COMPAT
Verify:
c1
Change-Id: I47b3d2bba6eb1825c96416fd593668bb397fde87
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
PD#SH-5853
Problem:
reboot power down cpu timeout
Solution:
power down cpus throug bl31
set PWRN_EN bits
Verify:
S905D3
Signed-off-by: fushan.zeng <fushan.zeng@amlogic.com>
Change-Id: Ib0a9bcf5ef4d0115ba0e83864f6497761050d6f5
PD#SWPL-36752
Problem:
The picture is incorrect due to alignment issues using GDC rotation.
Solution:
When using GDC rotation, the width of the buffer and the width
of the effective area are transmitted to the GDC drive.
Verify:
on A311D-W400
Change-Id: I6fabb794750dbb971fc270a174b48dd24965bc9b
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
PD#SWPL-27018
Problem:
The mismatch between the width and height of the buffer
and canvas results in garbage.
Solution:
Configure buffer and canvas according to rotation requirements.
Verify:
on U212
Change-Id: Ied08838ad4d4fc7628be55cd2de58f91562030c0
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
PD#SWPL-26142
Problem:
vdin is compressed in 1080 & 4k output, but ppmgr does
not support compressed format.
Solution:
If rotation is required, ppmgr informs vdin to output yuv.
Verify:
ab301
Change-Id: Ifebda530dad1c1a57a0415389543d48a8d4fbef2
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
PD#SWPL-18297
Problem:
The picture shows abnormality after ppmgr.
Solution:
The picture format is not rotated.
Verify:
on U212
Change-Id: I259554c2f7cb3a5eeb4e90c1c3e135d5005a6f01
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
PD#SWPL-36752
Problem:
Support the stride in physical address configuration
Solution:
add this support
Verify:
verified on g12b
Change-Id: Ic85384af6b67687e9f437319f6bc397c6e39a0cc
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
PD#SWPL-31258
Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel
Solution:
1, replace __FILE__ definition, using relative path instead of
absolute path. This can help to save about 50KB memory. For example:
[ 36.820945@0] WARNING: CPU: 0 PID: 4817 at /mnt/fileroot/tao.zeng/p-android/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
common/drivers/amlogic/memory_ext/page_trace.c:973
~~~~~~ absolute path
pagetrace_write+0x10/0x18
[ 42.792868@1] WARNING: CPU: 1 PID: 4864 at drivers/amlogic/
memory_ext/page_trace.c:973 pagetrace_write+0x10/0x18
2, replace __FUNC__ definition. using kallsyms interface to print function
instead of build in const string. This change can save about 100KB rodata.
Verify:
x301
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I65e4e9eb61a2226002557759833e4e16ed37b92e
PD#SWPL-31258
Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel
Solution:
1, optimize kallsyms compress code. This can help to increase
about 18% of compress ratio and save about 200 ~ 500KB under
different config.
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I4c058fbb22d89bc50c81fa3266ee0f7613f076f2
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
PD#SWPL-5301
Problem:
Sometimes we need to catch who allcated/free cma pools
Solution:
Add more functions in pagetrace
Verify:
x301
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I06c114441fc20c8fbde853be9ecb0fc96fd00111
PD#SWPL-16990
Problem:
Lost RAM will be over 200MB when playing 4K.
Solution:
Add cma pages in /proc/meminfo and give a information
for android layer to count them.
Verify:
x301
Change-Id: I99d1ded53ed351a5cb0d24f0e03850a55ef0d272
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
PD#SWPL-31258
Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel
Solution:
1, remove CONFIG_KALLSYMS_ALL in module.c, which can help to save
about 200KB module memory during runtime compared from /proc/pagetrce:
3068, c020edd8, module_alloc -- before
2776, c020edd8, module_alloc -- after
Verify:
x301
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I15acee0df76f74a04c10d8f290d10fc35d51a283
PD#SWPL-31258
Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel
Solution:
1, remove CONFIG_KALLSYMS_ALL in scripts, which can help to save
about 1MB ro data in code size.
Verify:
x301
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: Ie0387da46c6b789cb4f8c5d7e2128238e3986da0
PD#SWPL-31258
Problem:
Kernel RO data is too large, about 4.5mb on 32bit and 5.9mb on
64bit kernel
Solution:
1, remove all # lines in .config when generate /proc/config.gz, which can
save about 20KB ro-memory.
Verify:
x301
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I80b85b006ddec3bbcfb9c8921eb59577af49ad0d
PD#SWPL-31258
[ Upstream commit 4d217a5adc ]
The newly added 'rodata_enabled' global variable is protected by
the wrong #ifdef, leading to a link error when CONFIG_DEBUG_SET_MODULE_RONX
is turned on:
kernel/module.o: In function `disable_ro_nx':
module.c:(.text.unlikely.disable_ro_nx+0x88): undefined reference to `rodata_enabled'
kernel/module.o: In function `module_disable_ro':
module.c:(.text.module_disable_ro+0x8c): undefined reference to `rodata_enabled'
kernel/module.o: In function `module_enable_ro':
module.c:(.text.module_enable_ro+0xb0): undefined reference to `rodata_enabled'
CONFIG_SET_MODULE_RONX does not exist, so use the correct one instead.
Fixes: 39290b389e ("module: extend 'rodata=off' boot cmdline parameter to module mappings")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jessica Yu <jeyu@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Change-Id: I3ed114cc957edca46684dc14bc47e133cd1725de