platform/kernel/linux-amlogic.git
6 years agodts: create p230 buildroot dts
liangzhuo.xie [Tue, 7 Nov 2017 07:11:11 +0000 (15:11 +0800)]
dts: create p230 buildroot dts

PD#146897: create p230 buildroot dts.[2/2]

Change-Id: If1ad7718cad1c52ece538dd06288ab7d3905e1c5
Signed-off-by: liangzhuo.xie <liangzhuo.xie@amlogic.com>
6 years agomm: change memory pre-alloc of page trace
tao zeng [Mon, 30 Oct 2017 07:50:13 +0000 (15:50 +0800)]
mm: change memory pre-alloc of page trace

PD#153090: mm: change memory pre-alloc of page trace

Use standard API of alloc_page* instead of directly delete page
lru from buddy.

Change-Id: Ia537d39f5d4e7e66c2c36eeeaf837b09bbccebff
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
6 years agoPD#153899: p241: add arch/arm64/boot/dts/amlogic/gxl_p241_1g.dts [2/2]
Xindong Xu [Mon, 6 Nov 2017 10:19:13 +0000 (18:19 +0800)]
PD#153899: p241: add arch/arm64/boot/dts/amlogic/gxl_p241_1g.dts [2/2]

1. init gxl_p241_1g.dts from gxl_p241_1g_buildroot.dts
2. change gxl_p241_1g.dts accord to gxl_p212_1g.dts in
   4.9 & gxl_p241_1g.dts in 3.14

Change-Id: I73ab298776ca257f79f4f54b5a4e619dd8af1a15
Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
6 years agodts: fix the boot-strap crash
liangzhuo.xie [Mon, 6 Nov 2017 09:08:07 +0000 (17:08 +0800)]
dts: fix the boot-strap crash

PD#152825: fix the boot-strap crash

Change-Id: I427e09237b8fef508f129b509d5045eae7bd2149
Signed-off-by: liangzhuo.xie <liangzhuo.xie@amlogic.com>
6 years agodefconfig: meson64: add CONFIG_HIDRAW
Kuibao Zhang [Wed, 1 Nov 2017 12:50:28 +0000 (20:50 +0800)]
defconfig: meson64: add CONFIG_HIDRAW

PD#150889: Support Android O BT remote audio

1.CONFIG_HIDRAW=y

Change-Id: I21cf8d6f33c11477f8d54295c48dc9fdb752ec37
Signed-off-by: Kuibao Zhang <kuibao.zhang@amlogic.com>
6 years agoPD#153316: media: sync decoder code with 3.14 trunk
Hui Zhang [Tue, 31 Oct 2017 07:43:59 +0000 (15:43 +0800)]
PD#153316: media: sync decoder code with 3.14 trunk

add two ioctl defines which used in media module

Change-Id: Ie4bde7b9c3803b767bef66e1edf3078b771870d8
Signed-off-by: Hui Zhang <hui.zhang@amlogic.com>
6 years agoosd: replace the timeout number with msecs_to_jiffies
Pengcheng Chen [Thu, 2 Nov 2017 02:34:17 +0000 (10:34 +0800)]
osd: replace the timeout number with msecs_to_jiffies

PD#150542: replace the timeout number with msecs_to_jiffies
1. osd: replace the timeout number with msecs_to_jiffies
2. ge2d: replace the timeout number with msecs_to_jiffies

Change-Id: I5f0032076f305932b0636742db37f537e34b4962
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
6 years agohdmitx: add pwr note function
Yi Zhou [Tue, 31 Oct 2017 05:49:55 +0000 (13:49 +0800)]
hdmitx: add pwr note function

PD#152848: add pwr note function

Change-Id: Ibcde5410eca1f254dc9ffdb8e97feb67f36758d7
Signed-off-by: Yi Zhou <yi.zhou@amlogic.com>
6 years agohdmitx: fix reading error EDID
Yi Zhou [Mon, 30 Oct 2017 01:07:23 +0000 (09:07 +0800)]
hdmitx: fix reading error EDID

PD#153236: hdmitx: fix reading error EDID

When reading EDID by using HW way, there is a logic error in it.
We forget to write 1 to 0x60 address when reading EDID every time.

Change-Id: Iee3148b16ee18df5549754cab63cd2ace80f348c
Signed-off-by: Yi Zhou <yi.zhou@amlogic.com>
6 years agodts: add partition dtsi for old partition table [2/2]
Xindong Xu [Mon, 23 Oct 2017 09:10:02 +0000 (17:10 +0800)]
dts: add partition dtsi for old partition table [2/2]

PD#152829: add partition dtsi for old partition table

Change-Id: I78a84c19fda1f3c1f5aa074dc8606a08ea579f8c
Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
6 years agodrm: prune drm implement if using osd
Yalong Liu [Tue, 31 Oct 2017 08:07:58 +0000 (16:07 +0800)]
drm: prune drm implement if using osd

PD#152825: prune drm to only gem when using fbdev
if using drm, drm must be complete

Change-Id: I17beff6232ca4b5dbf7ce24798f6a638eab42ea7
Signed-off-by: Yalong Liu <yalong.liu@amlogic.com>
6 years agoemmc: add volume name in partinfo
Yonghui Yu [Fri, 15 Sep 2017 07:05:56 +0000 (15:05 +0800)]
emmc: add volume name in partinfo

PD#151127: emmc: add volume name in partinfo

this commit try to add partion information into uevent message
in order to support android8.0 early mount

Change-Id: I604c5dfdfbe8c7eb1e46bfa4af3ab1e406278c61
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
6 years agotreble: enable full treble mode [9/9]
Yixun Lan [Mon, 18 Sep 2017 02:27:46 +0000 (10:27 +0800)]
treble: enable full treble mode [9/9]

PD#151674: treble: enable full treble mode [9/9]

dts: add android fstab info to support early mount

the android init(system/core/init) will try to parse dts to
find fstab information in order to support early mount

Change-Id: I6ddd463a8da4e05cef43ec334a6da8bf2094aff2
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
6 years agoosd: add mem_alloc property in meson-fb dts
Pengcheng Chen [Mon, 30 Oct 2017 10:42:28 +0000 (18:42 +0800)]
osd: add mem_alloc property in meson-fb dts

PD#152220: osd: add mem_alloc property in meson-fb dts
           set mem_alloc will alloc fb in fb_open,
           otherwise alloc in fb_mmap

Change-Id: I4eb2abb76b17905c146b09eb1a8f2a4f2fdac5b5
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
6 years agoRevert "tee: open tee loading under optee"
Pengfei He [Tue, 31 Oct 2017 13:25:22 +0000 (21:25 +0800)]
Revert "tee: open tee loading under optee"

This reverts commit 190a64cb3af9beb2ee5eac79d01da59483c32473.

Change-Id: I712f5a1abf4e63197bc5c7ed320c888901dca7c8
Signed-off-by: Pengfei He <pengfei.he@amlogic.com>
6 years agoionvideo: Fixed fillbuffer failure causes throwing buffer
Renjiang Han [Tue, 31 Oct 2017 09:22:45 +0000 (17:22 +0800)]
ionvideo: Fixed fillbuffer failure causes throwing buffer

PD#152274: Fixed fillbuffer failure causes throwing buffer

Change-Id: Icafef860f57073ba2fc8417e2287f46c9acf9f72
Signed-off-by: Renjiang Han <renjiang.han@amlogic.com>
6 years agoclk: fixed gp0_pll spell error
Jiyu Yang [Sat, 28 Oct 2017 08:04:54 +0000 (16:04 +0800)]
clk: fixed gp0_pll spell error

PD#151164: fixed gp0_pll spell error

Change-Id: I06b0c03492ad97260a1a12ca9f3882a8ec579388
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
6 years agotcp/dccp: drop SYN packets if accept queue is full
Eric Dumazet [Wed, 26 Oct 2016 16:27:57 +0000 (09:27 -0700)]
tcp/dccp: drop SYN packets if accept queue is full

PD#152538: tcp/dccp: drop SYN packets if accept queue is full

tcp/dccp: drop SYN packets if accept queue is full

Per listen(fd, backlog) rules, there is really no point accepting a SYN,
sending a SYNACK, and dropping the following ACK packet if accept queue
is full, because application is not draining accept queue fast enough.

This behavior is fooling TCP clients that believe they established a
flow, while there is nothing at server side. They might then send about
10 MSS (if using IW10) that will be dropped anyway while server is under
stress.

Change-Id: I674728eac69b418255522afc8d345995b8891a7e
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
6 years agodi: modify for true bypass case
kele bai [Mon, 30 Oct 2017 08:20:01 +0000 (16:20 +0800)]
di: modify for true bypass case

PD#152280: di: fix 4k clip crash

1) merge true bypass logic from 143783
2) replace bypass direct with di_debug_flag

Change-Id: I3ba7c1a6281d381028904409b101b414b044be90
Signed-off-by: kele bai <kele.bai@amlogic.com>
6 years agoosd_drm: fix osd drm blank function not work
Pengcheng Chen [Tue, 31 Oct 2017 02:26:10 +0000 (10:26 +0800)]
osd_drm: fix osd drm blank function not work

PD#152825: fix osd drm blank function not work

Change-Id: I3a0b337a79f7530ccecd3d762a5441b8e27b6759
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
6 years agodts: add s400emmc dts
Yueguie He [Mon, 30 Oct 2017 12:43:42 +0000 (20:43 +0800)]
dts: add s400emmc dts

PD#151896: dts: add s400emmc dts

    1. axg_s400emmc.dts
    2. axg_s400emmc_v03.dts

Change-Id: I33231482d7cb1e588f694087d53a1956359ff637
Signed-off-by: Yueguie He <yuegui.he@amlogic.com>
6 years agoionvideo: init input_queue and output_queue in vidioc_open
Yao.Liu [Mon, 30 Oct 2017 08:48:47 +0000 (16:48 +0800)]
ionvideo: init input_queue and output_queue in vidioc_open

PD#152800: dont cleaning buffer queue when codec_reset, omx handle it

Change-Id: I0c6ff9ccc729d55da8c601c4fef8210c6fbe0b42
Signed-off-by: Yao.Liu <yao.liu@amlogic.com>
6 years agodrm: add fbdev emulate implement
Yalong Liu [Mon, 30 Oct 2017 02:54:27 +0000 (10:54 +0800)]
drm: add fbdev emulate implement

PD#152825: add amlogic emulate fbdev implement
it just support software renderring mode

Change-Id: Iffb3b83bbfcc831608e46d9c176fc6c8da8e3ff4
Signed-off-by: Yalong Liu <yalong.liu@amlogic.com>
6 years agoion: enarge ion buffer for some apk.
Zhi Zhou [Sat, 28 Oct 2017 08:53:43 +0000 (16:53 +0800)]
ion: enarge ion buffer for some apk.

PD#153238:
for youtube cast&vr/playmovies

Change-Id: I3857d732056ccf5a9f10cfeefbd7a467631ed08f
Signed-off-by: Zhi Zhou <zhi.zhou@amlogic.com>
6 years agomm: disable page trace by default
tao zeng [Sat, 28 Oct 2017 11:48:15 +0000 (19:48 +0800)]
mm: disable page trace by default

PD#153090: mm: disable page trace by default

Change-Id: I25cd5b1e8e475993f25e5455a411f0c9cc079493
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
6 years agoaudio: fix loopback channel swap, adjust channel map to pdm Dmic array
Xing Wang [Fri, 8 Sep 2017 12:22:44 +0000 (20:22 +0800)]
audio: fix loopback channel swap, adjust channel map to pdm Dmic array

PD#150757: audio: loopback: fix loopback channel swap and map issue
1) fix loopback audio in disorder
2) adjust channel map to pdm Dmic array

Change-Id: Ia3a4e94687815496ca8fcc57bb97797b2bf37adb
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
6 years agodrm: add amlogic KMS implement
sky zhou [Tue, 26 Sep 2017 11:56:13 +0000 (19:56 +0800)]
drm: add amlogic KMS implement

PD#152825: add bypass implement based on amlogic internal driver.

We need reuse the existing driver to implement drm, but not
fully re-write all the drm driver.

Change-Id: Ie6492d8eb978059b9822b98cb7e34a643bdd2c6e
Signed-off-by: sky zhou <sky.zhou@amlogic.com>
6 years agomm: fix pages delete bug by pagetrace
tao zeng [Thu, 26 Oct 2017 07:53:21 +0000 (15:53 +0800)]
mm: fix pages delete bug by pagetrace

PD#153090: mm: fix page delete bug by pagetrace

This change fix another bug when page del many times.

Change-Id: I5fe2cc9d688c2e19e2a7d6c6960229e23f8b133c
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
6 years agoaloop: open sound card aloop driver
Renjun Xu [Thu, 26 Oct 2017 08:56:46 +0000 (16:56 +0800)]
aloop: open sound card aloop driver

PD#153105: open sound card aloop driver

Change-Id: I2ddc97f48a229b1e2b4415210d9fa23d7c6dbac4
Signed-off-by: Renjun Xu <renjun.xu@amlogic.com>
6 years agomm: fix vmemmap pages free bug by pagetrace
tao zeng [Thu, 26 Oct 2017 03:21:32 +0000 (11:21 +0800)]
mm: fix vmemmap pages free bug by pagetrace

PD#153090: mm: fix vmemmap pages free bug by pagetrace

A page in vmemap will be freed when pagetrace is enabled.
This caused page information wrong and may cause unexpected
panic issue.

Change-Id: I486c62af592a98c22bd1ab071b3a224c3298986d
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
6 years agowifi: delete the dhd_static_buf print
Rongjun Chen [Wed, 25 Oct 2017 09:13:31 +0000 (17:13 +0800)]
wifi: delete the dhd_static_buf print

PD#146292: delete the dhd_static_buf print

Change-Id: I01daa03d8e38c1738d74f51d1db33c1ed9b61d1e
Signed-off-by: Rongjun Chen <rongjun.chen@amlogic.com>
6 years agodts: change system size to 280M
Yueguie He [Tue, 24 Oct 2017 13:09:30 +0000 (21:09 +0800)]
dts: change system size to 280M

PD#153008: dts: change system size to 280M

Change-Id: Ic1102bae634be539e9825f48eaac3d46c7aa40dd
Signed-off-by: Yueguie He <yuegui.he@amlogic.com>
6 years agopicdec: initial add the driver
Guosong Zhou [Tue, 24 Oct 2017 05:54:52 +0000 (13:54 +0800)]
picdec: initial add the driver

PD#149244: initial add the driver

1.Add amlogic picture decoder driver;
2.device tree of picdec for p212/p230/p231/q200/skt;
3.related Makefiles/Kconfig/Headfiles update;

Change-Id: Ida1d223ac0f976d601d912bc3dce6473d9d3bf86
Signed-off-by: Guosong Zhou <guosong.zhou@amlogic.com>
6 years agoRevert "osd: fixed smem_start error [3/3]"
Jiyu Yang [Tue, 24 Oct 2017 03:29:17 +0000 (11:29 +0800)]
Revert "osd: fixed smem_start error [3/3]"

This cause Android can't work, revert it firstly
This reverts commit 474cffeae2863caa8a0395d55b976d579621afcd.

Change-Id: I6b3b86a6a88fe734900bd9e688bd0683a3008a43
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
6 years agoaudio: fix pdm Asynchronous FIFO for channel shift issue
Xing Wang [Tue, 24 Oct 2017 02:23:46 +0000 (10:23 +0800)]
audio: fix pdm Asynchronous FIFO for channel shift issue

PD#152798: audio: fix pdm channel shift issue

Change-Id: I1ed76602041625eba2bd6f9691b3d0b8138eac31
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
6 years agoosd: fixed smem_start error [3/3]
Pengcheng Chen [Fri, 20 Oct 2017 06:35:06 +0000 (14:35 +0800)]
osd: fixed smem_start error [3/3]

PD#152220: fixed smem_start error

Change-Id: I8beac687d912d8ffd642d05a9e4c2bee7df02649
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
6 years agodts: update gpu freq tbl for buildroot[2/3]
Jiyu Yang [Thu, 19 Oct 2017 12:10:04 +0000 (20:10 +0800)]
dts: update gpu freq tbl for buildroot[2/3]

PD#152220: update gpu freq tbl for buildroot

Change-Id: I5f0409285aa350cd2f87e15b25497229245d28f4
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
6 years agoclk: update gpu clk node [1/3]
Jiyu Yang [Mon, 18 Sep 2017 08:22:56 +0000 (16:22 +0800)]
clk: update gpu clk node [1/3]

PD#152220: update gpu clk node

Change-Id: I77796b9db66a24466211380432700bbaf50ac1d7
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
6 years agomm: add pagetrace function
tao zeng [Mon, 23 Oct 2017 02:38:16 +0000 (10:38 +0800)]
mm: add pagetrace function

PD#151104: mm: add pagetrace function

1. implement pagetrace as a driver; you can get information
  of how many pages allocated by each function by read:

  cat /proc/pagetrace

2. fix wrong statistics of free memory of each migrate type.

Change-Id: Ib2dff4bb5b3dd288ee188007352fc7b353eda100
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
6 years agoMerge "mtd: report all bad block as 1" into amlogic-4.9-dev
Jianxin Pan [Mon, 23 Oct 2017 07:11:17 +0000 (00:11 -0700)]
Merge "mtd: report all bad block as 1" into amlogic-4.9-dev

6 years agomtd: report all bad block as 1
Yonghui Yu [Thu, 1 Jun 2017 10:46:32 +0000 (18:46 +0800)]
mtd: report all bad block as 1

PD#145359: mtd: report factory bad block as used bad one to mtd.

nandwrite in mtd utilies identify bad blocks by checking whether
return value of mtd_block_isbad is 1;
Our host driver need to distinguish used(1)/factory(FACTORY_BAD_BLOCK_ERROR)
bad block because partition table caculation cares factory bad ones only.

As mtd->_block_isbad is called by inside usage, so we normalize all the bad
block return value in mtd_block_isbad.

Change-Id: I19b0f25ce93ce527b6e02d59330b2edaf61020d4
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
6 years agomm: fix cma allocate fail problem
tao zeng [Mon, 23 Oct 2017 01:35:57 +0000 (09:35 +0800)]
mm: fix cma allocate fail problem

PD#152454: mm: fix cma allocate fail problem

boost work shoud return right value of __alloc_contig_migrate_range

Change-Id: I8275a8541cd263f5ea5574fba1c053a30e3cbc80
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
6 years agoion_dev: add codec_mm heap for omx. [3/3]
jintao xu [Thu, 19 Oct 2017 08:32:29 +0000 (16:32 +0800)]
ion_dev: add codec_mm heap for omx. [3/3]

PD#152137: add codec_mm heap for omx
           codec_mm_cma 308M;
           ion_dev_dma 92M;

Change-Id: I804d16c19e6133ec41bd51a7b2c328339a8d0fd7
Signed-off-by: jintao xu <jintao.xu@amlogic.com>
6 years agounifykey: fix arbitrary memory access in unifykeys ioctl
Jiamin Ma [Fri, 20 Oct 2017 09:45:20 +0000 (17:45 +0800)]
unifykey: fix arbitrary memory access in unifykeys ioctl

PD#152036: arbitrary memory access in unifykeys ioctl

Change-Id: Ic7aa0fce291af7bd5810b4815137ca26b37110f8
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
6 years agomedia: add ioctl video layer1 on/off state in amvideo.[2/1]
Rongrong Zhou [Thu, 19 Oct 2017 09:34:06 +0000 (17:34 +0800)]
media: add ioctl video layer1 on/off state in amvideo.[2/1]

PD#152453: add ioctl for OMX to get current video layer1 on/off state
for DRM TVP resource release.

Change-Id: I8a45869f63259500cbe8be7bc146793e6d7eb266
Signed-off-by: Rongrong Zhou <rongrong.zhou@amlogic.com>
6 years agoRevert "unifykey: fix arbitrary memory access in unifykeys ioctl"
Jiamin Ma [Fri, 20 Oct 2017 09:29:48 +0000 (02:29 -0700)]
Revert "unifykey: fix arbitrary  memory access in unifykeys ioctl"

This reverts commit 54f617de7f85d04b74c766147ea06f6407beb84d.

Change-Id: Ibdd0cb5c073513bb529e5c39f6f963906391a870
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
6 years agounifykey: fix arbitrary memory access in unifykeys ioctl
Jiamin Ma [Fri, 20 Oct 2017 08:25:07 +0000 (16:25 +0800)]
unifykey: fix arbitrary  memory access in unifykeys ioctl

PD#152036: arbitrary  memory access in unifykeys ioctl

Change-Id: I2e76906bef8f417909d97c8a04289ce38baa6087
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
6 years agoUSB: get RESET1_REGISTER address from dts.[1/1]
Qi Duan [Thu, 19 Oct 2017 08:36:20 +0000 (16:36 +0800)]
USB: get RESET1_REGISTER address from dts.[1/1]

PD#152591: USB: get RESET_REGISTER address from dts.
Before we get this address by offset of cbus.
From txlx,this address is not the same because memory map modifty.
Now usb module get this address from dts.

Change-Id: I2ed7d3a19f52c80edab33dec2569ed3ccd375438
Signed-off-by: Qi Duan <qi.duan@amlogic.com>
6 years agoPower: add wakeup interface in shutdown
hong.guo [Fri, 22 Sep 2017 07:31:04 +0000 (15:31 +0800)]
Power: add wakeup interface in shutdown

PD#150222: shutdown: add interface for alarm wakeup

1.add interface for alarm wakeup.
2.set alarm to wakeup system in shutdown.

Change-Id: I21adaecd15b0bc28c6c363835820c9e0291b87af
Signed-off-by: hong.guo <hong.guo@amlogic.com>
6 years agodts: sync s420 & s420_128m
Yueguie He [Thu, 19 Oct 2017 06:54:43 +0000 (14:54 +0800)]
dts: sync s420 & s420_128m

PD#150185: dts: sync s420 & s420_128m

Change-Id: I2e11bdffb760ee51d57aeb7aaf6d0f833a15c9ec
Signed-off-by: Yueguie He <yuegui.he@amlogic.com>
6 years agovdin: clean up dead code and bad compare
Bencheng Jing [Wed, 20 Sep 2017 12:01:34 +0000 (20:01 +0800)]
vdin: clean up dead code and bad compare

PD#151225: driver defect clean up:
#228
#262
#354
#407
#442
#445
#461
#576
#580
#598
#599
#615
#616
#671
#756
#760
#874

Change-Id: I1bc47c3e30ecfa1ca44e53f91201aa4e09ff19f5
Signed-off-by: Bencheng Jing <bencheng.jing@amlogic.com>
6 years agoMerge branch 'android-4.9' into amlogic-4.9-dev
Victor Wan [Thu, 19 Oct 2017 00:43:31 +0000 (08:43 +0800)]
Merge branch 'android-4.9' into amlogic-4.9-dev

6 years agohdmitx: clean up deadcode
Yi Zhou [Wed, 11 Oct 2017 12:31:03 +0000 (20:31 +0800)]
hdmitx: clean up deadcode

PD#151236: driver defect clean up:
#252
#270~283

Change-Id: I009c06dcb14bd3fb686c46a155418093bc7f7514
Signed-off-by: Yi Zhou <yi.zhou@amlogic.com>
6 years agoionvideo: modify ionvideo print info to pass the vts test
Yao.Liu [Mon, 16 Oct 2017 09:04:02 +0000 (17:04 +0800)]
ionvideo: modify ionvideo print info to pass the vts test

PD#151634: modify ionvideo print info to pass the vts test

Change-Id: I32e6bba500f7dc3cc0c987c65187e1354efc424e
Signed-off-by: Yao.Liu <yao.liu@amlogic.com>
6 years agodefconfig: disable CONFIG_ANDROID_LOGGER
Ao Xu [Mon, 16 Oct 2017 06:51:25 +0000 (14:51 +0800)]
defconfig: disable CONFIG_ANDROID_LOGGER

PD#149771: disable CONFIG_ANDROID_LOGGER

No need CONFIG_ANDROID_LOGGER from Android L.
Android uses a service called logd to provide the
same function as the driver did.

Change-Id: I89c9d3bdb3dc3786e817c5f4055856f41babfc5a
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
6 years agonand: add slc nand support:F59L1G81LA (2Y),F59L1G81MA (2Y)
Yi Zeng [Mon, 18 Sep 2017 06:20:37 +0000 (14:20 +0800)]
nand: add slc nand support:F59L1G81LA (2Y),F59L1G81MA (2Y)

PD#151128: nand: add slc nand support:F59L1G81LA (2Y),F59L1G81MA (2Y)

Change-Id: I695e222c305aa4a7c9ca33d6e17c20d57bcf0191
Signed-off-by: Yi Zeng <yi.zeng@amlogic.com>
7 years agounifykey: check secure check secure storage valid before SMC call ATF.
Yan Wang [Mon, 4 Sep 2017 11:57:13 +0000 (19:57 +0800)]
unifykey: check secure check secure storage valid before SMC call ATF.

  PD#150482: unifykey: check secure storage valid before SMC call ATF.

  same as PD#150483.

    ATF use CONFIG to enable/disable secure storage.
    If ATF disable secure storage, secure storage code will be
    compiled out. Kernel should check if secure stroage exists before
    SMC call ATF.

Change-Id: Ifd5e3c42a181bb814dcedad13bebb4596ae95e27
Signed-off-by: Yan Wang <yan.wang@amlogic.com>
7 years agoUSB: gadget: add wake lock when gadget connect.[1/1]
Qi Duan [Wed, 11 Oct 2017 11:47:59 +0000 (19:47 +0800)]
USB: gadget: add wake lock when gadget connect.[1/1]

PD#151886: usb: gadget: add wake lock when gadget connect
       this case,not real suspend.

Change-Id: I0c371ad2c051b3f4fc64b96f8372fdc3be795145
Signed-off-by: Qi Duan <qi.duan@amlogic.com>
7 years agoUART: add spinlock for tx protect in interrupt. [1/1]
Qi Duan [Tue, 26 Sep 2017 05:56:54 +0000 (13:56 +0800)]
UART: add spinlock for tx protect in interrupt. [1/1]

PD#151632: UART: add spinlock for tx protect in interrupt.

Change-Id: Ie2c7e6d3003d8b4248f05a72acd6c5242d45441f
Signed-off-by: Qi Duan <qi.duan@amlogic.com>
7 years agoosd: null pointer risk protect
Pengcheng Chen [Wed, 11 Oct 2017 03:06:34 +0000 (11:06 +0800)]
osd: null pointer risk protect

PD#151241: null pointer risk protect

driver defect clean up:
#284

Change-Id: I05ffb3df451b0f62de0ef00a688edc6bc33b1964
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
7 years agoamvecm: fix hdr no effect
MingLiang Dong [Thu, 21 Sep 2017 08:26:47 +0000 (16:26 +0800)]
amvecm: fix hdr no effect

PD#151008: fix hdr no effect

Change-Id: I9edc076cb74783d26e1f16ebeaceb48dbb7e6bfe
Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
7 years agouart: fix NULL pointer deferencing in suspend/resume
Jiamin Ma [Wed, 20 Sep 2017 06:54:31 +0000 (14:54 +0800)]
uart: fix NULL pointer deferencing in suspend/resume

PD#151229: driver defect clean up
#235
#236

Change-Id: I59acc448a4ece1f385d0b6d602721d34ce60e02c
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
7 years agoclocksource: fix NULL pointer deferencing issue
Jiamin Ma [Wed, 20 Sep 2017 07:29:34 +0000 (15:29 +0800)]
clocksource: fix NULL pointer deferencing issue

PD#151226: driver defect clean up
#229

Change-Id: Ie37dc17d5036813958180415d2b9b4405a44c793
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
7 years agoamvecm: incorrect free pointer event
wenfeng.guo [Tue, 19 Sep 2017 08:02:39 +0000 (16:02 +0800)]
amvecm: incorrect free pointer event

PD#150076: incorrect free pointer event

driver defect clean up:
#4
#7

Change-Id: Iec9d38a5fd71d26c36115eefe98326b909f85527
Signed-off-by: wenfeng.guo <wenfeng.guo@amlogic.com>
7 years agotee: open tee loading under optee
Yvonne Chen [Fri, 29 Sep 2017 06:11:58 +0000 (14:11 +0800)]
tee: open tee loading under optee

PD#151855: open tee loading under optee

Change-Id: Id18ff381bedadb724ace5f22cc820ef64f4666f6
Signed-off-by: Yvonne Chen <yvonne.chen@amlogic.com>
7 years agoMerge branch 'android-4.9' into amlogic-4.9-dev
Victor Wan [Mon, 9 Oct 2017 07:30:18 +0000 (15:30 +0800)]
Merge branch 'android-4.9' into amlogic-4.9-dev

7 years agodi: driver defect clean up
KeLe Bai [Thu, 21 Sep 2017 08:44:05 +0000 (16:44 +0800)]
di: driver defect clean up

PD#151224: driver defect clean up:

#227
#238~239
#249
#257~258
#285~287
#384
#466~467
#472~474
#585
#655
#659~660

Change-Id: I241d863318a8754c0e7c5fa1155247d99a21eb9e
Signed-off-by: KeLe Bai <kele.bai@amlogic.com>
7 years agoosd: osd display error when work in 1080i and cvbs
Pengcheng Chen [Sat, 30 Sep 2017 05:06:22 +0000 (13:06 +0800)]
osd: osd display error when work in 1080i and cvbs

PD#151305: osd: osd display error when work in 1080i and cvbs

Change-Id: I75dbc06ceddf724210f3a2a858bc10685c829fcf
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
7 years agoMerge 4.9.54 into android-4.9
Greg Kroah-Hartman [Sun, 8 Oct 2017 08:49:06 +0000 (10:49 +0200)]
Merge 4.9.54 into android-4.9

Changes in 4.9.54
drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define
drm: bridge: add DT bindings for TI ths8135
GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next
drm/i915: Fix the overlay frontbuffer tracking
ARM: dts: exynos: Add CPU OPPs for Exynos4412 Prime
clk: sunxi-ng: fix PLL_CPUX adjusting on H3
RDS: RDMA: Fix the composite message user notification
ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes
MIPS: Ensure bss section ends on a long-aligned address
MIPS: ralink: Fix a typo in the pinmux setup.
MIPS: ralink: Fix incorrect assignment on ralink_soc
power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error
scsi: be2iscsi: Add checks to validate CID alloc/free
ARM: dts: am335x-chilisom: Wakeup from RTC-only state by power on event
igb: re-assign hw address pointer on reset after PCI error
extcon: axp288: Use vbus-valid instead of -present to determine cable presence
reset: ti_syscon: fix a ti_syscon_reset_status issue
sh_eth: use correct name for ECMR_MPDE bit
clk/axs10x: Clear init field in driver probe
usb: make the MTK XHCI driver compile for older MIPS SoCs
hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes
iio: adc: imx25-gcq: Fix module autoload
iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications
iio: adc: hx711: Add DT binding for avia,hx711
IB/rxe: Add a runtime check in alloc_index()
IB/rxe: Fix a MR reference leak in check_rkey()
ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM
drm/i915/psr: disable psr2 for resolution greater than 32X20
serial: 8250: moxa: Store num_ports in brd
tty: goldfish: Fix a parameter of a call to free_irq
serial: 8250_port: Remove dangerous pr_debug()
IB/ipoib: Fix deadlock over vlan_mutex
IB/ipoib: rtnl_unlock can not come after free_netdev
IB/ipoib: Replace list_del of the neigh->list with list_del_init
arm: dts: mt2701: Add subsystem clock controller device nodes
drm/amdkfd: fix improper return value on error
USB: serial: mos7720: fix control-message error handling
USB: serial: mos7840: fix control-message error handling
sfc: get PIO buffer size from the NIC
partitions/efi: Fix integer overflow in GPT size calculation
ASoC: dapm: handle probe deferrals
audit: log 32-bit socketcalls
ath10k: prevent sta pointer rcu violation
spi: pxa2xx: Add support for Intel Gemini Lake
iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged'
usb: chipidea: vbus event may exist before starting gadget
rtl8xxxu: Add additional USB IDs for rtl8192eu devices
ASoC: dapm: fix some pointer error handling
drm: mali-dp: Fix destination size handling when rotating
drm: mali-dp: Fix transposed horizontal/vertical flip
HID: wacom: release the resources before leaving despite devm
MIPS: Lantiq: Fix another request_mem_region() return code check
mips: ath79: clock:- Unmap region obtained by of_iomap
lkdtm: Fix Oops when unloading the module
net: core: Prevent from dereferencing null pointer when releasing SKB
net/packet: check length in getsockopt() called with PACKET_HDRLEN
team: fix memory leaks
usb: plusb: Add support for PL-27A1
udp: disable inner UDP checksum offloads in IPsec case
net: dsa: b53: Include IMP/CPU port in dumb forwarding mode
qed: Fix possible system hang in the dcbnl-getdcbx() path.
mmc: sdio: fix alignment issue in struct sdio_func
bridge: netlink: register netdevice before executing changelink
Btrfs: fix segmentation fault when doing dio read
Btrfs: fix potential use-after-free for cloned bio
sata_via: Enable hotplug only on VT6421
hugetlbfs: initialize shared policy as part of inode allocation
kasan: do not sanitize kexec purgatory
drivers/rapidio/devices/tsi721.c: make module parameter variable name unique
netfilter: invoke synchronize_rcu after set the _hook_ to NULL
MIPS: IRQ Stack: Unwind IRQ stack onto task stack
iommu/exynos: Block SYSMMU while invalidating FLPD cache
exynos-gsc: Do not swap cb/cr for semi planar formats
MIPS: smp-cps: Fix retrieval of VPE mask on big endian CPUs
nvme-rdma: handle cpu unplug when re-establishing the controller
netfilter: nfnl_cthelper: fix incorrect helper->expect_class_max
parisc: perf: Fix potential NULL pointer dereference
nfs: make nfs4_cb_sv_ops static
ibmvnic: Free tx/rx scrq pointer array when releasing sub-crqs
cpufreq: intel_pstate: Update pid_params.sample_rate_ns in pid_param_set()
x86/acpi: Restore the order of CPU IDs
iommu/io-pgtable-arm: Check for leaf entry before dereferencing it
mm/cgroup: avoid panic when init with low memory
rds: ib: add error handle
md/raid10: submit bio directly to replacement disk
netfilter: nf_tables: set pktinfo->thoff at AH header if found
i2c: meson: fix wrong variable usage in meson_i2c_put_data
xfs: remove kmem_zalloc_greedy
ASoC: wm_adsp: Return an error on write to a disabled volatile control
libata: transport: Remove circular dependency at free time
ARM: dts: BCM5301X: Fix memory start address
tools/power turbostat: bugfix: GFXMHz column not changing
IB/qib: fix false-postive maybe-uninitialized warning
ARM: remove duplicate 'const' annotations'
ASoC: rt5514: fix gcc-7 warning
ASoC: rt5659: drop double const
ASoC: rt5660: remove double const
ALSA: au88x0: avoid theoretical uninitialized access
ttpci: address stringop overflow warning
s390/mm: make pmdp_invalidate() do invalidation only
Linux 4.9.54

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
7 years agoLinux 4.9.54 v4.9.54
Greg Kroah-Hartman [Sun, 8 Oct 2017 08:26:32 +0000 (10:26 +0200)]
Linux 4.9.54

7 years agos390/mm: make pmdp_invalidate() do invalidation only
Gerald Schaefer [Mon, 18 Sep 2017 14:10:35 +0000 (16:10 +0200)]
s390/mm: make pmdp_invalidate() do invalidation only

commit 91c575b335766effa6103eba42a82aea560c365f upstream.

Commit 227be799c39a ("s390/mm: uninline pmdp_xxx functions from pgtable.h")
inadvertently changed the behavior of pmdp_invalidate(), so that it now
clears the pmd instead of just marking it as invalid. Fix this by restoring
the original behavior.

A possible impact of the misbehaving pmdp_invalidate() would be the
MADV_DONTNEED races (see commits ced10803 and 58ceeb6b), although we
should not have any negative impact on the related dirty/young flags,
since those flags are not set by the hardware on s390.

Fixes: 227be799c39a ("s390/mm: uninline pmdp_xxx functions from pgtable.h")
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agottpci: address stringop overflow warning
Arnd Bergmann [Thu, 2 Feb 2017 14:51:28 +0000 (12:51 -0200)]
ttpci: address stringop overflow warning

commit 69d3973af1acd4c0989ec8218c05f12d303cd7cf upstream.

gcc-7.0.1 warns about old code in ttpci:

In file included from drivers/media/pci/ttpci/av7110.c:63:0:
In function 'irdebi.isra.2',
    inlined from 'start_debi_dma' at drivers/media/pci/ttpci/av7110.c:376:3,
    inlined from 'gpioirq' at drivers/media/pci/ttpci/av7110.c:659:3:
drivers/media/pci/ttpci/av7110_hw.h:406:3: warning: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   memcpy(av7110->debi_virt, (char *) &res, count);
In function 'irdebi.isra.2',
    inlined from 'start_debi_dma' at drivers/media/pci/ttpci/av7110.c:376:3,
    inlined from 'gpioirq' at drivers/media/pci/ttpci/av7110.c:668:3:
drivers/media/pci/ttpci/av7110_hw.h:406:3: warning: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   memcpy(av7110->debi_virt, (char *) &res, count);

Apparently, 'count' can be negative here, which will then get turned
into a giant size argument for memcpy. Changing the sizes to 'unsigned
int' instead seems safe as we already check for maximum sizes, and it
also simplifies the code a bit.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoALSA: au88x0: avoid theoretical uninitialized access
Arnd Bergmann [Thu, 23 Mar 2017 15:15:55 +0000 (16:15 +0100)]
ALSA: au88x0: avoid theoretical uninitialized access

commit 13f99ebdd602ebdafb909e15ec6ffb1e34690167 upstream.

The latest gcc-7.0.1 snapshot points out that we if nr_ch is zero, we never
initialize some variables:

sound/pci/au88x0/au88x0_core.c: In function 'vortex_adb_allocroute':
sound/pci/au88x0/au88x0_core.c:2304:68: error: 'mix[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
sound/pci/au88x0/au88x0_core.c:2305:58: error: 'src[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]

I assume this can never happen in practice, but adding a check here doesn't
hurt either and avoids the warning. The code has been unchanged since
the start of git history.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoASoC: rt5660: remove double const
Nicholas Mc Guire [Thu, 12 Jan 2017 10:48:11 +0000 (11:48 +0100)]
ASoC: rt5660: remove double const

commit 4281fcc02ed9f902dfa52d3635ac7f04b1a7341f upstream.

Drop the const qualifier as it is being added by SOC_ENUM_DOUBLE_DECL()
already which is called by SOC_ENUM_SINGLE_DECL() here.

Fixes: commit 2b26dd4c1fc5 ("ASoC: rt5660: add rt5660 codec driver")
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoASoC: rt5659: drop double const
Nicholas Mc Guire [Thu, 12 Jan 2017 13:15:03 +0000 (14:15 +0100)]
ASoC: rt5659: drop double const

commit eae39b5f4269260d5d8b35133ba0f4c5e2895b71 upstream.

Drop the const qualifier as it is being added by SOC_ENUM_DOUBLE_DECL()
already which is called by SOC_ENUM_SINGLE_DECL() as well as the
double const by calls to SOC_VALUE_ENUM_SINGLE_DECL() via
SOC_VALUE_ENUM_DOUBLE_DECL).

Fixes: commit d3cb2de2479b ("ASoC: rt5659: add rt5659 codec driver")
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoASoC: rt5514: fix gcc-7 warning
Arnd Bergmann [Thu, 11 May 2017 11:44:38 +0000 (13:44 +0200)]
ASoC: rt5514: fix gcc-7 warning

commit 03ba791df98d15d07ea74075122af71e35c7611c upstream.

gcc-7 warns that there is a duplicate 'const' specifier in some
variables that are declared using the SOC_ENUM_SINGLE_DECL macro:

sound/soc/codecs/rt5514.c:398:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const SOC_ENUM_SINGLE_DECL(
sound/soc/codecs/rt5514.c:405:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const SOC_ENUM_SINGLE_DECL(

This removes one to fix the warning.

Fixes: 4a6180ea7399 ("ASoC: rt5514: add rt5514 codec driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoARM: remove duplicate 'const' annotations'
Arnd Bergmann [Thu, 11 May 2017 11:50:16 +0000 (13:50 +0200)]
ARM: remove duplicate 'const' annotations'

commit 0527873b29b077fc8e656acd63e1866b429fef55 upstream.

gcc-7 warns about some declarations that are more 'const' than necessary:

arch/arm/mach-at91/pm.c:338:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const struct of_device_id const ramc_ids[] __initconst = {
arch/arm/mach-bcm/bcm_kona_smc.c:36:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const struct of_device_id const bcm_kona_smc_ids[] __initconst = {
arch/arm/mach-spear/time.c:207:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const struct of_device_id const timer_of_match[] __initconst = {
arch/arm/mach-omap2/prm_common.c:714:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const struct of_device_id const omap_prcm_dt_match_table[] __initconst = {
arch/arm/mach-omap2/vc.c:562:35: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const struct i2c_init_data const omap4_i2c_timing_data[] __initconst = {

The ones in arch/arm were apparently all introduced accidentally by one
commit that correctly marked a lot of variables as __initconst.

Fixes: 19c233b79d1a ("ARM: appropriate __init annotation for const data")
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Krzysztof Hałasa <khalasa@piap.pl>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoIB/qib: fix false-postive maybe-uninitialized warning
Arnd Bergmann [Tue, 14 Mar 2017 12:18:45 +0000 (13:18 +0100)]
IB/qib: fix false-postive maybe-uninitialized warning

commit f6aafac184a3e46e919769dd4faa8bf0dc436534 upstream.

aarch64-linux-gcc-7 complains about code it doesn't fully understand:

drivers/infiniband/hw/qib/qib_iba7322.c: In function 'qib_7322_txchk_change':
include/asm-generic/bitops/non-atomic.h:105:35: error: 'shadow' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The code is right, and despite trying hard, I could not come up with a version
that I liked better than just adding a fake initialization here to shut up the
warning.

Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agotools/power turbostat: bugfix: GFXMHz column not changing
Len Brown [Sat, 4 Mar 2017 20:42:48 +0000 (15:42 -0500)]
tools/power turbostat: bugfix: GFXMHz column not changing

[ Upstream commit 22048c5485503749754b3b5daf9d99ef89fcacdc ]

turbostat displays a GFXMHz column, which comes from reading
/sys/class/graphics/fb0/device/drm/card0/gt_cur_freq_mhz

But GFXMHz was not changing, even when a manual
cat /sys/class/graphics/fb0/device/drm/card0/gt_cur_freq_mhz
showed a new value.

It turns out that a rewind() on the open file is not sufficient,
fflush() (or a close/open) is needed to read fresh values.

Reported-by: Yaroslav Isakov <yaroslav.isakov@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoARM: dts: BCM5301X: Fix memory start address
Jon Mason [Wed, 8 Feb 2017 20:37:12 +0000 (15:37 -0500)]
ARM: dts: BCM5301X: Fix memory start address

[ Upstream commit 88d1fa70c21d7b431386cfe70cdc514d98b0c9c4 ]

Memory starts at 0x80000000, not 0.  0 "works" due to mirrior of the
first 128M of RAM to that address.  Anything greater than 128M will
quickly find nothing there.  Correcting the starting address has
everything working again.

Signed-off-by: Jon Mason <jon.mason@broadcom.com>
Fixes: 7eb05f6d ("ARM: dts: bcm5301x: Add BCM SVK DT files")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agolibata: transport: Remove circular dependency at free time
Gwendal Grignou [Fri, 3 Mar 2017 17:00:09 +0000 (09:00 -0800)]
libata: transport: Remove circular dependency at free time

[ Upstream commit d85fc67dd11e9a32966140677d4d6429ca540b25 ]

Without this patch, failed probe would not free resources like irq.

ata port tdev object currently hold a reference to the ata port
object.  Therefore the ata port object release function will not get
called until the ata_tport_release is called. But that would never
happen, releasing the last reference of ata port dev is done by
scsi_host_release, which is called by ata_host_release when the ata
port object is released.

The ata device objects actually do not need to explicitly hold a
reference to their real counterpart, given the transport objects are
the children of these objects and device_add() is call for each child.
We know the parent will not be deleted until we call the child's
device_del().

Reported-by: Matthew Whitehead <tedheadster@gmail.com>
Tested-by: Matthew Whitehead <tedheadster@gmail.com>
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoASoC: wm_adsp: Return an error on write to a disabled volatile control
Charles Keepax [Mon, 6 Mar 2017 16:54:33 +0000 (16:54 +0000)]
ASoC: wm_adsp: Return an error on write to a disabled volatile control

[ Upstream commit 67430a39ca7a6af28aade5acb92d43ee257c1014 ]

Volatile controls should only be accessed when the firmware is active,
currently however writes to these controls will succeed, but the data
will be lost, if the firmware is powered down. Update this behaviour such
that an error is returned the same as it is for reads.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoxfs: remove kmem_zalloc_greedy
Darrick J. Wong [Mon, 6 Mar 2017 19:58:20 +0000 (11:58 -0800)]
xfs: remove kmem_zalloc_greedy

[ Upstream commit 08b005f1333154ae5b404ca28766e0ffb9f1c150 ]

The sole remaining caller of kmem_zalloc_greedy is bulkstat, which uses
it to grab 1-4 pages for staging of inobt records.  The infinite loop in
the greedy allocation function is causing hangs[1] in generic/269, so
just get rid of the greedy allocator in favor of kmem_zalloc_large.
This makes bulkstat somewhat more likely to ENOMEM if there's really no
pages to spare, but eliminates a source of hangs.

[1] http://lkml.kernel.org/r/20170301044634.rgidgdqqiiwsmfpj%40XZHOUW.usersys.redhat.com

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoi2c: meson: fix wrong variable usage in meson_i2c_put_data
Heiner Kallweit [Tue, 7 Mar 2017 20:06:38 +0000 (21:06 +0100)]
i2c: meson: fix wrong variable usage in meson_i2c_put_data

[ Upstream commit 3b0277f198ac928f323c42e180680d2f79aa980d ]

Most likely a copy & paste error.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Fixes: 30021e3707a7 ("i2c: add support for Amlogic Meson I2C controller")
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agonetfilter: nf_tables: set pktinfo->thoff at AH header if found
Pablo Neira Ayuso [Sat, 4 Mar 2017 18:53:47 +0000 (19:53 +0100)]
netfilter: nf_tables: set pktinfo->thoff at AH header if found

[ Upstream commit 568af6de058cb2b0c5b98d98ffcf37cdc6bc38a7 ]

Phil Sutter reports that IPv6 AH header matching is broken. From
userspace, nft generates bytecode that expects to find the AH header at
NFT_PAYLOAD_TRANSPORT_HEADER both for IPv4 and IPv6. However,
pktinfo->thoff is set to the inner header after the AH header in IPv6,
while in IPv4 pktinfo->thoff points to the AH header indeed. This
behaviour is inconsistent. This patch fixes this problem by updating
ipv6_find_hdr() to get the IP6_FH_F_AUTH flag so this function stops at
the AH header, so both IPv4 and IPv6 pktinfo->thoff point to the AH
header.

This is also inconsistent when trying to match encapsulated headers:

1) A packet that looks like IPv4 + AH + TCP dport 22 will *not* match.
2) A packet that looks like IPv6 + AH + TCP dport 22 will match.

Reported-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agomd/raid10: submit bio directly to replacement disk
Shaohua Li [Thu, 23 Feb 2017 20:26:41 +0000 (12:26 -0800)]
md/raid10: submit bio directly to replacement disk

[ Upstream commit 6d399783e9d4e9bd44931501948059d24ad96ff8 ]

Commit 57c67df(md/raid10: submit IO from originating thread instead of
md thread) submits bio directly for normal disks but not for replacement
disks. There is no point we shouldn't do this for replacement disks.

Cc: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agords: ib: add error handle
Zhu Yanjun [Tue, 7 Mar 2017 07:48:36 +0000 (02:48 -0500)]
rds: ib: add error handle

[ Upstream commit 3b12f73a5c2977153f28a224392fd4729b50d1dc ]

In the function rds_ib_setup_qp, the error handle is missing. When some
error occurs, it is possible that memory leak occurs. As such, error
handle is added.

Cc: Joe Jin <joe.jin@oracle.com>
Reviewed-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Guanglei Li <guanglei.li@oracle.com>
Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agomm/cgroup: avoid panic when init with low memory
Laurent Dufour [Fri, 10 Mar 2017 00:17:06 +0000 (16:17 -0800)]
mm/cgroup: avoid panic when init with low memory

[ Upstream commit bfc7228b9a9647e1c353e50b40297a2929801759 ]

The system may panic when initialisation is done when almost all the
memory is assigned to the huge pages using the kernel command line
parameter hugepage=xxxx.  Panic may occur like this:

  Unable to handle kernel paging request for data at address 0x00000000
  Faulting instruction address: 0xc000000000302b88
  Oops: Kernel access of bad area, sig: 11 [#1]
  SMP NR_CPUS=2048 [    0.082424] NUMA
  pSeries
  Modules linked in:
  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.0-15-generic #16-Ubuntu
  task: c00000021ed01600 task.stack: c00000010d108000
  NIP: c000000000302b88 LR: c000000000270e04 CTR: c00000000016cfd0
  REGS: c00000010d10b2c0 TRAP: 0300   Not tainted (4.9.0-15-generic)
  MSR: 8000000002009033 <SF,VEC,EE,ME,IR,DR,RI,LE>[ 0.082770]   CR: 28424422  XER: 00000000
  CFAR: c0000000003d28b8 DAR: 0000000000000000 DSISR: 40000000 SOFTE: 1
  GPR00: c000000000270e04 c00000010d10b540 c00000000141a300 c00000010fff6300
  GPR04: 0000000000000000 00000000026012c0 c00000010d10b630 0000000487ab0000
  GPR08: 000000010ee90000 c000000001454fd8 0000000000000000 0000000000000000
  GPR12: 0000000000004400 c00000000fb80000 00000000026012c0 00000000026012c0
  GPR16: 00000000026012c0 0000000000000000 0000000000000000 0000000000000002
  GPR20: 000000000000000c 0000000000000000 0000000000000000 00000000024200c0
  GPR24: c0000000016eef48 0000000000000000 c00000010fff7d00 00000000026012c0
  GPR28: 0000000000000000 c00000010fff7d00 c00000010fff6300 c00000010d10b6d0
  NIP mem_cgroup_soft_limit_reclaim+0xf8/0x4f0
  LR do_try_to_free_pages+0x1b4/0x450
  Call Trace:
    do_try_to_free_pages+0x1b4/0x450
    try_to_free_pages+0xf8/0x270
    __alloc_pages_nodemask+0x7a8/0xff0
    new_slab+0x104/0x8e0
    ___slab_alloc+0x620/0x700
    __slab_alloc+0x34/0x60
    kmem_cache_alloc_node_trace+0xdc/0x310
    mem_cgroup_init+0x158/0x1c8
    do_one_initcall+0x68/0x1d0
    kernel_init_freeable+0x278/0x360
    kernel_init+0x24/0x170
    ret_from_kernel_thread+0x5c/0x74
  Instruction dump:
  eb81ffe0 eba1ffe8 ebc1fff0 ebe1fff8 4e800020 3d230001 e9499a42 3d220004
  3929acd8 794a1f24 7d295214 eac90100 <e93600002fa90000 419eff74 3b200000
  ---[ end trace 342f5208b00d01b6 ]---

This is a chicken and egg issue where the kernel try to get free memory
when allocating per node data in mem_cgroup_init(), but in that path
mem_cgroup_soft_limit_reclaim() is called which assumes that these data
are allocated.

As mem_cgroup_soft_limit_reclaim() is best effort, it should return when
these data are not yet allocated.

This patch also fixes potential null pointer access in
mem_cgroup_remove_from_trees() and mem_cgroup_update_tree().

Link: http://lkml.kernel.org/r/1487856999-16581-2-git-send-email-ldufour@linux.vnet.ibm.com
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Balbir Singh <bsingharora@gmail.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoiommu/io-pgtable-arm: Check for leaf entry before dereferencing it
Oleksandr Tyshchenko [Mon, 27 Feb 2017 12:30:25 +0000 (14:30 +0200)]
iommu/io-pgtable-arm: Check for leaf entry before dereferencing it

[ Upstream commit ed46e66cc1b3d684042f92dfa2ab15ee917b4cac ]

Do a check for already installed leaf entry at the current level before
dereferencing it in order to avoid walking the page table down with
wrong pointer to the next level.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
CC: Will Deacon <will.deacon@arm.com>
CC: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agox86/acpi: Restore the order of CPU IDs
Dou Liyang [Fri, 3 Mar 2017 08:02:25 +0000 (16:02 +0800)]
x86/acpi: Restore the order of CPU IDs

[ Upstream commit 2b85b3d22920db7473e5fed5719e7955c0ec323e ]

The following commits:

  f7c28833c2 ("x86/acpi: Enable acpi to register all possible cpus at
boot time") and 8f54969dc8 ("x86/acpi: Introduce persistent storage
for cpuid <-> apicid mapping")

... registered all the possible CPUs at boot time via ACPI tables to
make the mapping of cpuid <-> apicid fixed. Both enabled and disabled
CPUs could have a logical CPU ID after boot time.

But, ACPI tables are unreliable. the number amd order of Local APIC
entries which depends on the firmware is often inconsistent with the
physical devices. Even if they are consistent, The disabled CPUs which
take up some logical CPU IDs will also make the order discontinuous.

Revert the part of disabled CPUs registration, keep the allocation
logic of logical CPU IDs and also keep some code location changes.

Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Tested-by: Xiaolong Ye <xiaolong.ye@intel.com>
Cc: rjw@rjwysocki.net
Cc: linux-acpi@vger.kernel.org
Cc: guzheng1@huawei.com
Cc: izumi.taku@jp.fujitsu.com
Cc: lenb@kernel.org
Link: http://lkml.kernel.org/r/1488528147-2279-4-git-send-email-douly.fnst@cn.fujitsu.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agocpufreq: intel_pstate: Update pid_params.sample_rate_ns in pid_param_set()
Rafael J. Wysocki [Sun, 12 Mar 2017 17:12:56 +0000 (18:12 +0100)]
cpufreq: intel_pstate: Update pid_params.sample_rate_ns in pid_param_set()

[ Upstream commit 6e7408acd04d06c04981c0c0fb5a2462b16fae4f ]

Fix the debugfs interface for PID tuning to actually update
pid_params.sample_rate_ns on PID parameters updates, as changing
pid_params.sample_rate_ms via debugfs has no effect now.

Fixes: a4675fbc4a7a (cpufreq: intel_pstate: Replace timers with utilization update callbacks)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoibmvnic: Free tx/rx scrq pointer array when releasing sub-crqs
Nathan Fontenot [Thu, 16 Mar 2017 03:38:07 +0000 (23:38 -0400)]
ibmvnic: Free tx/rx scrq pointer array when releasing sub-crqs

[ Upstream commit 9501df3cd9204f5859f649182431616a31ee88a1 ]

The pointer array for the tx/rx sub crqs should be free'ed when
releasing the tx/rx sub crqs.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agonfs: make nfs4_cb_sv_ops static
Jason Yan [Fri, 10 Mar 2017 02:48:13 +0000 (10:48 +0800)]
nfs: make nfs4_cb_sv_ops static

[ Upstream commit 05fae7bbc237bc7de0ee9c3dcf85b2572a80e3b5 ]

Fixes the following sparse warning:

fs/nfs/callback.c:235:21: warning: symbol 'nfs4_cb_sv_ops' was not
declared. Should it be static?

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoparisc: perf: Fix potential NULL pointer dereference
Arvind Yadav [Tue, 14 Mar 2017 09:54:51 +0000 (15:24 +0530)]
parisc: perf: Fix potential NULL pointer dereference

[ Upstream commit 74e3f6e63da6c8e8246fba1689e040bc926b4a1a ]

Fix potential NULL pointer dereference and clean up
coding style errors (code indent, trailing whitespaces).

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agonetfilter: nfnl_cthelper: fix incorrect helper->expect_class_max
Liping Zhang [Sun, 19 Mar 2017 14:35:59 +0000 (22:35 +0800)]
netfilter: nfnl_cthelper: fix incorrect helper->expect_class_max

[ Upstream commit ae5c682113f9f94cc5e76f92cf041ee624c173ee ]

The helper->expect_class_max must be set to the total number of
expect_policy minus 1, since we will use the statement "if (class >
helper->expect_class_max)" to validate the CTA_EXPECT_CLASS attr in
ctnetlink_alloc_expect.

So for compatibility, set the helper->expect_class_max to the
NFCTH_POLICY_SET_NUM attr's value minus 1.

Also: it's invalid when the NFCTH_POLICY_SET_NUM attr's value is zero.
1. this will result "expect_policy = kzalloc(0, GFP_KERNEL);";
2. we cannot set the helper->expect_class_max to a proper value.

So if nla_get_be32(tb[NFCTH_POLICY_SET_NUM]) is zero, report -EINVAL to
the userspace.

Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agonvme-rdma: handle cpu unplug when re-establishing the controller
Sagi Grimberg [Thu, 9 Mar 2017 11:26:07 +0000 (13:26 +0200)]
nvme-rdma: handle cpu unplug when re-establishing the controller

[ Upstream commit c248c64387fac5a6b31b343d9acb78f478e8619c ]

If a cpu unplug event has occured, we need to take the minimum
of the provided nr_io_queues and the number of online cpus,
otherwise we won't be able to connect them as blk-mq mapping
won't dispatch to those queues.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoMIPS: smp-cps: Fix retrieval of VPE mask on big endian CPUs
Matt Redfearn [Tue, 21 Mar 2017 14:39:19 +0000 (14:39 +0000)]
MIPS: smp-cps: Fix retrieval of VPE mask on big endian CPUs

[ Upstream commit fb2155e3c30dc2043b52020e26965067a3e7779c ]

The vpe_mask member of struct core_boot_config is of type atomic_t,
which is a 32bit type. In cps-vec.S this member was being retrieved by a
PTR_L macro, which on 64bit systems is a 64bit load. On little endian
systems this is OK, since the double word that is retrieved will have
the required less significant word in the correct position. However, on
big endian systems the less significant word of the load is retrieved
from address+4, and the more significant from address+0. The destination
register therefore ends up with the required word in the more
significant word
e.g. when starting the second VP of a big endian 64bit system, the load

PTR_L    ta2, COREBOOTCFG_VPEMASK(a0)

ends up setting register ta2 to 0x0000000300000000

When this value is written to the CPC it is ignored, since it is
invalid to write anything larger than 4 bits. This results in any VP
other than VP0 in a core failing to start in 64bit big endian systems.

Change the load to a 32bit load word instruction to fix the bug.

Fixes: f12401d7219f ("MIPS: smp-cps: Pull boot config retrieval out of mips_cps_boot_vpes")
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/15787/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoexynos-gsc: Do not swap cb/cr for semi planar formats
Thibault Saunier [Wed, 1 Feb 2017 20:05:21 +0000 (18:05 -0200)]
exynos-gsc: Do not swap cb/cr for semi planar formats

[ Upstream commit d7f3e33df4fbdc9855fb151f4a328ec46447e3ba ]

In the case of semi planar formats cb and cr are in the same plane
in memory, meaning that will be set to 'cb' whatever the format is,
and whatever the (packed) order of those components are.

Suggested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Thibault Saunier <thibault.saunier@osg.samsung.com>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoiommu/exynos: Block SYSMMU while invalidating FLPD cache
Marek Szyprowski [Mon, 20 Mar 2017 09:17:56 +0000 (10:17 +0100)]
iommu/exynos: Block SYSMMU while invalidating FLPD cache

[ Upstream commit 7d2aa6b814476a2e2794960f844344519246df72 ]

Documentation specifies that SYSMMU should be in blocked state while
performing TLB/FLPD cache invalidation, so add needed calls to
sysmmu_block/unblock.

Fixes: 66a7ed84b345d ("iommu/exynos: Apply workaround of caching fault page table entries")
CC: stable@vger.kernel.org # v4.10+
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoMIPS: IRQ Stack: Unwind IRQ stack onto task stack
Matt Redfearn [Tue, 21 Mar 2017 14:52:25 +0000 (14:52 +0000)]
MIPS: IRQ Stack: Unwind IRQ stack onto task stack

[ Upstream commit db8466c581cca1a08b505f1319c3ecd246f16fa8 ]

When the separate IRQ stack was introduced, stack unwinding only
proceeded as far as the top of the IRQ stack, leading to kernel
backtraces being less useful, lacking the trace of what was interrupted.

Fix this by providing a means for the kernel to unwind the IRQ stack
onto the interrupted task stack. The processor state is saved to the
kernel task stack on interrupt. The IRQ_STACK_START macro reserves an
unsigned long at the top of the IRQ stack where the interrupted task
stack pointer can be saved. After the active stack is switched to the
IRQ stack, save the interrupted tasks stack pointer to the reserved
location.

Fix the stack unwinding code to look for the frame being the top of the
IRQ stack and if so get the next frame from the saved location. The
existing test does not work with the separate stack since the ra is no
longer pointed at ret_from_{irq,exception}.

The test to stop unwinding the stack 32 bytes from the top of a stack
must be modified to allow unwinding to continue up to the location of
the saved task stack pointer when on the IRQ stack. The low / high marks
of the stack are set depending on whether the sp is on an irq stack or
not.

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: Masanari Iida <standby24x7@gmail.com>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jason A. Donenfeld <jason@zx2c4.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/15788/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>