platform/kernel/linux-amlogic.git
6 years agoosd: fix osd buildroot compile error
pengcheng chen [Wed, 12 Sep 2018 01:48:18 +0000 (09:48 +0800)]
osd: fix osd buildroot compile error

PD#163001: osd: fix osd buildroot compile error

Change-Id: I93b9b9646316879f013f901f683c092a20d9ff71
Signed-off-by: pengcheng chen <pengcheng.chen@amlogic.com>
6 years agovideo: toggle first frame for netflix video peek
shuanglong.wang [Wed, 22 Aug 2018 05:13:34 +0000 (13:13 +0800)]
video: toggle first frame for netflix video peek

PD#172137 :toggle first frame for netflix video peek

Change-Id: I28b29cba40f621c71fd67f0cf0c8e80c835483cf
Signed-off-by: shuanglong.wang <shuanglong.wang@amlogic.com>
6 years agocodec_mm: fix serial port prints "memory allocate failure" message.
Peng Yixin [Thu, 30 Aug 2018 02:03:30 +0000 (10:03 +0800)]
codec_mm: fix serial port prints "memory allocate failure" message.

PD#172077

Change-Id: Id89a4b3e26ae928a3be0f098592ce42cdaead49b
Signed-off-by: Peng Yixin <yixin.peng@amlogic.com>
6 years agogdc: modify the line offset of gdc
keke.li [Mon, 10 Sep 2018 08:43:31 +0000 (16:43 +0800)]
gdc: modify the line offset of gdc

PD#173042: gdc: modify the line offset param of gdc

Change-Id: I946f174282fe6583432c408065a56f685db424d2
Signed-off-by: Keke Li <keke.li@amlogic.com>
6 years agolcd: g12b: update hpll & gp0_pll wait lock sequence [2/2]
Evoke Zhang [Fri, 31 Aug 2018 02:33:46 +0000 (10:33 +0800)]
lcd: g12b: update hpll & gp0_pll wait lock sequence [2/2]

PD#172762: lcd: g12b: update hpll & gp0_pll wait lock sequence

Change-Id: If085975292682ed5570e2fc326c895d38e896449
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
6 years agolcd: mipi-dsi: optimize power on sequence for encl and dsi [2/2]
Evoke Zhang [Thu, 19 Jul 2018 08:41:49 +0000 (16:41 +0800)]
lcd: mipi-dsi: optimize power on sequence for encl and dsi [2/2]

PD#170290: lcd: mipi-dsi: optimize power on sequence for encl and dsi

Change-Id: If081780fe22d2a94548ff7afe8dfdb099d6b725a
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
6 years agolcd: add viu2 vsync interrupt & no viu vsync supoort
Evoke Zhang [Mon, 3 Sep 2018 05:16:34 +0000 (13:16 +0800)]
lcd: add viu2 vsync interrupt & no viu vsync supoort

PD#172761: lcd: add viu2 vsync interrupt & no viu vsync supoort

Change-Id: Idefc6208af4cfe650907e97fd823353405fce35d
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
6 years agoosd: screen zoom in/out support for mesonhwc
pengcheng chen [Thu, 3 May 2018 10:41:14 +0000 (18:41 +0800)]
osd: screen zoom in/out support for mesonhwc

PD#163001: osd: screen zoom in/out support for mesonhwc
1. support screen zoom in/out
2. support 1080i
3. support afbcd RGBA_1010102
4. fix fence error for mesonhwc caused by commit 76382d549bd3
   ("osd: adjust render kthreads priority [1/1]")
5. fix cursor distort on top of the screen

Change-Id: I99e2593fd5eb5263da689321a84fbabd2527cf03
Signed-off-by: pengcheng chen <pengcheng.chen@amlogic.com>
6 years agoemmc: aign all data lines with latest data for HS200 busmode
Long Yu [Fri, 27 Jul 2018 11:34:19 +0000 (19:34 +0800)]
emmc: aign all data lines with latest data for HS200 busmode

PD#170721: align all data lines with latest data for HS200 busmode

Change-Id: I94b07e6ae2e16a5dfd0c0dfafd4c9d45fe0b6d11
Signed-off-by: Long Yu <long.yu@amlogic.com>
6 years agolcd: mipi-dsi: update phy timing calculation [2/2]
Evoke Zhang [Tue, 19 Jun 2018 01:38:46 +0000 (09:38 +0800)]
lcd: mipi-dsi: update phy timing calculation [2/2]

PD#169192: lcd: mipi-dsi: update phy timing calculation

Change-Id: I0ed035d3f1852da98abbea940e72b2fac396f858
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
6 years agoionvideo: support yuv422 frame from di
Rico Yang [Tue, 17 Apr 2018 08:51:47 +0000 (16:51 +0800)]
ionvideo: support yuv422 frame from di

PD#160993: ionvideo: support yuv422 frame from di

support yuv422 frame from di in ionvideo to enable deinterlacing on OSD

Change-Id: Ibc9a1e3021f06d0f9c3f21ac3e6359c0fd465b7c
Signed-off-by: Rico Yang <wei.yang@amlogic.com>
6 years agovdac: add Bandgap optimization
Nian Jing [Tue, 21 Aug 2018 09:19:33 +0000 (17:19 +0800)]
vdac: add Bandgap optimization

PD#171856: optimizationg bandgap for hdmi audio pll unlock

Change-Id: Iaa042ab0589ed85e812cdb18b6f4aa9fc7a0e85a
Signed-off-by: Nian Jing <nian.jing@amlogic.com>
6 years agoMH264: Support 4K MMU visition for G12A
Rong Zhang [Thu, 28 Jun 2018 02:24:59 +0000 (10:24 +0800)]
MH264: Support 4K MMU visition for G12A

PD#169065: Support 4K MMU visition

Change-Id: I8c93159aaf2079ec52be94f37226c3c50e3edbaa
Signed-off-by: Rong Zhang <rong.zhang@amlogic.com>
6 years agohdmirx: reset bandgap when aud pll error
yicheng shen [Thu, 23 Aug 2018 02:49:18 +0000 (10:49 +0800)]
hdmirx: reset bandgap when aud pll error

PD#171856: hdmirx: reset bandgap when aud pll error

Change-Id: I17970eeeea89726513dee61ea743769753a5e71a
Signed-off-by: yicheng shen <yicheng.shen@amlogic.com>
6 years agoamvecm: add cm enable/disable flag
Dezhi Kong [Tue, 7 Aug 2018 10:33:59 +0000 (18:33 +0800)]
amvecm: add cm enable/disable flag

PD#170727: amvecm: add cm enable/disable flag

Change-Id: Id56777a45c056216eb1c893fe7d8c7f4cabedfc0
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
6 years agodts: r311: reduce ion memory allocation [2/2]
Lei Qian [Mon, 10 Sep 2018 06:50:03 +0000 (14:50 +0800)]
dts: r311: reduce ion memory allocation [2/2]

PD#173394:dts: r311: reduce ion memory allocation

Change-Id: Ie8facd2079f9095e695f5c0047705741152bea37
Signed-off-by: Lei Qian <lei.qian@amlogic.com>
6 years agoMerge "hdmirx: fix kasan bug in rx_get_edid" into amlogic-4.9-dev
Tao Zeng [Mon, 10 Sep 2018 12:05:56 +0000 (05:05 -0700)]
Merge "hdmirx: fix kasan bug in rx_get_edid" into amlogic-4.9-dev

6 years agohdmirx: fix kasan bug in rx_get_edid
Hang Cheng [Thu, 6 Sep 2018 09:38:24 +0000 (17:38 +0800)]
hdmirx: fix kasan bug in rx_get_edid

PD#172927: hdmirx: fix KASAN bug in rx_get_edid

BUG: KASAN: global-out-of-bounds in rx_get_edid+0x74/0xa0
Read of size 8 at addr ffffff900bda5cb8 by task swapper/0/1

CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.9.113 #3
Hardware name: Amlogic (DT)
Call trace:
[<ffffff900908ecc0>] dump_backtrace+0x0/0x368
[<ffffff900908f0cc>] show_stack+0x24/0x30
[<ffffff900963bdb0>] dump_stack+0xa0/0xc8
[<ffffff90092ba21c>] print_address_description+0x144/0x258
[<ffffff90092ba694>] kasan_report+0x264/0x338
[<ffffff90092b8cd4>] __asan_load8+0x84/0x98
[<ffffff9009cdd394>] rx_get_edid+0x74/0xa0
[<ffffff9009cde2ec>] hdmi_rx_top_edid_update+0xb4/0x1d8
[<ffffff9009ccf524>] hdmirx_hw_probe+0x10c/0x168
[<ffffff9009cd3eb0>] hdmirx_probe+0x9d8/0x10f8
[<ffffff9009762b60>] platform_drv_probe+0x78/0xf8
[<ffffff900975f93c>] driver_probe_device+0x134/0x380
[<ffffff900975fc74>] __driver_attach+0xec/0xf0
[<ffffff900975c71c>] bus_for_each_dev+0xf4/0x160
[<ffffff900975eec8>] driver_attach+0x38/0x48
[<ffffff900975e748>] bus_add_driver+0x1b0/0x308
[<ffffff9009760d34>] driver_register+0xbc/0x1a0
[<ffffff9009762a4c>] __platform_driver_register+0x84/0x90
[<ffffff900ac1752c>] hdmirx_init+0xa0/0xfc
[<ffffff900908421c>] do_one_initcall+0xac/0x1f8
[<ffffff900abc10bc>] kernel_init_freeable+0x254/0x2f4
[<ffffff900a2929b0>] kernel_init+0x18/0x118
[<ffffff9009083e80>] ret_from_fork+0x10/0x50

The buggy address belongs to the variable:
 edid_list+0x38/0x60

Memory state around the buggy address:
 ffffff900bda5b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffff900bda5c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffff900bda5c80: 00 00 00 00 00 00 fa fa fa fa fa fa 04 fa fa fa
                                        ^
 ffffff900bda5d00: fa fa fa fa 01 fa fa fa fa fa fa fa 00 00 00 00
 ffffff900bda5d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Change-Id: Ie0bdc00195732b4bc6f317c33dcc34ace3dc4051
Signed-off-by: Hang Cheng <hang.cheng@amlogic.com>
6 years agoirblaster: code optimization for axg g12a and g12b
Yu Tu [Fri, 7 Sep 2018 09:55:08 +0000 (17:55 +0800)]
irblaster: code optimization for axg g12a and g12b

PD#172603: irblaster: code optimization

Add interrupt for irblaster. Because it adds a way to
interrupt starting with axg. Check out AO_IR_BLASTER_ADDR3
for details.

Change-Id: I24761207d43c1d783a4669b352f2f93e994df357
Signed-off-by: Yu Tu <yu.tu@amlogic.com>
6 years agoosd: fix using the fence_map which may be freed by KASAN scan
Brian Zhu [Fri, 31 Aug 2018 16:47:33 +0000 (00:47 +0800)]
osd: fix using the fence_map which may be freed by KASAN scan

PD#172928: osd: fix using the fence_map which may be freed by KASAN scan
    KASAN log:
        BUG: KASAN: use-after-free in sync_render_single_fence+0x25c/0x3b0
        Read of size 4 at addr ffffffc017f49864 by task HwBinder:3104_2/3182

Change-Id: Ia3e9987da9218eeba07e44178d62f55555707979
Signed-off-by: Brian Zhu <brian.zhu@amlogic.com>
6 years agoosd: fix access disp_rect memory out-of-bounds by KASAN scan
Brian Zhu [Fri, 31 Aug 2018 18:10:02 +0000 (02:10 +0800)]
osd: fix access disp_rect memory out-of-bounds by KASAN scan

PD#172933: osd: fix access disp_rect memory out-of-bounds by KASAN scan
    KASAN log:
        BUG: KASAN: global-out-of-bounds in osd_notify_callback+0x1e8/0x5f0
        Read of size 4 at addr ffffff900c8e91a0 by task HwBinder:3063_2/3163

Change-Id: Icbea6a91da73919a09d37295660fb029e1de8488
Signed-off-by: Brian Zhu <brian.zhu@amlogic.com>
6 years agodtc: enable generation of symbols
Jianxin Pan [Wed, 5 Sep 2018 14:37:24 +0000 (22:37 +0800)]
dtc: enable generation of symbols

PD#173147: update dtc to v1.4.4

add -@ to dtc option to enable generation of symbols

Change-Id: Ica497de494a3f228f4111773d9cba674b2a2e061
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
6 years agoscripts/dtc: dtx_diff - 2nd update of include dts paths to match build
Frank Rowand [Tue, 19 Sep 2017 00:18:44 +0000 (17:18 -0700)]
scripts/dtc: dtx_diff - 2nd update of include dts paths to match build

PD#173147: update dtc to v1.4.4

Update dtx_diff include paths in the same manner as:
commit b12869a8d519 ("of: remove drivers/of/testcase-data from
include search path for CPP"), commit 5ffa2aed389c ("of: remove
arch/$(SRCARCH)/boot/dts from include search path for CPP"), and
commit 50f9ddaf64e1 ("of: search scripts/dtc/include-prefixes path
for both CPP and DTC").

Remove proposed include path kernel/dts/, which was never implemented
for the dtb build.

For the diff case, each source file is compiled separately.  For
each of those compiles, provide the location of the source file
as an include path, not the location of both source files.

Change-Id: I12b517369e7cde352d4021ceb46f21ec7b7291c0
Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agoscripts/dtc: fix '%zx' warning
Russell King [Thu, 31 Aug 2017 23:15:36 +0000 (16:15 -0700)]
scripts/dtc: fix '%zx' warning

PD#173147: update dtc to v1.4.4

dtc uses an incorrect format specifier for printing a uint64_t value.
uint64_t may be either 'unsigned long' or 'unsigned long long' depending
on the host architecture.

Fix this by using %llx and casting to unsigned long long, which ensures
that we always have a wide enough variable to print 64 bits of hex.

    HOSTCC  scripts/dtc/checks.o
  scripts/dtc/checks.c: In function 'check_simple_bus_reg':
  scripts/dtc/checks.c:876:2: warning: format '%zx' expects argument of type 'size_t', but argument 4 has type 'uint64_t' [-Wformat=]
    snprintf(unit_addr, sizeof(unit_addr), "%zx", reg);
    ^
  scripts/dtc/checks.c:876:2: warning: format '%zx' expects argument of type 'size_t', but argument 4 has type 'uint64_t' [-Wformat=]

Change-Id: I43a0277d4c136ab1fae9dbca23f96928e1087c20
Link: http://lkml.kernel.org/r/20170829222034.GJ20805@n2100.armlinux.org.uk
Fixes: 828d4cdd012c ("dtc: check.c fix compile error")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
6 years agoscripts/dtc: dtx_diff - update include dts paths to match build
Frank Rowand [Thu, 20 Jul 2017 01:35:31 +0000 (18:35 -0700)]
scripts/dtc: dtx_diff - update include dts paths to match build

PD#173147: update dtc to v1.4.4

Update the cpp include flags for compiling device tree dts files
to match the changes made to the kernel build process in
commit d5d332d3f7e8 ("devicetree: Move include prefixes from arch
to separate directory").

Change-Id: I173fb2ff01d854130f1942159b457a294f7e21ec
Cc: <stable@vger.kernel.org> # 4.12
Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agoscripts/dtc: dtx_diff - Show real file names in diff header
Geert Uytterhoeven [Thu, 22 Jun 2017 13:07:06 +0000 (15:07 +0200)]
scripts/dtc: dtx_diff - Show real file names in diff header

PD#173147: update dtc to v1.4.4

As the comparison uses process substitution to pass files after
conversion to DTS format, the diff header doesn't show the real
filenames, but the names of the file descriptors used:

    --- /dev/fd/63  2017-06-22 11:21:47.531637188 +0200
    +++ /dev/fd/62  2017-06-22 11:21:47.531637188 +0200

This is especially annoying when comparing a bunch of DT files in a
loop, as the output doesn't show a clue about which files it refers to.

Fix this by explicitly passing the original file names to the diff
command using the --label option, giving e.g.:

    --- arch/arm/boot/dts/r8a7791-koelsch.dtb
    +++ arch/arm/boot/dts/r8a7791-porter.dtb

Change-Id: I6e070da490a8190682b7ec522e3f6746cdb651b2
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agodtc: check.c fix compile error
Shuah Khan [Tue, 16 May 2017 16:08:08 +0000 (10:08 -0600)]
dtc: check.c fix compile error

PD#173147: update dtc to v1.4.4

Fix the following compile error found on odroid-xu4:

checks.c: In function ‘check_simple_bus_reg’:
checks.c:876:41: error: format ‘%lx’ expects argument of type
‘long unsigned int’, but argument 4 has type
‘uint64_t{aka long long unsigned int}’ [-Werror=format=]
  snprintf(unit_addr, sizeof(unit_addr), "%lx", reg);
                                         ^
checks.c:876:41: error: format ‘%lx’ expects argument of type
‘long unsigned int’, but argument 4 has type
‘uint64_t {aka long long unsigned int}’ [-Werror=format=]
cc1: all warnings being treated as errors
Makefile:304: recipe for target 'checks.o' failed
make: *** [checks.o] Error 1

Change-Id: I070dedf5201d8b299748ad4881b5f1a1a1c9ef4f
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
[dwg: Correct new format to be correct in general]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
[robh: cherry-picked from upstream dtc commit 2a42b14d0d03]
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agodtc: update warning settings for new bus and node/property name checks
Rob Herring [Tue, 21 Mar 2017 14:14:20 +0000 (09:14 -0500)]
dtc: update warning settings for new bus and node/property name checks

PD#173147: update dtc to v1.4.4

dtc gained new warnings checking PCI and simple buses, unit address
formatting, and stricter node and property name checking. Disable the
new dtc warnings by default as there are 1000s. As before, warnings are
enabled with W=1 or W=2. The strict node and property name checks are a
bit subjective, so they are only enabled for W=2.

Change-Id: Ic9253cdb1f27f59c73f7c337b96c3e8c5f876b20
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agoscripts/dtc: Update to upstream version v1.4.4-8-g756ffc4f52f6
Rob Herring [Tue, 21 Mar 2017 14:01:08 +0000 (09:01 -0500)]
scripts/dtc: Update to upstream version v1.4.4-8-g756ffc4f52f6

PD#173147: update dtc to v1.4.4

This adds the following commits from upstream:

756ffc4f52f6 Build pylibfdt as part of the normal build process
8cb3896358e9 Adjust libfdt.h to work with swig
b40aa8359aff Mention pylibfdt in the documentation
12cfb740cc76 Add tests for pylibfdt
50f250701631 Add an initial Python library for libfdt
cdbb2b6c7a3a checks: Warn on node name unit-addresses with '0x' or leading 0s
4c15d5da17cc checks: Add bus checks for simple-bus buses
33c3985226d3 checks: Add bus checks for PCI buses
558cd81bdd43 dtc: Bump version to v1.4.4
c17a811c62eb fdtput: Remove star from value_len documentation
194d5caaefcb fdtget: Use @return to document the return value
d922ecdd017b tests: Make realloc_fdt() really allocate *fdt
921cc17fec29 libfdt: overlay: Check the value of the right variable
9ffdf60bf463 dtc: Simplify asm_emit_string() implementation
881012e44386 libfdt: Change names of sparse helper macros
bad5b28049e5 Fix assorted sparse warnings
672ac09ea04d Clean up gcc attributes
49300f2ade6a dtc: Don't abuse struct fdt_reserve_entry
fa8bc7f928ac dtc: Bump version to v1.4.3
34a9886a177f Add printf format attributes
f72508e2b6ca Correct some broken printf() like format mismatches
397d5ef0203c libfdt: Add fdt_setprop_empty()
69a1bd6ad3f9 libfdt: Remove undefined behaviour setting empty properties
acd1b534a592 Print output filename as part of warning messages
120775eb1cf3 dtc: Use streq() in preference to strcmp()
852e9ecbe197 checks: Add Warning for stricter node name character checking
ef0e8f061534 checks: Add Warning for stricter property name character checking
00d7bb1f4b0e dtc: pos parameter to srcpos_string() can't be NULL
95d57726bca4 livetree.c: Fix memory leak
3b9c97093d6e dtc: Fix NULL pointer use in dtlabel + dtref case
43eb551426ea manual: Fix typo it -> in
4baf15f7f13f Makefile: Add tags rule

Change-Id: Ie5749e27d77b0baed3d6047f79c706036360f615
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agoscripts/dtc: automate getting dtc version and log in update script
Rob Herring [Tue, 21 Mar 2017 13:28:11 +0000 (08:28 -0500)]
scripts/dtc: automate getting dtc version and log in update script

PD#173147: update dtc to v1.4.4

Further automate the dtc update script to fill in the dtc version and
commit log.

Change-Id: I3830550bf108268db5b3783fe2053fbb0f81033d
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agoscripts/dtc: Update to upstream version 0931cea3ba20
Rob Herring [Wed, 4 Jan 2017 16:45:20 +0000 (10:45 -0600)]
scripts/dtc: Update to upstream version 0931cea3ba20

PD#173147: update dtc to v1.4.4

Sync to upstream dtc commit 0931cea3ba20 ("dtc: fdtdump: check fdt if
not in scanning mode"). In particular, this pulls in dtc overlay
support.

This adds the following commits from upstream:

f88865469b65 dtc: Fix memory leak in character literal parsing
00fbb8696b66 Rename boot_info
1ef86ad2c24f dtc: Clean up /dts-v1/ and /plugin/ handling in grammar
e3c769aa9c16 dtc: Don't always generate __symbols__ for plugins
c96cb3c0169e tests: Don't use -@ on plugin de/recompile tests
66381538ce24 tests: Remove "suppression of fixups" tests
ba765b273f0f tests: Clarify dtc overlay tests
6ea8cd944fcd tests: More thorough tests of libfdt overlay application without dtc
7d8ef6e1db97 tests: Correct fdt handling of overlays without fixups and base trees without symbols
b4dc0ed8b127 tests: Fix double expansion bugs in test code
3ea879dc0c8f tests: Split overlay tests into those with do/don't exercise dtc plugin generation
47b4d66a2f11 tests: Test auto-alias generation on base tree, not overlay
72e1ad811523 tests: Make overlay/plugin tests unconditional
e7b3c3b5951b tests: Add overlay tests
9637e3f772a9 tests: Add check_path test
20f29d8d41f6 dtc: Plugin and fixup support
a2c92cac53f8 dtc: Document the dynamic plugin internals
8f70ac39801d checks: Pass boot_info instead of root node
ea10f953878f libfdt: add missing errors to fdt_strerror()
daa75e8fa594 libfdt: fix fdt_stringlist_search()
e28eff5b787a libfdt: fix fdt_stringlist_count()
ae97c7722840 tests: overlay: Rename the device tree blobs to be more explicit
96162d2bd9cb tests: overlay: Add test suffix to the compiled blobs
5ce8634733b7 libfdt: Add fdt_overlay_apply to the exported symbols
804a9db90ad2 fdt: strerr: Remove spurious BADOVERLAY
e8c3a1a493fa tests: overlay: Move back the bad fixup tests
7a72d89d3f81 libfdt: overlay: Fix symbols and fixups nodes condition
cabbaa972cdd libfdt: overlay: Report a bad overlay for mismatching local fixups
deb0a5c1aeaa libfdt: Add BADPHANDLE error string
7b7a6be9ba15 libfdt: Don't use 'index' as a local variable name
aea8860d831e tests: Add tests cases for the overlay code
0cdd06c5135b libfdt: Add overlay application function
39240cc865cf libfdt: Extend the reach of FDT_ERR_BADPHANDLE
4aa3a6f5e6d9 libfdt: Add new errors for the overlay code
6d1832c9e64b dtc: Remove "home page" link
45fd440a9561 Fix some typing errors in libfdt.h and livetree.c
a59be4939c13 Merge tag 'v1.4.2'
a34bb721caca dtc: Fix assorted problems in the testcases for the -a option
874f40588d3e Implement the -a option to pad dtb aligned
ec02b34c05be dtc: Makefile improvements for release uploading
1ed45d40a137 dtc: Bump version to 1.4.2
36fd7331fb11 libfdt: simplify fdt_del_mem_rsv()
d877364e4a0f libfdt: Add fdt_setprop_inplace_namelen_partial
3e9037aaad44 libfdt: Add fdt_getprop_namelen_w
84e0e1346c68 libfdt: Add max phandle retrieval function
d29126c90acb libfdt: Add iterator over properties
902d0f0953d0 libfdt: Add a subnodes iterator macro
c539075ba8ba fdtput.c: Fix memory leak.
f79ddb83e185 fdtget.c: Fix memory leak
1074ee54b63f convert-dtsv0-lexer.l: fix memory leak
e24d39a024e6 fdtdump.c: make sure size_t argument to memchr is always unsigned.
44a59713cf05 Remove unused srcpos_dump() function
cb9241ae3453 DTC: Fix memory leak on flatname.
1ee0ae24ea09 Simplify check field and macro names
9d97527a8621 Remove property check functions
2e709d158e11 Remove tree check functions
c4cb12e193e3 Alter grammar to allow multiple /dts-v1/ tags
d71d25d76012 Use xasprintf() in srcpos
9dc404958e9c util: Add xasprintf portable asprintf variant
beef80b8b55f Correct a missing space in a fdt_header cast
68d43cec1253 Correct line lengths in libfdt.h
b0dbceafd49a Correct space-after-tab in libfdt.h

Change-Id: Id702488d3d676b3f6dfbe013ae152c55a3b967b3
Signed-off-by: Rob Herring <robh@kernel.org>
6 years agostb_dv: reload the previous lut when core2 meet CONST_TC2 flag
Brian Zhu [Wed, 5 Sep 2018 13:15:23 +0000 (21:15 +0800)]
stb_dv: reload the previous lut when core2 meet CONST_TC2 flag

PD#173006: stb_dv: reload the previous lut when core2 meet CONST_TC2 flag

Change-Id: Id7fbcb353e0fc3804b30c505e38c4bbb3b01d3f6
Signed-off-by: Brian Zhu <brian.zhu@amlogic.com>
6 years agohdmitx: adjust hdmitx related code [1/2]
Zongdong Jiao [Wed, 5 Sep 2018 09:12:53 +0000 (17:12 +0800)]
hdmitx: adjust hdmitx related code [1/2]

PD#173252: hdmitx: adjust hdmitx related code

Change-Id: Ie8dfd4b21055b9ab34b50efca65dfafa78f2254d
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
6 years agodtv_demod: fix atsc-c search issue
Jihong Sui [Wed, 5 Sep 2018 01:42:54 +0000 (09:42 +0800)]
dtv_demod: fix atsc-c search issue

PD#168297: fix atsc-c search issue

Change-Id: Ie4744cfd7118377057b02c0145cb0388be0c793d
Signed-off-by: Jihong Sui <jihong.sui@amlogic.com>
6 years agokasan: fix panic bug in check_channel_mask function
tao zeng [Fri, 7 Sep 2018 03:17:29 +0000 (11:17 +0800)]
kasan: fix panic bug in check_channel_mask function

PD#172700

When open kasan, kernel paniced on P321:

Internal error: Oops: 96000005 [#1] PREEMPT SMP
PC is at strncmp+0x1e0/0x210
LR is at check_channel_mask+0x30/0xa8

[<ffffff900963ad10>] strncmp+0x1e0/0x210
[<ffffff9009e64418>] parse_speaker_channel_mask.isra.1+0x120/0x258
[<ffffff9009e6610c>] txl_chipset_init+0x8c/0xc0
[<ffffff9009e653ac>] aml_init_work_func+0x54/0x210
[<ffffff90090dcb18>] process_one_work+0x378/0x880
[<ffffff90090dd0bc>] worker_thread+0x9c/0x7a0
[<ffffff90090e6514>] kthread+0x184/0x1a0
[<ffffff9009083e80>] ret_from_fork+0x10/0x50

return value of of_property_read_string must be checked!

Change-Id: Ic0e0dcd0a3aa2f4ed10335e417f7db259a51fc95
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
6 years agotouchscreen: goodix_gt9xx: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 11:52:14 +0000 (19:52 +0800)]
touchscreen: goodix_gt9xx: fix coverity warning

PD#172713: touchscreen: goodix_gt9xx: fix coverity warning

There is no judgment about whether the pointer
 is NULL before using it.
This causes "Dereference before null check".

Change-Id: Ic4d96cc1e48d16f409b71c70a049b433eeb39bf1
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agomeson: i2c: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 05:48:27 +0000 (13:48 +0800)]
meson: i2c: fix coverity warning

PD#172722: meson: i2c: fix coverity warning

Here,the value of "ret" must be equal to 0,
so that the program cannot execute to the left of
the expression "return ret ?: size;".
This causes "Logically dead code".

Change-Id: Ief0cdb891e5583f0fba1ff166b40a5e71b67342f
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agotouchscreen: goodix_gt1x: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 10:51:32 +0000 (18:51 +0800)]
touchscreen: goodix_gt1x: fix coverity warning

PD#172714: touchscreen: goodix_gt1x: fix coverity warning

There is no judgment about whether it is null before
using the pointer.
This causes "Untrusted value as argument".

Change-Id: I147b89e9a96cddf4bdc3c42753bd165b6b802065
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agotouchscreen: goodix_gt1x: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 11:07:23 +0000 (19:07 +0800)]
touchscreen: goodix_gt1x: fix coverity warning

PD#172714: touchscreen: goodix_gt1x: fix coverity warning

1.The return value of the function "gt1x_i2c_read" is not
checked in the "gt1x_generic.c" file.
2.There is no exit condition for the "while (retry > 0)"
loop statement in the "gt1x_update.c" file.
This causes "Untrusted valued as argument" and "Logically dead code".

Change-Id: I07c0639d084ca3b961dd187ce6721f0167b2e4cc
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agotouchscreen: focaltech: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 09:20:14 +0000 (17:20 +0800)]
touchscreen: focaltech: fix coverity warning

PD#172715: touchscreen: focaltech: fix coverity warning

In the "copy_from_user" function does not ensure that
the string "writebuf" ends with a null character.So that
need to add a null character at the end.
This causes "String not null terminated".

Change-Id: I4cc0736ec06652226f39dd5dcde3dc7406639b89
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agotouchscreen: focaltech: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 08:45:39 +0000 (16:45 +0800)]
touchscreen: focaltech: fix coverity warning

PD#172715: touchscreen: focaltech: fix coverity warning

In the "drivers/amlogic/input/touchscreen/focaltech_touch/
focaltech_core.c" file,the variable "irq_gpio"and
"reset_gpio" is an unsigned integer, they cannot be
compared with 0.
This causes "Unsigned compared against 0.

Change-Id: Ic0ef2043e18550cc6c81867ef73f492d2dc446ec
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agomeson: adc_key: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 08:27:07 +0000 (16:27 +0800)]
meson: adc_key: fix coverity warning

PD#172717: meson: adc_key: fix coverity warning

The "strncpy" function does not ensure that
the string "key->name"ends with a null character.
So, the function "strncpy" is replaced by the function "snprintf".
This causes "Buffer not null terminated".

Change-Id: I83cd35f2df8790ca779a8cc8bcde1cd97f2c9020
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agomeson: pwm: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 08:03:36 +0000 (16:03 +0800)]
meson: pwm: fix coverity warning

PD#172718: meson: pwm: fix coverity warning

"value < 0" and "value > 255", two conditions cannot be
met simultaneously.So that the if statement cannot be executed.
This causes "Logically dead code".

Change-Id: I55930eb7ae9c6b44aa3b20b85aab6fbae9b04210
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agomeson: i2c: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 02:49:05 +0000 (10:49 +0800)]
meson: i2c: fix coverity warning

PD#172722: meson: i2c: fix coverity warning

When the function "devm_ioremap_resource" returns
an error,the previously applied memory resource
"slave" is not released.
This causes resource leak.

Change-Id: I2dfb7fab007977e1ae57e714ae489fbf80ec7103
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agomeson: pinctrl: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 07:45:04 +0000 (15:45 +0800)]
meson: pinctrl: fix coverity warning

PD#172720: meson: pinctrl: fix coverity warning

The variable "reg" should be replaced by "ret",
otherwise statement "if (ret) return ret;" will
not be executed.
This causes "Logically dead code".

Change-Id: I2a69b68dd00235198e17255f78c580212f922724
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agodeinterlace: fix pq issues on 32bit
Jihong Sui [Tue, 28 Aug 2018 04:01:21 +0000 (12:01 +0800)]
deinterlace: fix pq issues on 32bit

PD#171620: fix pq issues on 32bit

Change-Id: I06650af722f97cdf25bbf47fb8ed5a8ca62c6186
Signed-off-by: Jihong Sui <jihong.sui@amlogic.com>
6 years agolcd: add gpio pinctrl for pinmux off
Evoke Zhang [Thu, 6 Sep 2018 02:54:52 +0000 (10:54 +0800)]
lcd: add gpio pinctrl for pinmux off

PD#172438: lcd: add gpio pinctrl for pinmux off
add axg_s400_v03gva dts bl pinmux off

Change-Id: Iba9bf0b567092e811373ead22abb56940201ca64
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
6 years agolcd: add gpio pinctrl for pinmux off
Evoke Zhang [Thu, 23 Aug 2018 12:21:46 +0000 (20:21 +0800)]
lcd: add gpio pinctrl for pinmux off

PD#172438: lcd: add gpio pinctrl for pinmux off

include below drivers:
1.lcd
2.lcd_extern
3.backlight
4.bl_ldim
5.bl_extern

Change-Id: I7b5449fa9581d0290135c615b63a7557eb9c915a
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
6 years agomeson: remote: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 08:17:30 +0000 (16:17 +0800)]
meson: remote: fix coverity warning

PD#172716: meson: remote: fix coverity warning

The "strncpy" function does not ensure that the
string "ptable->tab.custom_name"ends with a null character.
So,the function "strncpy" is replaced by the function "snprintf".
This causes "Buffer not null terminated".

Change-Id: I4dd7ce89778ba8be7d60f3463e445f5a3a753061
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agotouchscreen: focaltech: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 10:34:28 +0000 (18:34 +0800)]
touchscreen: focaltech: fix coverity warning

PD#172715: touchscreen: focaltech: fix coverity warning

The two header files "focaltech_upgrade_common.h" and
"focaltech_flash.h" contain each other.
This causes "Recursion in included headers".

Change-Id: I5ca6deae0c33a7cc32aa4f9498e19d40c001b2d3
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agotouchscreen: goodix_gt1x: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 10:44:34 +0000 (18:44 +0800)]
touchscreen: goodix_gt1x: fix coverity warning

PD#172714: touchscreen: goodix_gt1x: fix coverity warning

The value of "ret" variable is overridden by
the new value before it is used.
This causes "Unused value".

Change-Id: Ie48b58668c4f4077606d69d5bafbd8d59264ae7e
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agotouchscreen: goodix_gt9xx: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 11:38:09 +0000 (19:38 +0800)]
touchscreen: goodix_gt9xx: fix coverity warning

PD#172713: touchscreen: goodix_gt9xx: fix coverity warning

1.The return value of function "gtp_i2c_read" is not
checked in the "gt9xx.c" file.
2."ts"null pointer dereferencing reference in the "gt9xx.c" file.
3.In the "goodix_tool.c" file, because the third argument to
"memset" function is of type int, expression "cmd_head.data_len + 1"
is of type u16, so it need to convert to int.
This causes "Unused value".

Change-Id: I85ae8d9c11da0ed5d0ffbef97ad4b6c89fd78cf3
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agomeson: adc: fix coverity warning
Yingyuan Zhu [Wed, 29 Aug 2018 12:27:10 +0000 (20:27 +0800)]
meson: adc: fix coverity warning

PD#172721: meson: adc: fix coverity warning

1.Function "regmap_write" does not check the return value.
2.There's a risk of dividing by 0.
3.There is a risk of null pointer dereferencing the reference
This causes "Unchecked return value" and "Division or modulo by zero".

Change-Id: I10a04dbd49db2d3f3e7def18b6b9eb9f836bc9f0
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
6 years agohdmirx: fix hdcp14 key reg error
Hang Cheng [Tue, 4 Sep 2018 02:51:37 +0000 (10:51 +0800)]
hdmirx: fix hdcp14 key reg error

PD#172916: hdmirx: fix hdcp14 key reg error

Change-Id: I0d614ee875c380cf877bba1e6e7ed236400b0563
Signed-off-by: Hang Cheng <hang.cheng@amlogic.com>
6 years agoamvecm: add cm2 adj interface
MingLiang Dong [Mon, 3 Sep 2018 08:31:01 +0000 (16:31 +0800)]
amvecm: add cm2 adj interface

PD#173053: amvecm: add cm2 adj interface

Change-Id: I74387ed76b05db18f64988d4e2973b5c6bc8a236
Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
6 years agosr: fix core0 input size config
Dezhi Kong [Tue, 4 Sep 2018 12:06:54 +0000 (20:06 +0800)]
sr: fix core0 input size config

PD#170665: sr: fix core0 input size config

Change-Id: I83ae7300917d2b17dac85fea455452d8a17f5f57
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
6 years agoarm64: dts: g12b: add cpufreq 1.908G.
Hong Guo [Wed, 5 Sep 2018 08:10:54 +0000 (16:10 +0800)]
arm64: dts: g12b: add cpufreq 1.908G.

PD#165143: cpufreq: add cpufreq 1.908G.

Change-Id: I24d3f0a8a51b2d0dfdc77e23e3f1eaec9d607ae6
Signed-off-by: Hong Guo <hong.guo@amlogic.com>
6 years agogdc: modify the alloc mem method
keke.li [Tue, 4 Sep 2018 02:50:12 +0000 (10:50 +0800)]
gdc: modify the alloc mem method

PD#173042: gdc: modify the alloc mem method

Change-Id: Iac88ae4f002e6ac4e4ea6f26511c079c535cff7e
Signed-off-by: Keke Li <keke.li@amlogic.com>
6 years agogdc: add gdc reserved memory
keke.li [Mon, 3 Sep 2018 08:55:58 +0000 (16:55 +0800)]
gdc: add gdc reserved memory

PD#173042: gdc: add gdc reserved memory

Change-Id: I1463fe2fba58b2d72a0b616352d81ff98e49b0b4
Signed-off-by: Keke Li <keke.li@amlogic.com>
6 years agolcd: fix lcd_status mistake
Evoke Zhang [Wed, 15 Aug 2018 12:16:14 +0000 (20:16 +0800)]
lcd: fix lcd_status mistake

PD#171850: lcd: fix lcd_status mistake

Change-Id: I5f0486bbc5ba89ba153d752a9e43af1379697658
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
6 years agobacklight: add pwm range 0~255 support
Evoke Zhang [Thu, 2 Aug 2018 08:09:10 +0000 (16:09 +0800)]
backlight: add pwm range 0~255 support

PD#171080: backlight: add pwm range 0~255 support
both support 0~100, 0~255 pwm range,
depend on pwm_duty_max value is bigger than 100 or not.

Change-Id: Ib5962ccaf5fbc728640326dfae3f82f70594001e
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
6 years agohdr: fix hdmi output hdr effect different
MingLiang Dong [Mon, 3 Sep 2018 06:20:09 +0000 (14:20 +0800)]
hdr: fix hdmi output hdr effect different

PD#171579: hdr: fix hdmi output hdr effect different

Change-Id: I4aa49c9b06a14a92f4f39f1ab1d54bc905bece1f
Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
6 years agonet: merge CVE-2018-5391 patch
Eric Dumazet [Tue, 31 Jul 2018 03:09:11 +0000 (20:09 -0700)]
net: merge CVE-2018-5391 patch

PD#172028 merge CVE patch

inet: frag: enforce memory limits earlier

[ Upstream commit 56e2c94f055d328f5f6b0a5c1721cca2f2d4e0a1 ]

We currently check current frags memory usage only when
a new frag queue is created. This allows attackers to first
consume the memory budget (default : 4 MB) creating thousands
of frag queues, then sending tiny skbs to exceed high_thresh
limit by 2 to 3 order of magnitude.

Note that before commit 648700f76b03 ("inet: frags: use rhashtables
for reassembly units"), work queue could be starved under DOS,
getting no cpu cycles.
After commit 648700f76b03, only the per frag queue timer can eventually
remove an incomplete frag queue and its skbs.

Change-Id: I93236ff2764c02ad347339872b05b6f4dce7a06a
Fixes: b13d3cbfb8e8 ("inet: frag: move eviction of queues to work queue")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Jann Horn <jannh@google.com>
Cc: Florian Westphal <fw@strlen.de>
Cc: Peter Oskolkov <posk@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agomeson_drm: add irq enable flag in crtc.
sky zhou [Tue, 14 Aug 2018 12:03:02 +0000 (20:03 +0800)]
meson_drm: add irq enable flag in crtc.

PD#172623: for vpu clock enabled before drm probed,
so we need a flag used in drm to emulate irq
enable/disable.

Change-Id: Iaddee0a885a396cfd6fa102533a1bde08536229e
Signed-off-by: sky zhou <sky.zhou@amlogic.com>
6 years agoethernet: omni phy turn on true powerdown
Zhuo Wang [Mon, 3 Sep 2018 10:53:32 +0000 (18:53 +0800)]
ethernet: omni phy turn on true powerdown

PD#172019: omni phy turn on true power down

Change-Id: Ib95a6f58ddcfda2e6dfacaa8bc2dea7ab5ccda9d
Signed-off-by: Zhuo Wang <zhuo.wang@amlogic.com>
6 years agohdmitx: optimise hdmi power consumption
Zongdong Jiao [Mon, 3 Sep 2018 07:09:35 +0000 (15:09 +0800)]
hdmitx: optimise hdmi power consumption

PD#172019: hdmitx: optimise hdmi power consumption
A tiny modification of HDMI_PHY_CNTL5 under suspend.

Change-Id: I429d930f980c1eb9af3c186c138c538c9ad4fcd0
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
6 years agoemmc: optimize emmc clk set suspend & resume.
Nan Li [Mon, 3 Sep 2018 08:01:36 +0000 (16:01 +0800)]
emmc: optimize emmc clk set suspend & resume.

PD#173040: optimize clk set suspend & resume.

Change-Id: I1f3b826f30db382178faa0293f2ba019525e6dec
Signed-off-by: Nan Li <nan.li@amlogic.com>
6 years agonet: merge CVE-2018-5391 patch
Eric Dumazet [Tue, 31 Jul 2018 04:50:29 +0000 (21:50 -0700)]
net: merge CVE-2018-5391 patch

PD#172028 merge CVE patch

ipv4: frags: handle possible skb truesize change

[ Upstream commit 4672694bd4f1aebdab0ad763ae4716e89cb15221 ]

ip_frag_queue() might call pskb_pull() on one skb that
is already in the fragment queue.

We need to take care of possible truesize change, or we
might have an imbalance of the netns frags memory usage.

IPv6 is immune to this bug, because RFC5722, Section 4,
amended by Errata ID 3089 states :

  When reassembling an IPv6 datagram, if
  one or more its constituent fragments is determined to be an
  overlapping fragment, the entire datagram (and any constituent
  fragments) MUST be silently discarded.

Change-Id: I55a7bb378c160972d99736e4ba592bc10c10f94e
Fixes: 158f323b9868 ("net: adjust skb->truesize in pskb_expand_head()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agonet: merge CVE-2018-5390 patch
Eric Dumazet [Fri, 27 Jul 2018 10:08:46 +0000 (12:08 +0200)]
net: merge CVE-2018-5390 patch

PD#172028 merge CVE patch

tcp: detect malicious patterns in tcp_collapse_ofo_queue()

[ Upstream commit 3d4bf93ac12003f9b8e1e2de37fe27983deebdcf ]

In case an attacker feeds tiny packets completely out of order,
tcp_collapse_ofo_queue() might scan the whole rb-tree, performing
expensive copies, but not changing socket memory usage at all.

1) Do not attempt to collapse tiny skbs.
2) Add logic to exit early when too many tiny skbs are detected.

We prefer not doing aggressive collapsing (which copies packets)
for pathological flows, and revert to tcp_prune_ofo_queue() which
will be less expensive.

In the future, we might add the possibility of terminating flows
that are proven to be malicious.

Change-Id: I5f857fe551726fcc5144cf0e217362ba0b8d85ae
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
6 years agonet: merge CVE-2018-5390 patch
Eric Dumazet [Fri, 27 Jul 2018 10:08:45 +0000 (12:08 +0200)]
net: merge CVE-2018-5390 patch

PD#172028 merge CVE patch

tcp: avoid collapses in tcp_prune_queue() if possible

[ Upstream commit f4a3313d8e2ca9fd8d8f45e40a2903ba782607e7 ]

Right after a TCP flow is created, receiving tiny out of order
packets allways hit the condition :

if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
tcp_clamp_window(sk);

tcp_clamp_window() increases sk_rcvbuf to match sk_rmem_alloc
(guarded by tcp_rmem[2])

Calling tcp_collapse_ofo_queue() in this case is not useful,
and offers a O(N^2) surface attack to malicious peers.

Better not attempt anything before full queue capacity is reached,
forcing attacker to spend lots of resource and allow us to more
easily detect the abuse.

Change-Id: I45bfe1bc87670f0871aebd5d6963aaf82b357f3e
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
6 years agonet: merge CVE-2018-5390 patch
Eric Dumazet [Fri, 27 Jul 2018 10:08:44 +0000 (12:08 +0200)]
net: merge CVE-2018-5390 patch

PD#172028: merge CVE patch

tcp: free batches of packets in tcp_prune_ofo_queue()

[ Upstream commit 72cd43ba64fc172a443410ce01645895850844c8 ]

Juha-Matti Tilli reported that malicious peers could inject tiny
packets in out_of_order_queue, forcing very expensive calls
to tcp_collapse_ofo_queue() and tcp_prune_ofo_queue() for
every incoming packet. out_of_order_queue rb-tree can contain
thousands of nodes, iterating over all of them is not nice.

Before linux-4.9, we would have pruned all packets in ofo_queue
in one go, every XXXX packets. XXXX depends on sk_rcvbuf and skbs
truesize, but is about 7000 packets with tcp_rmem[2] default of 6 MB.

Since we plan to increase tcp_rmem[2] in the future to cope with
modern BDP, can not revert to the old behavior, without great pain.

Strategy taken in this patch is to purge ~12.5 % of the queue capacity.

Change-Id: I647968cc33ccb0acd37ce647923b7cc320eaaf4f
Fixes: 36a6503fedda ("tcp: refine tcp_prune_ofo_queue() to not drop all packets")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Juha-Matti Tilli <juha-matti.tilli@iki.fi>
Acked-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
6 years agoionvideo: fix a crash in ionvideo_thread_tick
jintao xu [Mon, 27 Aug 2018 07:22:49 +0000 (15:22 +0800)]
ionvideo: fix a crash in ionvideo_thread_tick

PD#171379:

Change-Id: I868dd27b8ada3e9bb199e1d6b4325151a568dbf7
Signed-off-by: jintao xu <jintao.xu@amlogic.com>
6 years agosdemmc: update fix adj tuning method
Yonghui Yu [Wed, 8 Aug 2018 07:51:02 +0000 (15:51 +0800)]
sdemmc: update fix adj tuning method

PD#172367: sdemmc: update fix adj tuning method

All adj delay are avalible is not fair when
fix adj mode were used for tuning.
We had tried to add all data with rx delay
to find out the unstable adj delay point.
This method can not cover all scene.
For example:
All adj delay are available as below.
ADJ   0   1   2   3   4   0   1
Src   --__--__--__--__--__--__--
D0    __________________--------
D1    __________________--------
D2    __________________--------
D3    __________________--------
when same rx delay were added to all data line.
All adj delay are still avalible as below.
ADJ   0   1   2   3   4   0   1
Src   --__--__--__--__--__--__--
D0    ----__________________----
D1    ----__________________----
D2    ----__________________----
D3    ----__________________----

So, a new method to find out the unstable adj point
were designed for better compatibility.
Rx delay were added on only 1 data line, such as D1.

When rx delay were added on D1 only. Adj delay 1 is
not available anymore as below.
ADJ   0   1   2   3   4   0   1
Src   --__--__--__--__--__--__--
D0    __________________--------
D1    ----__________________----
D2    __________________--------
D3    __________________--------

In this way, the unsatble adj delay could be
distinguished.

Change-Id: I0488dec001a55f6b50b431ee4d691c872947f0f3
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
6 years agousb: fix variable not initial issue
Lei Qian [Sat, 1 Sep 2018 02:32:18 +0000 (10:32 +0800)]
usb: fix variable not initial issue

PD#165090:usb: fix variable not initial issue

Change-Id: Ideee120dcde79a2cd0b688413784e6e9e474c6da
Signed-off-by: Lei Qian <lei.qian@amlogic.com>
6 years agoDTS: modify thermal high temperature shutdown and reboot data
Huan Biao [Fri, 31 Aug 2018 07:32:51 +0000 (15:32 +0800)]
DTS: modify thermal high temperature shutdown and reboot data

PD#172934: modify sw shutdown temp and hw reboot temp for g12a/b

sw governor shutdown temp 110
hw sensor reboot temp 115

Change-Id: Ie43037ee86c9de4c0b2f43dd9a1662f3d6042a2d
Signed-off-by: Huan Biao <huan.biao@amlogic.com>
6 years agoosd: add osd reset logic for chip txl when hdr
Brian Zhu [Fri, 31 Aug 2018 09:28:07 +0000 (17:28 +0800)]
osd: add osd reset logic for chip txl when hdr

PD#172201: osd: add osd reset logic for chip txl when hdr

Change-Id: Iaf3f723cb3c515570c500614e8f720a72d5d8758
Signed-off-by: Brian Zhu <brian.zhu@amlogic.com>
6 years agohdmi: cec: cmd interface cause system crash
Yong Qin [Thu, 30 Aug 2018 10:05:31 +0000 (18:05 +0800)]
hdmi: cec: cmd interface cause system crash

PD#172867: cec: cmd interface cause system crash

1.cmd file interface will cause system crash
when send data more than 4 bytes

Change-Id: I57035a17138df6c8929d0879068ea095463c128e
Signed-off-by: Yong Qin <yong.qin@amlogic.com>
6 years agoosd: add the position check to avoid refresh logo when mode changed
Brian Zhu [Wed, 29 Aug 2018 15:36:55 +0000 (23:36 +0800)]
osd: add the position check to avoid refresh logo when mode changed

PD#171930: add the position check to avoid refresh logo when mode changed

Change-Id: I6760a70736209d89d6edeba40c6772d5f794208d
Signed-off-by: Brian Zhu <brian.zhu@amlogic.com>
6 years agoMerge "hdmitx: fix KASAN Bug in store_valid_mode [1/1]" into amlogic-4.9-dev
Tao Zeng [Fri, 31 Aug 2018 11:41:58 +0000 (04:41 -0700)]
Merge "hdmitx: fix KASAN Bug in store_valid_mode [1/1]" into amlogic-4.9-dev

6 years agohdmitx: fix KASAN Bug in store_valid_mode [1/1]
Zongdong Jiao [Fri, 31 Aug 2018 08:34:48 +0000 (16:34 +0800)]
hdmitx: fix KASAN Bug in store_valid_mode [1/1]

PD#172926: hdmitx: fix KASAN Bug in store_valid_mode

==================================================================
BUG: KASAN: slab-out-of-bounds in store_valid_mode+0x48/0x70
Read of size 32 at addr ffffffc04a64ef80 by task systemcontrol/2924

CPU: 1 PID: 2924 Comm: systemcontrol Tainted: G           O    4.9.113 #7
Hardware name: Amlogic (DT)
Call trace:
[<ffffff900908ecc0>] dump_backtrace+0x0/0x368
[<ffffff900908f0cc>] show_stack+0x24/0x30
[<ffffff900963bdb0>] dump_stack+0xa0/0xc8
[<ffffff90092ba140>] print_address_description+0x68/0x258
[<ffffff90092ba694>] kasan_report+0x264/0x338
[<ffffff90092b8fdc>] check_memory_region+0x12c/0x1c0
[<ffffff90092b90c4>] __asan_loadN+0x14/0x20
[<ffffff9009c0c250>] store_valid_mode+0x48/0x70
[<ffffff9009757104>] dev_attr_store+0x4c/0x68
[<ffffff90093973b0>] sysfs_kf_write+0x98/0xb8
[<ffffff9009396134>] kernfs_fop_write+0x12c/0x270
[<ffffff90092c9870>] __vfs_write+0xd8/0x268
[<ffffff90092cae30>] vfs_write+0xd8/0x240
[<ffffff90092ccd74>] SyS_write+0xc4/0x148
[<ffffff9009083f00>] el0_svc_naked+0x34/0x38

Allocated by task 2924:
 save_stack_trace_tsk+0x0/0x268
 save_stack_trace+0x24/0x30
 kasan_kmalloc+0xd8/0x188
 __kmalloc+0x14c/0x2e8
 kernfs_fop_write+0x1d0/0x270
 __vfs_write+0xd8/0x268
 vfs_write+0xd8/0x240
 SyS_write+0xc4/0x148
 el0_svc_naked+0x34/0x38

Freed by task 2746:
 save_stack_trace_tsk+0x0/0x268
 save_stack_trace+0x24/0x30
 kasan_slab_free+0x88/0x188
 kfree+0x80/0x280
 selinux_cred_free+0x34/0x50
 security_cred_free+0x48/0x70
 put_cred_rcu+0x38/0x110
 rcu_process_callbacks+0x3b4/0x950
 __do_softirq+0x210/0x5ec

The buggy address belongs to the object at ffffffc04a64ef80
 which belongs to the cache kmalloc-64 of size 64
The buggy address is located 0 bytes inside of
 64-byte region [ffffffc04a64ef80ffffffc04a64efc0)
The buggy address belongs to the page:
page:ffffffbf01299380 count:1 mapcount:0 mapping:          (null) index:0x0
flags: 0x7ab1600000080(slab)
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffffffc04a64ee80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffffffc04a64ef00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffffffc04a64ef80: 00 00 02 fc fc fc fc fc fc fc fc fc fc fc fc fc
                         ^
 ffffffc04a64f000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffffc04a64f080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Change-Id: I553bd648453385788899fadf0da9f17817891db2
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
6 years agohdmirx: add power ctrl in early suspend
Hang Cheng [Wed, 8 Aug 2018 13:25:27 +0000 (21:25 +0800)]
hdmirx: add power ctrl in early suspend

PD#171879: hdmirx: add power ctrl in early suspend

add rxsense pulse(20ms) to fix mtk box sda low
issue. 50ms delay is needed between rxsense pulse
and rxsense high, accroding to experiment and LG TV

Change-Id: Ifceeec415f9c69abce7aced1f3011020848043d0
Signed-off-by: Hang Cheng <hang.cheng@amlogic.com>
6 years agomtd: fix coverity for mtd driver
xianjun.liu [Thu, 23 Aug 2018 03:38:52 +0000 (11:38 +0800)]
mtd: fix coverity for mtd driver

PD#172180: code style and logic issue

Change-Id: Ife539ada43eafa04538150697e5e4c63f4f90db0
Signed-off-by: xianjun.liu <xianjun.liu@amlogic.com>
6 years agohdr: add some hdr flags in t962e dts
Yi Zhou [Fri, 17 Aug 2018 05:14:16 +0000 (13:14 +0800)]
hdr: add some hdr flags in t962e dts

PD#171577:hdr: add some flags in t962e dts

1.PD#164627: hdr: add osd lut table for nts test
2.PD#165557: hdr set bt2020 output when connect hdr tv

Change-Id: I826f7ce51d484cea0508f87b0eda5b278b9391aa
Signed-off-by: Yi Zhou <yi.zhou@amlogic.com>
6 years agotee: cpuid: change function of getting cpuid for arm32
Yan Wang [Fri, 31 Aug 2018 07:17:44 +0000 (15:17 +0800)]
tee: cpuid: change function of getting cpuid for arm32

PD#170391

Change getting cpuid function for 32bit kernel compile.

Change-Id: Ibccfc8ab1df599b23555fd14efc63c1d4df07895
Signed-off-by: Yan Wang <yan.wang@amlogic.com>
6 years agokasan: bring up kasan
tao zeng [Thu, 30 Aug 2018 06:17:02 +0000 (14:17 +0800)]
kasan: bring up kasan

PD#172700:

1. Fix boot fail due to vmap exit problem after enable kasan;
2. Fix make fail problem when open stack/static size check
   after enable kasan;
3. fix dt-match problems reported by kasan:

==================================================================
BUG: KASAN: global-out-of-bounds in __of_match_node+0x78/0xc0
Read of size 1 at addr ffffff900a5696d0 by task swapper/0/1

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.113 #5
Hardware name: Amlogic (DT)
Call trace:
[<ffffff900908ecc0>] dump_backtrace+0x0/0x368
[<ffffff900908f0cc>] show_stack+0x24/0x30
[<ffffff900963bdb0>] dump_stack+0xa0/0xc8
[<ffffff90092ba21c>] print_address_description+0x144/0x258
[<ffffff90092ba694>] kasan_report+0x264/0x338
[<ffffff90092b897c>] __asan_load1+0x4c/0x58
[<ffffff9009ab99c0>] __of_match_node+0x78/0xc0
[<ffffff9009ab9a48>] of_match_node+0x40/0x68
[<ffffff9009abcac8>] of_match_device+0x38/0x50
[<ffffff90097631c4>] platform_match+0x7c/0x128
[<ffffff900975fcdc>] __device_attach_driver+0x64/0x140
[<ffffff900975c8b4>] bus_for_each_drv+0xec/0x158
[<ffffff900975f694>] __device_attach+0x164/0x1c8
[<ffffff900975fe4c>] device_initial_probe+0x24/0x30
[<ffffff900975e3a8>] bus_probe_device+0xe8/0xf8
[<ffffff900975aae8>] device_add+0x548/0x880
[<ffffff9009abd21c>] of_device_add+0x64/0x90
[<ffffff9009abdbd8>] of_platform_device_create_pdata+0xc0/0x128
[<ffffff9009abde4c>] of_platform_bus_create+0x1c4/0x488
[<ffffff9009abe274>] of_platform_populate+0x74/0xd0
[<ffffff900abfeaa0>] of_platform_default_populate_init+0x78/0x88
[<ffffff900908421c>] do_one_initcall+0xac/0x1f8
[<ffffff900abb10bc>] kernel_init_freeable+0x254/0x2f4
[<ffffff900a290b40>] kernel_init+0x18/0x118
[<ffffff9009083e80>] ret_from_fork+0x10/0x50

The buggy address belongs to the variable:
meson_gxl_pinctrl_dt_match+0x190/0x840

Memory state around the buggy address:
ffffff900a569580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffff900a569600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffff900a569680: 00 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa
^
ffffff900a569700: 00 04 fa fa fa fa fa fa 00 06 fa fa fa fa fa fa
ffffff900a569780: 03 fa fa fa fa fa fa fa 05 fa fa fa fa fa fa fa
==================================================================

Change-Id: I8b0a6369fbdc10ba5106bf4f40d4b82971b7ad23
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
6 years agoemmc: clean the coverity errors for emmc module.
Qiang Li [Wed, 18 Jul 2018 05:35:48 +0000 (13:35 +0800)]
emmc: clean the coverity errors for emmc module.

PD#170176: code defects in emmc part.

Change-Id: I2fbdb03d20bb1ea8087453398a3bc3731b30b466
Signed-off-by: Qiang Li <qiang.li@amlogic.com>
6 years agoDTS: fix the dts configuration error of leds
jinrong.liao [Wed, 29 Aug 2018 05:02:12 +0000 (13:02 +0800)]
DTS: fix the dts configuration error of leds

PD#172284: this commit changes mainly for GVA

1) fix the dts configuration error of leds
2) enable "is31fl3236a" driver

Change-Id: Ic2135991b39dcca78b0b09158af0cf9b3f5fb87d
Signed-off-by: jinrong.liao <jinrong.liao@amlogic.com>
6 years agoaudio: enable spdif defconfig and enable dd+ decoder
jinrong.liao [Wed, 29 Aug 2018 04:47:39 +0000 (12:47 +0800)]
audio: enable spdif defconfig and enable dd+ decoder

PD#170752: this commit changes mainly for GVA

1) enable spdif defconfig.
2) enable dd+ decoder.

Change-Id: I0e38208e4d1bd935c2f85b1ccb4723ac85e7149b
Signed-off-by: jinrong.liao <jinrong.liao@amlogic.com>
6 years agoinput: add pca9557 keypad driver for new mic board D607
jinrong.liao [Wed, 29 Aug 2018 04:35:24 +0000 (12:35 +0800)]
input: add pca9557 keypad driver for new mic board D607

PD#172286: this commit changes mainly for GVA

1) keypad: add pca9557 keypad driver for new mic board D607.

Change-Id: I0d9ec9626362b3d87d6c55e5c967bfa4486b1472
Signed-off-by: jinrong.liao <jinrong.liao@amlogic.com>
6 years agoinput: add touch sensor driver.
jinrong.liao [Wed, 29 Aug 2018 04:21:49 +0000 (12:21 +0800)]
input: add touch sensor driver.

PD#172287: this commit changes mainly for GVA

1) add sensor cy8c4014 driver.

Change-Id: Ic1ed6cf2a42e2286e4860946d89091a3dd524ef8
Signed-off-by: jinrong.liao <jinrong.liao@amlogic.com>
6 years agoplatform: modify partition for s420/s400 platform
jinrong.liao [Wed, 29 Aug 2018 03:27:06 +0000 (11:27 +0800)]
platform: modify partition for s420/s400 platform

PD#172285: this commit changes mainly for GVA

1) modify partition for s420/s400 platform.
2) new dts for GVA platform.

Change-Id: If7861004b2c5aa79136282b0db2fa28aedce599e
Signed-off-by: jinrong.liao <jinrong.liao@amlogic.com>
6 years agoemmc: optimize emmc TDMA config on g12a.
Nan Li [Mon, 27 Aug 2018 06:36:42 +0000 (14:36 +0800)]
emmc: optimize emmc TDMA config on g12a.

PD#172626: add emmc TDMA config set on match-data.

Change-Id: I1efc93dc1ab437f9f0e383cb545b78947e1997a4
Signed-off-by: Nan Li <nan.li@amlogic.com>
6 years agohdr: fix hdr gamut convert support 32/64bit
MingLiang Dong [Thu, 30 Aug 2018 05:45:28 +0000 (13:45 +0800)]
hdr: fix hdr gamut convert support 32/64bit

PD#172813: hdr: fix hdr gamut convert support 32/64bit

Change-Id: Iab330be778920c2d5322d4f29b5673266f065e6f
Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
6 years agosaradc/adc_keypad: add shutdown interface
Xingyu Chen [Wed, 29 Aug 2018 03:26:55 +0000 (11:26 +0800)]
saradc/adc_keypad: add shutdown interface

PD#172019: saradc/adc_keypad: add shutdown interface

Change-Id: I5345e9f85e88ebd44156de3f00790f798327ddf3
Signed-off-by: Xingyu Chen <xingyu.chen@amlogic.com>
6 years agohdr: fix hdr color abnormal
MingLiang Dong [Tue, 28 Aug 2018 07:34:20 +0000 (15:34 +0800)]
hdr: fix hdr color abnormal

PD#171738: hdr: fix hdr color abnormal

1. lcd send hdr flag according to panel config
2. 32bit revert

Change-Id: I6865d76e69acd504911dfa2ff30ab13e2cd8431d
Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
6 years agoddr: fix coverity check for dmc monitor
tao zeng [Wed, 29 Aug 2018 07:28:49 +0000 (15:28 +0800)]
ddr: fix coverity check for dmc monitor

PD#172256

Change-Id: Iaa80d73df756c58d59b2055a75a5ded5f0345c09
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
6 years agoamvecm: add ioctrl for sat/hue/contrast/pcmode/dnlp_en
Bencheng Jing [Wed, 25 Jul 2018 12:41:04 +0000 (20:41 +0800)]
amvecm: add ioctrl for sat/hue/contrast/pcmode/dnlp_en

PD#169671: amvecm: add ioctrl for sat/hue/contrast/pcmode/dnlp_en

Change-Id: Ib5257a577274561d367f29c48d464e810f1b0f91
Signed-off-by: Bencheng Jing <bencheng.jing@amlogic.com>
6 years agomodpost: eliminate the section mismatches warning
Jianxiong Pan [Mon, 27 Aug 2018 10:51:16 +0000 (18:51 +0800)]
modpost: eliminate the section mismatches warning

PD#172419: found 3 section mismatches

Change-Id: I886c06b7ebd17cb463ade5bc66f82c1c09400431
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
6 years agoddr: add dmc monitor driver tool [1/2]
tao zeng [Wed, 22 Aug 2018 06:34:44 +0000 (14:34 +0800)]
ddr: add dmc monitor driver tool [1/2]

PD#172256

1. Add dts config for dmc monitor of each chip;
2. rename ddr_band_port_desc.c to ddr_port_desc.c, to reuse
   name description of each DMC port and chip;
3. Implement driver code for dmc monitor.

Change-Id: I645ded2af519b858118365d359b1d47fa455039c
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
6 years agoatv_demod: optimize atv channel scan [1/1]
nengwen.chen [Tue, 28 Aug 2018 01:56:41 +0000 (09:56 +0800)]
atv_demod: optimize atv channel scan [1/1]

PD#171265: optimize atv channel scan

Change-Id: Iea0a9adcb7fad8757368f411274d05998516535f
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>