platform/kernel/linux-amlogic.git
7 years agonand: add slc nand support:F59L1G81LA (2Y),F59L1G81MA (2Y)
Yi Zeng [Mon, 18 Sep 2017 06:20:37 +0000 (14:20 +0800)]
nand: add slc nand support:F59L1G81LA (2Y),F59L1G81MA (2Y)

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

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

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

  same as PD#150483.

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

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

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

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

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

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

PD#151241: null pointer risk protect

driver defect clean up:
#284

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

PD#151008: fix hdr no effect

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

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

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

PD#151226: driver defect clean up
#229

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

PD#150076: incorrect free pointer event

driver defect clean up:
#4
#7

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

PD#151855: open tee loading under optee

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

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

PD#151224: driver defect clean up:

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

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

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

Change-Id: I75dbc06ceddf724210f3a2a858bc10685c829fcf
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
7 years agoemmc: clr emmc pinmux fail
Nan Li [Fri, 29 Sep 2017 09:55:05 +0000 (17:55 +0800)]
emmc: clr emmc pinmux fail

PD#151924: clear emmc pimux fail on m8b,
because BOOT gpio pin number error.

Change-Id: Ic67dff49d28c99e208929f7b142849ecd44d53cc
Signed-off-by: Nan Li <nan.li@amlogic.com>
7 years agotee: disable tee secure firmware load temporary
Yvonne Chen [Tue, 26 Sep 2017 09:13:48 +0000 (17:13 +0800)]
tee: disable tee secure firmware load temporary

PD#150992: disable tee secure firmware load

disable tee secure firmware load temporary

Change-Id: I2acf75b340fc9abea6238f57b635fff4862166f7
Signed-off-by: Yvonne Chen <yvonne.chen@amlogic.com>
7 years agoge2d: merge 3.14 ge2d fix to 4.9
Pengcheng Chen [Fri, 15 Sep 2017 08:42:59 +0000 (16:42 +0800)]
ge2d: merge 3.14 ge2d fix to 4.9

PD#151061: merge 3.14 ge2d fix to 4.9
1. ge2d: fix yv12 format phy addr error(73c2443a1744)
2. ge2d: adjust ge2d clk according vpu clk(28d6c91a495c)

Change-Id: I215d1bec2f359b16176daf1b7c9c4cf838e1eed0
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
7 years agodts: p230: add bt-dev to fix bt open fail issue
Rongjun Chen [Thu, 21 Sep 2017 03:32:27 +0000 (11:32 +0800)]
dts: p230: add bt-dev to fix bt open fail issue

PD#151283: BT: add bt-dev to p230 dts

Change-Id: I8c15fd7112037fcbde4c1fdd096aa5400cbe8337
Signed-off-by: Rongjun Chen <rongjun.chen@amlogic.com>
7 years agofs: add exfat file system support
Baocheng Sun [Mon, 4 Sep 2017 02:22:59 +0000 (10:22 +0800)]
fs: add exfat file system support

PD#147260: add exfat file system support

Change-Id: Id3ec5e1959b8e34d8fc54e04318677295d8ccbf9
Signed-off-by: Baocheng Sun <baocheng.sun@amlogic.com>
7 years agoaudio: enable continuous clks
Shuai Li [Tue, 19 Sep 2017 12:56:11 +0000 (20:56 +0800)]
audio: enable continuous clks

PD#150879: if continuous-clock is configed, the audio clock don't
gate off when there is audio stream. Also, this commit could simply
set the same MPLL source to make PDM-in and TDM-out work synchronously.

Change-Id: Iac488b4d4813f758f0bc1ebd8bb5f35f9a8dfff1
Signed-off-by: Shuai Li <shuai.li@amlogic.com>
7 years agommc: remove unnecessary call to single_release
Jiamin Ma [Fri, 22 Sep 2017 08:16:06 +0000 (16:16 +0800)]
mmc: remove unnecessary call to single_release

PD#151361: Oops when doing OTA upgrading

    in single_release file->private_data will be dereferenced,
which is assigned a value by single_open. So if signle_open
is not called before single_release, an "unable to handle
kernel NULL pointer..." issue will appear.
    But in this case, since single_open and seq_read is not
called, there is no need calling single_release to release
mem allocated by single_open and seq_read. Simpley remove
calling single_release is the best choise

Change-Id: I21882da33cc2509c1b5b42daabbd7c6f3fdc4542
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
7 years agovideo_sink: disable hdmiin frame check default
Dezhi Kong [Thu, 21 Sep 2017 10:54:48 +0000 (18:54 +0800)]
video_sink: disable hdmiin frame check default

PD#151428: disable hdmiin frame check default

Change-Id: I7378dcfecf8c72203dcd10ed0ee8c0c4aa0bea3d
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
7 years agoPM/sleep: add freeze op for gx
Qiufang Dai [Tue, 19 Sep 2017 03:04:47 +0000 (11:04 +0800)]
PM/sleep: add freeze op for gx

PD#148982: add freeze op to distinguish freeze mode vs mem mode
Signed-off-by: Qiufang Dai <qiufang.dai@amlogic.com>
Change-Id: I3bec4d687a933603a29aeb7a44422aa81e47cea7

7 years agodefconfig: enable ntfs file system support
Baocheng Sun [Fri, 1 Sep 2017 06:46:13 +0000 (14:46 +0800)]
defconfig: enable ntfs file system support

PD#147260: support ntfs file system, CONFIG_NTFS_FS=y

Change-Id: I24926eb04dd129a1d691ee8221f46b09e014c93f
Signed-off-by: Baocheng Sun <baocheng.sun@amlogic.com>
7 years agogpio_key: add gpio key driver
hong.guo [Thu, 21 Sep 2017 06:52:09 +0000 (14:52 +0800)]
gpio_key: add gpio key driver

PD#150152: gpio_key:add gpio key's driver for  wakeup function

1. add gpio key driver,drivers/amlogic/input/gpio_key/*.
2.press gpio key can suspend/wakeup system.

Change-Id: Id2069eb3fe762f751661569a08d0c4d6847ccf7c
Signed-off-by: hong.guo <hong.guo@amlogic.com>
7 years agoconfig: enable sysrq
Jiamin Ma [Thu, 21 Sep 2017 02:33:50 +0000 (10:33 +0800)]
config: enable sysrq

PD#150578: enable sysrq
CONFIG_MAGIC_SYSRQ is selected by CONFIG_KGDB_SERIAL_CONSOLE in Kconfig,
so CONFIG_MAGIC_SYSRQ should by enabled to enable syrq after KGDB is
disabled

Change-Id: I09207781dba9369b6f0a505492f8840526474acf
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
7 years agoemmc: modify the RPMB mark
Long Yu [Thu, 14 Sep 2017 12:19:51 +0000 (20:19 +0800)]
emmc: modify the RPMB mark

PD#151126: emmc: modify the RPMB mark

1. modify the RPMB mark in AMLSD.c file

2. add debug debugging methods

Change-Id: Iae4f87612c8976520c8283188d331e9e94e72784
Signed-off-by: Long Yu <long.yu@amlogic.com>
7 years agodts: change s420 amlogic-dt-id
Yueguie He [Wed, 20 Sep 2017 08:21:15 +0000 (16:21 +0800)]
dts: change s420 amlogic-dt-id

PD#151313: dts: change s420 dts amlogic dt id

Change-Id: I4bf3a4eb4e798f876e048b190ab8c49b9882cb57
Signed-off-by: Yueguie He <yuegui.he@amlogic.com>
7 years agodefconfig: disable CONFIG_DEVPORT on arm64 systems
Ao Xu [Tue, 19 Sep 2017 07:59:03 +0000 (15:59 +0800)]
defconfig: disable CONFIG_DEVPORT on arm64 systems

PD#149771: disable CONFIG_DEVPORT on arm64 systems

CONFIG_DEVPORT should not be used on arm64 systems.
It cannot really be used.

Change-Id: I2ed538e3c9dc7596be55789dbc23480ed92b13f9
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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

7 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>
7 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>
7 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>
7 years agoMerge 4.9.50 into android-4.9
Greg Kroah-Hartman [Thu, 14 Sep 2017 16:14:13 +0000 (09:14 -0700)]
Merge 4.9.50 into android-4.9

Changes in 4.9.50
mtd: nand: mxc: Fix mxc_v1 ooblayout
mtd: nand: qcom: fix read failure without complete bootchain
mtd: nand: qcom: fix config error for BCH
nvme-fabrics: generate spec-compliant UUID NQNs
btrfs: resume qgroup rescan on rw remount
selftests/x86/fsgsbase: Test selectors 1, 2, and 3
mm/memory.c: fix mem_cgroup_oom_disable() call missing
locktorture: Fix potential memory leak with rw lock test
ALSA: msnd: Optimize / harden DSP and MIDI loops
Bluetooth: Properly check L2CAP config option output buffer length
ARM64: dts: marvell: armada-37xx: Fix GIC maintenance interrupt
ARM: 8692/1: mm: abort uaccess retries upon fatal signal
NFS: Fix 2 use after free issues in the I/O code
NFS: Sync the correct byte range during synchronous writes
xfs: XFS_IS_REALTIME_INODE() should be false if no rt device present
Linux 4.9.50

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 years agoLinux 4.9.50 v4.9.50
Greg Kroah-Hartman [Wed, 13 Sep 2017 21:13:54 +0000 (14:13 -0700)]
Linux 4.9.50

7 years agoxfs: XFS_IS_REALTIME_INODE() should be false if no rt device present
Richard Wareing [Tue, 12 Sep 2017 23:09:35 +0000 (09:09 +1000)]
xfs: XFS_IS_REALTIME_INODE() should be false if no rt device present

commit b31ff3cdf540110da4572e3e29bd172087af65cc upstream.

If using a kernel with CONFIG_XFS_RT=y and we set the RHINHERIT flag on
a directory in a filesystem that does not have a realtime device and
create a new file in that directory, it gets marked as a real time file.
When data is written and a fsync is issued, the filesystem attempts to
flush a non-existent rt device during the fsync process.

This results in a crash dereferencing a null buftarg pointer in
xfs_blkdev_issue_flush():

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
  IP: xfs_blkdev_issue_flush+0xd/0x20
  .....
  Call Trace:
    xfs_file_fsync+0x188/0x1c0
    vfs_fsync_range+0x3b/0xa0
    do_fsync+0x3d/0x70
    SyS_fsync+0x10/0x20
    do_syscall_64+0x4d/0xb0
    entry_SYSCALL64_slow_path+0x25/0x25

Setting RT inode flags does not require special privileges so any
unprivileged user can cause this oops to occur.  To reproduce, confirm
kernel is compiled with CONFIG_XFS_RT=y and run:

  # mkfs.xfs -f /dev/pmem0
  # mount /dev/pmem0 /mnt/test
  # mkdir /mnt/test/foo
  # xfs_io -c 'chattr +t' /mnt/test/foo
  # xfs_io -f -c 'pwrite 0 5m' -c fsync /mnt/test/foo/bar

Or just run xfstests with MKFS_OPTIONS="-d rtinherit=1" and wait.

Kernels built with CONFIG_XFS_RT=n are not exposed to this bug.

Fixes: f538d4da8d52 ("[XFS] write barrier support")
Signed-off-by: Richard Wareing <rwareing@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoNFS: Sync the correct byte range during synchronous writes
tarangg@amazon.com [Thu, 7 Sep 2017 13:29:23 +0000 (09:29 -0400)]
NFS: Sync the correct byte range during synchronous writes

commit e973b1a5999e57da677ab50da5f5479fdc0f0c31 upstream.

Since commit 18290650b1c8 ("NFS: Move buffered I/O locking into
nfs_file_write()") nfs_file_write() has not flushed the correct byte
range during synchronous writes.  generic_write_sync() expects that
iocb->ki_pos points to the right edge of the range rather than the
left edge.

To replicate the problem, open a file with O_DSYNC, have the client
write at increasing offsets, and then print the successful offsets.
Block port 2049 partway through that sequence, and observe that the
client application indicates successful writes in advance of what the
server received.

Fixes: 18290650b1c8 ("NFS: Move buffered I/O locking into nfs_file_write()")
Signed-off-by: Jacob Strauss <jsstraus@amazon.com>
Signed-off-by: Tarang Gupta <tarangg@amazon.com>
Tested-by: Tarang Gupta <tarangg@amazon.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoNFS: Fix 2 use after free issues in the I/O code
Trond Myklebust [Sat, 9 Sep 2017 01:28:11 +0000 (21:28 -0400)]
NFS: Fix 2 use after free issues in the I/O code

commit 196639ebbe63a037fe9a80669140bd292d8bcd80 upstream.

The writeback code wants to send a commit after processing the pages,
which is why we want to delay releasing the struct path until after
that's done.

Also, the layout code expects that we do not free the inode before
we've put the layout segments in pnfs_writehdr_free() and
pnfs_readhdr_free()

Fixes: 919e3bd9a875 ("NFS: Ensure we commit after writeback is complete")
Fixes: 4714fb51fd03 ("nfs: remove pgio_header refcount, related cleanup")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoARM: 8692/1: mm: abort uaccess retries upon fatal signal
Mark Rutland [Tue, 22 Aug 2017 10:36:17 +0000 (11:36 +0100)]
ARM: 8692/1: mm: abort uaccess retries upon fatal signal

commit 746a272e44141af24a02f6c9b0f65f4c4598ed42 upstream.

When there's a fatal signal pending, arm's do_page_fault()
implementation returns 0. The intent is that we'll return to the
faulting userspace instruction, delivering the signal on the way.

However, if we take a fatal signal during fixing up a uaccess, this
results in a return to the faulting kernel instruction, which will be
instantly retried, resulting in the same fault being taken forever. As
the task never reaches userspace, the signal is not delivered, and the
task is left unkillable. While the task is stuck in this state, it can
inhibit the forward progress of the system.

To avoid this, we must ensure that when a fatal signal is pending, we
apply any necessary fixup for a faulting kernel instruction. Thus we
will return to an error path, and it is up to that code to make forward
progress towards delivering the fatal signal.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoARM64: dts: marvell: armada-37xx: Fix GIC maintenance interrupt
Marc Zyngier [Sat, 1 Jul 2017 14:16:34 +0000 (15:16 +0100)]
ARM64: dts: marvell: armada-37xx: Fix GIC maintenance interrupt

commit 95696d292e204073433ed2ef3ff4d3d8f42a8248 upstream.

The GIC-500 integrated in the Armada-37xx SoCs is compliant with
the GICv3 architecture, and thus provides a maintenance interrupt
that is required for hypervisors to function correctly.

With the interrupt provided in the DT, KVM now works as it should.
Tested on an Espressobin system.

Fixes: adbc3695d9e4 ("arm64: dts: add the Marvell Armada 3700 family and a development board")
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoBluetooth: Properly check L2CAP config option output buffer length
Ben Seri [Sat, 9 Sep 2017 21:15:59 +0000 (23:15 +0200)]
Bluetooth: Properly check L2CAP config option output buffer length

commit e860d2c904d1a9f38a24eb44c9f34b8f915a6ea3 upstream.

Validate the output buffer length for L2CAP config requests and responses
to avoid overflowing the stack buffer used for building the option blocks.

Signed-off-by: Ben Seri <ben@armis.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoALSA: msnd: Optimize / harden DSP and MIDI loops
Takashi Iwai [Thu, 6 Jul 2017 10:34:40 +0000 (12:34 +0200)]
ALSA: msnd: Optimize / harden DSP and MIDI loops

commit 20e2b791796bd68816fa115f12be5320de2b8021 upstream.

The ISA msnd drivers have loops fetching the ring-buffer head, tail
and size values inside the loops.  Such codes are inefficient and
fragile.

This patch optimizes it, and also adds the sanity check to avoid the
endless loops.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196131
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196133
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: grygorii tertychnyi <gtertych@cisco.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agolocktorture: Fix potential memory leak with rw lock test
Yang Shi [Thu, 10 Nov 2016 21:06:39 +0000 (13:06 -0800)]
locktorture: Fix potential memory leak with rw lock test

commit f4dbba591945dc301c302672adefba9e2ec08dc5 upstream.

When running locktorture module with the below commands with kmemleak enabled:

$ modprobe locktorture torture_type=rw_lock_irq
$ rmmod locktorture

The below kmemleak got caught:

root@10:~# echo scan > /sys/kernel/debug/kmemleak
[  323.197029] kmemleak: 2 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
root@10:~# cat /sys/kernel/debug/kmemleak
unreferenced object 0xffffffc07592d500 (size 128):
  comm "modprobe", pid 368, jiffies 4294924118 (age 205.824s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 c3 7b 02 00 00 00 00 00  .........{......
    00 00 00 00 00 00 00 00 d7 9b 02 00 00 00 00 00  ................
  backtrace:
    [<ffffff80081e5a88>] create_object+0x110/0x288
    [<ffffff80086c6078>] kmemleak_alloc+0x58/0xa0
    [<ffffff80081d5acc>] __kmalloc+0x234/0x318
    [<ffffff80006fa130>] 0xffffff80006fa130
    [<ffffff8008083ae4>] do_one_initcall+0x44/0x138
    [<ffffff800817e28c>] do_init_module+0x68/0x1cc
    [<ffffff800811c848>] load_module+0x1a68/0x22e0
    [<ffffff800811d340>] SyS_finit_module+0xe0/0xf0
    [<ffffff80080836f0>] el0_svc_naked+0x24/0x28
    [<ffffffffffffffff>] 0xffffffffffffffff
unreferenced object 0xffffffc07592d480 (size 128):
  comm "modprobe", pid 368, jiffies 4294924118 (age 205.824s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 3b 6f 01 00 00 00 00 00  ........;o......
    00 00 00 00 00 00 00 00 23 6a 01 00 00 00 00 00  ........#j......
  backtrace:
    [<ffffff80081e5a88>] create_object+0x110/0x288
    [<ffffff80086c6078>] kmemleak_alloc+0x58/0xa0
    [<ffffff80081d5acc>] __kmalloc+0x234/0x318
    [<ffffff80006fa22c>] 0xffffff80006fa22c
    [<ffffff8008083ae4>] do_one_initcall+0x44/0x138
    [<ffffff800817e28c>] do_init_module+0x68/0x1cc
    [<ffffff800811c848>] load_module+0x1a68/0x22e0
    [<ffffff800811d340>] SyS_finit_module+0xe0/0xf0
    [<ffffff80080836f0>] el0_svc_naked+0x24/0x28
    [<ffffffffffffffff>] 0xffffffffffffffff

It is because cxt.lwsa and cxt.lrsa don't get freed in module_exit, so free
them in lock_torture_cleanup() and free writer_tasks if reader_tasks is
failed at memory allocation.

Signed-off-by: Yang Shi <yang.shi@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Cc: 石洋 <yang.s@alibaba-inc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agomm/memory.c: fix mem_cgroup_oom_disable() call missing
Laurent Dufour [Fri, 8 Sep 2017 23:13:12 +0000 (16:13 -0700)]
mm/memory.c: fix mem_cgroup_oom_disable() call missing

commit de0c799bba2610a8e1e9a50d76a28614520a4cd4 upstream.

Seen while reading the code, in handle_mm_fault(), in the case
arch_vma_access_permitted() is failing the call to
mem_cgroup_oom_disable() is not made.

To fix that, move the call to mem_cgroup_oom_enable() after calling
arch_vma_access_permitted() as it should not have entered the memcg OOM.

Link: http://lkml.kernel.org/r/1504625439-31313-1-git-send-email-ldufour@linux.vnet.ibm.com
Fixes: bae473a423f6 ("mm: introduce fault_env")
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoselftests/x86/fsgsbase: Test selectors 1, 2, and 3
Andy Lutomirski [Tue, 1 Aug 2017 14:11:36 +0000 (07:11 -0700)]
selftests/x86/fsgsbase: Test selectors 1, 2, and 3

commit 23d98c204386a98d9ef9f9e744f41443ece4929f upstream.

Those are funny cases.  Make sure they work.

(Something is screwy with signal handling if a selector is 1, 2, or 3.
Anyone who wants to dive into that rabbit hole is welcome to do so.)

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Borislav Petkov <bpetkov@suse.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Chang Seok <chang.seok.bae@intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agobtrfs: resume qgroup rescan on rw remount
Aleksa Sarai [Tue, 4 Jul 2017 11:49:06 +0000 (21:49 +1000)]
btrfs: resume qgroup rescan on rw remount

commit 6c6b5a39c4bf3dbd8cf629c9f5450e983c19dbb9 upstream.

Several distributions mount the "proper root" as ro during initrd and
then remount it as rw before pivot_root(2). Thus, if a rescan had been
aborted by a previous shutdown, the rescan would never be resumed.

This issue would manifest itself as several btrfs ioctl(2)s causing the
entire machine to hang when btrfs_qgroup_wait_for_completion was hit
(due to the fs_info->qgroup_rescan_running flag being set but the rescan
itself not being resumed). Notably, Docker's btrfs storage driver makes
regular use of BTRFS_QUOTA_CTL_DISABLE and BTRFS_IOC_QUOTA_RESCAN_WAIT
(causing this problem to be manifested on boot for some machines).

Cc: Jeff Mahoney <jeffm@suse.com>
Fixes: b382a324b60f ("Btrfs: fix qgroup rescan resume on mount")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Tested-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agonvme-fabrics: generate spec-compliant UUID NQNs
Daniel Verkamp [Wed, 30 Aug 2017 22:18:19 +0000 (15:18 -0700)]
nvme-fabrics: generate spec-compliant UUID NQNs

commit 40a5fce495715c48c2e02668144e68a507ac5a30 upstream.

The default host NQN, which is generated based on the host's UUID,
does not follow the UUID-based NQN format laid out in the NVMe 1.3
specification.  Remove the "NVMf:" portion of the NQN to match the spec.

Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agomtd: nand: qcom: fix config error for BCH
Abhishek Sahu [Thu, 3 Aug 2017 15:56:39 +0000 (17:56 +0200)]
mtd: nand: qcom: fix config error for BCH

commit 10777de570016471fd929869c7830a7772893e39 upstream.

The configuration for BCH is not correct in the current driver.
The ECC_CFG_ECC_DISABLE bit defines whether to enable or disable the
BCH ECC in which

0x1 : BCH_DISABLED
0x0 : BCH_ENABLED

But currently host->bch_enabled is being assigned to BCH_DISABLED.

Fixes: c76b78d8ec05a ("mtd: nand: Qualcomm NAND controller driver")
Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agomtd: nand: qcom: fix read failure without complete bootchain
Abhishek Sahu [Fri, 11 Aug 2017 11:39:16 +0000 (17:09 +0530)]
mtd: nand: qcom: fix read failure without complete bootchain

commit d8a9b320a26c1ea28e51e4f3ecfb593d5aac2910 upstream.

The NAND page read fails without complete boot chain since
NAND_DEV_CMD_VLD value is not proper. The default power on reset
value for this register is

    0xe - ERASE_START_VALID | WRITE_START_VALID | READ_STOP_VALID

The READ_START_VALID should be enabled for sending PAGE_READ
command. READ_STOP_VALID should be cleared since normal NAND
page read does not require READ_STOP command.

Fixes: c76b78d8ec05a ("mtd: nand: Qualcomm NAND controller driver")
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agomtd: nand: mxc: Fix mxc_v1 ooblayout
Boris Brezillon [Fri, 25 Nov 2016 10:32:32 +0000 (11:32 +0100)]
mtd: nand: mxc: Fix mxc_v1 ooblayout

commit 3bff08dffe3115a25ce04b95ea75f6d868572c60 upstream.

Commit a894cf6c5a82 ("mtd: nand: mxc: switch to mtd_ooblayout_ops")
introduced a bug in the OOB layout description. Even if the driver claims
that 3 ECC bytes are reserved to protect 512 bytes of data, it's actually
5 ECC bytes to protect 512+6 bytes of data (some OOB bytes are also
protected using extra ECC bytes).

Fix the mxc_v1_ooblayout_{free,ecc}() functions to reflect this behavior.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Fixes: a894cf6c5a82 ("mtd: nand: mxc: switch to mtd_ooblayout_ops")
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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 agoANDROID: commoncap: Begin to warn users of implicit PARANOID_NETWORK capability grants
John Stultz [Fri, 25 Aug 2017 23:41:26 +0000 (16:41 -0700)]
ANDROID: commoncap: Begin to warn users of implicit PARANOID_NETWORK capability grants

CAP_NET_ADMIN and CAP_NET_RAW are implicity granted to the "special"
Android groups net_admin and net_raw.

This is a byproduct of the init system not being able to specify
capabilities back in the day, but has now been resolved and .rc files
can explictly specify the capabilities to be granted to a service.

Thus, we should start to remove this implict capability grant, and the
first step is to warn when a process doesn't have explicit capablity
but is a member of the implicitly granted group, when that capability
is checked.

This will allow for the PARANOID_NETWORK checks in commoncap.c to
be totally removed in a future kernel.

Change-Id: I6dac90e23608b6dba14a8f2049ba29ae56cb7ae4
Signed-off-by: John Stultz <john.stultz@linaro.org>
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 agoMerge 4.9.49 into android-4.9
Greg Kroah-Hartman [Mon, 11 Sep 2017 15:40:40 +0000 (08:40 -0700)]
Merge 4.9.49 into android-4.9

Changes in 4.9.49
usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard
USB: serial: option: add support for D-Link DWM-157 C1
usb: Add device quirk for Logitech HD Pro Webcam C920-C
usb:xhci:Fix regression when ATI chipsets detected
USB: musb: fix external abort on suspend
USB: core: Avoid race of async_completed() w/ usbdev_release()
staging/rts5208: fix incorrect shift to extract upper nybble
iio: adc: ti-ads1015: fix incorrect data rate setting update
iio: adc: ti-ads1015: fix scale information for ADS1115
iio: adc: ti-ads1015: enable conversion when CONFIG_PM is not set
iio: adc: ti-ads1015: avoid getting stale result after runtime resume
iio: adc: ti-ads1015: don't return invalid value from buffer setup callbacks
iio: adc: ti-ads1015: add adequate wait time to get correct conversion
driver core: bus: Fix a potential double free
intel_th: pci: Add Cannon Lake PCH-H support
intel_th: pci: Add Cannon Lake PCH-LP support
ath10k: fix memory leak in rx ring buffer allocation
Input: trackpoint - assume 3 buttons when buttons detection fails
rtlwifi: rtl_pci_probe: Fix fail path of _rtl_pci_find_adapter
Bluetooth: Add support of 13d3:3494 RTL8723BE device
iwlwifi: pci: add new PCI ID for 7265D
dlm: avoid double-free on error path in dlm_device_{register,unregister}
mwifiex: correct channel stat buffer overflows
MCB: add support for SC31 to mcb-lpc
s390/mm: avoid empty zero pages for KVM guests to avoid postcopy hangs
drm/nouveau/pci/msi: disable MSI on big-endian platforms by default
workqueue: Fix flag collision
cs5536: add support for IDE controller variant
scsi: sg: protect against races between mmap() and SG_SET_RESERVED_SIZE
scsi: sg: recheck MMAP_IO request length with lock held
drm/bridge: adv7511: Use work_struct to defer hotplug handing to out of irq context
drm/bridge: adv7511: Switch to using drm_kms_helper_hotplug_event()
Linux 4.9.49

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 agoLinux 4.9.49 v4.9.49
Greg Kroah-Hartman [Sun, 10 Sep 2017 05:49:19 +0000 (07:49 +0200)]
Linux 4.9.49

7 years agodrm/bridge: adv7511: Switch to using drm_kms_helper_hotplug_event()
John Stultz [Tue, 17 Jan 2017 00:52:48 +0000 (16:52 -0800)]
drm/bridge: adv7511: Switch to using drm_kms_helper_hotplug_event()

commit 6d5104c5a6b56385426e15047050584794bb6254 upstream.

In chasing down a previous issue with EDID probing from calling
drm_helper_hpd_irq_event() from irq context, Laurent noticed
that the DRM documentation suggests that
drm_kms_helper_hotplug_event() should be used instead.

Thus this patch replaces drm_helper_hpd_irq_event() with
drm_kms_helper_hotplug_event(), which requires we update the
connector.status entry and only call _hotplug_event() when the
status changes.

Cc: David Airlie <airlied@linux.ie>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-3-git-send-email-john.stultz@linaro.org
Signed-off-by: Thong Ho <thong.ho.px@rvc.renesas.com>
Signed-off-by: Nhan Nguyen <nhan.nguyen.yb@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agodrm/bridge: adv7511: Use work_struct to defer hotplug handing to out of irq context
John Stultz [Tue, 17 Jan 2017 00:52:47 +0000 (16:52 -0800)]
drm/bridge: adv7511: Use work_struct to defer hotplug handing to out of irq context

commit 518cb7057a59b9441336d2e88a396d52b6ab0cce upstream.

I was recently seeing issues with EDID probing, where
the logic to wait for the EDID read bit to be set by the
IRQ wasn't happening and the code would time out and fail.

Digging deeper, I found this was due to the fact that
IRQs were disabled as we were running in IRQ context from
the HPD signal.

Thus this patch changes the logic to handle the HPD signal
via a work_struct so we can be out of irq context.

With this patch, the EDID probing on hotplug does not time
out.

Cc: David Airlie <airlied@linux.ie>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-2-git-send-email-john.stultz@linaro.org
Signed-off-by: Thong Ho <thong.ho.px@rvc.renesas.com>
Signed-off-by: Nhan Nguyen <nhan.nguyen.yb@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoscsi: sg: recheck MMAP_IO request length with lock held
Todd Poynor [Wed, 16 Aug 2017 04:48:43 +0000 (21:48 -0700)]
scsi: sg: recheck MMAP_IO request length with lock held

commit 8d26f491116feaa0b16de370b6a7ba40a40fa0b4 upstream.

Commit 1bc0eb044615 ("scsi: sg: protect accesses to 'reserved' page
array") adds needed concurrency protection for the "reserve" buffer.
Some checks that are initially made outside the lock are replicated once
the lock is taken to ensure the checks and resulting decisions are made
using consistent state.

The check that a request with flag SG_FLAG_MMAP_IO set fits in the
reserve buffer also needs to be performed again under the lock to ensure
the reserve buffer length compared against matches the value in effect
when the request is linked to the reserve buffer.  An -ENOMEM should be
returned in this case, instead of switching over to an indirect buffer
as for non-MMAP_IO requests.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoscsi: sg: protect against races between mmap() and SG_SET_RESERVED_SIZE
Todd Poynor [Wed, 16 Aug 2017 05:41:08 +0000 (22:41 -0700)]
scsi: sg: protect against races between mmap() and SG_SET_RESERVED_SIZE

commit 6a8dadcca81fceff9976e8828cceb072873b7bd5 upstream.

Take f_mutex around mmap() processing to protect against races with the
SG_SET_RESERVED_SIZE ioctl.  Ensure the reserve buffer length remains
consistent during the mapping operation, and set the "mmap called" flag
to prevent further changes to the reserved buffer size as an atomic
operation with the mapping.

[mkp: fixed whitespace]

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agocs5536: add support for IDE controller variant
Andrey Korolyov [Thu, 10 Aug 2017 10:21:14 +0000 (13:21 +0300)]
cs5536: add support for IDE controller variant

commit 591b6bb605785c12a21e8b07a08a277065b655a5 upstream.

Several legacy devices such as Geode-based Cisco ASA appliances
and DB800 development board do possess CS5536 IDE controller
with different PCI id than existing one. Using pata_generic is
not always feasible as at least DB800 requires MSR quirk from
pata_cs5536 to be used with vendor firmware.

Signed-off-by: Andrey Korolyov <andrey@xdel.ru>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>