Commit Graph

649682 Commits

Author SHA1 Message Date
Kees Cook
d0efc15436 Kbuild: make designated_init attribute fatal
[ Upstream commit c834f0e8a8 ]

If a structure is marked with __attribute__((designated_init)) from
GCC or Sparse, it needs to have all static initializers using designated
initialization. Fail the build for any missing cases. This attribute will
be used by the randstruct plugin to make sure randomized structures are
being correctly initialized.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-12 16:25:52 +09:00
Masahiro Yamada
d7eb37dd3d kbuild: initialize CLANG_FLAGS correctly in the top Makefile
commit 5241ab4cf4 upstream.

CLANG_FLAGS is initialized by the following line:

  CLANG_FLAGS     := --target=$(notdir $(CROSS_COMPILE:%-=%))

..., which is run only when CROSS_COMPILE is set.

Some build targets (bindeb-pkg etc.) recurse to the top Makefile.

When you build the kernel with Clang but without CROSS_COMPILE,
the same compiler flags such as -no-integrated-as are accumulated
into CLANG_FLAGS.

If you run 'make CC=clang' and then 'make CC=clang bindeb-pkg',
Kbuild will recompile everything needlessly due to the build command
change.

Fix this by correctly initializing CLANG_FLAGS.

Fixes: 238bcbc4e0 ("kbuild: consolidate Clang compiler flags")
Cc: <stable@vger.kernel.org> # v5.0+
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:25:50 +09:00
Nathan Chancellor
a856a71190 kbuild: Add -Werror=unknown-warning-option to CLANG_FLAGS
[ Upstream commit 589834b3a0 ]

In commit ebcc5928c5 ("arm64: Silence gcc warnings about arch ABI
drift"), the arm64 Makefile added -Wno-psabi to KBUILD_CFLAGS, which is
a GCC only option so clang rightfully complains:

warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]

https://clang.llvm.org/docs/DiagnosticsReference.html#wunknown-warning-option

However, by default, this is merely a warning so the build happily goes
on with a slew of these warnings in the process.

Commit c3f0d0bc5b ("kbuild, LLVMLinux: Add -Werror to cc-option to
support clang") worked around this behavior in cc-option by adding
-Werror so that unknown flags cause an error. However, this all happens
silently and when an unknown flag is added to the build unconditionally
like -Wno-psabi, cc-option will always fail because there is always an
unknown flag in the list of flags. This manifested as link time failures
in the arm64 libstub because -fno-stack-protector didn't get added to
KBUILD_CFLAGS.

To avoid these weird cryptic failures in the future, make clang behave
like gcc and immediately error when it encounters an unknown flag by
adding -Werror=unknown-warning-option to CLANG_FLAGS. This can be added
unconditionally for clang because it is supported by at least 3.0.0,
according to godbolt [1] and 4.0.0, according to its documentation [2],
which is far earlier than we typically support.

[1]: https://godbolt.org/z/7F7rm3
[2]: https://releases.llvm.org/4.0.0/tools/clang/docs/DiagnosticsReference.html#wunknown-warning-option

Link: https://github.com/ClangBuiltLinux/linux/issues/511
Link: https://github.com/ClangBuiltLinux/linux/issues/517
Suggested-by: Peter Smith <peter.smith@linaro.org>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-12 16:25:47 +09:00
Linus Torvalds
ca456f6559 gcc-9: silence 'address-of-packed-member' warning
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>
2023-05-12 16:25:45 +09:00
Matthias Kaehlcke
077f2b716d Revert "kbuild: use -Oz instead of -Os when using clang"
commit a75bb4eb9e upstream.

The clang option -Oz enables *aggressive* optimization for size,
which doesn't necessarily result in smaller images, but can have
negative impact on performance. Switch back to the less aggressive
-Os.

This reverts commit 6748cb3c29.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-12 16:25:42 +09:00
Nick Desaulniers
d6d9c63ddc kbuild: clang: choose GCC_TOOLCHAIN_DIR not on LD
commit ad15006cc7 upstream.

This causes an issue when trying to build with `make LD=ld.lld` if
ld.lld and the rest of your cross tools aren't in the same directory
(ex. /usr/local/bin) (as is the case for Android's build system), as the
GCC_TOOLCHAIN_DIR then gets set based on `which $(LD)` which will point
where LLVM tools are, not GCC/binutils tools are located.

Instead, select the GCC_TOOLCHAIN_DIR based on another tool provided by
binutils for which LLVM does not provide a substitute for, such as
elfedit.

Fixes: 785f11aa59 ("kbuild: Add better clang cross build support")
Link: https://github.com/ClangBuiltLinux/linux/issues/341
Suggested-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-12 16:25:39 +09:00
Masahiro Yamada
b4d313beda kbuild: consolidate Clang compiler flags
commit 238bcbc4e0 upstream.

Collect basic Clang options such as --target, --prefix, --gcc-toolchain,
-no-integrated-as into a single variable CLANG_FLAGS so that it can be
easily reused in other parts of Makefile.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Acked-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:25:37 +09:00
Masahiro Yamada
add9f3d6ca kbuild: add -no-integrated-as Clang option unconditionally
commit dbe27a002e upstream.

We are still a way off the Clang's integrated assembler support for
the kernel. Hence, -no-integrated-as is mandatory to build the kernel
with Clang. If you had an ancient version of Clang that does not
recognize this option, you would not be able to compile the kernel
anyway.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:25:34 +09:00
Stefan Agner
91439dd77e kbuild: set no-integrated-as before incl. arch Makefile
commit 0f0e8de334 upstream.

In order to make sure compiler flag detection for ARM works
correctly the no-integrated-as flags need to be set before
including the arch specific Makefile.

Fixes: cfe17c9bbe ("kbuild: move cc-option and cc-disable-warning after incl. arch Makefile")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[nc: Backport to 4.9; adjust context due to a previous backport]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:25:32 +09:00
Sodagudi Prasad
8b92d5cd3a kbuild: clang: disable unused variable warnings only when constant
commit 0a5f417674 upstream.

Currently, GCC disables -Wunused-const-variable, but not
-Wunused-variable, so warns unused variables if they are
non-constant.

While, Clang does not warn unused variables at all regardless of
the const qualifier because -Wno-unused-const-variable is implied
by the stronger option -Wno-unused-variable.

Disable -Wunused-const-variable instead of -Wunused-variable so that
GCC and Clang work in the same way.

Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:25:29 +09:00
Nick Desaulniers
8adb946778 kbuild: clang: remove crufty HOSTCFLAGS
commit df16aaac26 upstream.

When compiling with `make CC=clang HOSTCC=clang`, I was seeing warnings
that clang did not recognize -fno-delete-null-pointer-checks for HOSTCC
targets.  These were added in commit 61163efae0 ("kbuild: LLVMLinux:
Add Kbuild support for building kernel with Clang").

Clang does not support -fno-delete-null-pointer-checks, so adding it to
HOSTCFLAGS if HOSTCC is clang does not make sense.

It's not clear why the other warnings were disabled, and just for
HOSTCFLAGS, but I can remove them, add -Werror to HOSTCFLAGS and compile
with clang just fine.

Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[nc: Backport to 4.9; adjust context]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:25:26 +09:00
David Lin
689f8442ca kbuild: clang: fix build failures with sparse check
commit bb3f38c3c5 upstream.

We should avoid using the space character when passing arguments to
clang, because static code analysis check tool such as sparse may
misinterpret the arguments followed by spaces as build targets hence
cause the build to fail.

Signed-off-by: David Lin <dtwlin@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[nc: Backport to 4.9; adjust context]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:25:23 +09:00
Masahiro Yamada
269bf1fce9 kbuild: move cc-option and cc-disable-warning after incl. arch Makefile
commit cfe17c9bbe upstream.

Geert reported commit ae6b289a37 ("kbuild: Set KBUILD_CFLAGS before
incl. arch Makefile") broke cross-compilation using a cross-compiler
that supports less compiler options than the host compiler.

For example,

  cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"

This problem happens on architectures that setup CROSS_COMPILE in their
arch/*/Makefile.

Move the cc-option and cc-disable-warning back to the original position,
but keep the Clang target options untouched.

Fixes: ae6b289a37 ("kbuild: Set KBUILD_CFLAGS before incl. arch Makefile")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
[nc: Backport to 4.9; adjust context due to a previous backport]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:20:10 +09:00
Stefan Agner
3ba78bf174 kbuild: allow to use GCC toolchain not in Clang search path
(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>
2023-05-12 16:20:07 +09:00
Stephen Rothwell
3bb1c653db disable stringop truncation warnings for now
commit 217c3e0196 upstream.

They are too noisy

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:20:05 +09:00
Chris Fries
b2182a9f0d kbuild: Set KBUILD_CFLAGS before incl. arch Makefile
(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>
2023-05-12 16:20:02 +09:00
Arnd Bergmann
3e4ab3c600 Kbuild: use -fshort-wchar globally
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>
2023-05-12 16:19:59 +09:00
Andrey Konovalov
b58850e1d4 kasan: don't emit builtin calls when sanitization is off
commit 0e410e158e upstream.

With KASAN enabled the kernel has two different memset() functions, one
with KASAN checks (memset) and one without (__memset).  KASAN uses some
macro tricks to use the proper version where required.  For example
memset() calls in mm/slub.c are without KASAN checks, since they operate
on poisoned slab object metadata.

The issue is that clang emits memset() calls even when there is no
memset() in the source code.  They get linked with improper memset()
implementation and the kernel fails to boot due to a huge amount of KASAN
reports during early boot stages.

The solution is to add -fno-builtin flag for files with KASAN_SANITIZE :=
n marker.

Link: http://lkml.kernel.org/r/8ffecfffe04088c52c42b92739c2bd8a0bcb3f5e.1516384594.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ Sami: Backported to 4.9 avoiding c5caf21ab0 and e7c52b84fb ]
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-12 16:19:56 +09:00
secuflag
0ac3eff30b Remove pre-commit patch check 2023-05-12 16:19:53 +09:00
Chris Fries
9a53390dab kernel: Add CC_WERROR config to turn warnings into errors
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
2023-05-12 16:19:37 +09:00
Linus Torvalds
088db916ce gcc-9: silence 'address-of-packed-member' warning
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>
2023-05-12 16:19:03 +09:00
Arnd Bergmann
e96126182f turn off -Wattribute-alias
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>
2023-05-12 16:17:26 +09:00
Chris
eee54bb0b9 Revert "cec: cec a bus busy cause system hold [1/1]"
This reverts commit e5617679de.

Change-Id: I23415ecad6254a65ddcf92b171fbce15ca0fac8c
2023-05-09 08:59:38 +09:00
Luke go
a78b44698b ODROID-C4: configs: Reenabled keyboard gpio polled.
Change-Id: I9c91cc912012b47280d0f631820c725653e83540
Signed-off-by: Luke go <sangch.go@gmail.com>
2023-05-02 12:02:10 +09:00
chunlong.cao
87e7c07df2 [display]amvecm: aml_vecm_init Initialization bug [1/1]
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
2023-04-27 09:33:37 +09:00
chunlong.cao
fe96d66ae6 device: [BDS][S905D3]change device u202 to yeker P102-tablet project.[4/5]
PD#SWPL-34159

Problem:
     need support  yeker P102-tablet project

Solution:
    change dts to arm64

Verify:
    U202

Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-24 13:59:54 +09:00
junlan.duan
e85d5e5b1f kernel: add Android P 64bit support
PD#SH-8250

Problem:
vendor partition size is low

Solution:
add vendor partition size

Verify:
p1

Signed-off-by: junlan.duan <junlan.duan@amlogic.com>
Change-Id: If9b43379355dec22bc11d5cb4f40b82e632927af
2023-04-21 13:52:38 +09:00
Pengcheng Chen
e21136bd5e osd: fix reboot quiescent caused screen blank issue [1/1]
PD#SWPL-17605

Problem:
in reboot quiescent, suspend & resume caused afbc_cfg
reg set err

Solution:
in resume, reset afbc_start to 0

Verify:
franklin

Change-Id: I6e019ee88a3cfeb5d39db4777a7c2ac6c9648b02
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
2023-04-21 13:52:38 +09:00
yao liu
1473adce54 vpp code style modify [1/1]
PD#SWPL-59491

Problem:
vpp code style modify

Solution:
vpp code style modify

Verify:
sm1

Signed-off-by: yao liu <yao.liu@amlogic.com>
Change-Id: I0ff44f15d441413a70366d86cabaee69a73587f7
2023-04-21 13:52:38 +09:00
yuhua.lin
5e9e5f621b ge2d: ge2d strechblit consumes too much time [1/1]
PD#SWPL-60558

Problem:
ge2d strechblit consumes too much time

Solution:
move cache sync in lib

Verify:
w400

Change-Id: I76d14e67dca6bd2fa05a7d3900c011367bf21884
Signed-off-by: yuhua.lin <yuhua.lin@amlogic.com>
2023-04-21 13:52:38 +09:00
chunlong.cao
6470ba59ea audio: add kcontrol of pdm hareware gain [1/1]
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
2023-04-21 13:52:37 +09:00
chunlong.cao
710cb430f8 audio: add kcontrol of pdm hareware gain [1/1]
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
2023-04-21 13:52:37 +09:00
chunlong.cao
d93a456063 Revert "lcd: fix lcd_extern device probe mistake [1/1]"
This reverts commit 5802fddc1a48cc97aab51d7e394f80b7fd0ea02f.
2023-04-21 13:52:37 +09:00
Evoke Zhang
9aba57f769 lcd: fix lcd_extern device probe mistake [1/1]
PD#SWPL-36737

Problem:
lcd_extern device can't probe when enter kernel

Solution:
fix lcd_extern device probe mistake

Verify:
ak301

Change-Id: I869806bf85e5bec16bb1956862f7fd2000359a8f
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
2023-04-21 13:52:37 +09:00
Tao Zeng
17ee56708e fs: fix crash in squash fs [1/1]
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>
2023-04-21 13:52:37 +09:00
Xingxing Wang
68e3843a22 cpufreq: mutex flow modification in set rate api [1/1]
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>
2023-04-21 13:52:37 +09:00
Tao Zeng
9ed5e33d2f fs: prevent squashfs cache lock in cma [1/1]
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
2023-04-21 13:52:37 +09:00
jian.zhou
afc8de3814 audio: set right EE_AUDIO_MST_PAD_CTRL0 register value [1/1]
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>
2023-04-21 13:52:37 +09:00
Xingxing Wang
190db37ed1 cpufreq: modify G12B revB&revA A53/A73 DVFS table [1/1]
PD#SWPL-33114

Problem:
modify G12B revB&revA A53/A73 DVFS table

Solution:
100M~1.4G: +40mV
1.5G~1.7G: +50mV

Verify:
G12B A311D

Change-Id: I2a720532e48168cae79e69d3f261661a6fc827de
Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
2023-04-21 13:52:36 +09:00
chunlong.cao
51897c7f2f Revert "ge2d: t5: add ge2d support [1/1]"
This reverts commit 529c6f4f398b0783f9d19ad03dccd48d2511565c.

Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
Change-Id: Id751430c9532e2570f3ebf24633da8f66838a921
2023-04-21 13:52:36 +09:00
Cao Jian
77e2034375 ge2d: add custom stride support [1/1]
PD#SWPL-29770

Problem:
accept customized picture stride

Solution:
add this support

Verify:
w400

Change-Id: I582286f0f19a617b728cc262f1616a8fce6091b2
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-21 13:52:36 +09:00
Cao Jian
7e699a3907 ge2d: use offset when getting plane paddr [1/1]
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>
2023-04-21 13:52:36 +09:00
Cao Jian
a7d4bbc988 ge2d: add hw capability flags [1/1]
PD#SWPL-35263

Problem:
acquire HW capabilities at runtime

Solution:
add hw capability flags

Verify:
on w400

Change-Id: I6cab307cd5e3df848da72de64370b71826d30377
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
2023-04-21 13:52:36 +09:00
Cao Jian
87ea2f5e78 ge2d: add ioctl to attach/detach [1/1]
PD#SWPL-33277

Problem:
reduce cache invalidate actions
while doing bulk actions to improve the performance

Solution:
add ioctl to attach/detach dma fd

Verify:
on sm1/w400

Change-Id: Iea8fae9e483ff70044da748c78d8641c52a0c65d
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-21 13:52:35 +09:00
Cao Jian
690e290f04 ge2d: unify power on and off macro [1/1]
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>
2023-04-21 13:52:35 +09:00
Cao Jian
4d07716e42 ge2d: t5: add ge2d support [1/1]
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>
2023-04-21 13:52:35 +09:00
Cao Jian
c003ef6bea osd: add member copying in CONFIG_COMPAT [1/1]
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>
2023-04-21 13:52:35 +09:00
fushan.zeng
13e82edf2e linux: reboot power down cpu timeout [1/3]
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
2023-04-21 13:52:35 +09:00
renjiang.han
2a0849472a ppmgr: The picture is incorrect due to alignment issues. [1/1]
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>
2023-04-21 13:52:35 +09:00
renjiang.han
0e4bc14772 ppmgr: add support gdc rotate. [1/1]
PD#SWPL-28849

Problem:
ppmgr uses ge2d for lower rotation efficiency.

Solution:
ppmgr uses gdc to do 1080p rotation.

Verify:
on w400

Change-Id: I81c7f3c3ababa2518e733608c89ac50074bbdbe9
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
Signed-off-by: chunlong.cao <chunlong.cao@amlogic.com>
2023-04-21 13:52:35 +09:00