platform/kernel/linux-amlogic.git
7 years agoge2d: add ge2d driver for axg bringup
Pengcheng Chen [Tue, 6 Jun 2017 05:13:19 +0000 (13:13 +0800)]
ge2d: add ge2d driver for axg bringup

PD#146096: ge2d: add ge2d driver for axg bringup

Change-Id: Iac19fca564ebb564372445c6011143968f2c9739
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
7 years agoMakefile: fix generation dependency for utsrelease.h
Yixun Lan [Mon, 26 Jun 2017 07:08:24 +0000 (15:08 +0800)]
Makefile: fix generation dependency for utsrelease.h

PD#144946: Makefile: fix generation dependency for utsrelease.h

we need to explicitly generate kernel.release_full first, before
creating utsrelease.h

Change-Id: I9e25d2511026dba8a5d3135468a53340ee3a59de
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
7 years agoclk: add saradc clk for gxl
Yun Cai [Fri, 23 Jun 2017 09:49:43 +0000 (17:49 +0800)]
clk: add saradc clk for gxl

PD#146222: add saradc clk for gxl

Change-Id: I5c82dfc4bc44908c10d96056b0d7a0cf3a64c46e
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agoPD#145804: vdin: optimize vdin mem & clk control
Dezhi Kong [Mon, 12 Jun 2017 08:43:36 +0000 (16:43 +0800)]
PD#145804: vdin: optimize vdin mem & clk control

Change-Id: I08c96702a1c5716393907f311be2f9b9f6b5c8cd
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
7 years agodts: axg: add D604 mic board led driver
Liang Zhao [Fri, 26 May 2017 12:01:26 +0000 (20:01 +0800)]
dts: axg: add D604 mic board led driver

PD#142470: add D604 mic board led driver

Change-Id: I81dd8ac3f46e0b0cbec6409328489a72d11c54ac
Signed-off-by: Liang Zhao <liang.zhao@amlogic.com>
7 years agoMakefile: generate kernel_full in seperate command
Yixun Lan [Fri, 23 Jun 2017 01:13:51 +0000 (09:13 +0800)]
Makefile: generate kernel_full in seperate command

PD#144946: Makefile: generate kernel_full in seperate command

in certain cases/system, echo command will refuse to interpret backslash
without the '-e' option, so it will end up with one line
"4.9.11\n4.9.11-1234-g1234"

this patch will generate KERNELRELEASE & KERNELRELEASE_FULL in seperate file

Change-Id: I51699f193e893f9ea566251d4440edecf3de7ad8
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
7 years agoclk: update for pcie range setting
Yun Cai [Wed, 21 Jun 2017 07:33:01 +0000 (15:33 +0800)]
clk: update for pcie range setting

PD#146333: update for pcie range setting

Change-Id: Ic105ec91bd480ab0d4b980eda90ccbcd1d7baa2c
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agodts: osd: add cma heap for ion
binqi.zhang [Wed, 21 Jun 2017 11:05:11 +0000 (19:05 +0800)]
dts: osd: add cma heap for ion

PD#146107: osd: add cma heap for ion on Android 8.0

Change-Id: I8ebb0c9068a93b9e1bae114a6d5231de5a2ee78f
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
7 years agopwm: revert pwm e and f order
Jian Hu [Wed, 21 Jun 2017 12:39:30 +0000 (20:39 +0800)]
pwm: revert pwm e and f order

PD#146170: pwm: revert pwm e and f order

1.please ask me to get a patch when you are using pwm on axg.
2.new pwm driver is rebuilding.
3.add pwm e and f for axg,actually the hardware not support.

Change-Id: I3222380b700fbe9668c3d2da1dc8d878f22b30aa
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
7 years agodts: p212: add vendor & oem partition
Xindong Xu [Thu, 1 Jun 2017 02:44:48 +0000 (10:44 +0800)]
dts: p212: add vendor & oem partition

PD#145255: dts: p212: add vendor & oem partition

Change-Id: I96312e567ef4f5b28740607e091283c70a80578f
Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
7 years agoosd: add cma heap for ion
binqi.zhang [Fri, 16 Jun 2017 06:38:58 +0000 (14:38 +0800)]
osd: add cma heap for ion

PD#146107: osd: add cma heap for ion on Android 8.0

Change-Id: Idf4371fd0dceecc883fd8402a656ed7724be1efd
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
7 years agopwm: fix several errors
Jian Hu [Fri, 16 Jun 2017 08:54:56 +0000 (16:54 +0800)]
pwm: fix several errors

PD#144476: pwm: fix pwm driver errors

1.change pwm e and f order
2.fix several errors

you can request like this:

PWM A 0
PWM B 1
PWM C 2
PWM D 3
PWM AO A 4
PWM AO B 5
PWM AO C 6
PWM AO D 7

Change-Id: Ic1ca7d1f0450db748569447140feab9b9d0c5c34
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
7 years agoirblaster: add code and dts config for axg
Zan Peng [Mon, 19 Jun 2017 08:31:09 +0000 (16:31 +0800)]
irblaster: add code and dts config for axg

PD#146157: irblaster : add code and dts config for axg
1. default dts config of irblater is disabled

Change-Id: I7cc4eece765d28dcac70e222bd2a36df2ba58183
Signed-off-by: Zan Peng <zan.peng@amlogic.com>
7 years agoMerge "i2c: add auto test i2c master and slave on axg skt." into amlogic-4.9-dev
Jianxin Pan [Tue, 20 Jun 2017 07:32:33 +0000 (00:32 -0700)]
Merge "i2c: add auto test i2c master and slave on axg skt." into amlogic-4.9-dev

7 years agoi2c: add auto test i2c master and slave on axg skt.
Xuhua Zhang [Sat, 17 Jun 2017 11:38:28 +0000 (19:38 +0800)]
i2c: add auto test i2c master and slave on axg skt.

PD#142470: add i2c auto test on axg.

1. if uboot parm(i2c_auto_test) is "open",
   open the i2c auto test function.
2. before the test,we should connect i2c slave and master.

Change-Id: Ia37e080dc7995d31e46c9122b389be1ed21acc63
Signed-off-by: Xuhua Zhang <xuhua.zhang@amlogic.com>
7 years agoamlvideo2: fix screen capture funciton
Guosong Zhou [Mon, 12 Jun 2017 11:09:49 +0000 (19:09 +0800)]
amlvideo2: fix screen capture funciton

PD#145804: fix screen capture function

Change-Id: Icb857a889b53d74cfc85072cc88464fb46d283b3
Signed-off-by: Guosong Zhou <guosong.zhou@amlogic.com>
7 years agoclk: add ao clk for axg
Yun Cai [Thu, 18 May 2017 07:01:03 +0000 (15:01 +0800)]
clk: add ao clk for axg

PD#142470: add ao clk saradc for axg

Change-Id: Icadbbf6e631a6158daade2feb4bfae31bed3c471
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agocfg80211: wifi: force to skip cfg80211_leave_all
Lianghu Su [Thu, 15 Jun 2017 07:01:57 +0000 (15:01 +0800)]
cfg80211: wifi: force to skip cfg80211_leave_all

PD#145741: wifi: bcm: fix unable to enter deep suspend mode issue

for the wowlan (wake on wireless lan) function under Linux platfrom,
we have problem to configure it via wpa_supplicant as we do it at Android
platform. so here when it enter into suspend mode, we try to skip calling
cfg80211_leave_all() function at the wire core path.

since this modify the wifi core code, it will also affect other
wifi drivers (not only bcm wifi).

Change-Id: I51eb9b2864afe1bb478ab9411eb7c590f995cd6e
Signed-off-by: Lianghu Su <lianghu.su@amlogic.com>
7 years agowifi: add pwm configuration for wifi 32k
Jian Hu [Mon, 19 Jun 2017 08:45:35 +0000 (16:45 +0800)]
wifi: add pwm configuration for wifi 32k

PD#146170: wifi: add pwm configuration for wifi 32k

Change-Id: If35f0a495b5b3f9a3ced9cf73ddb0ec7dc1f8ea6
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
7 years agolcd: add lcd driver for axg
Evoke Zhang [Fri, 9 Jun 2017 02:46:09 +0000 (10:46 +0800)]
lcd: add lcd driver for axg

PD#142470: lcd: add lcd driver for axg

Change-Id: I58e2a2af474bafbbe3718f51493c9b46cb07cf31
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
7 years agomtd: nand: fix oob read pannic.
Yonghui Yu [Thu, 8 Jun 2017 13:00:13 +0000 (21:00 +0800)]
mtd: nand: fix oob read pannic.

PD#145890: nand: fix oob read

When reading oob by nandread from toolbox of andriod,
the oob should be protected. so we read back the whole
page with ecc on, and copy out oob only.

Change-Id: I08f35396015316a35631727dfbfedb862567d913
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
7 years agomtd: nand: enhance the robust of env
Yonghui Yu [Wed, 14 Jun 2017 13:19:51 +0000 (21:19 +0800)]
mtd: nand: enhance the robust of env

PD#145594: nand: enhance the robust of env

1)enhance sudden power lost and ecc-error protection
2)add mtd env mutex for kernel

Change-Id: I0a454149c408f882924543d84db5d46591230d3d
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
7 years agoosd: add osd driver for axg
Pengcheng Chen [Fri, 5 May 2017 05:48:36 +0000 (13:48 +0800)]
osd: add osd driver for axg

PD#146066: osd: add osd driver for axg bringup

Change-Id: Iea6889046d2a0bd0d7c79f106e4d89ed9828d035
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
7 years agopcie: add pcie reset mode.
Yue Wang [Fri, 16 Jun 2017 03:04:35 +0000 (11:04 +0800)]
pcie: add pcie reset mode.

PD#142470: pcie: add pcie reset mode.

Change-Id: I76999754af16890a7c74d0f31978db69b7710191
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
7 years agopcie: power on pcie in the probe.
Yue Wang [Tue, 13 Jun 2017 03:05:06 +0000 (11:05 +0800)]
pcie: power on pcie in the probe.

PD#146002: pcie: power on pcie in the probe.

Change-Id: I36ec41c19a7d6bfbe364ddefeaa2c48f181d5d3b
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
7 years agodts: gxl: disable uart_B
Lianghu Su [Tue, 13 Jun 2017 08:15:50 +0000 (16:15 +0800)]
dts: gxl: disable uart_B

PD#145722: gpio conflict between uart_B and sysled, both of them use
GPIODV_24.

Change-Id: I75ff92b8166244044034a94cd79e4cfc24a39f81
Signed-off-by: Lianghu Su <lianghu.su@amlogic.com>
7 years agoclk: fix mpll3 jitter too large
Yun Cai [Mon, 12 Jun 2017 09:02:36 +0000 (17:02 +0800)]
clk: fix mpll3 jitter too large

PD#142470: fix mpll3 jitter too large

Change-Id: I106bf9c627a0125ec61ec221d02c0689e547c965
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agopinctrl&gpio: add new interface to set pull-down/up
xingyu.chen [Wed, 7 Jun 2017 08:02:31 +0000 (16:02 +0800)]
pinctrl&gpio: add new interface to set pull-down/up

PD#142470: pinctrl&gpio: add new interface to set pull-down/up

1. add property file 'pull' in directory /sys/class/gpio/gpioX/
pull-up:      echo up > pull
pull-down:    echo down > pull
pull-disable: echo disable > pull

2. add new functions, as follows:
+ gpiod_set_pull(struct gpio_desc *desc, int value)
+ gpiod_set_pull_cansleep(struct gpio_desc *desc, int value)

'value' can be set:
GPIOD_PULL_DIS
GPIOD_PULL_DOWN
GPIOD_PULL_UP

Change-Id: Iba750729288651a897ebac827093ebc6c143f16b
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
7 years agovpu: add vpu support for axg
Evoke Zhang [Thu, 11 May 2017 09:13:07 +0000 (17:13 +0800)]
vpu: add vpu support for axg

PD#142470: add vpu support for axg

Change-Id: I9be3f440ac25f09e393544121aa33446ff76ff58
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
7 years agopinctrl: fixed some pull configuration errors for gxl/gxm
xingyu.chen [Thu, 8 Jun 2017 09:03:30 +0000 (17:03 +0800)]
pinctrl: fixed some pull configuration errors for gxl/gxm

PD#138714: pinctrl: fixed some pull configuration errors for gxl/gxm

Change-Id: I77db8754c17efcdf139a79086ef9009cb7488929
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
7 years agoclkmsr: add special setting for axg audio
Yun Cai [Fri, 26 May 2017 02:23:55 +0000 (10:23 +0800)]
clkmsr: add special setting for axg audio

PD#142470:
1. add special setting for axg audio for AXG
2. update iomap for axg

Change-Id: I1a6ca7bd440aabd1010c854ba0c700b63a105d01
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agopinctrl: avoid requesting the same pin for mux and gpio
xingyu.chen [Mon, 5 Jun 2017 08:16:52 +0000 (16:16 +0800)]
pinctrl: avoid requesting the same pin for mux and gpio

PD#142470: pinctrl: avoid requesting the same pin for mux and gpio

Change-Id: I768aa7d8ffa2792c14c7d932314328d2475c0574
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
7 years agoPD#145277: ge2d: export the symbo of the ge2d funs to media modules.
Nanxin Qin [Wed, 31 May 2017 15:59:14 +0000 (23:59 +0800)]
PD#145277: ge2d: export the symbo of the ge2d funs to media modules.

Change-Id: I4e87b8550869ebeb62ab2fe5252601dd7ac9d40e
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
7 years agoMerge branch 'android-4.9' into amlogic-4.9-dev
Victor Wan [Thu, 8 Jun 2017 02:59:07 +0000 (10:59 +0800)]
Merge branch 'android-4.9' into amlogic-4.9-dev

7 years agoosd: osd support cma, reserved, and ion memory depend on dts config
Pengcheng Chen [Sat, 27 May 2017 03:22:26 +0000 (11:22 +0800)]
osd: osd support cma, reserved, and ion memory depend on dts config

PD#143435: osd support cma, reserved, and ion memory depend on dts config

Change-Id: I79f1a8cebccdb016cee6a6ca54c0356d19fb2657
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
7 years agodts: m400: audio: disable i2sclk disable on startup
Peipeng Zhao [Tue, 6 Jun 2017 05:51:58 +0000 (13:51 +0800)]
dts: m400: audio: disable i2sclk disable on startup

PD#141217: audio: fix M400 board noise when device startup

Change-Id: I7030a2648df5e49580d72eaa784fe2c3d0bbdc81
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
7 years agopcie: add pcie phy control register access.
Yue Wang [Fri, 2 Jun 2017 07:58:45 +0000 (15:58 +0800)]
pcie: add pcie phy control register access.

PD#142470: pcie: add pcie phy control register access.

Change-Id: I832b05763a722c074980f19682c6249915c0363d
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
7 years agodts: axg: add thermal config
Tao Zeng [Wed, 31 May 2017 08:46:05 +0000 (16:46 +0800)]
dts: axg: add thermal config

PD#142470: thermal: enable thermal for axg

1. add thermal node for all axg devices;
2. calculate thermal parameters for all axg device.

Change-Id: I78b7fbe24bfb7910fa52223ade63c93265a6d6e1
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
7 years agounifykey: initial add unifykey driver for m8bb
Jiamin Ma [Wed, 17 May 2017 02:56:23 +0000 (10:56 +0800)]
unifykey: initial add unifykey driver for m8bb

PD#141217: initial add unifykey driver for m8bb

known issues:
1. do not support efuse mode for key storage
2. do not support nand key storage
3. do not suppot unifykey ops in multi-thread env
changelists:
1. use internal sha apis
how to use:
su
cd /sys/class/unifykeys
echo 1 > attach
echo mac > name
echo 001122 > write
echo mac > name
cat read

Change-Id: I0586f1a41ded72553afe3cc4cc199dbc4b563bf1
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
7 years agopinctrl: fix some errors and add new function groups for gxl/gxm
xingyu.chen [Thu, 1 Jun 2017 07:52:40 +0000 (15:52 +0800)]
pinctrl: fix some errors and add new function groups for gxl/gxm

PD#138714: pinctrl: fix some errors and add new function groups

Change-Id: I25a99b8715d22c887f07f0cbbbe5b9a3ba42f927
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
7 years agonand: enable 8 copies bl2 for axg by default[3/3]
Yonghui Yu [Mon, 5 Jun 2017 04:45:41 +0000 (12:45 +0800)]
nand: enable 8 copies bl2 for axg by default[3/3]

PD#145459: nand: write 8 copies info-page for axg by default

Change-Id: Id53907f6219678a73581ac9725721d5795993051
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
7 years agodtsi: axg: add remote config
Zan Peng [Mon, 5 Jun 2017 12:37:57 +0000 (20:37 +0800)]
dtsi: axg: add remote config

PD#142470: dtsi: axg add remote config

Change-Id: Idb10aea3385d5f48f89fe0dd9fa8c76d4bb49fac
Signed-off-by: Zan Peng <zan.peng@amlogic.com>
7 years agopinctrl: add TEST_N and GPIOCLK bank pins support
xingyu.chen [Thu, 1 Jun 2017 06:07:23 +0000 (14:07 +0800)]
pinctrl: add TEST_N and GPIOCLK bank pins support

PD#142470: pinctrl: add TEST_N and GPIOCK bank pins support

1. add TEST_N pin support for axg and gxl/gxm
2. add GPIOCLK bank pins support for gxl/gxm

Change-Id: I8248ffe94b883a38f971ce07910258602b488cf2
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
7 years agodts: S400: change tdm-b for audio capture
Peipeng Zhao [Fri, 26 May 2017 09:43:37 +0000 (17:43 +0800)]
dts: S400: change tdm-b for audio capture

PD#145484: audio: support snd_soc_dai_set_sysclk for mutli codec

Change-Id: I3a2e24e1321e9251029e0abe79e97a9852a68450
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
7 years agoaudio: add pcm186x, ssm3515, ssm3525 codec driver
Peipeng Zhao [Fri, 12 May 2017 10:38:18 +0000 (18:38 +0800)]
audio: add pcm186x, ssm3515, ssm3525 codec driver

PD#145486: audio: add codec driver

Change-Id: Ief27ff9892ffabba81f676f4bed2ec6b4ead74f5
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
7 years agodts: m400: add wifi/bt config
Peipeng Zhao [Fri, 2 Jun 2017 10:39:17 +0000 (18:39 +0800)]
dts: m400: add wifi/bt config

PD#141217: add wifi/bt config on dts for board M400

Change-Id: I241607a40ab2341748b22072806f744c7a24f873
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
7 years agosdio: slove sdio & emmc dealocks on m8b
Nan Li [Tue, 23 May 2017 07:03:35 +0000 (15:03 +0800)]
sdio: slove sdio & emmc dealocks on m8b

PD#141217: slove sdio & emmc dealocks on m8b.
1) Add a semaphore to avoid emmc deadlocks occur and sdio
when they shared the same controller.
2) remove sd ro of dts.
3) add m400 dts support.

Change-Id: I5fe0a76517a341313513e5abdbc16366724cbbe9
Signed-off-by: Nan Li <nan.li@amlogic.com>
7 years agoaudio: enable pdm module firstly
Xing Wang [Fri, 2 Jun 2017 12:32:15 +0000 (20:32 +0800)]
audio: enable pdm module firstly

PD#142470: audio: ensure pdm module enable firstly
1) Ensure pdm clk and module enable firstly
2) add control that hcic shift gain would be fixed with coeff

Change-Id: I9c0dd7cf0e36d2e653c3f593c853f5d14d1dfdcf
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
7 years agoaudio: add tdm lanemask config
Shuai Li [Mon, 5 Jun 2017 00:37:30 +0000 (17:37 -0700)]
audio: add tdm lanemask config

PD#142470: audio: add lanesmask

Change-Id: I56d01ff4f77c90c4fb5575fc654b3459fec1ed14
Signed-off-by: Shuai Li <shuai.li@amlogic.com>
7 years agosecurity: arm: meson: add tee support [2/2]
Peifu Jiang [Wed, 24 May 2017 10:34:15 +0000 (18:34 +0800)]
security: arm: meson: add tee support [2/2]

PD#145094: security: arm: meson: add tee support

Change-Id: I8789ef2b6d774abb6252e60c0726e7384127339f
Signed-off-by: Peifu Jiang <peifu.jiang@amlogic.com>
7 years agoemmc: add emmc HS400 function
Long Yu [Fri, 19 May 2017 01:54:22 +0000 (09:54 +0800)]
emmc: add emmc HS400 function

PD#142470: emmc: support hs400 busmode

1. refix source clock 400MHZ
2. add hs400 timming function

Change-Id: I9cc767262379ba2be5ab5d3e68aae87c1f18c242
Signed-off-by: Long Yu <long.yu@amlogic.com>
7 years agodts: axg: s400,s420: support uart bt
Weiguang Ruan [Tue, 23 May 2017 04:14:34 +0000 (12:14 +0800)]
dts: axg: s400,s420: support uart bt

PD#142470: bt: add s400 & s420 uart bt support

1. add bt power enable configuration: bt-dev
2. enable uart_a
3. add cts rts pin mux for uart_a

Change-Id: I96bbb3c885da3c860bc1015b2b33971ee9740b26
Signed-off-by: Weiguang Ruan <Weiguang.ruan@amlogic.com>
7 years agoaudio: add asoc auge driver for axg
Xing Wang [Tue, 30 May 2017 13:22:31 +0000 (21:22 +0800)]
audio: add asoc auge driver for axg

PD#142470: audio: new Asoc driver
1) tdm module
2) spdif module
3) pdm module
4) audio clock

Change-Id: I064975f4cb036d013a7ca74d781a91c31e7c2436
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
7 years agoBACKPORT [FROMLIST] New getsockopt option to get socket cookie
Chenbo Feng [Thu, 6 Apr 2017 02:00:55 +0000 (19:00 -0700)]
BACKPORT [FROMLIST] New getsockopt option to get socket cookie

Cherry-pick from linux net-next branch commit
http://patchwork.ozlabs.org/patch/747590/

Introduce a new getsockopt operation to retrieve the socket cookie
for a specific socket based on the socket fd.  It returns a unique
non-decreasing cookie for each socket.
Tested: https://android-review.googlesource.com/#/c/358163/

Test: Unit test added in kernel/tests

Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Chenbo Feng <fengc@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoUPSTREAM: bpf: cgroup: fix documentation of __cgroup_bpf_update()
Daniel Mack [Mon, 28 Nov 2016 13:11:04 +0000 (14:11 +0100)]
UPSTREAM: bpf: cgroup: fix documentation of __cgroup_bpf_update()

There's a 'not' missing in one paragraph. Add it.

Fixes: 3007098494be ("cgroup: add support for eBPF programs")
Signed-off-by: Daniel Mack <daniel@zonque.org>
Reported-by: Rami Rosen <roszenrami@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fixes: Change-Id: I3df35d8d3b1261503f9b5bcd90b18c9358f1ac28
  Â  Â  Â ("cgroup: add support for eBPF programs")
(cherry picked from commit 01ae87eab53675cbdabd5c4d727c4a35e397cce0)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
7 years agoBACKPORT: bpf: introduce BPF_F_ALLOW_OVERRIDE flag
Alexei Starovoitov [Sat, 11 Feb 2017 04:28:24 +0000 (20:28 -0800)]
BACKPORT: bpf: introduce BPF_F_ALLOW_OVERRIDE flag

If BPF_F_ALLOW_OVERRIDE flag is used in BPF_PROG_ATTACH command
to the given cgroup the descendent cgroup will be able to override
effective bpf program that was inherited from this cgroup.
By default it's not passed, therefore override is disallowed.

Examples:
1.
prog X attached to /A with default
prog Y fails to attach to /A/B and /A/B/C
Everything under /A runs prog X

2.
prog X attached to /A with allow_override.
prog Y fails to attach to /A/B with default (non-override)
prog M attached to /A/B with allow_override.
Everything under /A/B runs prog M only.

3.
prog X attached to /A with allow_override.
prog Y fails to attach to /A with default.
The user has to detach first to switch the mode.

In the future this behavior may be extended with a chain of
non-overridable programs.

Also fix the bug where detach from cgroup where nothing is attached
was not throwing error. Return ENOENT in such case.

Add several testcases and adjust libbpf.

Fixes: 3007098494be ("cgroup: add support for eBPF programs")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fixes: Change-Id: I3df35d8d3b1261503f9b5bcd90b18c9358f1ac28
  Â  Â  Â ("cgroup: add support for eBPF programs")
[AmitP: Refactored original patch for android-4.9 where libbpf sources
        are in samples/bpf/ and test_cgrp2_attach2, test_cgrp2_sock,
        and test_cgrp2_sock2 sample tests do not exist.]
(cherry picked from commit 7f677633379b4abb3281cdbe7e7006f049305c03)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
7 years agoUPSTREAM: bpf: restore skb->sk before pskb_trim() call
Eric Dumazet [Wed, 26 Apr 2017 16:09:23 +0000 (09:09 -0700)]
UPSTREAM: bpf: restore skb->sk before pskb_trim() call

While testing a fix [1] in ___pskb_trim(), addressing the WARN_ON_ONCE()
in skb_try_coalesce() reported by Andrey, I found that we had an skb
with skb->sk set but no skb->destructor.

This invalidated heuristic found in commit 158f323b9868 ("net: adjust
skb->truesize in pskb_expand_head()") and in cited patch.

Considering the BUG_ON(skb->sk) we have in skb_orphan(), we should
restrain the temporary setting to a minimal section.

[1] https://patchwork.ozlabs.org/patch/755570/
    net: adjust skb->truesize in ___pskb_trim()

Fixes: 8f917bba0042 ("bpf: pass sk to helper functions")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fixes: Change-Id: Ifcbcbe2ab2882dc79c56f9707be1d6aef08c7fd3
       ("BACKPORT: UPSTREAM: bpf: pass sk to helper functions")
(cherry picked from commit d1f496fd8f34a40458d0eda6be0655926559e546)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
7 years agoUPSTREAM: cgroup: move CONFIG_SOCK_CGROUP_DATA to init/Kconfig
Arnd Bergmann [Tue, 10 Jan 2017 12:08:06 +0000 (13:08 +0100)]
UPSTREAM: cgroup: move CONFIG_SOCK_CGROUP_DATA to init/Kconfig

We now 'select SOCK_CGROUP_DATA' but Kconfig complains that this is
not right when CONFIG_NET is disabled and there is no socket interface:

warning: (CGROUP_BPF) selects SOCK_CGROUP_DATA which has unmet direct dependencies (NET)

I don't know what the correct solution for this is, but simply removing
the dependency on NET from SOCK_CGROUP_DATA by moving it out of the
'if NET' section avoids the warning and does not produce other build
errors.

Fixes: 483c4933ea09 ("cgroup: Fix CGROUP_BPF config")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fixes: Change-Id: Ib41ef78fba02eb9e592558ddbf06f9ec0aa337b6
       ("UPSTREAM: cgroup: Fix CGROUP_BPF config")
(cherry picked from commit 73b351473547e543e9c8166dd67fd99c64c15b0b)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
7 years agoUPSTREAM: cgroup, bpf: remove unnecessary #include
Alexei Starovoitov [Wed, 30 Nov 2016 18:16:08 +0000 (10:16 -0800)]
UPSTREAM: cgroup, bpf: remove unnecessary #include

this #include is unnecessary and brings whole set of
other headers into cgroup-defs.h. Remove it.

Fixes: 3007098494be ("cgroup: add support for eBPF programs")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Rami Rosen <roszenrami@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fixes: Change-Id: I3df35d8d3b1261503f9b5bcd90b18c9358f1ac28
  Â  Â  Â ("cgroup: add support for eBPF programs")
(cherry picked from commit b634d30a79ecc2d28e61cbe5b1f4443952f37a8f)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
7 years agoANDROID: mnt: Fix next_descendent
Daniel Rosenberg [Mon, 29 May 2017 23:38:16 +0000 (16:38 -0700)]
ANDROID: mnt: Fix next_descendent

next_descendent did not properly handle the case
where the initial mount had no slaves. In this case,
we would look for the next slave, but since don't
have a master, the check for wrapping around to the
start of the list will always fail. Instead, we check
for this case, and ensure that we end the iteration
when we come back to the root.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 62094374
Change-Id: I43dfcee041aa3730cb4b9a1161418974ef84812e

7 years agodts: s420; remove ethmac config
Alex Deng [Sat, 27 May 2017 14:06:28 +0000 (22:06 +0800)]
dts: s420; remove ethmac config

PD#142470: eth: A113x no eth

Change-Id: I39ee67276a4126b7ecf741285d1b5129eb12cf4b
Signed-off-by: Alex Deng <alex.deng@amlogic.com>
7 years agowifi: meson64: support ath10k pcie wifi and sdio wifi in s400/s420
Weiguang Ruan [Tue, 16 May 2017 14:32:52 +0000 (22:32 +0800)]
wifi: meson64: support ath10k pcie wifi and sdio wifi in s400/s420

PD#142470: wifi
1. add ath10k driver compile as module
add cfg80211_wext_compat to support wext command.

CONFIG_CFG80211_WEXT=y
CONFIG_ATH_COMMON=m
CONFIG_ATH10K=m
CONFIG_ATH10K_PCI=m

2. fix wifi enalbe & irq pin num
3. add pwm config for 32k
4. add 32k pin mux

Change-Id: I71872ceef147b6cc49a76bce837a9aff0d5be66f
Signed-off-by: Weiguang Ruan <Weiguang.ruan@amlogic.com>
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agodts: add watchdog support for axg
Bo Yang [Tue, 9 May 2017 06:54:08 +0000 (14:54 +0800)]
dts: add watchdog support for axg

PD#142470: dts: add watchdog support for axg

Default disable watchdog.

Change-Id: I1d314594eff9773d04aeb4943a4e89604c35f100
Signed-off-by: Bo Yang <bo.yang@amlogic.com>
7 years agoeth: add ethernet function for axg
Yizhou Jiang [Wed, 17 May 2017 02:33:14 +0000 (10:33 +0800)]
eth: add ethernet function for axg

PD#142470: eth: add ethernet for axg

1.for external phy
2.not set regs that did not exist in axg

Change-Id: I4d9f8732f35a0e9e605f1a4a4a9a0285236e705f
Signed-off-by: Yizhou Jiang <yizhou.jiang@amlogic.com>
7 years agopinctrl: add enable interface for gpio request
xingyu.chen [Thu, 18 May 2017 04:48:38 +0000 (12:48 +0800)]
pinctrl: add enable interface for gpio request

PD#142470: pinctrl and fix tas5707 reset pin
1. add enable interface for gpio request
mux register be set '0x0' when pin requested as gpio
2. fix reset pin of gpio ao in dts.
3. fix gpio ctl when no reset pin defined in dts

Change-Id: I866d29a96025811b1d0436eb5d157e4dff1ff7ca
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
Signed-off-by: Alex Deng <alex.deng@amlogic.com>
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agoemmc/sdio: support emmc/sdio driver for new host controller
Long Yu [Tue, 16 May 2017 15:26:41 +0000 (23:26 +0800)]
emmc/sdio: support emmc/sdio driver for new host controller

PD#142470: emmc/sdio: support emmc/sdio driver for new host controller
1. add emmc support
2. support emmc DDR52 Busmode
3. add sdio support
4: axg_s400: disabled emmc function

Change-Id: Iaccca580393477f0ad96e7638dfa4d9e2809c37d
Signed-off-by: Long Yu <long.yu@amlogic.com>
7 years agodts: all uart dts setting [1/1]
Qi Duan [Mon, 15 May 2017 09:48:40 +0000 (17:48 +0800)]
dts: all uart dts setting [1/1]

PD#142470: all uart dts setting

all uart node added.default is disable
If want to enable, 1. status = okay 2.set the right pinmux

Change-Id: I744db5735212f3a3217a4b9e26f4ebe074aa5bdc
Signed-off-by: Qi Duan <qi.duan@amlogic.com>
7 years agonand: update config for mtd driver
Yonghui Yu [Mon, 15 May 2017 03:49:39 +0000 (11:49 +0800)]
nand: update config for mtd driver

PD#142470: update nand config for mtd
1. update dts of skt&s400
2. update clock reg
3. update regbase
4. update bchmode for infopage
5. mtd: support desctrete uboot layout for slc
   change uboot layout for slc [3/3]

multi bootloaders were stored in mlc/slc/emmc.

For emmc/mlc, there's enough space at the begining.
bl2&fip can be stored together which we may call it
as compact mode.
    |bl2|fip|bl2|fip|bl2|fip|rsv|normal|

But for slc, space is restricted by romboot. bl2 and
fip had to be stored discretely.
    |bl2|bl2|bl2|bl2|rsv|fip|fip|fip|fip|normal|

If kernle want mtd driver use descrete mode.
1. bl_mode in dts should be set as 1.
2. fip_copies and fip_size should be the same as uboot which
   was described by marco CONFIG_TPL_COPY_NUM&CONFIG_TPL_SIZE_PER_COPY.
3. And the tpl partition should be added in mtd partition table whose
    offset and size are negligible.

when using, mtd0 is for bl2, mtd1 is for tpl(fip)

Change-Id: I0ed07168ba7497d674a7160f7966ebb484a123d5
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
7 years agoMakefile: lock kernel version without localversion appended
Yixun Lan [Thu, 25 May 2017 04:27:15 +0000 (12:27 +0800)]
Makefile: lock kernel version without localversion appended

PD#144946: Makefile: lock kernel version without localversion appended

after this change, we will lock kernel version to 4.x.y
but we can still get out the exact commit version from dmesg.

1) uname -r : 4.9.27
2) dmesg |grep "Linux version"
  [    0.000000@0] Linux version 4.9.27-638106-g5de5d7a  ....

Change-Id: I35072b399af403d3a1737300a8786cf36063c668
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
7 years agospicc: add spicc driver for axg
Sunny Luo [Fri, 5 May 2017 12:45:58 +0000 (20:45 +0800)]
spicc: add spicc driver for axg

PD#142470: add spicc driver for axg and fix spicc-b
interrupt number error

Change-Id: Ibbda6d8526c4141992fcbe307d6f1e0fbc570cfe
Signed-off-by: Sunny Luo <sunny.luo@amlogic.com>
7 years agousb: dts: set otg switch for board axg
Yue Wang [Fri, 12 May 2017 06:52:39 +0000 (14:52 +0800)]
usb: dts: set otg switch for board axg

PD#142470: set otg switch for board axg

Change-Id: I97500402a2747910d82b9928a55419d35ce2f826
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
7 years agopcie: add pcie driver for axg
Yue Wang [Fri, 12 May 2017 01:55:03 +0000 (09:55 +0800)]
pcie: add pcie driver for axg

PD#142470: add pcie driver for axg
1. update dts of skt&s400
2. update pcie driver

Change-Id: Ic569e8fed1a4434e54847580299703f0fe07cd9b
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
7 years agoclk: update clk for axg
Yun Cai [Fri, 5 May 2017 06:41:21 +0000 (14:41 +0800)]
clk: update clk for axg

PD#142470:
1. add amlogic,axg-clkc.h for mesonaxg.dtsi
and fix clkc reg value
2. update pcie and hifi pll setting for axg

PD#142470: update hifi pll setting for axg

Change-Id: I34aac4ead8384e6a150ae8630034c247f53ac27a
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agocrypto: sha driver update
Matthew Shyu [Fri, 31 Mar 2017 10:33:40 +0000 (18:33 +0800)]
crypto: sha driver update

PD#142470: crypto: sha driver update for txlx and beyond

Change-Id: Ia5eb0c1750bedd0894e3db1e7f0796de23cce1dd
Signed-off-by: Matthew Shyu <matthew.shyu@amlogic.com>
7 years agoi2c: add i2c support for axg
Xuhua Zhang [Thu, 11 May 2017 11:18:13 +0000 (19:18 +0800)]
i2c: add i2c support for axg

PD#142470: i2c: add i2c support fot axg and fix i2c_ao error on axg

Change-Id: I15c00bc5833dd10c94562e939c6b53d0138ac231
Signed-off-by: Xuhua Zhang <xuhua.zhang@amlogic.com>
7 years agopwm: add pwm support for axg
Jian Hu [Fri, 5 May 2017 06:04:24 +0000 (14:04 +0800)]
pwm: add pwm support for axg

PD#142470: pwm: add pwm support fot axg

the pwm groups's addresses are the same with txlx,
just add several macros to support axg.

Change-Id: Iaefa3c2a31fc8f43e4dc80448c6548c2df62fa8f
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
7 years agodts: add dts for A113D socket and development boards
Yun Cai [Sat, 27 May 2017 06:06:57 +0000 (14:06 +0800)]
dts: add dts for A113D socket and development boards

PD#142470: add axg_a113d_skt.dts axg_s400.dts and axg_s420.dts

Change-Id: If8c5b1e0fa5b6a21a91ce1323fa1107d608c4af7
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
7 years agoMerge 4.9.30 into android-4.9
Greg Kroah-Hartman [Thu, 25 May 2017 15:32:43 +0000 (17:32 +0200)]
Merge 4.9.30 into android-4.9

Changes in 4.9.30
usb: misc: legousbtower: Fix buffers on stack
usb: misc: legousbtower: Fix memory leak
USB: ene_usb6250: fix DMA to the stack
watchdog: pcwd_usb: fix NULL-deref at probe
char: lp: fix possible integer overflow in lp_setup()
USB: core: replace %p with %pK
tpm_tis_core: Choose appropriate timeout for reading burstcount
ALSA: hda: Fix cpu lockup when stopping the cmd dmas
ARM: tegra: paz00: Mark panel regulator as enabled on boot
fanotify: don't expose EOPENSTALE to userspace
tpm_tis_spi: Use single function to transfer data
tpm_tis_spi: Abort transfer when too many wait states are signaled
tpm_tis_spi: Check correct byte for wait state indicator
tpm_tis_spi: Remove limitation of transfers to MAX_SPI_FRAMESIZE bytes
tpm_tis_spi: Add small delay after last transfer
tpm: msleep() delays - replace with usleep_range() in i2c nuvoton driver
tpm: add sleep only for retry in i2c_nuvoton_write_status()
tpm_crb: check for bad response size
ASoC: cs4271: configure reset GPIO as output
mlx5: Fix mlx5_ib_map_mr_sg mr length
infiniband: call ipv6 route lookup via the stub interface
dm btree: fix for dm_btree_find_lowest_key()
dm raid: select the Kconfig option CONFIG_MD_RAID0
dm bufio: avoid a possible ABBA deadlock
dm bufio: check new buffer allocation watermark every 30 seconds
dm mpath: split and rename activate_path() to prepare for its expanded use
dm cache metadata: fail operations if fail_io mode has been established
dm bufio: make the parameter "retain_bytes" unsigned long
dm thin metadata: call precommit before saving the roots
dm space map disk: fix some book keeping in the disk space map
md: update slab_cache before releasing new stripes when stripes resizing
md: MD_CLOSING needs to be cleared after called md_set_readonly or do_md_stop
rtlwifi: rtl8821ae: setup 8812ae RFE according to device type
mwifiex: MAC randomization should not be persistent
mwifiex: pcie: fix cmd_buf use-after-free in remove/reset
ima: accept previously set IMA_NEW_FILE
KVM: x86: Fix load damaged SSEx MXCSR register
KVM: x86: Fix potential preemption when get the current kvmclock timestamp
KVM: X86: Fix read out-of-bounds vulnerability in kvm pio emulation
x86: fix 32-bit case of __get_user_asm_u64()
regulator: rk808: Fix RK818 LDO2
regulator: tps65023: Fix inverted core enable logic.
s390/kdump: Add final note
s390/cputime: fix incorrect system time
ath9k_htc: Add support of AirTies 1eda:2315 AR9271 device
ath9k_htc: fix NULL-deref at probe
drm/amdgpu: Make display watermark calculations more accurate
drm/amdgpu: Avoid overflows/divide-by-zero in latency_watermark calculations.
drm/amdgpu: Add missing lb_vblank_lead_lines setup to DCE-6 path.
drm/nouveau/therm: remove ineffective workarounds for alarm bugs
drm/nouveau/tmr: ack interrupt before processing alarms
drm/nouveau/tmr: fix corruption of the pending list when rescheduling an alarm
drm/nouveau/tmr: avoid processing completed alarms when adding a new one
drm/nouveau/tmr: handle races with hw when updating the next alarm time
gpio: omap: return error if requested debounce time is not possible
cdc-acm: fix possible invalid access when processing notification
ohci-pci: add qemu quirk
cxl: Force context lock during EEH flow
cxl: Route eeh events to all drivers in cxl_pci_error_detected()
proc: Fix unbalanced hard link numbers
of: fix sparse warning in of_pci_range_parser_one
of: fix "/cpus" reference leak in of_numa_parse_cpu_nodes()
of: fdt: add missing allocation-failure check
ibmvscsis: Do not send aborted task response
iio: dac: ad7303: fix channel description
IIO: bmp280-core.c: fix error in humidity calculation
IB/hfi1: Return an error on memory allocation failure
IB/hfi1: Fix a subcontext memory leak
pid_ns: Sleep in TASK_INTERRUPTIBLE in zap_pid_ns_processes
pid_ns: Fix race between setns'ed fork() and zap_pid_ns_processes()
USB: serial: ftdi_sio: fix setting latency for unprivileged users
USB: serial: ftdi_sio: add Olimex ARM-USB-TINY(H) PIDs
USB: chaoskey: fix Alea quirk on big-endian hosts
f2fs: check entire encrypted bigname when finding a dentry
fscrypt: avoid collisions when presenting long encrypted filenames
libnvdimm: fix clear length of nvdimm_forget_poison()
xhci: remove GFP_DMA flag from allocation
usb: host: xhci-plat: propagate return value of platform_get_irq()
xhci: apply PME_STUCK_QUIRK and MISSING_CAS quirk for Denverton
usb: host: xhci-mem: allocate zeroed Scratchpad Buffer
net: irda: irda-usb: fix firmware name on big-endian hosts
usbvision: fix NULL-deref at probe
mceusb: fix NULL-deref at probe
ttusb2: limit messages to buffer size
dvb-usb-dibusb-mc-common: Add MODULE_LICENSE
usb: dwc3: gadget: Prevent losing events in event cache
usb: musb: tusb6010_omap: Do not reset the other direction's packet size
usb: musb: Fix trying to suspend while active for OTG configurations
USB: iowarrior: fix info ioctl on big-endian hosts
usb: serial: option: add Telit ME910 support
USB: serial: qcserial: add more Lenovo EM74xx device IDs
USB: serial: mct_u232: fix big-endian baud-rate handling
USB: serial: io_ti: fix div-by-zero in set_termios
USB: hub: fix SS hub-descriptor handling
USB: hub: fix non-SS hub-descriptor handling
ipx: call ipxitf_put() in ioctl error path
iio: proximity: as3935: fix as3935_write
iio: hid-sensor: Store restore poll and hysteresis on S3
s5p-mfc: Fix race between interrupt routine and device functions
gspca: konica: add missing endpoint sanity check
s5p-mfc: Fix unbalanced call to clock management
dib0700: fix NULL-deref at probe
zr364xx: enforce minimum size when reading header
dvb-frontends/cxd2841er: define symbol_rate_min/max in T/C fe-ops
digitv: limit messages to buffer size
dw2102: limit messages to buffer size
cx231xx-audio: fix init error path
cx231xx-audio: fix NULL-deref at probe
cx231xx-cards: fix NULL-deref at probe
powerpc/mm: Ensure IRQs are off in switch_mm()
powerpc/eeh: Avoid use after free in eeh_handle_special_event()
powerpc/book3s/mce: Move add_taint() later in virtual mode
powerpc/pseries: Fix of_node_put() underflow during DLPAR remove
powerpc/iommu: Do not call PageTransHuge() on tail pages
powerpc/64e: Fix hang when debugging programs with relocated kernel
powerpc/tm: Fix FP and VMX register corruption
arm64: KVM: Do not use stack-protector to compile EL2 code
arm: KVM: Do not use stack-protector to compile HYP code
KVM: arm: plug potential guest hardware debug leakage
ARM: 8662/1: module: split core and init PLT sections
ARM: 8670/1: V7M: Do not corrupt vector table around v7m_invalidate_l1 call
ARM: dts: at91: sama5d3_xplained: fix ADC vref
ARM: dts: at91: sama5d3_xplained: not all ADC channels are available
ARM: dts: imx6sx-sdb: Remove OPP override
arm64: dts: hi6220: Reset the mmc hosts
arm64: xchg: hazard against entire exchange variable
arm64: ensure extension of smp_store_release value
arm64: armv8_deprecated: ensure extension of addr
arm64: uaccess: ensure extension of access_ok() addr
arm64: documentation: document tagged pointer stack constraints
staging: rtl8192e: rtl92e_fill_tx_desc fix write to mapped out memory.
staging: rtl8192e: fix 2 byte alignment of register BSSIDR.
staging: rtl8192e: rtl92e_get_eeprom_size Fix read size of EPROM_CMD.
staging: rtl8192e: GetTs Fix invalid TID 7 warning.
iommu/vt-d: Flush the IOTLB to get rid of the initial kdump mappings
metag/uaccess: Fix access_ok()
metag/uaccess: Check access_ok in strncpy_from_user
stackprotector: Increase the per-task stack canary's random range from 32 bits to 64 bits on 64-bit platforms
uwb: fix device quirk on big-endian hosts
genirq: Fix chained interrupt data ordering
nvme: unmap CMB and remove sysfs file in reset path
MIPS: Loongson-3: Select MIPS_L1_CACHE_SHIFT_6
osf_wait4(): fix infoleak
um: Fix to call read_initrd after init_bootmem
tracing/kprobes: Enforce kprobes teardown after testing
PCI: hv: Allocate interrupt descriptors with GFP_ATOMIC
PCI: hv: Specify CPU_AFFINITY_ALL for MSI affinity when >= 32 CPUs
PCI: Fix pci_mmap_fits() for HAVE_PCI_RESOURCE_TO_USER platforms
PCI: Fix another sanity check bug in /proc/pci mmap
PCI: Only allow WC mmap on prefetchable resources
PCI: Freeze PME scan before suspending devices
mtd: nand: orion: fix clk handling
mtd: nand: omap2: Fix partition creation via cmdline mtdparts
mtd: nand: add ooblayout for old hamming layout
drm/edid: Add 10 bpc quirk for LGD 764 panel in HP zBook 17 G2
NFSv4: Fix a hang in OPEN related to server reboot
NFS: Fix use after free in write error path
NFS: Use GFP_NOIO for two allocations in writeback
nfsd: fix undefined behavior in nfsd4_layout_verify
nfsd: encoders mustn't use unitialized values in error cases
drivers: char: mem: Check for address space wraparound with mmap()
drm/i915/gvt: Disable access to stolen memory as a guest
Linux 4.9.30

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
7 years agoLinux 4.9.30 v4.9.30
Greg Kroah-Hartman [Thu, 25 May 2017 13:45:05 +0000 (15:45 +0200)]
Linux 4.9.30

7 years agodrm/i915/gvt: Disable access to stolen memory as a guest
Chris Wilson [Wed, 9 Nov 2016 10:39:05 +0000 (10:39 +0000)]
drm/i915/gvt: Disable access to stolen memory as a guest

commit 04a68a35ce6d7b54749989f943993020f48fed62 upstream.

Explicitly disable stolen memory when running as a guest in a virtual
machine, since the memory is not mediated between clients and reserved
entirely for the host. The actual size should be reported as zero, but
like every other quirk we want to tell the user what is happening.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99028
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161109103905.17860-1-chris@chris-wilson.co.uk
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agodrivers: char: mem: Check for address space wraparound with mmap()
Julius Werner [Fri, 12 May 2017 21:42:58 +0000 (14:42 -0700)]
drivers: char: mem: Check for address space wraparound with mmap()

commit b299cde245b0b76c977f4291162cf668e087b408 upstream.

/dev/mem currently allows mmap() mappings that wrap around the end of
the physical address space, which should probably be illegal. It
circumvents the existing STRICT_DEVMEM permission check because the loop
immediately terminates (as the start address is already higher than the
end address). On the x86_64 architecture it will then cause a panic
(from the BUG(start >= end) in arch/x86/mm/pat.c:reserve_memtype()).

This patch adds an explicit check to make sure offset + size will not
wrap around in the physical address type.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agonfsd: encoders mustn't use unitialized values in error cases
J. Bruce Fields [Fri, 5 May 2017 20:17:57 +0000 (16:17 -0400)]
nfsd: encoders mustn't use unitialized values in error cases

commit f961e3f2acae94b727380c0b74e2d3954d0edf79 upstream.

In error cases, lgp->lg_layout_type may be out of bounds; so we
shouldn't be using it until after the check of nfserr.

This was seen to crash nfsd threads when the server receives a LAYOUTGET
request with a large layout type.

GETDEVICEINFO has the same problem.

Reported-by: Ari Kauppi <Ari.Kauppi@synopsys.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agonfsd: fix undefined behavior in nfsd4_layout_verify
Ari Kauppi [Fri, 5 May 2017 20:07:55 +0000 (16:07 -0400)]
nfsd: fix undefined behavior in nfsd4_layout_verify

commit b550a32e60a4941994b437a8d662432a486235a5 upstream.

  UBSAN: Undefined behaviour in fs/nfsd/nfs4proc.c:1262:34
  shift exponent 128 is too large for 32-bit type 'int'

Depending on compiler+architecture, this may cause the check for
layout_type to succeed for overly large values (which seems to be the
case with amd64). The large value will be later used in de-referencing
nfsd4_layout_ops for function pointers.

Reported-by: Jani Tuovila <tuovila@synopsys.com>
Signed-off-by: Ari Kauppi <ari@synopsys.com>
[colin.king@canonical.com: use LAYOUT_TYPE_MAX instead of 32]
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoNFS: Use GFP_NOIO for two allocations in writeback
Benjamin Coddington [Wed, 19 Apr 2017 14:11:33 +0000 (10:11 -0400)]
NFS: Use GFP_NOIO for two allocations in writeback

commit ae97aa524ef495b6276fd26f5d5449fb22975d7c upstream.

Prevent a deadlock that can occur if we wait on allocations
that try to write back our pages.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Fixes: 00bfa30abe869 ("NFS: Create a common pgio_alloc and pgio_release...")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoNFS: Fix use after free in write error path
Fred Isaman [Fri, 14 Apr 2017 18:24:28 +0000 (14:24 -0400)]
NFS: Fix use after free in write error path

commit 1f84ccdf37d0db3a70714d02d51b0b6d45887fb8 upstream.

Signed-off-by: Fred Isaman <fred.isaman@gmail.com>
Fixes: 0bcbf039f6b2b ("nfs: handle request add failure properly")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoNFSv4: Fix a hang in OPEN related to server reboot
Trond Myklebust [Sat, 15 Apr 2017 23:20:01 +0000 (19:20 -0400)]
NFSv4: Fix a hang in OPEN related to server reboot

commit 56e0d71ef12f026d96213e45a662bde6bbff4676 upstream.

If the server fails to return the attributes as part of an OPEN
reply, and then reboots, we can end up hanging. The reason is that
the client attempts to send a GETATTR in order to pick up the
missing OPEN call, but fails to release the slot first, causing
reboot recovery to deadlock.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Fixes: 2e80dbe7ac51a ("NFSv4.1: Close callback races for OPEN, LAYOUTGET...")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agodrm/edid: Add 10 bpc quirk for LGD 764 panel in HP zBook 17 G2
Mario Kleiner [Fri, 21 Apr 2017 15:05:08 +0000 (17:05 +0200)]
drm/edid: Add 10 bpc quirk for LGD 764 panel in HP zBook 17 G2

commit e345da82bd6bdfa8492f80b3ce4370acfd868d95 upstream.

The builtin eDP panel in the HP zBook 17 G2 supports 10 bpc,
as advertised by the Laptops product specs and verified via
injecting a fixed edid + photometer measurements, but edid
reports unknown depth, so drivers fall back to 6 bpc.

Add a quirk to get the full 10 bpc.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1492787108-23959-1-git-send-email-mario.kleiner.de@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agomtd: nand: add ooblayout for old hamming layout
Alexander Couzens [Tue, 2 May 2017 10:19:00 +0000 (12:19 +0200)]
mtd: nand: add ooblayout for old hamming layout

commit 6a623e07694437ad09f382a13f76cffc32239a7f upstream.

The old 1-bit hamming layout requires ECC data to be placed at a
fixed offset, and not necessarily at the end of the OOB area.
Add this old layout back in order to fix legacy setups.

Fixes: 41b207a70d3a ("mtd: nand: implement the default mtd_ooblayout_ops")
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agomtd: nand: omap2: Fix partition creation via cmdline mtdparts
Roger Quadros [Thu, 30 Mar 2017 07:37:50 +0000 (10:37 +0300)]
mtd: nand: omap2: Fix partition creation via cmdline mtdparts

commit 2d283ede59869159f4bb84ae689258c5caffce54 upstream.

commit c9711ec5250b ("mtd: nand: omap: Clean up device tree support")
caused the parent device name to be changed from "omap2-nand.0"
to "<base address>.nand"  (e.g. 30000000.nand on omap3 platforms).
This caused mtd->name to be changed as well. This breaks partition
creation via mtdparts passed by u-boot as it uses "omap2-nand.0"
for the mtd-id.

Fix this by explicitly setting the mtd->name to "omap2-nand.<CS number>"
if it isn't already set by nand_set_flash_node(). CS number is the
NAND controller instance ID.

Fixes: c9711ec5250b ("mtd: nand: omap: Clean up device tree support")
Reported-by: Leto Enrico <enrico.leto@siemens.com>
Reported-by: Adam Ford <aford173@gmail.com>
Suggested-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Tested-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agomtd: nand: orion: fix clk handling
Simon Baatz [Mon, 27 Mar 2017 18:02:07 +0000 (20:02 +0200)]
mtd: nand: orion: fix clk handling

commit 675b11d94ce9baa5eb365a51b35d2793f77c8ab8 upstream.

The clk handling in orion_nand.c had two problems:

- In the probe function, clk_put() was called for an enabled clock,
  which violates the API (see documentation for clk_put() in
  include/linux/clk.h)

- In the error path of the probe function, clk_put() could be called
  twice for the same clock.

In order to clean this up, use the managed function devm_clk_get() and
store the pointer to the clk in the driver data.

Fixes: baffab28b13120694fa3ebab08d3e99667a851d2 ('ARM: Orion: fix driver probe error handling with respect to clk')
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoPCI: Freeze PME scan before suspending devices
Lukas Wunner [Tue, 18 Apr 2017 18:44:30 +0000 (20:44 +0200)]
PCI: Freeze PME scan before suspending devices

commit ea00353f36b64375518662a8ad15e39218a1f324 upstream.

Laurent Pinchart reported that the Renesas R-Car H2 Lager board (r8a7790)
crashes during suspend tests.  Geert Uytterhoeven managed to reproduce the
issue on an M2-W Koelsch board (r8a7791):

  It occurs when the PME scan runs, once per second.  During PME scan, the
  PCI host bridge (rcar-pci) registers are accessed while its module clock
  has already been disabled, leading to the crash.

One reproducer is to configure s2ram to use "s2idle" instead of "deep"
suspend:

  # echo 0 > /sys/module/printk/parameters/console_suspend
  # echo s2idle > /sys/power/mem_sleep
  # echo mem > /sys/power/state

Another reproducer is to write either "platform" or "processors" to
/sys/power/pm_test.  It does not (or is less likely) to happen during full
system suspend ("core" or "none") because system suspend also disables
timers, and thus the workqueue handling PME scans no longer runs.  Geert
believes the issue may still happen in the small window between disabling
module clocks and disabling timers:

  # echo 0 > /sys/module/printk/parameters/console_suspend
  # echo platform > /sys/power/pm_test    # Or "processors"
  # echo mem > /sys/power/state

(Make sure CONFIG_PCI_RCAR_GEN2 and CONFIG_USB_OHCI_HCD_PCI are enabled.)

Rafael Wysocki agrees that PME scans should be suspended before the host
bridge registers become inaccessible.  To that end, queue the task on a
workqueue that gets frozen before devices suspend.

Rafael notes however that as a result, some wakeup events may be missed if
they are delivered via PME from a device without working IRQ (which hence
must be polled) and occur after the workqueue has been frozen.  If that
turns out to be an issue in practice, it may be possible to solve it by
calling pci_pme_list_scan() once directly from one of the host bridge's
pm_ops callbacks.

Stacktrace for posterity:

  PM: Syncing filesystems ... [   38.566237] done.
  PM: Preparing system for sleep (mem)
  Freezing user space processes ... [   38.579813] (elapsed 0.001 seconds) done.
  Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
  PM: Suspending system (mem)
  PM: suspend of devices complete after 152.456 msecs
  PM: late suspend of devices complete after 2.809 msecs
  PM: noirq suspend of devices complete after 29.863 msecs
  suspend debug: Waiting for 5 second(s).
  Unhandled fault: asynchronous external abort (0x1211) at 0x00000000
  pgd = c0003000
  [00000000] *pgd=80000040004003, *pmd=00000000
  Internal error: : 1211 [#1] SMP ARM
  Modules linked in:
  CPU: 1 PID: 20 Comm: kworker/1:1 Not tainted
  4.9.0-rc1-koelsch-00011-g68db9bc814362e7f #3383
  Hardware name: Generic R8A7791 (Flattened Device Tree)
  Workqueue: events pci_pme_list_scan
  task: eb56e140 task.stack: eb58e000
  PC is at pci_generic_config_read+0x64/0x6c
  LR is at rcar_pci_cfg_base+0x64/0x84
  pc : [<c041d7b4>]    lr : [<c04309a0>]    psr: 600d0093
  sp : eb58fe98  ip : c041d750  fp : 00000008
  r10: c0e2283c  r9 : 00000000  r8 : 600d0013
  r7 : 00000008  r6 : eb58fed6  r5 : 00000002  r4 : eb58feb4
  r3 : 00000000  r2 : 00000044  r1 : 00000008  r0 : 00000000
  Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
  Control: 30c5387d  Table: 6a9f6c80  DAC: 55555555
  Process kworker/1:1 (pid: 20, stack limit = 0xeb58e210)
  Stack: (0xeb58fe98 to 0xeb590000)
  fe80:                                                       00000002 00000044
  fea0: eb6f5800 c041d9b0 eb58feb4 00000008 00000044 00000000 eb78a000 eb78a000
  fec0: 00000044 00000000 eb9aff00 c0424bf0 eb78a000 00000000 eb78a000 c0e22830
  fee0: ea8a6fc0 c0424c5c eaae79c0 c0424ce0 eb55f380 c0e22838 eb9a9800 c0235fbc
  ff00: eb55f380 c0e22838 eb55f380 eb9a9800 eb9a9800 eb58e000 eb9a9824 c0e02100
  ff20: eb55f398 c02366c4 eb56e140 eb5631c0 00000000 eb55f380 c023641c 00000000
  ff40: 00000000 00000000 00000000 c023a928 cd105598 00000000 40506a34 eb55f380
  ff60: 00000000 00000000 dead4ead ffffffff ffffffff eb58ff74 eb58ff74 00000000
  ff80: 00000000 dead4ead ffffffff ffffffff eb58ff90 eb58ff90 eb58ffac eb5631c0
  ffa0: c023a844 00000000 00000000 c0206d68 00000000 00000000 00000000 00000000
  ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 3a81336c 10ccd1dd
  [<c041d7b4>] (pci_generic_config_read) from [<c041d9b0>]
  (pci_bus_read_config_word+0x58/0x80)
  [<c041d9b0>] (pci_bus_read_config_word) from [<c0424bf0>]
  (pci_check_pme_status+0x34/0x78)
  [<c0424bf0>] (pci_check_pme_status) from [<c0424c5c>] (pci_pme_wakeup+0x28/0x54)
  [<c0424c5c>] (pci_pme_wakeup) from [<c0424ce0>] (pci_pme_list_scan+0x58/0xb4)
  [<c0424ce0>] (pci_pme_list_scan) from [<c0235fbc>]
  (process_one_work+0x1bc/0x308)
  [<c0235fbc>] (process_one_work) from [<c02366c4>] (worker_thread+0x2a8/0x3e0)
  [<c02366c4>] (worker_thread) from [<c023a928>] (kthread+0xe4/0xfc)
  [<c023a928>] (kthread) from [<c0206d68>] (ret_from_fork+0x14/0x2c)
  Code: ea000000 e5903000 f57ff04f e3a00000 (e5843000)
  ---[ end trace 667d43ba3aa9e589 ]---

Fixes: df17e62e5bff ("PCI: Add support for polling PME state on suspended legacy PCI devices")
Reported-and-tested-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reported-and-tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoPCI: Only allow WC mmap on prefetchable resources
David Woodhouse [Wed, 12 Apr 2017 12:25:52 +0000 (13:25 +0100)]
PCI: Only allow WC mmap on prefetchable resources

commit cef4d02305a06be581bb7f4353446717a1b319ec upstream.

The /proc/bus/pci mmap interface allows the user to specify whether they
want WC or not.  Don't let them do so on non-prefetchable BARs.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoPCI: Fix another sanity check bug in /proc/pci mmap
David Woodhouse [Wed, 12 Apr 2017 12:25:51 +0000 (13:25 +0100)]
PCI: Fix another sanity check bug in /proc/pci mmap

commit 17caf56731311c9596e7d38a70c88fcb6afa6a1b upstream.

Don't match MMIO maps with I/O BARs and vice versa.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoPCI: Fix pci_mmap_fits() for HAVE_PCI_RESOURCE_TO_USER platforms
David Woodhouse [Wed, 12 Apr 2017 12:25:50 +0000 (13:25 +0100)]
PCI: Fix pci_mmap_fits() for HAVE_PCI_RESOURCE_TO_USER platforms

commit 6bccc7f426abd640f08d8c75fb22f99483f201b4 upstream.

In the PCI_MMAP_PROCFS case when the address being passed by the user is a
'user visible' resource address based on the bus window, and not the actual
contents of the resource, that's what we need to be checking it against.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoPCI: hv: Specify CPU_AFFINITY_ALL for MSI affinity when >= 32 CPUs
K. Y. Srinivasan [Fri, 24 Mar 2017 18:07:21 +0000 (11:07 -0700)]
PCI: hv: Specify CPU_AFFINITY_ALL for MSI affinity when >= 32 CPUs

commit 433fcf6b7b31f1f233dd50aeb9d066a0f6ed4b9d upstream.

When we have 32 or more CPUs in the affinity mask, we should use a special
constant to specify that to the host. Fix this issue.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoPCI: hv: Allocate interrupt descriptors with GFP_ATOMIC
K. Y. Srinivasan [Fri, 24 Mar 2017 18:07:22 +0000 (11:07 -0700)]
PCI: hv: Allocate interrupt descriptors with GFP_ATOMIC

commit 59c58ceeea9cdc6144d7b0303753e6bd26d87455 upstream.

The memory allocation here needs to be non-blocking.  Fix the issue.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agotracing/kprobes: Enforce kprobes teardown after testing
Thomas Gleixner [Wed, 17 May 2017 08:19:49 +0000 (10:19 +0200)]
tracing/kprobes: Enforce kprobes teardown after testing

commit 30e7d894c1478c88d50ce94ddcdbd7f9763d9cdd upstream.

Enabling the tracer selftest triggers occasionally the warning in
text_poke(), which warns when the to be modified page is not marked
reserved.

The reason is that the tracer selftest installs kprobes on functions marked
__init for testing. These probes are removed after the tests, but that
removal schedules the delayed kprobes_optimizer work, which will do the
actual text poke. If the work is executed after the init text is freed,
then the warning triggers. The bug can be reproduced reliably when the work
delay is increased.

Flush the optimizer work and wait for the optimizing/unoptimizing lists to
become empty before returning from the kprobes tracer selftest. That
ensures that all operations which were queued due to the probes removal
have completed.

Link: http://lkml.kernel.org/r/20170516094802.76a468bb@gandalf.local.home
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: 6274de498 ("kprobes: Support delayed unoptimizing")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoum: Fix to call read_initrd after init_bootmem
Masami Hiramatsu [Thu, 27 Apr 2017 03:15:10 +0000 (12:15 +0900)]
um: Fix to call read_initrd after init_bootmem

commit 5b4236e17cc1bd9fa14b2b0c7a4ae632d41f2e20 upstream.

Since read_initrd() invokes alloc_bootmem() for allocating
memory to load initrd image, it must be called after init_bootmem.

This makes read_initrd() called directly from setup_arch()
after init_bootmem() and mem_total_pages().

Fixes: b63236972e1 ("um: Setup physical memory in setup_arch()")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoosf_wait4(): fix infoleak
Al Viro [Mon, 15 May 2017 01:47:25 +0000 (21:47 -0400)]
osf_wait4(): fix infoleak

commit a8c39544a6eb2093c04afd5005b6192bd0e880c6 upstream.

failing sys_wait4() won't fill struct rusage...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoMIPS: Loongson-3: Select MIPS_L1_CACHE_SHIFT_6
Huacai Chen [Thu, 16 Mar 2017 13:00:28 +0000 (21:00 +0800)]
MIPS: Loongson-3: Select MIPS_L1_CACHE_SHIFT_6

commit 17c99d9421695a0e0de18bf1e7091d859e20ec1d upstream.

Some newer Loongson-3 have 64 bytes cache lines, so select
MIPS_L1_CACHE_SHIFT_6.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: John Crispin <john@phrozen.org>
Cc: Steven J . Hill <Steven.Hill@caviumnetworks.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15755/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>