Commit Graph

615360 Commits

Author SHA1 Message Date
Cai YiWei
ca2856326a phy: rockchip: mipi-dphy-rx: csi_mipidphy add stream off
Change-Id: Ifee3d6fb80425fc505ed716cbcbe6cc48a9e02bb
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2019-02-22 11:56:41 +08:00
Jon Lin
3cbec52b29 arm: dts: rv1108: add nandc node
Change-Id: I34a1c10ada37b0473eb78d6daf650f1c152724d1
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-02-21 14:07:14 +08:00
Zorro Liu
197efdedb6 arm64: dts: rockchip: disable ddr auto freq for rk3368-xikp and rk3368-p9 boards
Change-Id: I7bc830e041f7ce5c984d90d45245a503e8039559
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2019-02-21 14:06:39 +08:00
Zheng Yang
01c37928eb drm: rockchip: dw-hdmi: fix rk3288 hdmi check YCbCr420 error
For platforms that do not support YCbCr420 output, it is not enough
to check only the pixel clock.

Change-Id: I0113ffb18aa4667384c621c4e80de2b68e4e8469
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-02-21 09:56:20 +08:00
Caesar Wang
c66526ad82 arm64: dts: rockchip: add the adc_keys for rk3399-sapphire-excavator-linux.dts
There are four adc keys on rk3399 sapphire excavator board, these are
ESC/MENU/VOL+/VOL- key.

Change-Id: I7ddb6343fd22240739a198665d9ccf82d4529af9
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2019-02-20 17:06:16 +08:00
Minchan Kim
7df0273f2c BACKPORT: mm: make unreserve highatomic functions reliable
Currently, unreserve_highatomic_pageblock bails out if it found highatomic
pageblock regardless of really moving free pages from the one so that it
could mitigate unreserve logic's goal which saves OOM of a process.

This patch makes unreserve functions bail out only if it moves some pages
out of !highatomic free list to avoid such false positive.

Another potential problem is that by race between page freeing and reserve
highatomic function, pages could be in highatomic free list even though
the pageblock is !high atomic migratetype.  In that case,
unreserve_highatomic_pageblock can be void if count of highatomic reserve
is less than pageblock_nr_pages.  We could solve it simply via draining
all of reserved pages before the OOM.  It would have a safeguard role to
exhuast reserved pages before converging to OOM.

BUG=chrome-os-partner:60028
TEST=for i in $(seq 100); do ./launchBalloons.sh 6 700 30 >/dev/null; done

Conflicts:
	mm/page_alloc.c
...this conflict resolution is trivial based on the conflict
resolution that was done as part of ("mm: try to exhaust highatomic
reserve before the OOM")

Link: http://lkml.kernel.org/r/1476259429-18279-5-git-send-email-minchan@kernel.org
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Sangseok Lee <sangseok.lee@lge.com>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
(cherry picked from akpm via linuxnext
 commit df6e3cc2c9168bdbf3abecec2821a6f9ae1a2128)
Reviewed-on: https://chromium-review.googlesource.com/414640
Reviewed-by: Guenter Roeck <groeck@chromium.org>

Change-Id: Ib3e9764c0aaa3b43e3afd05192a8c43e225adb81
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2019-02-20 14:56:31 +08:00
Minchan Kim
79b42a1ce7 BACKPORT: mm: try to exhaust highatomic reserve before the OOM
I got OOM report from production team with v4.4 kernel.  It had enough
free memory but failed to allocate GFP_KERNEL order-0 page and finally
encountered OOM kill.  It occured during QA process which launches several
apps, switching and so on.  It happned rarely.  IOW, In normal situation,
it was not a problem but if we are unluck so that several apps uses peak
memory at the same time, it can happen.  If we manage to pass the phase,
the system can go working well.

I could reproduce it with my test(memory spike easily. Look at below.

The reason is free pages(19M) of DMA32 zone are reserved for
HIGHORDERATOMIC and doesn't unreserved before the OOM.

balloon invoked oom-killer: gfp_mask=0x24280ca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), order=0, oom_score_adj=0
balloon cpuset=/ mems_allowed=0
CPU: 1 PID: 8473 Comm: balloon Tainted: G        W  OE   4.8.0-rc7-00219-g3f74c9559583-dirty #3161
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
 0000000000000000 ffff88007f15bbc8 ffffffff8138eb13 ffff88007f15bd88
 ffff88005a72a4c0 ffff88007f15bc28 ffffffff811d2d13 ffff88007f15bc08
 ffffffff8146a5ca ffffffff81c8df60 0000000000000015 0000000000000206
Call Trace:
 [<ffffffff8138eb13>] dump_stack+0x63/0x90
 [<ffffffff811d2d13>] dump_header+0x5c/0x1ce
 [<ffffffff8146a5ca>] ? virtballoon_oom_notify+0x2a/0x80
 [<ffffffff81171e5e>] oom_kill_process+0x22e/0x400
 [<ffffffff8117222c>] out_of_memory+0x1ac/0x210
 [<ffffffff811775ce>] __alloc_pages_nodemask+0x101e/0x1040
 [<ffffffff811a245a>] handle_mm_fault+0xa0a/0xbf0
 [<ffffffff8106029d>] __do_page_fault+0x1dd/0x4d0
 [<ffffffff81060653>] trace_do_page_fault+0x43/0x130
 [<ffffffff81059bda>] do_async_page_fault+0x1a/0xa0
 [<ffffffff817a3f38>] async_page_fault+0x28/0x30
Mem-Info:
active_anon:383949 inactive_anon:106724 isolated_anon:0
 active_file:15 inactive_file:44 isolated_file:0
 unevictable:0 dirty:0 writeback:24 unstable:0
 slab_reclaimable:2483 slab_unreclaimable:3326
 mapped:0 shmem:0 pagetables:1906 bounce:0
 free:6898 free_pcp:291 free_cma:0
Node 0 active_anon:1535796kB inactive_anon:426896kB active_file:60kB inactive_file:176kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:0kB writeback:96kB shmem:0kB writeback_tmp:0kB unstable:0kB pages_scanned:1418 all_unreclaimable? no
DMA free:8188kB min:44kB low:56kB high:68kB active_anon:7648kB inactive_anon:0kB active_file:0kB inactive_file:4kB unevictable:0kB writepending:0kB present:15992kB managed:15908kB mlocked:0kB slab_reclaimable:0kB slab_unreclaimable:20kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
lowmem_reserve[]: 0 1952 1952 1952
DMA32 free:19404kB min:5628kB low:7624kB high:9620kB active_anon:1528148kB inactive_anon:426896kB active_file:60kB inactive_file:420kB unevictable:0kB writepending:96kB present:2080640kB managed:2030092kB mlocked:0kB slab_reclaimable:9932kB slab_unreclaimable:13284kB kernel_stack:2496kB pagetables:7624kB bounce:0kB free_pcp:900kB local_pcp:112kB free_cma:0kB
lowmem_reserve[]: 0 0 0 0
DMA: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 2*4096kB (H) = 8192kB
DMA32: 7*4kB (H) 8*8kB (H) 30*16kB (H) 31*32kB (H) 14*64kB (H) 9*128kB (H) 2*256kB (H) 2*512kB (H) 4*1024kB (H) 5*2048kB (H) 0*4096kB = 19484kB
51131 total pagecache pages
50795 pages in swap cache
Swap cache stats: add 3532405601, delete 3532354806, find 124289150/1822712228
Free swap  = 8kB
Total swap = 255996kB
524158 pages RAM
0 pages HighMem/MovableOnly
12658 pages reserved
0 pages cma reserved
0 pages hwpoisoned

Another example exceeded the limit by the race is

in:imklog: page allocation failure: order:0, mode:0x2280020(GFP_ATOMIC|__GFP_NOTRACK)
CPU: 0 PID: 476 Comm: in:imklog Tainted: G            E   4.8.0-rc7-00217-g266ef83c51e5-dirty #3135
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
 0000000000000000 ffff880077c37590 ffffffff81389033 0000000000000000
 0000000000000000 ffff880077c37618 ffffffff8117519b 0228002000000000
 ffffffffffffffff ffffffff81cedb40 0000000000000000 0000000000000040
Call Trace:
 [<ffffffff81389033>] dump_stack+0x63/0x90
 [<ffffffff8117519b>] warn_alloc_failed+0xdb/0x130
 [<ffffffff81175746>] __alloc_pages_nodemask+0x4d6/0xdb0
 [<ffffffff8120c149>] ? bdev_write_page+0xa9/0xd0
 [<ffffffff811a97b3>] ? __page_check_address+0xd3/0x130
 [<ffffffff811ba4ea>] ? deactivate_slab+0x12a/0x3e0
 [<ffffffff811b9549>] new_slab+0x339/0x490
 [<ffffffff811bad37>] ___slab_alloc.constprop.74+0x367/0x480
 [<ffffffff814601ad>] ? alloc_indirect.isra.14+0x1d/0x50
 [<ffffffff8109d0c2>] ? default_wake_function+0x12/0x20
 [<ffffffff811bae70>] __slab_alloc.constprop.73+0x20/0x40
 [<ffffffff811bb034>] __kmalloc+0x1a4/0x1e0
 [<ffffffff814601ad>] alloc_indirect.isra.14+0x1d/0x50
 [<ffffffff81460434>] virtqueue_add_sgs+0x1c4/0x470
 [<ffffffff81365075>] ? __bt_get.isra.8+0xe5/0x1c0
 [<ffffffff8150973e>] __virtblk_add_req+0xae/0x1f0
 [<ffffffff810b37d0>] ? wake_atomic_t_function+0x60/0x60
 [<ffffffff810337b9>] ? sched_clock+0x9/0x10
 [<ffffffff81360afb>] ? __blk_mq_alloc_request+0x10b/0x230
 [<ffffffff8135e293>] ? blk_rq_map_sg+0x213/0x550
 [<ffffffff81509a1d>] virtio_queue_rq+0x12d/0x290
 [<ffffffff813629c9>] __blk_mq_run_hw_queue+0x239/0x370
 [<ffffffff8136276f>] blk_mq_run_hw_queue+0x8f/0xb0
 [<ffffffff8136397c>] blk_mq_insert_requests+0x18c/0x1a0
 [<ffffffff81364865>] blk_mq_flush_plug_list+0x125/0x140
 [<ffffffff813596a7>] blk_flush_plug_list+0xc7/0x220
 [<ffffffff81359bec>] blk_finish_plug+0x2c/0x40
 [<ffffffff8117b836>] __do_page_cache_readahead+0x196/0x230
 [<ffffffffa00006ba>] ? zram_free_page+0x3a/0xb0 [zram]
 [<ffffffff8116f928>] filemap_fault+0x448/0x4f0
 [<ffffffff8119e9e4>] ? alloc_set_pte+0xe4/0x350
 [<ffffffff8125fa16>] ext4_filemap_fault+0x36/0x50
 [<ffffffff8119be35>] __do_fault+0x75/0x140
 [<ffffffff8119f6cd>] handle_mm_fault+0x84d/0xbe0
 [<ffffffff812483e4>] ? kmsg_read+0x44/0x60
 [<ffffffff8106029d>] __do_page_fault+0x1dd/0x4d0
 [<ffffffff81060653>] trace_do_page_fault+0x43/0x130
 [<ffffffff81059bda>] do_async_page_fault+0x1a/0xa0
 [<ffffffff8179dcb8>] async_page_fault+0x28/0x30
Mem-Info:
active_anon:363826 inactive_anon:121283 isolated_anon:32
 active_file:65 inactive_file:152 isolated_file:0
 unevictable:0 dirty:0 writeback:46 unstable:0
 slab_reclaimable:2778 slab_unreclaimable:3070
 mapped:112 shmem:0 pagetables:1822 bounce:0
 free:9469 free_pcp:231 free_cma:0
Node 0 active_anon:1455304kB inactive_anon:485132kB active_file:260kB inactive_file:608kB unevictable:0kB isolated(anon):128kB isolated(file):0kB mapped:448kB dirty:0kB writeback:184kB shmem:0kB writeback_tmp:0kB unstable:0kB pages_scanned:13641 all_unreclaimable? no
DMA free:7748kB min:44kB low:56kB high:68kB active_anon:7944kB inactive_anon:104kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:15992kB managed:15908kB mlocked:0kB slab_reclaimable:0kB slab_unreclaimable:108kB kernel_stack:0kB pagetables:4kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
lowmem_reserve[]: 0 1952 1952 1952
DMA32 free:30128kB min:5628kB low:7624kB high:9620kB active_anon:1447360kB inactive_anon:485028kB active_file:260kB inactive_file:608kB unevictable:0kB writepending:184kB present:2080640kB managed:2030132kB mlocked:0kB slab_reclaimable:11112kB slab_unreclaimable:12172kB kernel_stack:2400kB pagetables:7284kB bounce:0kB free_pcp:924kB local_pcp:72kB free_cma:0kB
lowmem_reserve[]: 0 0 0 0
DMA: 7*4kB (UE) 3*8kB (UH) 1*16kB (M) 0*32kB 2*64kB (U) 1*128kB (M) 1*256kB (U) 0*512kB 1*1024kB (U) 1*2048kB (U) 1*4096kB (H) = 7748kB
DMA32: 10*4kB (H) 3*8kB (H) 47*16kB (H) 38*32kB (H) 5*64kB (H) 1*128kB (H) 2*256kB (H) 3*512kB (H) 3*1024kB (H) 3*2048kB (H) 4*4096kB (H) = 30128kB
2775 total pagecache pages
2536 pages in swap cache
Swap cache stats: add 206786828, delete 206784292, find 7323106/106686077
Free swap  = 108744kB
Total swap = 255996kB
524158 pages RAM
0 pages HighMem/MovableOnly
12648 pages reserved
0 pages cma reserved
0 pages hwpoisoned

It's weird to show that zone has enough free memory above min
watermark but OOMed with 4K GFP_KERNEL allocation due to
reserved highatomic pages. As last resort, try to unreserve
highatomic pages again and if it has moved pages to
non-highatmoc free list, retry reclaim once more.

BUG=chrome-os-partner:60028
TEST=for i in $(seq 100); do ./launchBalloons.sh 6 700 30 >/dev/null; done

Conflicts:
	mm/page_alloc.c
...upstream has a whole lot of differences.  I took my best guess at
the location for the new call to unreserve_highatomic_pageblock().

Link: http://lkml.kernel.org/r/1476259429-18279-4-git-send-email-minchan@kernel.org
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Sangseok Lee <sangseok.lee@lge.com>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
(cherry picked akpm via linuxnext
 from commit 4284cb9a20e1f1c75f7b173b3f8ba6fea781cf77)
Reviewed-on: https://chromium-review.googlesource.com/414639
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>

Change-Id: Idaec3271e337469d03a55e99e0cd00f6d79d196e
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2019-02-20 14:56:31 +08:00
Minchan Kim
9b95697cc7 UPSTREAM: mm: don't steal highatomic pageblock
Patch series "use up highorder free pages before OOM", v3.

I got OOM report from production team with v4.4 kernel.  It had enough
free memory but failed to allocate GFP_KERNEL order-0 page and finally
encountered OOM kill.  It occured during QA process which launches
several apps, switching and so on.  It happned rarely.  IOW, In normal
situation, it was not a problem but if we are unluck so that several
apps uses peak memory at the same time, it can happen.  If we manage to
pass the phase, the system can go working well.

I could reproduce it with my test(memory spike easily.  Look at below.

The reason is free pages(19M) of DMA32 zone are reserved for
HIGHORDERATOMIC and doesn't unreserved before the OOM.

  balloon invoked oom-killer: gfp_mask=0x24280ca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), order=0, oom_score_adj=0
  balloon cpuset=/ mems_allowed=0
  CPU: 1 PID: 8473 Comm: balloon Tainted: G        W  OE   4.8.0-rc7-00219-g3f74c9559583-dirty #3161
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
  Call Trace:
    dump_stack+0x63/0x90
    dump_header+0x5c/0x1ce
    oom_kill_process+0x22e/0x400
    out_of_memory+0x1ac/0x210
    __alloc_pages_nodemask+0x101e/0x1040
    handle_mm_fault+0xa0a/0xbf0
    __do_page_fault+0x1dd/0x4d0
    trace_do_page_fault+0x43/0x130
    do_async_page_fault+0x1a/0xa0
    async_page_fault+0x28/0x30
  Mem-Info:
  active_anon:383949 inactive_anon:106724 isolated_anon:0
   active_file:15 inactive_file:44 isolated_file:0
   unevictable:0 dirty:0 writeback:24 unstable:0
   slab_reclaimable:2483 slab_unreclaimable:3326
   mapped:0 shmem:0 pagetables:1906 bounce:0
   free:6898 free_pcp:291 free_cma:0
  Node 0 active_anon:1535796kB inactive_anon:426896kB active_file:60kB inactive_file:176kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:0kB writeback:96kB shmem:0kB writeback_tmp:0kB unstable:0kB pages_scanned:1418 all_unreclaimable? no
  DMA free:8188kB min:44kB low:56kB high:68kB active_anon:7648kB inactive_anon:0kB active_file:0kB inactive_file:4kB unevictable:0kB writepending:0kB present:15992kB managed:15908kB mlocked:0kB slab_reclaimable:0kB slab_unreclaimable:20kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
  lowmem_reserve[]: 0 1952 1952 1952
  DMA32 free:19404kB min:5628kB low:7624kB high:9620kB active_anon:1528148kB inactive_anon:426896kB active_file:60kB inactive_file:420kB unevictable:0kB writepending:96kB present:2080640kB managed:2030092kB mlocked:0kB slab_reclaimable:9932kB slab_unreclaimable:13284kB kernel_stack:2496kB pagetables:7624kB bounce:0kB free_pcp:900kB local_pcp:112kB free_cma:0kB
  lowmem_reserve[]: 0 0 0 0
  DMA: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 2*4096kB (H) = 8192kB
  DMA32: 7*4kB (H) 8*8kB (H) 30*16kB (H) 31*32kB (H) 14*64kB (H) 9*128kB (H) 2*256kB (H) 2*512kB (H) 4*1024kB (H) 5*2048kB (H) 0*4096kB = 19484kB
  51131 total pagecache pages
  50795 pages in swap cache
  Swap cache stats: add 3532405601, delete 3532354806, find 124289150/1822712228
  Free swap  = 8kB
  Total swap = 255996kB
  524158 pages RAM
  0 pages HighMem/MovableOnly
  12658 pages reserved
  0 pages cma reserved
  0 pages hwpoisoned

Another example exceeded the limit by the race is

  in:imklog: page allocation failure: order:0, mode:0x2280020(GFP_ATOMIC|__GFP_NOTRACK)
  CPU: 0 PID: 476 Comm: in:imklog Tainted: G            E   4.8.0-rc7-00217-g266ef83c51e5-dirty #3135
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
  Call Trace:
    dump_stack+0x63/0x90
    warn_alloc_failed+0xdb/0x130
    __alloc_pages_nodemask+0x4d6/0xdb0
    new_slab+0x339/0x490
    ___slab_alloc.constprop.74+0x367/0x480
    __slab_alloc.constprop.73+0x20/0x40
    __kmalloc+0x1a4/0x1e0
    alloc_indirect.isra.14+0x1d/0x50
    virtqueue_add_sgs+0x1c4/0x470
    __virtblk_add_req+0xae/0x1f0
    virtio_queue_rq+0x12d/0x290
    __blk_mq_run_hw_queue+0x239/0x370
    blk_mq_run_hw_queue+0x8f/0xb0
    blk_mq_insert_requests+0x18c/0x1a0
    blk_mq_flush_plug_list+0x125/0x140
    blk_flush_plug_list+0xc7/0x220
    blk_finish_plug+0x2c/0x40
    __do_page_cache_readahead+0x196/0x230
    filemap_fault+0x448/0x4f0
    ext4_filemap_fault+0x36/0x50
    __do_fault+0x75/0x140
    handle_mm_fault+0x84d/0xbe0
    __do_page_fault+0x1dd/0x4d0
    trace_do_page_fault+0x43/0x130
    do_async_page_fault+0x1a/0xa0
    async_page_fault+0x28/0x30
  Mem-Info:
  active_anon:363826 inactive_anon:121283 isolated_anon:32
   active_file:65 inactive_file:152 isolated_file:0
   unevictable:0 dirty:0 writeback:46 unstable:0
   slab_reclaimable:2778 slab_unreclaimable:3070
   mapped:112 shmem:0 pagetables:1822 bounce:0
   free:9469 free_pcp:231 free_cma:0
  Node 0 active_anon:1455304kB inactive_anon:485132kB active_file:260kB inactive_file:608kB unevictable:0kB isolated(anon):128kB isolated(file):0kB mapped:448kB dirty:0kB writeback:184kB shmem:0kB writeback_tmp:0kB unstable:0kB pages_scanned:13641 all_unreclaimable? no
  DMA free:7748kB min:44kB low:56kB high:68kB active_anon:7944kB inactive_anon:104kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:15992kB managed:15908kB mlocked:0kB slab_reclaimable:0kB slab_unreclaimable:108kB kernel_stack:0kB pagetables:4kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
  lowmem_reserve[]: 0 1952 1952 1952
  DMA32 free:30128kB min:5628kB low:7624kB high:9620kB active_anon:1447360kB inactive_anon:485028kB active_file:260kB inactive_file:608kB unevictable:0kB writepending:184kB present:2080640kB managed:2030132kB mlocked:0kB slab_reclaimable:11112kB slab_unreclaimable:12172kB kernel_stack:2400kB pagetables:7284kB bounce:0kB free_pcp:924kB local_pcp:72kB free_cma:0kB
  lowmem_reserve[]: 0 0 0 0
  DMA: 7*4kB (UE) 3*8kB (UH) 1*16kB (M) 0*32kB 2*64kB (U) 1*128kB (M) 1*256kB (U) 0*512kB 1*1024kB (U) 1*2048kB (U) 1*4096kB (H) = 7748kB
  DMA32: 10*4kB (H) 3*8kB (H) 47*16kB (H) 38*32kB (H) 5*64kB (H) 1*128kB (H) 2*256kB (H) 3*512kB (H) 3*1024kB (H) 3*2048kB (H) 4*4096kB (H) = 30128kB
  2775 total pagecache pages
  2536 pages in swap cache
  Swap cache stats: add 206786828, delete 206784292, find 7323106/106686077
  Free swap  = 108744kB
  Total swap = 255996kB
  524158 pages RAM
  0 pages HighMem/MovableOnly
  12648 pages reserved
  0 pages cma reserved
  0 pages hwpoisoned

During the investigation, I found some problems with highatomic so this
patch aims to solve the problems and the final goal is to unreserve
every highatomic free pages before the OOM kill.

This patch (of 4):

In page freeing path, migratetype is racy so that a highorderatomic page
could free into non-highorderatomic free list.  If that page is
allocated, VM can change the pageblock from higorderatomic to something.
In that case, highatomic pageblock accounting is broken so it doesn't
work(e.g., VM cannot reserve highorderatomic pageblocks any more
although it doesn't reach 1% limit).

So, this patch prohibits the changing from highatomic to other type.
It's no problem because MIGRATE_HIGHATOMIC is not listed in fallback
array so stealing will only happen due to unexpected races which is
really rare.  Also, such prohibiting keeps highatomic pageblock more
longer so it would be better for highorderatomic page allocation.

Link: http://lkml.kernel.org/r/1476259429-18279-2-git-send-email-minchan@kernel.org
Signed-off-by: Minchan Kim <minchan@kernel.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Sangseok Lee <sangseok.lee@lge.com>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 88ed365ea2)

Change-Id: I446fe4977b45d56da322638d051f3ac0eb35238d
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2019-02-20 14:56:31 +08:00
Simon Xue
733e2b512a arm64: dts: rockchip: miss RK3328 WDT clock
Change-Id: I4df6373a3323ebf0fed74dddabc387164cd0aa5c
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2019-02-20 14:10:17 +08:00
Shixiang Zheng
8f2b75df0e ARM: dts: rockchip: rk3288-android: add assigned clocks for rga
Change-Id: Ice88b6a58b2f7c766b5cd42291bddbdbfb50cb2d
Signed-off-by: Shixiang Zheng <shixiang.zheng@rock-chips.com>
2019-02-20 11:34:34 +08:00
Wyon Bi
b7c62bbf2d ARM: dts: rockchip: remove lvds bus format comment
Change-Id: I9e46b6d026db584365a88f918f20f1773bff15cc
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-19 14:12:31 +08:00
Wyon Bi
361ae22ff9 arm64: dts: rockchip: remove lvds bus format comment
Change-Id: I0693ef2a36222df0eca676837662e41972b9706b
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-19 14:12:30 +08:00
Wyon Bi
48a6e78673 drm/rockchip/rk618: lvds: Add support for MEDIA_BUS_FMT_RGB666_1X7X3_JEIDA bus format
Change-Id: I2d173633373137ac103946aceedc39bb8118d35a
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-19 14:12:29 +08:00
Wyon Bi
1688ac79be drm/rockchip: vop: Add support for MEDIA_BUS_FMT_RGB666_1X7X3_JEIDA bus format
Change-Id: Ie615fe85d8e0500033b0e876e00ed923756b5898
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-19 14:12:28 +08:00
Wyon Bi
58ef97d6a9 drm/rockchip: lvds: Add support for MEDIA_BUS_FMT_RGB666_1X7X3_JEIDA bus format
Change-Id: I1aaa9d6ea899704b784e97450441bcdeabb095a6
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-19 14:12:27 +08:00
Wyon Bi
346a749a73 dt-bindings: display: media-bus-format: Sync with include/uapi/linux/media-bus-format.h
Change-Id: I3f6deb2e264956205da725aa78f79ee7404d13a8
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-19 14:10:11 +08:00
Wyon Bi
fb2e95bef9 media: Add MEDIA_BUS_FMT_RGB666_1X7X3_JEIDA media bus code definitions
This patch adds a new RGB media bus formats that describe
18-bit samples transferred over an LVDS bus with three
differential data pairs, serialized into 7 time slots,
using standard JEIDA data ordering.

Change-Id: Ia0bedd53e57aa34829a0d61b144aa99a1c98cffd
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-19 14:08:12 +08:00
Wyon Bi
85a84917d5 video/drm: lvds: Correct P2S_EN register field on px30
Change-Id: Ia82a463437fbcf0b45805f65647e9bbfd0cdf43e
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-19 12:54:25 +08:00
XiaoDong Huang
f611ec6c1c arm64: dts: rockchip: rk1808-evb: change pmic pinctrl of the pmic_sleep pin
For sleep function, switch gpio0_a4 iomux to gpio;
For reset function, switch gpio0_a4 iomux to pmic_sleep;

Change-Id: I2f49eaa1522bc2af01d1c6a8061af7fc60915b3d
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2019-02-18 16:06:38 +08:00
Longjian Lin
b5dc63f92c arm64: dts: rockchip: pulldown BT irq gpio for rk3399pro evb
Change-Id: I0426e9335154b9069fa3d73068250745b8481053
Signed-off-by: Longjian Lin <llj@rock-chips.com>
2019-02-18 16:06:20 +08:00
Caesar Wang
d8bc92af0a regulator: core: Fix device link error when registering regulator
The sysfs device link can only be created after regulator device
registered.

Otherwise, the regulator always have some warning logs.
...
[    1.033024] DCDC_REG1: supplied by vcc5v0_sys
[    1.033427] vcc5v0_sys: could not add device link regulator.3 err -2
[    1.034302] vdd_center: 750 <--> 1350 mV at 900 mV
[    1.034862] rk808 0-0020: Looking up vcc2-supply from device tree
[    1.034907] DCDC_REG2: supplied by vcc5v0_sys
[    1.035298] vcc5v0_sys: could not add device link regulator.4 err -2
[    1.036301] vdd_cpu_l: 750 <--> 1350 mV at 900 mV
[    1.036837] rk808 0-0020: Looking up vcc3-supply from device tree
[    1.036880] DCDC_REG3: supplied by vcc5v0_sys
[    1.037271] vcc5v0_sys: could not add device link regulator.5 err -2
[    1.037985] vcc_ddr: at 500 mV
[    1.038508] rk808 0-0020: Looking up vcc4-supply from device tree
[    1.038550] DCDC_REG4: supplied by vcc5v0_sys
[    1.038941] vcc5v0_sys: could not add device link regulator.6 err -2
[    1.039657] vcc3v3_sys: 3300 mV
[    1.040179] rk808 0-0020: Looking up vcc9-supply from device tree
[    1.040223] DCDC_REG5: supplied by vcc5v0_sys

Fixes: c438b9d017 ("regulator: core: Move registration of regulator device")

Change-Id: Ie20421eab45f3f8229a5bedf3fecf99c757160bb
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2019-02-18 16:03:19 +08:00
Wang Panzhenzhuan
5e0baa55b6 media: rockchip: isp1: fix high fps preview blurred bug
fix following camera err:
    rkisp1: CIF_ISP_PIC_SIZE_ERROR (0x00000002)

Change-Id: I6168d352d521cf75d7537ffe70a9af6f2ec07282
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2019-02-18 09:45:40 +08:00
Liang Chen
83ad402c20 arm64: dts: rockchip: adjust opp-table for rk1808 SoCs
Auto select opp-table level by pvtm value.

Change-Id: I6043bd768452c84290715428500e4f72068eac0d
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-02-15 18:05:25 +08:00
Simon Xue
9642bc8824 PCI: rockchip: fix failed to enter L2 link state
The ioremap operation for the msg_region move to the bottom of the
rockchip_cfg_atu to make msg_region make sense which used for sending
PME_TURN_OFF message to make PCIe link enter L2 state

Change-Id: I50d1bef5d534102ed5b7db474c3f819e656fd626
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2019-02-15 17:53:20 +08:00
Shunqian Zheng
646ffe1fc1 ARM: dts: rk3128/px3se: enable video phy node for linux dts
Change-Id: I6a1e5139709c8d367e636c80533cc85ddb1e496e
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
2019-02-15 14:24:13 +08:00
Cai YiWei
931422cb12 media: i2c: add imx327
Change-Id: Idffad2860d824ba445d4fecd08b7f000d77bf980
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2019-02-15 11:09:24 +08:00
Cai YiWei
555ccf739b dt-bindings: Document add imx327
Change-Id: I4f174e1c6fa49692138035909cef6534fa35fcab
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2019-02-15 11:09:24 +08:00
Wyon Bi
42eab4ff2f drm/bridge: analogix_dp: fix spelling mistake "suspend" -> "suspend_late"
Fixes: 0b8c593910 ("BACKPORT: drm/bridge: analogix: Do not use device's drvdata")
Change-Id: I4b4bd81e895022ddee0bbfd727bf05eb4d7864f2
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-15 09:53:23 +08:00
Huibin Hong
5f289855ae serial: 8250: enable Programmable THRE Interrupt for tx
Programmable THRE Interrupt mode in order to increase system
performance.

Change-Id: Ic1ef9ecae0c6feb00170ad97ee3c6245ca3bf068
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2019-02-14 17:49:31 +08:00
Huibin Hong
11850f5985 serial: 8250: support rx dma mode only
Most SOCS have only 8 or 6 channels, but have more than 16
peripherals. If those peripherals work together, some
fails to request dma channel, because there are no enough
channels. And maybe it's unnecessary to use dma for uart
tx. It is necessary for uart rx when hardware auto flow
control is not used.

&uart0 {
	dma-names = "!tx", "rx";  // disable uart tx with dma
	status = "okay";
};

Change-Id: Ia74477514ba57300a4d19a5c2565ae7b5b8ab521
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2019-02-14 17:49:31 +08:00
Wang Panzhenzhuan
656576327b arm: dts: rockchip: rk3288-th804 9.0 add gc2145 and ov8858 support
Change-Id: Ia8d480fe12e4ee9eee19a5bb147cf564fb2b468b
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2019-02-14 15:33:47 +08:00
Wang Panzhenzhuan
f9f18ded32 arm: dts: rockchip: rk3288 add rkisp1
rk3288.dtsi add rkisp1 node &&
pinctrl isp_dvp_d2d9 remove cif_clkout

Change-Id: I823579e02dc81e54c9a7f8e2e9760be66a2a820c
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2019-02-14 15:02:24 +08:00
David Wu
af32e02ec9 iio: adc: rockchip: Don't return fail at probe when the regulator is dummy
If the referenced regulator is a dummy, the voltage is invalid,
but someone doesn't need the voltage, just need the adc value,
so don't return fail at probe when the regulator is dummy. If
he wants the voltage, configures the actual referenced regulator
at dts.

Change-Id: I8eaecc1a8e7e57c3a87aa69b9b852735bf4a025a
Signed-off-by: David Wu <david.wu@rock-chips.com>
2019-02-14 14:48:26 +08:00
Wang Panzhenzhuan
6e34d6d8e2 arm64: dts: rockchip: rk3368-xikp 9.0 add gc2145 and ov8858 support
Add camera sensor gc2145 and ov8858 &&
rk3368-android.dtsi pinctrl isp_dvp_d2d9 remove
needless cif_clkout for rk3368-xik-avb 9.0

Change-Id: Iee5b5f412abb36c28b6266cdc27106994b9aac00
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2019-02-14 09:38:59 +08:00
Wang Panzhenzhuan
beedfb0451 media: i2c: add sensor ov8858
support R2A two lane

Change-Id: I36d09e83d5320c53e44ca34edf9255c2adcab29a
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2019-02-14 09:36:41 +08:00
Caesar Wang
a209651073 arm64: dts: rockchip: fixes incorrect wifi chip on rk3399pro evb
As the wifi module used the ap6398s on rk3399pro evb, not the ap6255.
Even though the wifi chip name isn't effect to load wifi module, at least
it won't be misunderstand.

Change-Id: Icd44ce27d9aebcdb0d252f7c8c1dabce657cd573
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2019-02-13 20:19:19 +08:00
Caesar Wang
ba93e854dd arm64: dts: rockchip: enable ramoops for rk3399-linux.dtsi
This patch enables the ramoops to fetch some logs for debugging and
testing, the log will save on /sys/fs/pstore/console-ramoops*.

Change-Id: I47c9efbd1a0e17228e07fd6ad87a446babb265ab
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2019-02-13 18:02:04 +08:00
Cai YiWei
44cd19a79c media: rockchip/cif: support input raw/y format
dvp input raw/y, will output 16bit per pixel,
so output format shuold be raw16/y16.

Change-Id: I13e05ebe62b8802fa3a4c51f603c420e8127b929
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2019-02-13 09:46:20 +08:00
Cai YiWei
af31f3c99d media: rockchip: isp1: rk3368 only support mainpath
Change-Id: Ieb819cec2869a18b5343d39bf950d154bae96964
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2019-02-13 09:46:07 +08:00
Cai YiWei
d9c5282a8a media: rockchip: isp1: add check for get_remote_sensor
Change-Id: Ic09b394daa96aa8227b327f1e59713a359be8c18
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2019-02-13 09:43:32 +08:00
William Wu
dca0c15a2d usb: dwc3: rockchip: use devm_extcon_register_notifier
This patch uses the devm_extcon_register_notifier to
manage the resource automatically.

Change-Id: I427c54d59283ee97623ad829e42dac40516c3df4
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-02-12 15:22:28 +08:00
William Wu
323ccc3640 usb: dwc3: rockchip: fix rk3399 dwc3 host power on fail
RK3399 Excavator Board has an USB 3.0 PHY power on issue
when Type-A USB 3.0 Host port connects with an USB 3.0
device and do system PM suspend/resume test.

When the issue happens, we gets the following error log:

phy phy-ff800000.phy.4: phy poweron failed --> -110
dpm_run_callback(): platform_pm_resume+0x0/0x54 returns -110
PM: Device fe900000.dwc3 failed to resume: error -110
xhci-hcd xhci-hcd.12.auto: port 0 resume PLC timeout

It's because that the Type-C PHY docs say that the DWC3
controller "needs to be held in reset to set the PIPE
power state in P2 before initializing the Type-C PHY",
but actually the PIPE is in P0 state because an USB 3.0
device is connected, and the current code doesn't reset
the DWC3 controller upon PM resume.

This patch prevents powering off the USB 3.0 PHY of
RK3399 Type-A USB 3.0 Host port when system enters
syspend. As a side effect, the power consumption in
standby mode will increase. However, if you want to
optimize the power consumption in standby mode and
allow the USB device to be reenumerated upon PM resume,
you can add a property "needs-reset-on-resume" in
DWC3 DTS like this:

&usbdrd3_1 {
	needs-reset-on-resume;
};

Change-Id: Ia1cdf6e09cac520e99931a15423b8de7be2ba52b
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-02-12 15:22:27 +08:00
William Wu
b2c584c65b dt-bindings: usb: dwc3: add needs-reset-on-resume property
This patch adds a new property "needs-reset-on-resume" for
Rockchip DWC3 IP. We can use it if we want to reset the DWC3
controller upon PM resume.

Change-Id: I8ae7f8fe46388cdc9e265e758d9edeb82840d284
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-02-12 15:22:07 +08:00
XiaoDong Huang
f9d77e7b33 arm64: dts: rockchip: rk1808: support cpu idle
Change-Id: Ic72e2f01e81c0e8853b90158675092595973b94a
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2019-02-12 09:55:16 +08:00
Yifeng Zhao
6dfc7913e7 drivers: rk_nand: support SKHynix 14nm 2D 16GB Nand Flash
support SKHynix 14nm 2D 16GB NAND FLASH H27TDG8T2D8R.

Change-Id: Ic465d325e6660cf1dc6db686391005529dd8fbeb
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-02-12 09:30:03 +08:00
Yifeng Zhao
f7468ce49e drivers: rk_nand: fix the exception of f2fs execution discard function
If the discard_granularity of the NAND flash block device has not
been initialized, then the DM device will not set max_discard_sectors
while it is created,and f2fs will have exceptions when it performs
the discard function.

bug:
WARNING: at fs/f2fs/segment.c:1212
[   28.075747] Hardware name: Rockchip rk3326 863 avb board (DT)
[   28.075767] task: ffffffc03b08d100 task.stack: ffffffc02f0b4000
[   28.075802] PC is at __submit_discard_cmd+0x1b4/0x4ec
[   28.075840] LR is at __issue_discard_cmd+0x1b8/0x248
[   28.075859] pc : [<ffffff800831f218>] lr : [<ffffff800831f8d0>] pstate: 60400145
[   28.075874] sp : ffffffc02f0b7be0

Change-Id: I940728a675e7a30a05742bf2a7dcace92f7a2354
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-02-12 09:29:48 +08:00
Wyon Bi
bc4c7f125e ARM: dts: rockchip: rk3288: assign clock rate for ACLK_VIO0 and ACLK_VIO1
Change-Id: I87fbbe3e043b040f8b9b9c79f21a8327b8e32bd0
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-01 17:03:07 +08:00
Xing Zheng
fb55546177 ARM: dts: rockchip: enable 2 micbias properties for rk3308 amic boards
Change-Id: I163f1a09cdaf9e9b4e6bb4c0d78e8a9af72acfa9
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-01 11:51:37 +08:00
Xing Zheng
fa272563f2 arm64: dts: rockchip: enable 2 micbias properties for rk3308 amic boards
Change-Id: I183025bebe9c6d041c7a883ab4c2ae06fe8f82ca
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-01 11:51:32 +08:00
Xing Zheng
9c163ef822 ASoC: rk3308_codec: Add the range of MICBIAS voltages
Change-Id: Ie9d1d4fc8854cc4111cbb1a324525f849c5c470a
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-01 11:51:21 +08:00