platform/kernel/linux-amlogic.git
6 years agodefconfig: remove meson64_audio_defconfig
Ao Xu [Wed, 20 Sep 2017 09:30:05 +0000 (17:30 +0800)]
defconfig: remove meson64_audio_defconfig

PD#149771: remove meson64_audio_defconfig

Change-Id: I80e92b3f7eae3895371bc2ad91d78f4538740937
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
6 years agodts: fix arch timer irq trigger type warning
jianxin.pan [Mon, 18 Sep 2017 12:15:54 +0000 (20:15 +0800)]
dts: fix arch timer irq trigger type warning

PD#151167: fix arm_arch_timer irq trigger type warning
irq: type mismatch, failed to map hwirq-29 for /interrupt-controller

Change-Id: I51cee425500596a3c48fb440e04c74d647688650
Signed-off-by: jianxin.pan <jianxin.pan@amlogic.com>
6 years agodts: wifi: fix irq type mismatch, failed to map error
Rongjun Chen [Tue, 19 Sep 2017 05:15:04 +0000 (13:15 +0800)]
dts: wifi: fix irq type mismatch, failed to map error

PD#151167: del interrupts = <  0 68 4> to fix irq: type mismatch issue
test on p212 board

Change-Id: I003175f59f77fd7711297a2472e1986fea8f3609
Signed-off-by: Rongjun Chen <rongjun.chen@amlogic.com>
6 years agolcd: synchronous lcd driver from linux3.14
Weiming Liu [Thu, 14 Sep 2017 05:12:42 +0000 (13:12 +0800)]
lcd: synchronous lcd driver from linux3.14

PD#150981: synchronous lcd driver linux3.14 to linux4.9

1.add bl_level bootargs parameter

2.repair unifykey bl_level error

3.update the mechanism of 50/60hz switch

4.add pwm & enable sequence reverse support

5.add vbyone special control adjust support

Change-Id: I63136af6b96d793691eed23c064e7515e1d50aff
Signed-off-by: Weiming Liu <weiming.liu@amlogic.com>
6 years agodts: gxl: update ion mem region size [3/3]
Jiyu Yang [Thu, 14 Sep 2017 11:14:53 +0000 (19:14 +0800)]
dts: gxl: update ion mem region size [3/3]

PD#151016: update ion mem region size

Change-Id: I4488f42757c9bf41a13e995c87a2204a5246dad6
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
6 years agop230: use a/b partition.dtsi default [1/2]
Xindong Xu [Mon, 18 Sep 2017 10:18:56 +0000 (18:18 +0800)]
p230: use a/b partition.dtsi default [1/2]

PD#151146: p230: use a/b partition.dtsi default

Change-Id: I7ebc40783aad7a50690403f3e28bed9be89d1b11
Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
6 years agodts: fix fb_reserved/logo_reserved alloc failed
Pengcheng Chen [Tue, 19 Sep 2017 05:27:41 +0000 (13:27 +0800)]
dts: fix fb_reserved/logo_reserved alloc failed

PD#150868: fix fb_reserved/logo_reserved alloc failed

Change-Id: Ibae0efc18b221bc72c419b99d908bf4ae1267d4b
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
6 years agomemleek: using single_open/seq_read and single_release in pair
Jiamin Ma [Wed, 16 Aug 2017 11:58:00 +0000 (19:58 +0800)]
memleek: using single_open/seq_read and single_release in pair

PD#149178: memleek when single_open/seq_readwithout single_release

single_open/seq_read will apply for one page and two small
slab memory. If we do not release them in single_release,
the system will crash for memory leeking

Change-Id: I2b74a0c6faec415e96164d0c20ba0676836e55eb
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
6 years agomm: optimize for cma allocation/free time
Tao Zeng [Fri, 15 Sep 2017 07:58:51 +0000 (15:58 +0800)]
mm: optimize for cma allocation/free time

PD#150914: mm: optimize for cma allocation/free time

1. NOT use __GFP_COLD during cma is under allcating to
  avoid page lock long time;
2. Mark __GFP_BDEV for alloc_migrate_target to avoid
   migrate allocate cma page again in cma allocate;
3. use SMP to allocate cma;
4. try to free large order of pages for cma.

Change-Id: I2213444a089ce27ee6486c84dea03e0584086cd3
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
6 years agoosd: merge 3.14 osd fix to 4.9
Pengcheng Chen [Thu, 14 Sep 2017 08:50:34 +0000 (16:50 +0800)]
osd: merge 3.14 osd fix to 4.9

PD#151059: merge 3.14 osd fix to 4.9
1. osd: fix dummy data caused green line issue(190f842)
2. osd: add debug for direct-render(cee727f)
3. osd: fix screen zoom in/out error(9854bdc)
4. osd: cursor can't full screen osd1 in 2xscaler(afadaff)
5. osd: osd_reserved caused direct render display wrong(fc55e9b)
6. osd: fix osd crash when bringup Android8.0(206fbe6)
7. osd: fix osd cursor distortion in 1080I mode(612eead)
8. osd: fix error when screen zoom in/out in osd_reverse(2243eb6)

Change-Id: Icfef7a66fcb1d0d42fe2aa57bb370f9e9a7ad5a4
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
6 years agoamlvideo2: fix unuse code and bad compare
Guosong Zhou [Thu, 14 Sep 2017 07:49:47 +0000 (15:49 +0800)]
amlvideo2: fix unuse code and bad compare

PD#150094: driver defect clean up:
#32
#86
#90
#92
#97
#101
#103
#152
#155
#157~#158
#164
#167
#169~#179
#187~#191
#193~#199
#201~#210
#212~#213
#316~#319
#385
#572
#693~#694
#696~#697

Change-Id: I9669e5c0d717ee2287faf57a271ff27692039802
Signed-off-by: Guosong Zhou <guosong.zhou@amlogic.com>
6 years agosecurity: fix security issues about mem corruption and info leakage
Jiamin Ma [Wed, 6 Sep 2017 03:50:07 +0000 (11:50 +0800)]
security: fix security issues about mem corruption and info leakage

PD#150578: kernel4.9 secure review issues
1. Kernel Debugging Options Enabled

2. Exploit Mitigations (KASLR, Stack Protector)
   Not Enabled In Kernel Config

3. Buffer Overflow in Amvideo Driver file_name
   SysFS Attribute

4. Memory Corruption in VFM Driver SysFS Attribute

5. Kernel Syslog Accessible To  Unprivileged Users

6. Kernel Memory Corruption in EFuse Driver

7. Kernel Memory Corruption in Unifykey IOCTL

Change-Id: I277c449f4cb14141bf37f90fd66764b8dccaaee0
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
6 years agoosd: create logo_reserved node in dts in Android O
Pengcheng Chen [Tue, 12 Sep 2017 09:08:06 +0000 (17:08 +0800)]
osd: create logo_reserved node in dts in Android O

PD#150868: create logo_reserved node in dts in Android O

Change-Id: I4057aef2e40504920a9d3b086d31d96aa23bb52f
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
6 years agoMerge branch 'android-4.9' into amlogic-4.9-dev
Victor Wan [Fri, 15 Sep 2017 06:23:48 +0000 (14:23 +0800)]
Merge branch 'android-4.9' into amlogic-4.9-dev

6 years agohdmitx: fix DEADCODE errors
Yi Zhou [Tue, 5 Sep 2017 12:31:51 +0000 (20:31 +0800)]
hdmitx: fix DEADCODE errors

PD#150471: hdmitx: driver defect clean up:
#168
#186
#200
#211
#192

Change-Id: Iffafec12c39cd98f8260a99417cb709ccc94935d
Signed-off-by: Yi Zhou <yi.zhou@amlogic.com>
6 years agoosd: fix move cursor caused android O reboot issue
Pengcheng Chen [Thu, 14 Sep 2017 05:26:58 +0000 (13:26 +0800)]
osd: fix move cursor caused android O reboot issue

PD#150952: fix move cursor caused android O reboot issue

Change-Id: Iba352617d7250167666029f80f82fd8bc9e4de3f
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
6 years agoeth: stmmac: fix timer expire issue in resume stage
Yixun Lan [Sat, 9 Sep 2017 13:36:29 +0000 (21:36 +0800)]
eth: stmmac: fix timer expire issue in resume stage

PD#150780: eth: stmmac: fix timer expire issue in resume stage

Change-Id: I1d154c1eb581972d6131871901ade2272a1192ad
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
6 years agomedia: merged code from c502feca7 on the amlogic-3.14-dev [1/3]
Nanxin Qin [Sun, 3 Sep 2017 14:47:21 +0000 (22:47 +0800)]
media: merged code from c502feca7 on the amlogic-3.14-dev [1/3]

PD#150739: merged code from c502feca7 on the amlogic-3.14-dev
1.codec_mm: fixed tvp first wait long time bug
2.pcrmaster: fix some avsync issue in pcrmaster mode
3.vfm: fix vf provider crash issue

Change-Id: I64202a38a3ed0c50ba665fb477caea26c67ddcb0
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
6 years agoosd: clean up deadcode
Pengcheng Chen [Wed, 13 Sep 2017 04:34:47 +0000 (12:34 +0800)]
osd: clean up deadcode

PD#150472: driver defect clean up:
#118
#147

Change-Id: I5eb405b884e05d42f238db43c9d3a16255f06d84
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
6 years agoviu: null point check
Dezhi Kong [Thu, 7 Sep 2017 01:10:47 +0000 (09:10 +0800)]
viu: null point check

PD#150474: viu: null point check

driver defect clean up:
#95

Change-Id: I29daf5b12927c7f6227c332d0064d2e437099a8c
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
6 years agounifykey: check return value of of_property_read_u32
Jiamin Ma [Thu, 31 Aug 2017 01:51:01 +0000 (09:51 +0800)]
unifykey: check return value of of_property_read_u32

PD#150092: Calling "of_property_read_u32" without checking return value
driver defect clean up:
#30

Change-Id: I590627fec489e2251c689b9a013d5c792ff19975
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
6 years agojtag: add check for class_register
Bo Yang [Wed, 30 Aug 2017 06:56:08 +0000 (14:56 +0800)]
jtag: add check for class_register

PD#150090: driver defect clean up:
#28

Change-Id: Ib75bbc51cf415b9ccdf8db9bbec7ae764b06e036
Signed-off-by: Bo Yang <bo.yang@amlogic.com>
6 years agomtd: nand: add slc ids and fix timing
Yonghui Yu [Tue, 5 Sep 2017 12:07:22 +0000 (20:07 +0800)]
mtd: nand: add slc ids and fix timing

PD#150552: mtd: nand: add slc ids and fix timing

Add ids:
    1. Toshiba 4Gib TC58BVG2S0HTA00
    2. Micron 4Gib MT29F4G08ABAEA
    3. Micron 4Gib MT29F4G08ABADA
fix timing for spansion/AMD
    1. S34ML02G1
    2. S34ML01G2

Change-Id: Ie92b0d5b25d1c27701e3ab1c06e5e0fbc7f27630
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
6 years agoosd: use the old fence close way [3/3]
Jiyu Yang [Mon, 11 Sep 2017 11:18:26 +0000 (19:18 +0800)]
osd: use the old fence close way [3/3]

PD#149525: osd use the old fence close way

Change-Id: I9473e4820d2cbf42c623ee6c563163b654c7fe85
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
6 years agoPD#146454 wifi: update dhd_static_buf[1/2]
Rongjun Chen [Mon, 11 Sep 2017 07:49:50 +0000 (15:49 +0800)]
PD#146454 wifi: update dhd_static_buf[1/2]

update dhd_static_buf to fix prealloc mem issue

Change-Id: I0f11d174d3b8d688b1ffe37f5dd922244cfae873
Signed-off-by: Rongjun Chen <rongjun.chen@amlogic.com>
6 years agodts: p241: add p241 dts config.
Lianghu Su [Tue, 12 Sep 2017 09:24:47 +0000 (17:24 +0800)]
dts: p241: add p241 dts config.

PD#150865: add p241 dts.
1. system partition size is 0x80000000.
2. max gpu clk is 650M.
3. uart_A status is disable, uart_C is okay.
4. vpu clk level is 200M.

Change-Id: I03cc3119e3d5be8ccedc2f6f3304189fd89ef33b
Signed-off-by: Lianghu Su <lianghu.su@amlogic.com>
6 years agoRevert "emmc: buffer size setting mismatch"
jianxin.pan [Wed, 13 Sep 2017 09:36:51 +0000 (17:36 +0800)]
Revert "emmc: buffer size setting mismatch"

revert this commit to avoid android boot error.

This reverts commit 709ec9c96bd9ca869b32d536fb97bc5c6772dddd.

Change-Id: Ie813a0051b38743fefa495b5401490459c15d1e4
Signed-off-by: jianxin.pan <jianxin.pan@amlogic.com>
6 years agohdmitx: fix dead code and bad sizeof
Zongdong Jiao [Mon, 4 Sep 2017 12:20:03 +0000 (20:20 +0800)]
hdmitx: fix dead code and bad sizeof

PD#150078: driver defect clean up:
#14
#89
#111
#124
#133
#136
#137
#146
#148
#150
#153

Change-Id: I734a66a8b92a0dc57a232879463a3fc074534fa0
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
6 years agohdmitx: clean up bad compare and dead code
Zongdong Jiao [Mon, 4 Sep 2017 12:35:35 +0000 (20:35 +0800)]
hdmitx: clean up bad compare and dead code

PD#150071: hdmitx: driver defect clean up:
#2
#156

Change-Id: Icf9d9d0cd112344d9981ed33171b04f744930808
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
Signed-off-by: Yi Zhou <yi.zhou@amlogic.com>
6 years agobt: compile hci_uart as module [3/4]
Weiguang Ruan [Wed, 13 Sep 2017 05:53:32 +0000 (13:53 +0800)]
bt: compile hci_uart as module [3/4]

PD#150522: compile hci_uart as module

    meson64_smarthome_defconfig:

    CONFIG_BT_HCIUART=m
    CONFIG_BT_HCIUART_QCA=y

1. realtek bt has its own hci_uart driver
   so we need compile both hci_uart driver
   as module

2. add hciuart_qca support, for we need qualcomm
   bt for bluez later

Change-Id: Icffbb66623a5e28803a4f26bb3523f79cae91bc3
Signed-off-by: Weiguang Ruan <Weiguang.ruan@amlogic.com>
6 years agodi: clean up deadcode
KeLe Bai [Thu, 7 Sep 2017 03:01:19 +0000 (11:01 +0800)]
di: clean up deadcode

PD#150463: driver defect clean up:
#69

Change-Id: If9604d390f5a77e2470d009058b2e77ce13f10e7
Signed-off-by: KeLe Bai <kele.bai@amlogic.com>
6 years agodi: clean up deadcode in flm
KeLe Bai [Wed, 6 Sep 2017 09:25:56 +0000 (17:25 +0800)]
di: clean up deadcode in flm

PD#150460: driver defect clean up
#57

Change-Id: I91f65ecadb8799971503fa26e1e58a557d54516e
Signed-off-by: KeLe Bai <kele.bai@amlogic.com>
6 years agodi: fix CHECK_RETURN error
KeLe Bai [Wed, 30 Aug 2017 06:57:38 +0000 (14:57 +0800)]
di: fix CHECK_RETURN error

PD#150096: di: fix CHECK_RETURN error add return check for reserved mem

driver defect clean up:
#34

Change-Id: I18c38121e3f7628e83cc3f385c142dfda96ff412
Signed-off-by: KeLe Bai <kele.bai@amlogic.com>
6 years agoemmc: buffer size setting mismatch
Long Yu [Fri, 1 Sep 2017 06:36:37 +0000 (14:36 +0800)]
emmc: buffer size setting mismatch

PD#150079: emmc: buffer size setting mismatch

1. change the tmp_table size from 16 to 20

driver defect clean up:
#15
#16
#17

Change-Id: Iebd919e760cd0ab975508a6a57e862ff5f683fc0
Signed-off-by: Long Yu <long.yu@amlogic.com>
6 years agodefconfig: add meson64_smarthome_defconfig for audio product
Peipeng Zhao [Fri, 8 Sep 2017 11:31:28 +0000 (19:31 +0800)]
defconfig: add meson64_smarthome_defconfig for audio product

PD#150725: defconfig: add meson64_smarthome_defconfig for audio product

Change-Id: I92611e5c28b66e8d48f4cd6ce190979311b92773
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
6 years agoi2c: clean up bad shift and return check
Jian Hu [Thu, 31 Aug 2017 02:18:22 +0000 (10:18 +0800)]
i2c: clean up bad shift and return check

PD#150077: driver defect clean up:
#8
#9
#10
#11
#12
#13
#24

Change-Id: I6bc36d30b761588a06a27957820d3ebc6aa5bf13
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
6 years agovout: driver defect clean up
Evoke Zhang [Wed, 6 Sep 2017 04:51:58 +0000 (12:51 +0800)]
vout: driver defect clean up

PD#150476: driver defect clean up:
#115
#597
#607
#609
#845

Change-Id: I92f0366ff00c8bd5e684db80c20000635256f612
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
6 years agomm: forward memory reclaim process
Tao Zeng [Tue, 12 Sep 2017 08:39:40 +0000 (16:39 +0800)]
mm: forward memory reclaim process

PD#150206: mm: forward memory reclaim process

memory reclaim process is usually do when first allocate failed
from buddy. This will cause some process crash especially when
memory is low, because there is not enough time to do reclaim
process. This change try to wake up kswapd process to reclaim
memory if free memory is less than high water mark. After apply
this change, free memory is usually keeps high than high_water
mark.

Change-Id: I03b5b931b6ec1fe1345d6f5cf8c15150438a26d3
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
7 years agovpu: driver defect clean up
Evoke Zhang [Mon, 4 Sep 2017 07:49:24 +0000 (15:49 +0800)]
vpu: driver defect clean up

PD#150097: driver defect clean up:
#35
#39
#54
#55
#83
#94
#96
#102
#649
#690
#695

Change-Id: I1b9a9384100f4e39da246c5242de8e506671454d
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
7 years agolcd: driver defect clean up
Evoke Zhang [Wed, 6 Sep 2017 01:57:35 +0000 (09:57 +0800)]
lcd: driver defect clean up

PD#150465: driver defect clean up:
#71
#77
#109
#127
#411
#600
#602
#603
#604
#611
#612

Change-Id: I38ac5ed6583bd6e57df9f42eaab04d05ee4ed663
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
7 years agobacklight: driver defect clean up
Evoke Zhang [Mon, 4 Sep 2017 09:45:05 +0000 (17:45 +0800)]
backlight: driver defect clean up

driver defect clean up:
#40
#41
#99
#100
#395
#396
#475
#614
#669

Change-Id: I581aaa8a1b950278bbf74d0c94aa647de89e07a9
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
7 years agolcd_extern: driver defect clean up
Evoke Zhang [Mon, 4 Sep 2017 08:41:42 +0000 (16:41 +0800)]
lcd_extern: driver defect clean up

PD#150081: driver defect clean up:
#20
#38
#87
#468
#469
#470
#471
#613
#668

Change-Id: Ifa0756e25088599571761b33efaffb6c2c898dfc
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
7 years agocvbs: clean up bad shift, deadcode, mixed enums errors
Nian Jing [Fri, 1 Sep 2017 03:25:32 +0000 (11:25 +0800)]
cvbs: clean up bad shift, deadcode, mixed enums errors

PD#150075: driver defect clean up:
 vdac_dev.c:
#5
#6
#876
 tv_vout.c:
#181
#267
#311
#312
#313
#314
#315
#532
#605

Change-Id: I185072efb68df1abdad036a21867bb64efca914c
Signed-off-by: Nian Jing <nian.jing@amlogic.com>
7 years agocpufreq: change interactive default parameters
Jiamin Ma [Tue, 12 Sep 2017 01:32:39 +0000 (09:32 +0800)]
cpufreq: change interactive default parameters

PD#138714: change interactive default parameters

Change-Id: I1813cda0f52755486a72efd85f79b0a4cc108514
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
7 years agoosd: move alloc buffer to osd_mmap for save memory in android
Pengcheng Chen [Fri, 8 Sep 2017 06:56:05 +0000 (14:56 +0800)]
osd: move alloc buffer to osd_mmap for save memory in android

PD#148907: osd: move alloc buffer to osd_mmap for save memory in android

Change-Id: Id8f42a08dbca33468bd8cea016aa88fa71e282c8
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
7 years agoaudio: optimize DDR fifo management
Shuai Li [Wed, 6 Sep 2017 11:37:57 +0000 (19:37 +0800)]
audio: optimize DDR fifo management

PD#150616: optimize audio DDR FIFO management driver.

Previously, we need to set DDR num and DDR IRQ number
in each audio devices.

This commit add one DDR manager which manipulate all
the ddr num and irq stuffs.
Make other audio driver easy to use it by simple interface.

Change-Id: Ie9688e651a4eff6fd4135811c50aa343e89580fe
Signed-off-by: Shuai Li <shuai.li@amlogic.com>
7 years agocodec: fixed audio codec tlv320adc3101 input mode error
Peipeng Zhao [Mon, 11 Sep 2017 02:10:42 +0000 (10:10 +0800)]
codec: fixed audio codec tlv320adc3101 input mode error

PD#150798: codec: fixed audio codec tlv320adc3101 input mode
add single end and differential input for S400&S420

Change-Id: I83086663b38e322425f6719247c89877504f22f5
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
7 years agovfm: fixed vfm bug on provider init
Yao.Liu [Thu, 7 Sep 2017 13:23:48 +0000 (21:23 +0800)]
vfm: fixed vfm bug on provider init

PD#149448: vfm: fixed vfm bug on provider init
        if provider use_cnt init later,
        some one may have on peek/get
        use_cnt may become error.

Change-Id: Ic4e416ab4ec6e0590ee095cbd1a8b40990537980
Signed-off-by: Yao.Liu <yao.liu@amlogic.com>
7 years agomedia: merge some bugfix from 3.14
Zhi Zhou [Fri, 21 Jul 2017 06:45:41 +0000 (14:45 +0800)]
media: merge some bugfix from 3.14

PD#146178: codec_mm: fixed scatter inc check bug
PD#148029: fixed codec_mm tvp aligned bug.
PD#148029 codec_mm: fixed 2 bugs [1/1]
fixed scatter memory check bug.
fixed codec_mm tvp alloc aligned bug.
PD#147242: amports: add protect for video keepr.
if not memory may free on keeping.

Change-Id: I7ebe0d3fb3caac3849dea558d91129123f8147ad
Signed-off-by: Zhi Zhou <zhi.zhou@amlogic.com>
7 years agoemmc: refixed RPMB operation process
Long Yu [Fri, 8 Sep 2017 02:26:34 +0000 (10:26 +0800)]
emmc: refixed RPMB operation process

PD149212: emmc: refixed RPMB operation process

Change-Id: Ifc845dc1009d2c28ee57a51fd45e43f12c28b7f6
Signed-off-by: Long Yu <long.yu@amlogic.com>
7 years agoemmc: pre-alloc cali blk_test memory to fix suspend/resume failed
Nan Li [Wed, 6 Sep 2017 02:25:10 +0000 (10:25 +0800)]
emmc: pre-alloc cali blk_test memory to fix suspend/resume failed

PD#150194: modify suspend & resume fail.
1. fixed alloc blk_test memory on probe,
pre-allocated memory allows suspend/resume
without dynamic allocation.
2. do not flush cache while resume.

Change-Id: If4a310da82f053359f89599fd187ad51a24f16ba
Signed-off-by: Nan Li <nan.li@amlogic.com>
7 years agodts: enlarge buffer size for omx & framebuffer
Yao.Liu [Thu, 7 Sep 2017 09:08:53 +0000 (17:08 +0800)]
dts: enlarge buffer size for omx & framebuffer

PD#150660: dts: enlarge buffer size for omx & framebuffer

Change-Id: Ib57e9ceef98df0c2f1b1f4785e5bcb916a8a35c0
Signed-off-by: Yao.Liu <yao.liu@amlogic.com>
7 years agoUSB: disable usb device interrupt when host mode
Qi Duan [Thu, 7 Sep 2017 09:10:07 +0000 (17:10 +0800)]
USB: disable usb device interrupt when host mode

PD#150668: USB: disable usb device interrupt when host mode. [1/1]

Change-Id: I4888617a442e0271f238a52d3998301264d4af4a
Signed-off-by: Qi Duan <qi.duan@amlogic.com>
7 years agotvin: add bt656in and hdmirx_ext support
Evoke Zhang [Thu, 24 Aug 2017 08:38:22 +0000 (16:38 +0800)]
tvin: add bt656in and hdmirx_ext support

PD#149610: tvin: add bt656in & hdmirx_ext support

Change-Id: Ic4bde4b8d9c5a945f59023dd6cb961b736c83eb2
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
7 years agomm: update cma policy and debug sysfs
Tao Zeng [Wed, 6 Sep 2017 08:38:09 +0000 (16:38 +0800)]
mm: update cma policy and debug sysfs

PD#150194: mm: update cma policy and debug sysfs

1. For movable memory, using CMA first, this can help to avoid
   low memory issue and driver can't allocate pages issue;
2. change /proc/slabinfo sysfs with total size print of each slab;
3. change /proc/pagetypeinfo with toatal pages of each migrate type;
4. add statistics for free pages of each migrate type, and show in
   echo m > /proc/sysrq-trigger.

Change-Id: I2fdab73c2d1278cd025185362a1159e4f683166b
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
7 years agowifi: add pci reinit and remove_reinit function [4/7]
Weiguang Ruan [Thu, 31 Aug 2017 08:16:54 +0000 (16:16 +0800)]
wifi: add pci reinit and remove_reinit function [4/7]

PD#148564: add pci reinit and remove_reinit function

pci_reinit: power on/off then rescan pci device.

pci_remove_reinit: remove pci device first,
then power on/off, rescan pci device.

Change-Id: I03f3ceb7b526ce686b835eaacddbbd7f2ed2c384
Signed-off-by: Weiguang Ruan <Weiguang.ruan@amlogic.com>
7 years agoreboot: add rpmbp reboot mode
Peifu Jiang [Tue, 4 Jul 2017 06:38:16 +0000 (14:38 +0800)]
reboot: add rpmbp reboot mode

PD#145456: Support RPMB shared secret provisioning [2/2]

[Problem]
RPMB requires a shared secret between host (AP) and device (eMMC flash)
in order to perform HMAC authentication.

[Solution]
This commit provides a special reboot mode, reboot rpmbp, to securely
provision the shared secret into eMMC flash device.

[Test]
Tested on GXL reference board P212. Passed.

Change-Id: I81dd482215d0f0232fe10efbc60b6af4ba2d9641
Signed-off-by: Peifu Jiang <peifu.jiang@amlogic.com>
7 years agocrypto: crypto update for axg
Matthew Shyu [Wed, 21 Jun 2017 10:06:28 +0000 (18:06 +0800)]
crypto: crypto update for axg

PD#146628: crypto update for axg

1. KEY_IV now can only read 16 bytes a time
2. DES is completely disabled and TDES with three identical keys are
also disabled.  This creates a potential hole in TDES driver, and
thus TDES support is removed from dts in axg

Change-Id: Iface9c52d494b8b5232e4f5915e0f85a959863a4
Signed-off-by: Matthew Shyu <matthew.shyu@amlogic.com>
7 years agomd: use dm-anroid-verity [3/4]
Xindong Xu [Fri, 1 Sep 2017 06:24:07 +0000 (14:24 +0800)]
md: use dm-anroid-verity [3/4]

PD#150024: md: use dm-android-verity.c for android dm-verity

Change-Id: I44ee22afb38aeb8f7c5958a6974f6bc48c721dbc
Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
7 years agodts: change a/b update partition table [3/3]
Xindong Xu [Mon, 28 Aug 2017 07:29:26 +0000 (15:29 +0800)]
dts: change a/b update partition table [3/3]

PD#150024 dts: change a/b update partition table

1. a/b update do not need recovery/cache
2. boot/system/vendor/odm need two slots: _a & _b

Change-Id: If74667eb4f7ebbd96a9ded3618d3d6b4c1fb8ae4
Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
7 years agodts: p230: enlarge buffer size for omx & framebuffer [1/1]
Xindong Xu [Wed, 6 Sep 2017 01:38:04 +0000 (09:38 +0800)]
dts: p230: enlarge buffer size for omx & framebuffer [1/1]

PD#148907: enlarge buffer size for omx & framebuffer

Change-Id: I0c9725b1ce35ba1e330ca1b603e09d99a26e0a86
Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
7 years agoamlvideo: set omx output buffer size to compWidth*compHeight
Yao.Liu [Tue, 5 Sep 2017 09:05:37 +0000 (17:05 +0800)]
amlvideo: set omx output buffer size to compWidth*compHeight

PD#150218: amlvideo: set omx output buffer size to compWidth*compHeight

Change-Id: I69ff2e5defb8344cd4aec05582f4696faa0abe7f
Signed-off-by: Yao.Liu <yao.liu@amlogic.com>
7 years agomtd: nand : add slc ids
Yueguie He [Mon, 4 Sep 2017 09:07:33 +0000 (17:07 +0800)]
mtd: nand : add slc ids

PD#150442: mtd: nand: add 128m FS33ND01GS108TFI0 nand

Change-Id: Ibda5d793825cef1a3c522cf42f277f74db3172f7
Signed-off-by: Yueguie He <yuegui.he@amlogic.com>
7 years agoframe_sync: replace the magic number with msecs_to_jiffies.
Nanxin Qin [Wed, 6 Sep 2017 03:10:03 +0000 (11:10 +0800)]
frame_sync: replace the magic number with msecs_to_jiffies.

PD#150542: replace the magic number with msecs_to_jiffies.

Change-Id: I071da655a9ea3edf496fca65dc67167145ccc167
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
7 years agovideo_sink: modify modules dir in the sysfs to compatible with kernel 3.14 [1/3]
Nanxin Qin [Mon, 4 Sep 2017 12:32:41 +0000 (20:32 +0800)]
video_sink: modify modules dir in the sysfs to compatible with kernel 3.14 [1/3]

PD#150498: modify modules dir in the sysfs to compatible with kernel 3.14

Change-Id: If34cb6a153a4e5b97537faad1da04a1afec3fe4b
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
7 years agoscheduler: remove log info for cpu capacity updating
Jiamin Ma [Wed, 6 Sep 2017 02:28:42 +0000 (10:28 +0800)]
scheduler: remove log info for cpu capacity updating

PD#138714: too much log info for cpu capacity updating

Change-Id: I14164903950afc2f29d7446d743ba0b0062edc19
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
7 years agonand: change boot partition size
Yueguie He [Tue, 5 Sep 2017 12:49:38 +0000 (20:49 +0800)]
nand: change boot partition size

PD#150531: nand: change boot partition size to 15M

Change-Id: I64e376b89908b882b6b70bfd370871bc540020f1
Signed-off-by: Yueguie He <yuegui.he@amlogic.com>
7 years agosd: add sd_uart support
Nan Li [Tue, 5 Sep 2017 02:39:24 +0000 (10:39 +0800)]
sd: add sd_uart support

PD#149976: add sd to uart support
modify emmc init min clk freq to 400k.

Change-Id: I204d68668497a1a6a1f37f5e06d944a2687412ff
Signed-off-by: Nan Li <nan.li@amlogic.com>
7 years agogcc: add options to limit large object and stack usage
Tao Zeng [Mon, 4 Sep 2017 03:07:03 +0000 (11:07 +0800)]
gcc: add options to limit large object and stack usage

PD#150373: gcc: add options to limit large object and stack usage

We should restrict limit large size of global object allocated in
driver code to reduce size of .data/.bss/.rodata sections. Also,
large array/many variables declared in a function is not allowed,
this behavior may cause kernel stack overflow especially in IRQ
context or recursion calls.
Right now we just set a very high limit in order to pass comiple.
Final target is to limit:

1. large global object size should not over 4096 bytes, a page size;
2. stack usage of each function should not over 256 bytes.

If your global object is larger than a page size, we advise allocate
it as a static pointer, and allocate it's memory during probe stage.

Change-Id: Ic14995f642bc1e0b47d3a07143468e6e1dac7bfc
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
7 years agoosd: init osd output pt value to 1, and fix osd buf hnd leak. [1/3]
sky zhou [Mon, 4 Sep 2017 14:54:14 +0000 (22:54 +0800)]
osd: init osd output pt value to 1, and fix osd buf hnd leak. [1/3]

PD#148907: fix osd output fence error and framebuffer hnd leak.

Change-Id: Ic5a412d41b808766d6d0e05edeb770b2b20bb4a6
Signed-off-by: sky zhou <sky.zhou@amlogic.com>
7 years agowifi: add wext and wext_priv [5/8]
Weiguang Ruan [Wed, 30 Aug 2017 02:45:15 +0000 (10:45 +0800)]
wifi: add wext and wext_priv [5/8]

PD#150114: add wext and wext_priv

select WIRELESS_EXT WEXT_PRIV in
driver/amlogic/wifi/Kconfig
qualcomm wifi drivers need wext support

Change-Id: I1f85481013ba6c35b304eeb45d0c4917a67c67eb
Signed-off-by: Weiguang Ruan <Weiguang.ruan@amlogic.com>
7 years agoosd: use new fence api. [3/7]
Jiyu Yang [Fri, 1 Sep 2017 12:59:13 +0000 (20:59 +0800)]
osd: use new fence api. [3/7]

PD#149525: osd use new fence api
Change-Id: I3c7f0acf63012a12cdc9a3b4512db0d3bd4f8927
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
7 years agosync: new fence api [2/7]
Jiyu Yang [Fri, 1 Sep 2017 12:45:37 +0000 (20:45 +0800)]
sync: new fence api [2/7]

PD#149525: sync: new fence api

Change-Id: I3c957758a67fb6c0a0b3aa5031637b00d3d510e8
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
7 years agoRevert "android: port fence driver from kernel-4.4 "[1/7]
Jiyu Yang [Tue, 22 Aug 2017 11:41:10 +0000 (19:41 +0800)]
Revert "android: port fence driver from kernel-4.4 "[1/7]

PD#149525: Revert "android: port fence driver from kernel-4.4

This reverts commit 22f718c442a2c91e6c92eb000f795dfe781721e9.

Change-Id: I0ad1ad31fe6624b11bb840bc13d64c9c5af5d651
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
7 years agoionvideo: omx support osd display
jintao xu [Thu, 31 Aug 2017 08:21:23 +0000 (16:21 +0800)]
ionvideo: omx support osd display

PD#150258: omx support osd display

Change-Id: I566e530e0ec2dc5e7eb73e33b90345552f6ae7fc
Signed-off-by: jintao xu <jintao.xu@amlogic.com>
7 years agoUSB: don't set softdisconnect when suspend
Qi Duan [Fri, 1 Sep 2017 06:52:16 +0000 (14:52 +0800)]
USB: don't set softdisconnect when suspend

PD#148350: USB: don't set softdisconnect when suspend. [1/1]

Change-Id: I037d951f23c6d5c606af64f8c1b5550246256d79
Signed-off-by: Qi Duan <qi.duan@amlogic.com>
7 years agodi: support muti decode
KeLe Bai [Fri, 1 Sep 2017 02:24:39 +0000 (10:24 +0800)]
di: support muti decode

PD#150173: di: merge muti decode from bug143269

Change-Id: I821171c93aa3a6a77a1309429a9c8a37e704b17b
Signed-off-by: KeLe Bai <kele.bai@amlogic.com>
7 years agodefconfig: add config to solve AndroidO CTS&VTS fail
Ao Xu [Fri, 1 Sep 2017 08:44:29 +0000 (16:44 +0800)]
defconfig: add config to solve AndroidO CTS&VTS fail

PD#149771: add config to solve AndroidO CTS&VTS fail

add the following configs:
1. CONFIG_ARMV8_DEPRECATED=y
   CONFIG_SWP_EMULATION=y
   CONFIG_CP15_BARRIER_EMULATION=y
   CONFIG_SETEND_EMULATION=y
2. CONFIG_RANDOMIZE_BASE=y
3. CONFIG_PM_AUTOSLEEP=y
4. CONFIG_INET_DIAG_DESTROY=y
   CONFIG_NF_CONNTRACK_SECMARK=y
   CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
   CONFIG_NETFILTER_XT_TARGET_SECMARK=y
   CONFIG_IP_NF_SECURITY=y
5. CONFIG_PPPOLAC=y
   CONFIG_PPPOPNS=y
6. CONFIG_USB_CONFIGFS_F_PTP=y
   CONFIG_USB_CONFIGFS_F_ACC=y
   CONFIG_USB_CONFIGFS_F_AUDIO_SRC=y
   CONFIG_USB_CONFIGFS_F_MIDI=y
7. CONFIG_QUOTA_NETLINK_INTERFACE=y
8. CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y
   CONFIG_HARDENED_USERCOPY=y

Change-Id: If0a9667682ed42790ed76addc9383dfdb62ff0c4
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
7 years agodts: axg: sync dts config
Yueguie He [Thu, 31 Aug 2017 07:15:10 +0000 (15:15 +0800)]
dts: axg: sync dts config

PD#150185: dts: sync dts config

Change-Id: I3edcba36aefc1c487fcb8e31b4bdb23108b226cb
Signed-off-by: Yueguie He <yuegui.he@amlogic.com>
7 years agomedia: codec_mm: fixed scatter cache bug
Zhi Zhou [Thu, 31 Aug 2017 03:03:59 +0000 (11:03 +0800)]
media: codec_mm: fixed scatter cache bug

PD#150197: codec_mm: fixed tvp first wait long time bug

Change-Id: Ide5532c0e331948a70bdc809fe232b06b4a7076d
Signed-off-by: Zhi Zhou <zhi.zhou@amlogic.com>
7 years agoaudio: fix loopback channel map
Xing Wang [Wed, 30 Aug 2017 16:00:35 +0000 (00:00 +0800)]
audio: fix loopback channel map

PD#149869: audio: fix tdmin_lb channel mask and swap for loopback

Change-Id: I1bf2dd42a2869ca2404b72e1f0e57a267f365e23
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
7 years agoMerge branch 'android-4.9' into amlogic-4.9-dev
Victor Wan [Thu, 31 Aug 2017 06:01:28 +0000 (14:01 +0800)]
Merge branch 'android-4.9' into amlogic-4.9-dev

Conflicts:
arch/arm/configs/s3c2410_defconfig
drivers/mmc/core/mmc.c

Signed-off-by: Victor Wan <victor.wan@amlogic.com>
7 years agocodec: fixed codec tlv320adc3101 driver clk error on 48K and 16K
Peipeng Zhao [Wed, 30 Aug 2017 09:32:43 +0000 (17:32 +0800)]
codec: fixed codec tlv320adc3101 driver clk error on 48K and 16K

PD#150168: fixed codec tlv320adc3101 record error on 48K and 16K

Change-Id: Ia672427de4c1a0e730eecdb00133d84640720785
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
7 years agoMerge 4.9.46 into android-4.9
Greg Kroah-Hartman [Wed, 30 Aug 2017 13:24:10 +0000 (15:24 +0200)]
Merge 4.9.46 into android-4.9

Changes in 4.9.46
sparc64: remove unnecessary log message
af_key: do not use GFP_KERNEL in atomic contexts
dccp: purge write queue in dccp_destroy_sock()
dccp: defer ccid_hc_tx_delete() at dismantle time
ipv4: fix NULL dereference in free_fib_info_rcu()
net_sched/sfq: update hierarchical backlog when drop packet
net_sched: remove warning from qdisc_hash_add
bpf: fix bpf_trace_printk on 32 bit archs
openvswitch: fix skb_panic due to the incorrect actions attrlen
ptr_ring: use kmalloc_array()
ipv4: better IP_MAX_MTU enforcement
nfp: fix infinite loop on umapping cleanup
sctp: fully initialize the IPv6 address in sctp_v6_to_addr()
tipc: fix use-after-free
ipv6: reset fn->rr_ptr when replacing route
ipv6: repair fib6 tree in failure case
tcp: when rearming RTO, if RTO time is in past then fire RTO ASAP
net/mlx4_core: Enable 4K UAR if SRIOV module parameter is not enabled
irda: do not leak initialized list.dev to userspace
net: sched: fix NULL pointer dereference when action calls some targets
net_sched: fix order of queue length updates in qdisc_replace()
bpf, verifier: add additional patterns to evaluate_reg_imm_alu
bpf: adjust verifier heuristics
bpf, verifier: fix alu ops against map_value{, _adj} register types
bpf: fix mixed signed/unsigned derived min/max value bounds
bpf/verifier: fix min/max handling in BPF_SUB
Input: trackpoint - add new trackpoint firmware ID
Input: elan_i2c - add ELAN0602 ACPI ID to support Lenovo Yoga310
Input: ALPS - fix two-finger scroll breakage in right side on ALPS touchpad
KVM: s390: sthyi: fix sthyi inline assembly
KVM: s390: sthyi: fix specification exception detection
KVM: x86: block guest protection keys unless the host has them enabled
ALSA: usb-audio: Add delay quirk for H650e/Jabra 550a USB headsets
ALSA: core: Fix unexpected error at replacing user TLV
ALSA: hda - Add stereo mic quirk for Lenovo G50-70 (17aa:3978)
ALSA: firewire: fix NULL pointer dereference when releasing uninitialized data of iso-resource
ARCv2: PAE40: Explicitly set MSB counterpart of SLC region ops addresses
mm, shmem: fix handling /sys/kernel/mm/transparent_hugepage/shmem_enabled
i2c: designware: Fix system suspend
mm/madvise.c: fix freeing of locked page with MADV_FREE
fork: fix incorrect fput of ->exe_file causing use-after-free
mm/memblock.c: reversed logic in memblock_discard()
drm: Release driver tracking before making the object available again
drm/atomic: If the atomic check fails, return its value first
drm: rcar-du: Fix crash in encoder failure error path
drm: rcar-du: Fix display timing controller parameter
drm: rcar-du: Fix H/V sync signal polarity configuration
tracing: Call clear_boot_tracer() at lateinit_sync
tracing: Fix kmemleak in tracing_map_array_free()
tracing: Fix freeing of filter in create_filter() when set_str is false
kbuild: linker script do not match C names unless LD_DEAD_CODE_DATA_ELIMINATION is configured
cifs: Fix df output for users with quota limits
cifs: return ENAMETOOLONG for overlong names in cifs_open()/cifs_lookup()
nfsd: Limit end of page list when decoding NFSv4 WRITE
ftrace: Check for null ret_stack on profile function graph entry function
perf/core: Fix group {cpu,task} validation
perf probe: Fix --funcs to show correct symbols for offline module
perf/x86/intel/rapl: Make package handling more robust
timers: Fix excessive granularity of new timers after a nohz idle
x86/mm: Fix use-after-free of ldt_struct
net: sunrpc: svcsock: fix NULL-pointer exception
Revert "leds: handle suspend/resume in heartbeat trigger"
netfilter: nat: fix src map lookup
Bluetooth: hidp: fix possible might sleep error in hidp_session_thread
Bluetooth: cmtp: fix possible might sleep error in cmtp_session
Bluetooth: bnep: fix possible might sleep error in bnep_session
Revert "android: binder: Sanity check at binder ioctl"
binder: use group leader instead of open thread
binder: Use wake up hint for synchronous transactions.
ANDROID: binder: fix proc->tsk check.
iio: imu: adis16480: Fix acceleration scale factor for adis16480
iio: hid-sensor-trigger: Fix the race with user space powering up sensors
staging: rtl8188eu: add RNX-N150NUB support
Clarify (and fix) MAX_LFS_FILESIZE macros
ntb_transport: fix qp count bug
ntb_transport: fix bug calculating num_qps_mw
NTB: ntb_test: fix bug printing ntb_perf results
ntb: no sleep in ntb_async_tx_submit
ntb: ntb_test: ensure the link is up before trying to configure the mws
ntb: transport shouldn't disable link due to bogus values in SPADs
ACPI: ioapic: Clear on-stack resource before using it
ACPI / APEI: Add missing synchronize_rcu() on NOTIFY_SCI removal
ACPI: EC: Fix regression related to wrong ECDT initialization order
powerpc/mm: Ensure cpumask update is ordered
Linux 4.9.46

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
7 years agohdmitx: fix 4k smpte no signal
Kaifu Hu [Wed, 30 Aug 2017 09:19:54 +0000 (17:19 +0800)]
hdmitx: fix 4k smpte no signal

PD#149239: hdmitx: fix 4k smpte no signal
when 4k smpte 444,10bit, div40 and scramble need be setted

Change-Id: Iadfc337519e1444c244b36086c3929d231bd80c4
Signed-off-by: Kaifu Hu <kaifu.hu@amlogic.com>
7 years agoLinux 4.9.46 v4.9.46
Greg Kroah-Hartman [Wed, 30 Aug 2017 08:24:43 +0000 (10:24 +0200)]
Linux 4.9.46

7 years agopowerpc/mm: Ensure cpumask update is ordered
Benjamin Herrenschmidt [Mon, 24 Jul 2017 04:28:00 +0000 (14:28 +1000)]
powerpc/mm: Ensure cpumask update is ordered

commit 1a92a80ad386a1a6e3b36d576d52a1a456394b70 upstream.

There is no guarantee that the various isync's involved with
the context switch will order the update of the CPU mask with
the first TLB entry for the new context being loaded by the HW.

Be safe here and add a memory barrier to order any subsequent
load/store which may bring entries into the TLB.

The corresponding barrier on the other side already exists as
pte updates use pte_xchg() which uses __cmpxchg_u64 which has
a sync after the atomic operation.

Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Add comments in the code]
[mpe: Backport to 4.12, minor context change]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoACPI: EC: Fix regression related to wrong ECDT initialization order
Lv Zheng [Wed, 16 Aug 2017 07:29:49 +0000 (15:29 +0800)]
ACPI: EC: Fix regression related to wrong ECDT initialization order

commit 98529b9272e06a7767034fb8a32e43cdecda240a upstream.

Commit 2a5708409e4e (ACPI / EC: Fix a gap that ECDT EC cannot handle
EC events) introduced acpi_ec_ecdt_start(), but that function is
invoked before acpi_ec_query_init(), which is too early.  This causes
the kernel to crash if an EC event occurs after boot, when ec_query_wq
is not valid:

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000102
 ...
 Workqueue: events acpi_ec_event_handler
 task: ffff9f539790dac0 task.stack: ffffb437c0e10000
 RIP: 0010:__queue_work+0x32/0x430

Normally, the DSDT EC should always be valid, so acpi_ec_ecdt_start()
is actually a no-op in the majority of cases.  However, commit
c712bb58d827 (ACPI / EC: Add support to skip boot stage DSDT probe)
caused the probing of the DSDT EC as the "boot EC" to be skipped when
the ECDT EC is valid and uncovered the bug.

Fix this issue by invoking acpi_ec_ecdt_start() after acpi_ec_query_init()
in acpi_ec_init().

Link: https://jira01.devtools.intel.com/browse/LCK-4348
Fixes: 2a5708409e4e (ACPI / EC: Fix a gap that ECDT EC cannot handle EC events)
Fixes: c712bb58d827 (ACPI / EC: Add support to skip boot stage DSDT probe)
Reported-by: Wang Wendy <wendy.wang@intel.com>
Tested-by: Feng Chenzhou <chenzhoux.feng@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
[ rjw: Changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoACPI / APEI: Add missing synchronize_rcu() on NOTIFY_SCI removal
James Morse [Thu, 16 Mar 2017 14:30:39 +0000 (14:30 +0000)]
ACPI / APEI: Add missing synchronize_rcu() on NOTIFY_SCI removal

commit 7d64f82cceb21e6d95db312d284f5f195e120154 upstream.

When removing a GHES device notified by SCI, list_del_rcu() is used,
ghes_remove() should call synchronize_rcu() before it goes on to call
kfree(ghes), otherwise concurrent RCU readers may still hold this list
entry after it has been freed.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
Fixes: 81e88fdc432a (ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoACPI: ioapic: Clear on-stack resource before using it
Joerg Roedel [Wed, 22 Mar 2017 17:33:23 +0000 (18:33 +0100)]
ACPI: ioapic: Clear on-stack resource before using it

commit e3d5092b6756b9e0b08f94bbeafcc7afe19f0996 upstream.

The on-stack resource-window 'win' in setup_res() is not
properly initialized. This causes the pointers in the
embedded 'struct resource' to contain stale addresses.

These pointers (in my case the ->child pointer) later get
propagated to the global iomem_resources list, causing a #GP
exception when the list is traversed in
iomem_map_sanity_check().

Fixes: c183619b63ec (x86/irq, ACPI: Implement ACPI driver to support IOAPIC hotplug)
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agontb: transport shouldn't disable link due to bogus values in SPADs
Dave Jiang [Fri, 28 Jul 2017 22:10:48 +0000 (15:10 -0700)]
ntb: transport shouldn't disable link due to bogus values in SPADs

commit f3fd2afed8eee91620d05b69ab94c14793c849d7 upstream.

It seems that under certain scenarios the SPAD can have bogus values caused
by an agent (i.e. BIOS or other software) that is not the kernel driver, and
that causes memory window setup failure. This should not cause the link to
be disabled because if we do that, the driver will never recover again. We
have verified in testing that this issue happens and prevents proper link
recovery.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Acked-by: Allen Hubbe <Allen.Hubbe@dell.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Fixes: 84f766855f61 ("ntb: stop link work when we do not have memory")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agontb: ntb_test: ensure the link is up before trying to configure the mws
Logan Gunthorpe [Tue, 25 Jul 2017 20:57:42 +0000 (14:57 -0600)]
ntb: ntb_test: ensure the link is up before trying to configure the mws

commit 0eb46345364d7318b11068c46e8a68d5dc10f65e upstream.

After the link tests, there is a race on one side of the test for
the link coming up. It's possible, in some cases, for the test script
to write to the 'peer_trans' files before the link has come up.

To fix this, we simply use the link event file to ensure both sides
see the link as up before continuning.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Allen Hubbe <Allen.Hubbe@dell.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Fixes: a9c59ef77458 ("ntb_test: Add a selftest script for the NTB subsystem")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agontb: no sleep in ntb_async_tx_submit
Allen Hubbe [Fri, 9 Jun 2017 22:06:36 +0000 (18:06 -0400)]
ntb: no sleep in ntb_async_tx_submit

commit 88931ec3dc11e7dbceb3b0df455693873b508fbe upstream.

Do not sleep in ntb_async_tx_submit, which could deadlock.
This reverts commit "8c874cc140d667f84ae4642bb5b5e0d6396d2ca4"

Fixes: 8c874cc140d6 ("NTB: Address out of DMA descriptor issue with NTB")
Reported-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: Allen Hubbe <Allen.Hubbe@dell.com>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoNTB: ntb_test: fix bug printing ntb_perf results
Logan Gunthorpe [Mon, 5 Jun 2017 16:13:24 +0000 (10:13 -0600)]
NTB: ntb_test: fix bug printing ntb_perf results

commit 07b0b22b3e58824f70b9188d085d400069ca3240 upstream.

The code mistakenly prints the local perf results for the remote test
so the script reports identical results for both directions. Fix this
by ensuring we print the remote result.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Fixes: a9c59ef77458 ("ntb_test: Add a selftest script for the NTB subsystem")
Acked-by: Allen Hubbe <Allen.Hubbe@dell.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agontb_transport: fix bug calculating num_qps_mw
Logan Gunthorpe [Mon, 5 Jun 2017 20:00:53 +0000 (14:00 -0600)]
ntb_transport: fix bug calculating num_qps_mw

commit 8e8496e0e9564b66165f5219a4e8ed20b0d3fc6b upstream.

A divide by zero error occurs if qp_count is less than mw_count because
num_qps_mw is calculated to be zero. The calculation appears to be
incorrect.

The requirement is for num_qps_mw to be set to qp_count / mw_count
with any remainder divided among the earlier mws.

For example, if mw_count is 5 and qp_count is 12 then mws 0 and 1
will have 3 qps per window and mws 2 through 4 will have 2 qps per window.
Thus, when mw_num < qp_count % mw_count, num_qps_mw is 1 higher
than when mw_num >= qp_count.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Fixes: e26a5843f7f5 ("NTB: Split ntb_hw_intel and ntb_transport drivers")
Acked-by: Allen Hubbe <Allen.Hubbe@dell.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agontb_transport: fix qp count bug
Logan Gunthorpe [Mon, 5 Jun 2017 20:00:52 +0000 (14:00 -0600)]
ntb_transport: fix qp count bug

commit cb827ee6ccc3e480f0d9c0e8e53eef55be5b0414 upstream.

In cases where there are more mw's than spads/2-2, the mw count gets
reduced to match the limitation. ntb_transport also tries to ensure that
there are fewer qps than mws but uses the full mw count instead of
the reduced one. When this happens, the math in
'ntb_transport_setup_qp_mw' will get confused and result in a kernel
paging request bug.

This patch fixes the bug by reducing qp_count to the reduced mw count
instead of the full mw count.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Fixes: e26a5843f7f5 ("NTB: Split ntb_hw_intel and ntb_transport drivers")
Acked-by: Allen Hubbe <Allen.Hubbe@dell.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoClarify (and fix) MAX_LFS_FILESIZE macros
Linus Torvalds [Sun, 27 Aug 2017 19:12:25 +0000 (12:12 -0700)]
Clarify (and fix) MAX_LFS_FILESIZE macros

commit 0cc3b0ec23ce4c69e1e890ed2b8d2fa932b14aad upstream.

We have a MAX_LFS_FILESIZE macro that is meant to be filled in by
filesystems (and other IO targets) that know they are 64-bit clean and
don't have any 32-bit limits in their IO path.

It turns out that our 32-bit value for that limit was bogus.  On 32-bit,
the VM layer is limited by the page cache to only 32-bit index values,
but our logic for that was confusing and actually wrong.  We used to
define that value to

(((loff_t)PAGE_SIZE << (BITS_PER_LONG-1))-1)

which is actually odd in several ways: it limits the index to 31 bits,
and then it limits files so that they can't have data in that last byte
of a page that has the highest 31-bit index (ie page index 0x7fffffff).

Neither of those limitations make sense.  The index is actually the full
32 bit unsigned value, and we can use that whole full page.  So the
maximum size of the file would logically be "PAGE_SIZE << BITS_PER_LONG".

However, we do wan tto avoid the maximum index, because we have code
that iterates over the page indexes, and we don't want that code to
overflow.  So the maximum size of a file on a 32-bit host should
actually be one page less than the full 32-bit index.

So the actual limit is ULONG_MAX << PAGE_SHIFT.  That means that we will
not actually be using the page of that last index (ULONG_MAX), but we
can grow a file up to that limit.

The wrong value of MAX_LFS_FILESIZE actually caused problems for Doug
Nazar, who was still using a 32-bit host, but with a 9.7TB 2 x RAID5
volume.  It turns out that our old MAX_LFS_FILESIZE was 8TiB (well, one
byte less), but the actual true VM limit is one page less than 16TiB.

This was invisible until commit c2a9737f45e2 ("vfs,mm: fix a dead loop
in truncate_inode_pages_range()"), which started applying that
MAX_LFS_FILESIZE limit to block devices too.

NOTE! On 64-bit, the page index isn't a limiter at all, and the limit is
actually just the offset type itself (loff_t), which is signed.  But for
clarity, on 64-bit, just use the maximum signed value, and don't make
people have to count the number of 'f' characters in the hex constant.

So just use LLONG_MAX for the 64-bit case.  That was what the value had
been before too, just written out as a hex constant.

Fixes: c2a9737f45e2 ("vfs,mm: fix a dead loop in truncate_inode_pages_range()")
Reported-and-tested-by: Doug Nazar <nazard@nazar.ca>
Cc: Andreas Dilger <adilger@dilger.ca>
Cc: Mark Fasheh <mfasheh@versity.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Dave Kleikamp <shaggy@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: add RNX-N150NUB support
Charles Milette [Fri, 18 Aug 2017 20:30:34 +0000 (16:30 -0400)]
staging: rtl8188eu: add RNX-N150NUB support

commit f299aec6ebd747298e35934cff7709c6b119ca52 upstream.

Add support for USB Device Rosewill RNX-N150NUB.
VendorID: 0x0bda, ProductID: 0xffef

Signed-off-by: Charles Milette <charles.milette@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoiio: hid-sensor-trigger: Fix the race with user space powering up sensors
Srinivas Pandruvada [Sat, 12 Aug 2017 16:09:21 +0000 (09:09 -0700)]
iio: hid-sensor-trigger: Fix the race with user space powering up sensors

commit f1664eaacec31035450132c46ed2915fd2b2049a upstream.

It has been reported for a while that with iio-sensor-proxy service the
rotation only works after one suspend/resume cycle. This required a wait
in the systemd unit file to avoid race. I found a Yoga 900 where I could
reproduce this.

The problem scenerio is:
- During sensor driver init, enable run time PM and also set a
  auto-suspend for 3 seconds.
This result in one runtime resume. But there is a check to avoid
a powerup in this sequence, but rpm is active
- User space iio-sensor-proxy tries to power up the sensor. Since rpm is
  active it will simply return. But sensors were not actually
powered up in the prior sequence, so actaully the sensors will not work
- After 3 seconds the auto suspend kicks

If we add a wait in systemd service file to fire iio-sensor-proxy after
3 seconds, then now everything will work as the runtime resume will
actually powerup the sensor as this is a user request.

To avoid this:
- Remove the check to match user requested state, this will cause a
  brief powerup, but if the iio-sensor-proxy starts immediately it will
still work as the sensors are ON.
- Also move the autosuspend delay to place when user requested turn off
  of sensors, like after user finished raw read or buffer disable

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tested-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoiio: imu: adis16480: Fix acceleration scale factor for adis16480
Dragos Bogdan [Thu, 3 Aug 2017 22:37:27 +0000 (01:37 +0300)]
iio: imu: adis16480: Fix acceleration scale factor for adis16480

commit fdd0d32eb95f135041236a6885d9006315aa9a1d upstream.

According to the datasheet, the range of the acceleration is [-10 g, + 10 g],
so the scale factor should be 10 instead of 5.

Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>