platform/kernel/linux-amlogic.git
5 years agoamlogic/media_modules: update Kconfig
Nick Xie [Fri, 12 Jul 2019 05:55:41 +0000 (13:55 +0800)]
amlogic/media_modules: update Kconfig

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoamlogic/avs2: fix amlogic multi dec
Nick Xie [Thu, 11 Jul 2019 07:09:48 +0000 (15:09 +0800)]
amlogic/avs2: fix amlogic multi dec

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoarm64: defconfig: disable CONFIG_AMLOGIC_MEDIA_MULTI_DEC
Nick Xie [Thu, 11 Jul 2019 07:09:02 +0000 (15:09 +0800)]
arm64: defconfig: disable CONFIG_AMLOGIC_MEDIA_MULTI_DEC

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agovp9: fix CONFIG_AMLOGIC_MEDIA_MULTI_DEC patch
afl1 [Wed, 26 Jun 2019 17:14:17 +0000 (19:14 +0200)]
vp9: fix CONFIG_AMLOGIC_MEDIA_MULTI_DEC patch

5 years agoamlogic/vvp9: fix amlogic multi dec
afl1 [Sun, 10 Mar 2019 20:08:12 +0000 (21:08 +0100)]
amlogic/vvp9: fix amlogic multi dec

5 years agodrivers/of: put extended cmdline at the end
kszaq [Sun, 26 Jun 2016 23:37:55 +0000 (01:37 +0200)]
drivers/of: put extended cmdline at the end

5 years agoproc: fix make cmdline writable for amlogic-4.9
adamg [Tue, 25 Jun 2019 04:51:02 +0000 (05:51 +0100)]
proc: fix make cmdline writable for amlogic-4.9

5 years agofs/proc: make cmdline writable
kszaq [Mon, 15 Aug 2016 00:45:14 +0000 (02:45 +0200)]
fs/proc: make cmdline writable

5 years agodrivers/amlogic/media/osd: change L2C1 register for osd_two_ports function
Portisch [Tue, 9 Jul 2019 05:57:43 +0000 (07:57 +0200)]
drivers/amlogic/media/osd: change L2C1 register for osd_two_ports function

This will change the osd _two_port register to VPU_WRARB_MODE_L2C1.
On S922X devices the system freezed sometimes on osd hardware init.

5 years agoaml: automatically switch on double write 1:2 mode with 8K content
Arthur Liberman [Sat, 6 Jul 2019 18:26:36 +0000 (21:26 +0300)]
aml: automatically switch on double write 1:2 mode with 8K content

5 years agoamlogic/bluetooth: Turn BT device on after probe
Radostan Riedel [Fri, 26 Jan 2018 20:55:36 +0000 (21:55 +0100)]
amlogic/bluetooth: Turn BT device on after probe

5 years agoamlogic/deinterlace: Don't bypass if the stream is mixed Interlaced and Progressive
Ray [Wed, 5 Jun 2019 09:15:04 +0000 (11:15 +0200)]
amlogic/deinterlace: Don't bypass if the stream is mixed Interlaced and Progressive

It fixes slowdowns on I/P switching.
Some UK streams switch between I and P (mostly) in commercials. 98% of
the stream is still interlaced so it is safe to DI the whole stream.

5 years agovh265: less kernel log spam
Ray [Wed, 20 Mar 2019 09:47:26 +0000 (10:47 +0100)]
vh265: less kernel log spam

5 years agovvc1: less pr_info spam
Ray [Wed, 20 Mar 2019 08:36:41 +0000 (09:36 +0100)]
vvc1: less pr_info spam

5 years agoh265: increase margin for dynamic buffers
afl1 [Fri, 31 May 2019 05:27:01 +0000 (07:27 +0200)]
h265: increase margin for dynamic buffers

Increasing margin from 7 to 8 fixes playback issue for some non-standard hevc streams.

5 years agoamlogic/decoder/vh264: Define ENABLE_SEI_ITU_T35
Ray [Mon, 27 May 2019 12:05:52 +0000 (14:05 +0200)]
amlogic/decoder/vh264: Define ENABLE_SEI_ITU_T35

This fixes fatal errors in the decoder when qos data is empty

5 years agoamlogic/decoder/vh264: use stretchblt_noalpha_noblk to not block ge2d
Ray [Fri, 24 May 2019 11:11:45 +0000 (13:11 +0200)]
amlogic/decoder/vh264: use stretchblt_noalpha_noblk to not block ge2d

5 years agovideo_sink: add amvideocap module This will add the amvideocap module to kernel 4...
Portisch [Mon, 8 Apr 2019 08:10:17 +0000 (08:10 +0000)]
video_sink: add amvideocap module This will add the amvideocap module to kernel 4.9 If the frame rate is higher than 30 fps each second frame get captured. stretchblt: fix missing block assignment in _stretchblt_noalpha

5 years agoEXPORT_SYMBOL(videosync_pcrscr_update)
afl1 [Wed, 15 May 2019 22:20:13 +0000 (00:20 +0200)]
EXPORT_SYMBOL(videosync_pcrscr_update)

5 years agotype override
afl1 [Wed, 15 May 2019 21:06:50 +0000 (23:06 +0200)]
type override

5 years agoamstream.c: Tweak video buffers
Ray [Fri, 3 May 2019 09:51:29 +0000 (11:51 +0200)]
amstream.c: Tweak video buffers

5 years agoenable build amlvideodri.ko
afl1 [Fri, 29 Mar 2019 05:17:00 +0000 (06:17 +0100)]
enable build amlvideodri.ko

5 years agoamlogic/vh264: Set enable_switch_fense to 0
Ray [Fri, 3 May 2019 09:56:51 +0000 (11:56 +0200)]
amlogic/vh264: Set enable_switch_fense to 0

5 years agoamlogic/vh264: non-idr or non-I frame will set pts_valid
afl1 [Sun, 10 Mar 2019 07:51:06 +0000 (08:51 +0100)]
amlogic/vh264: non-idr or non-I frame will set pts_valid

5 years agoamlogic/vh264: use error_recovery_mode = 1 for H264
afl1 [Sun, 10 Mar 2019 07:03:35 +0000 (08:03 +0100)]
amlogic/vh264: use error_recovery_mode = 1 for H264

5 years agoamlogic/vmpeg4: calculate PTS from DTS for PTS_ON_KEYFRAME
Ray [Wed, 6 Mar 2019 08:22:42 +0000 (09:22 +0100)]
amlogic/vmpeg4: calculate PTS from DTS for PTS_ON_KEYFRAME

5 years agoamlogic/vvc1: calculate PTS from DTS for PTS_ON_KEYFRAME
Ray [Wed, 6 Mar 2019 08:01:57 +0000 (09:01 +0100)]
amlogic/vvc1: calculate PTS from DTS for PTS_ON_KEYFRAME

5 years agoAML: v4l2_qbuf
Ray [Wed, 6 Mar 2019 08:25:36 +0000 (09:25 +0100)]
AML: v4l2_qbuf

5 years agodeinterlace.c: bypass on progressive
Ray [Fri, 3 May 2019 09:55:30 +0000 (11:55 +0200)]
deinterlace.c: bypass on progressive

5 years agoTSin: fix FEC_INPUT_CONTROL
afl1 [Wed, 1 May 2019 09:53:04 +0000 (11:53 +0200)]
TSin: fix FEC_INPUT_CONTROL

5 years agotee: disable by default
Ray [Mon, 29 Apr 2019 13:31:17 +0000 (15:31 +0200)]
tee: disable by default

Fixes weird h264 reset bug

5 years agorealtek: Reinit phy after wakeup when WOL is disabled
Ray [Wed, 24 Apr 2019 13:41:44 +0000 (15:41 +0200)]
realtek: Reinit phy after wakeup when WOL is disabled

When WOL is disabled the power is cut in uboot. After wakeup the speed
is very slow. Re-init fixes it.

5 years agovpp: disable super_scaler
Ray [Tue, 16 Apr 2019 07:17:44 +0000 (09:17 +0200)]
vpp: disable super_scaler

fixes cartoon like bleeding effects

5 years agohdmitx: add "now" to attr to trigger set_disp_mode_auto()
cdu13a [Thu, 11 Apr 2019 03:58:08 +0000 (23:58 -0400)]
hdmitx: add "now" to attr to trigger set_disp_mode_auto()

Useful for testing. Adding "now" to attr is a one shot way to force
changes to current hdmi settings to take effect imediatly instead of
waiting for a mode change.

5 years agohdmi_tx: improve display of current hdmi config
cdu13a [Sun, 7 Apr 2019 01:04:11 +0000 (21:04 -0400)]
hdmi_tx: improve display of current hdmi config

Use register info to get info about current config and display it in a more human
readable format.

5 years agodrivers/amlogic: fix 'dobly' typos to 'dolby'
Arthur Liberman [Sat, 9 Mar 2019 13:23:35 +0000 (15:23 +0200)]
drivers/amlogic: fix 'dobly' typos to 'dolby'

5 years agohdmi_audio: fix passthrough for 4k DD+ This hack is no longer required, as hdmi_get_a...
Arthur Liberman [Sun, 28 Apr 2019 20:35:34 +0000 (23:35 +0300)]
hdmi_audio: fix passthrough for 4k DD+ This hack is no longer required, as hdmi_get_aud_n_paras() now handles the multiplier correctly.

5 years agosound/soc/auge: fix clock for DD+
afl1 [Sat, 9 Mar 2019 16:10:51 +0000 (17:10 +0100)]
sound/soc/auge: fix clock for DD+

5 years agosound/soc/auge: fix HD audio passthrough
afl1 [Wed, 6 Mar 2019 20:18:55 +0000 (21:18 +0100)]
sound/soc/auge: fix HD audio passthrough

5 years agophy_device: fix: do not check for suspend on resume Only check if the device was...
Portisch [Tue, 5 Mar 2019 12:10:12 +0000 (13:10 +0100)]
phy_device: fix: do not check for suspend on resume Only check if the device was sent to suspend before.

5 years agoosd: don't call osd_wait_vsync_event during HW decoded video playback
Arthur Liberman [Mon, 8 Apr 2019 22:03:16 +0000 (01:03 +0300)]
osd: don't call osd_wait_vsync_event during HW decoded video playback

5 years agodrivers/amlogic/media/osd: fix potentially incorrect hw/pxp modes
adamg [Fri, 22 Feb 2019 11:08:02 +0000 (11:08 +0000)]
drivers/amlogic/media/osd: fix potentially incorrect hw/pxp modes

5 years agosound: fixup sound card
Nick Xie [Wed, 3 Jul 2019 09:52:13 +0000 (17:52 +0800)]
sound: fixup sound card

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agosound: spdif: disable mono sound channel
Nick Xie [Wed, 3 Jul 2019 08:52:56 +0000 (16:52 +0800)]
sound: spdif: disable mono sound channel

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoarm64: dts: VIM3: remove memory node to support 4GB DDR
Nick Xie [Mon, 1 Jul 2019 02:53:39 +0000 (10:53 +0800)]
arm64: dts: VIM3: remove memory node to support 4GB DDR

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoMCU: FAN: fixup speed level
Nick Xie [Wed, 26 Jun 2019 07:02:07 +0000 (15:02 +0800)]
MCU: FAN: fixup speed level

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoMCU: VIM3: fixup temperature read issue
Nick Xie [Wed, 26 Jun 2019 06:40:22 +0000 (14:40 +0800)]
MCU: VIM3: fixup temperature read issue

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoMCU: add poweroff node
Nick Xie [Wed, 26 Jun 2019 03:25:02 +0000 (11:25 +0800)]
MCU: add poweroff node

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoMCU: VIM3: add USB PCIe switch node
Nick Xie [Wed, 26 Jun 2019 03:07:41 +0000 (11:07 +0800)]
MCU: VIM3: add USB PCIe switch node

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoVIM3: tca6408: setup all gpios to output low when initialize
Nick Xie [Mon, 24 Jun 2019 14:08:57 +0000 (22:08 +0800)]
VIM3: tca6408: setup all gpios to output low when initialize

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoemmc: After standby sleep, clear the CMD tuning flag [1/1]
Long Yu [Tue, 28 May 2019 07:28:12 +0000 (15:28 +0800)]
emmc: After standby sleep, clear the CMD tuning flag [1/1]

PD#SWPL-9075

Problem:
Because the CMD tune flag was not cleared before standby,
debug printing was performed during auto tune

Solution:
After standby sleep, clear the CMD tuning flag

Verify:
passed on TL1

Change-Id: Ie4a531346f50983009477131408d81c76d5c020f
Signed-off-by: Long Yu <long.yu@amlogic.com>
5 years agoemmc: report response crc error on G12B when hs400 200M busmode [1/1]
Long Yu [Tue, 14 May 2019 07:17:30 +0000 (15:17 +0800)]
emmc: report response crc error on G12B when hs400 200M busmode [1/1]

PD#SWPL-8670

Problem:
G12B report response crc error when hs400 200M busmode

Solution:
find a eyetest hole between 14-20 or 48-54, otherwise
tuning tx_delay and find again and
adjust CMD rx timing dynamically in HS400 mode

Verify:
passed on G12B

Change-Id: I23e4d5118e0ca0564367a77102aea9e1085633a9
Signed-off-by: Long Yu <long.yu@amlogic.com>
5 years agoemmc: report response crc error on tl1 when hs400 200M busmode [1/1]
Ruixuan Li [Thu, 18 Apr 2019 07:48:44 +0000 (15:48 +0800)]
emmc: report response crc error on tl1 when hs400 200M busmode [1/1]

PD#SWPL-7740

Problem:
tl1 report response crc error on tl1 when hs400 200M busmode

Solution:
find a eyetest hole between 14-20 or 48-54, otherwise
tuning tx_delay and find again

Verify:
passed on tl1_skt

Change-Id: I46e2c3c4d7ef24bcac7b44fee73112894540fc33
Signed-off-by: Ruixuan Li <ruixuan.li@amlogic.com>
5 years agoemmc: run hs400 200M on sm1 [1/1]
Ruixuan Li [Tue, 23 Apr 2019 08:07:12 +0000 (16:07 +0800)]
emmc: run hs400 200M on sm1 [1/1]

PD#SWPL-5404

Problem:
run hs400 200M on sm1

Solution:
config sm1 and modify dts

Verify:
passed on ac200

Change-Id: I34e54f88db79ce42f9effbf8d673ade613de328f
Signed-off-by: Ruixuan Li <ruixuan.li@amlogic.com>
5 years agoarm64: dts: emmc: VIM3: Add HS400 busmode support
Nick Xie [Wed, 19 Jun 2019 03:43:39 +0000 (11:43 +0800)]
arm64: dts: emmc: VIM3: Add HS400 busmode support

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agostorage: emmc: Add HS400 busmode support for G12B-RevB [1/1]
long yu [Thu, 21 Feb 2019 07:22:01 +0000 (15:22 +0800)]
storage: emmc: Add HS400 busmode support for G12B-RevB [1/1]

PD#SWPL-5040

Problem:
not support HS400 busmode

Solution:
add HS400 busmode support for G12B-RevB

Verify:
T962X-R311,TL1-T962X2_X301,G12B-W400

Change-Id: I11a1f47b9473fa341c7d754a51d6e270551758a7
Signed-off-by: long yu <long.yu@amlogic.com>
5 years agostorage: emmc: Add HS400 busmode support for TL1 [1/1]
Long Yu [Fri, 14 Dec 2018 09:13:36 +0000 (17:13 +0800)]
storage: emmc: Add HS400 busmode support for TL1 [1/1]

PD#SWPL-2311

Problem:
not support HS400 busmode

Solution:
add HS400 busmode support for TL1

Verify:
TL1-T962X2_X301

Change-Id: I95ac19e9c0c5b84c9225602cda6964aaaee4151e
Signed-off-by: Long Yu <long.yu@amlogic.com>
Signed-off-by: Luan Yuan <luan.yuan@amlogic.com>
5 years agoarm64: dts: VIM3: fixup USB 3.0
Nick Xie [Mon, 24 Jun 2019 06:35:41 +0000 (14:35 +0800)]
arm64: dts: VIM3: fixup USB 3.0

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoVIM3: add MCU control support
Nick Xie [Sat, 22 Jun 2019 08:51:07 +0000 (16:51 +0800)]
VIM3: add MCU control support

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoarm64: dts: VIM1/VIM2: add missing reset-cells property
Nick Xie [Wed, 19 Jun 2019 14:37:04 +0000 (22:37 +0800)]
arm64: dts: VIM1/VIM2: add missing reset-cells property

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoarm64: dts: VIMs: add dummy node 'chosen {}' for KEXEC
Nick Xie [Tue, 18 Jun 2019 10:22:00 +0000 (18:22 +0800)]
arm64: dts: VIMs: add dummy node 'chosen {}' for KEXEC

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoarm64: config: enable CONFIG_KEXEC
Nick Xie [Tue, 18 Jun 2019 10:18:42 +0000 (18:18 +0800)]
arm64: config: enable CONFIG_KEXEC

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoarm64: dts: VIM3: move to Amlogic A311D
Nick Xie [Wed, 12 Jun 2019 13:33:59 +0000 (21:33 +0800)]
arm64: dts: VIM3: move to Amlogic A311D

dts sync from 'g12b_a311d_w400_buildroot.dts'

backup S922X dts as 'kvim3_s922x_linux.dts'

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoarm64: dts: VIM3: disable fusb302
Nick Xie [Wed, 12 Jun 2019 12:39:24 +0000 (20:39 +0800)]
arm64: dts: VIM3: disable fusb302

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoVIMs: add gpiomem support
Nick Xie [Tue, 11 Jun 2019 02:30:48 +0000 (10:30 +0800)]
VIMs: add gpiomem support

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoadd device model to /proc/cpuinfo
Nick Xie [Tue, 11 Jun 2019 01:11:12 +0000 (09:11 +0800)]
add device model to /proc/cpuinfo

Signed-off-by: Nick Xie <nick@khadas.com>
5 years agoconfig: enable framebuffer console rotation
Nick [Tue, 4 Jun 2019 13:11:02 +0000 (21:11 +0800)]
config: enable framebuffer console rotation

Signed-off-by: Nick <nick@khadas.com>
5 years agoMerge tag 'v4.9.179' into khadas-vims-4.9.y
Nick [Tue, 4 Jun 2019 07:07:55 +0000 (15:07 +0800)]
Merge tag 'v4.9.179' into khadas-vims-4.9.y

This is the 4.9.179 stable release

5 years agoarm64: config: enable RAID
Nick [Tue, 4 Jun 2019 03:18:06 +0000 (11:18 +0800)]
arm64: config: enable RAID

Signed-off-by: Nick <nick@khadas.com>
5 years agoarm64: config: rename kvim3_defconfig to kvim_defconfig
Nick [Tue, 4 Jun 2019 02:37:21 +0000 (10:37 +0800)]
arm64: config: rename kvim3_defconfig to kvim_defconfig

Signed-off-by: Nick <nick@khadas.com>
5 years agoarm64: dts: VIM1/VIM2: add remote support
Nick [Tue, 4 Jun 2019 01:51:54 +0000 (09:51 +0800)]
arm64: dts: VIM1/VIM2: add remote support

5 years agoadd MCU control driver
Nick [Mon, 3 Jun 2019 14:08:24 +0000 (22:08 +0800)]
add MCU control driver

Signed-off-by: Nick <nick@khadas.com>
5 years agoMAC: get ethernet mac address from command line or DTB
Nick [Mon, 3 Jun 2019 09:54:49 +0000 (17:54 +0800)]
MAC: get ethernet mac address from command line or DTB

Signed-off-by: Nick <nick@khadas.com>
5 years agophy/realtek: WOL: get the wol state from command line
Nick [Mon, 3 Jun 2019 09:27:06 +0000 (17:27 +0800)]
phy/realtek: WOL: get the wol state from command line

Signed-off-by: Nick <nick@khadas.com>
5 years agophy/realtek: fixup WOL on shutdown
Nick [Mon, 3 Jun 2019 09:13:16 +0000 (17:13 +0800)]
phy/realtek: fixup WOL on shutdown

Signed-off-by: Nick <nick@khadas.com>
5 years agoarm64: dts: VIM2: add gpio keypad node
Nick [Mon, 3 Jun 2019 06:20:41 +0000 (14:20 +0800)]
arm64: dts: VIM2: add gpio keypad node

Signed-off-by: Nick <nick@khadas.com>
5 years agoarm64: dts: VIM2: add BT node
Nick [Mon, 3 Jun 2019 06:03:57 +0000 (14:03 +0800)]
arm64: dts: VIM2: add BT node

Signed-off-by: Nick <nick@khadas.com>
5 years agoVIM2: add fan driver for V1.2
Nick [Mon, 3 Jun 2019 05:49:25 +0000 (13:49 +0800)]
VIM2: add fan driver for V1.2

Signed-off-by: Nick <nick@khadas.com>
5 years agomemory: VIM2: auto to allocate the memory with 'ddr_size'
terry [Mon, 3 Jul 2017 08:23:21 +0000 (16:23 +0800)]
memory: VIM2: auto to allocate the memory with 'ddr_size'

Signed-off-by: Nick <nick@khadas.com>
5 years agoosd/fb: VIM2: disable afbc
Nick [Sat, 1 Jun 2019 09:45:33 +0000 (17:45 +0800)]
osd/fb: VIM2: disable afbc

Signed-off-by: Nick <nick@khadas.com>
5 years agoarm64: dts: VIM2: disable uart_B
Nick [Sat, 1 Jun 2019 03:15:52 +0000 (11:15 +0800)]
arm64: dts: VIM2: disable uart_B

Signed-off-by: Nick <nick@khadas.com>
5 years agoaem64: defconfig: disable CONFIG_AMLOGIC_RAMDUMP
Nick [Sat, 1 Jun 2019 02:04:06 +0000 (10:04 +0800)]
aem64: defconfig: disable CONFIG_AMLOGIC_RAMDUMP

Signed-off-by: Nick <nick@khadas.com>
5 years agoadd Khadas VIM2 support
Nick [Fri, 31 May 2019 07:28:09 +0000 (15:28 +0800)]
add Khadas VIM2 support

dts sync from 'gxm_q200_2g_buildroot.dts'

Signed-off-by: Nick <nick@khadas.com>
5 years agoVIM3/VIM3L: config: build GPU driver as module
Nick [Fri, 31 May 2019 07:03:36 +0000 (15:03 +0800)]
VIM3/VIM3L: config: build GPU driver as module

Signed-off-by: Nick <nick@khadas.com>
5 years agoadd Khadas VIM support
Nick [Wed, 29 May 2019 07:28:23 +0000 (15:28 +0800)]
add Khadas VIM support

dts sync from 'gxl_p212_2g_buildroot'

Signed-off-by: Nick <nick@khadas.com>
5 years agoGPU: add utgard r7p0 driver for mali 450
Nick [Tue, 28 May 2019 15:29:49 +0000 (23:29 +0800)]
GPU: add utgard r7p0 driver for mali 450

sync from buildroot_openlinux_kernel_4.9_fbdev_20180706

5 years agoLinux 4.9.179 v4.9.179
Greg Kroah-Hartman [Sat, 25 May 2019 16:26:58 +0000 (18:26 +0200)]
Linux 4.9.179

5 years agofbdev: sm712fb: fix memory frequency by avoiding a switch/case fallthrough
Yifeng Li [Tue, 2 Apr 2019 15:14:10 +0000 (17:14 +0200)]
fbdev: sm712fb: fix memory frequency by avoiding a switch/case fallthrough

commit 9dc20113988b9a75ea6b3abd68dc45e2d73ccdab upstream.

A fallthrough in switch/case was introduced in f627caf55b8e ("fbdev:
sm712fb: fix crashes and garbled display during DPMS modesetting"),
due to my copy-paste error, which would cause the memory clock frequency
for SM720 to be programmed to SM712.

Since it only reprograms the clock to a different frequency, it's only
a benign issue without visible side-effect, so it also evaded Sudip
Mukherjee's code review and regression tests. scripts/checkpatch.pl
also failed to discover the issue, possibly due to nested switch
statements.

This issue was found by Stephen Rothwell by building linux-next with
-Wimplicit-fallthrough.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: f627caf55b8e ("fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting")
Signed-off-by: Yifeng Li <tomli@tomli.me>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agobtrfs: Honour FITRIM range constraints during free space trim
Nikolay Borisov [Mon, 25 Mar 2019 12:31:21 +0000 (14:31 +0200)]
btrfs: Honour FITRIM range constraints during free space trim

commit c2d1b3aae33605a61cbab445d8ae1c708ccd2698 upstream.

Up until now trimming the freespace was done irrespective of what the
arguments of the FITRIM ioctl were. For example fstrim's -o/-l arguments
will be entirely ignored. Fix it by correctly handling those paramter.
This requires breaking if the found freespace extent is after the end of
the passed range as well as completing trim after trimming
fstrim_range::len bytes.

Fixes: 499f377f49f0 ("btrfs: iterate over unused chunk space in FITRIM")
CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomd/raid: raid5 preserve the writeback action after the parity check
Nigel Croxon [Tue, 16 Apr 2019 16:50:09 +0000 (09:50 -0700)]
md/raid: raid5 preserve the writeback action after the parity check

commit b2176a1dfb518d870ee073445d27055fea64dfb8 upstream.

The problem is that any 'uptodate' vs 'disks' check is not precise
in this path. Put a "WARN_ON(!test_bit(R5_UPTODATE, &dev->flags)" on the
device that might try to kick off writes and then skip the action.
Better to prevent the raid driver from taking unexpected action *and* keep
the system alive vs killing the machine with BUG_ON.

Note: fixed warning reported by kbuild test robot <lkp@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoRevert "Don't jump to compute_result state from check_result state"
Song Liu [Tue, 16 Apr 2019 16:34:21 +0000 (09:34 -0700)]
Revert "Don't jump to compute_result state from check_result state"

commit a25d8c327bb41742dbd59f8c545f59f3b9c39983 upstream.

This reverts commit 4f4fd7c5798bbdd5a03a60f6269cf1177fbd11ef.

Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Nigel Croxon <ncroxon@redhat.com>
Cc: Xiao Ni <xni@redhat.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoperf bench numa: Add define for RUSAGE_THREAD if not present
Arnaldo Carvalho de Melo [Thu, 25 Apr 2019 21:36:51 +0000 (18:36 -0300)]
perf bench numa: Add define for RUSAGE_THREAD if not present

[ Upstream commit bf561d3c13423fc54daa19b5d49dc15fafdb7acc ]

While cross building perf to the ARC architecture on a fedora 30 host,
we were failing with:

      CC       /tmp/build/perf/bench/numa.o
  bench/numa.c: In function ‘worker_thread’:
  bench/numa.c:1261:12: error: ‘RUSAGE_THREAD’ undeclared (first use in this function); did you mean ‘SIGEV_THREAD’?
    getrusage(RUSAGE_THREAD, &rusage);
              ^~~~~~~~~~~~~
              SIGEV_THREAD
  bench/numa.c:1261:12: note: each undeclared identifier is reported only once for each function it appears in

[perfbuilder@60d5802468f6 perf]$ /arc_gnu_2019.03-rc1_prebuilt_uclibc_le_archs_linux_install/bin/arc-linux-gcc --version | head -1
arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225
[perfbuilder@60d5802468f6 perf]$

Trying to reproduce a report by Vineet, I noticed that, with just
cross-built zlib and numactl libraries, I ended up with the above
failure.

So, since RUSAGE_THREAD is available as a define, check for that and
numactl libraries, I ended up with the above failure.

So, since RUSAGE_THREAD is available as a define in the system headers,
check if it is defined in the 'perf bench numa' sources and define it if
not.

Now it builds and I have to figure out if the problem reported by Vineet
only takes place if we have libelf or some other library available.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: linux-snps-arc@lists.infradead.org
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Link: https://lkml.kernel.org/n/tip-2wb4r1gir9xrevbpq7qp0amk@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5 years agoufs: fix braino in ufs_get_inode_gid() for solaris UFS flavour
Al Viro [Thu, 2 May 2019 02:46:11 +0000 (22:46 -0400)]
ufs: fix braino in ufs_get_inode_gid() for solaris UFS flavour

[ Upstream commit 4e9036042fedaffcd868d7f7aa948756c48c637d ]

To choose whether to pick the GID from the old (16bit) or new (32bit)
field, we should check if the old gid field is set to 0xffff.  Mainline
checks the old *UID* field instead - cut'n'paste from the corresponding
code in ufs_get_inode_uid().

Fixes: 252e211e90ce
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5 years agopower: supply: sysfs: prevent endless uevent loop with CONFIG_POWER_SUPPLY_DEBUG
Andrey Smirnov [Wed, 24 Apr 2019 07:16:10 +0000 (00:16 -0700)]
power: supply: sysfs: prevent endless uevent loop with CONFIG_POWER_SUPPLY_DEBUG

[ Upstream commit 349ced9984ff540ce74ca8a0b2e9b03dc434b9dd ]

Fix a similar endless event loop as was done in commit
8dcf32175b4e ("i2c: prevent endless uevent loop with
CONFIG_I2C_DEBUG_CORE"):

  The culprit is the dev_dbg printk in the i2c uevent handler. If
  this is activated (for instance by CONFIG_I2C_DEBUG_CORE) it results
  in an endless loop with systemd-journald.

  This happens if user-space scans the system log and reads the uevent
  file to get information about a newly created device, which seems
  fair use to me. Unfortunately reading the "uevent" file uses the
  same function that runs for creating the uevent for a new device,
  generating the next syslog entry

Both CONFIG_I2C_DEBUG_CORE and CONFIG_POWER_SUPPLY_DEBUG were reported
in https://bugs.freedesktop.org/show_bug.cgi?id=76886 but only former
seems to have been fixed. Drop debug prints as it was done in I2C
subsystem to resolve the issue.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5 years agoKVM: arm/arm64: Ensure vcpu target is unset on reset failure
Andrew Jones [Thu, 4 Apr 2019 17:42:30 +0000 (19:42 +0200)]
KVM: arm/arm64: Ensure vcpu target is unset on reset failure

[ Upstream commit 811328fc3222f7b55846de0cd0404339e2e1e6d7 ]

A failed KVM_ARM_VCPU_INIT should not set the vcpu target,
as the vcpu target is used by kvm_vcpu_initialized() to
determine if other vcpu ioctls may proceed. We need to set
the target before calling kvm_reset_vcpu(), but if that call
fails, we should then unset it and clear the feature bitmap
while we're at it.

Signed-off-by: Andrew Jones <drjones@redhat.com>
[maz: Simplified patch, completed commit message]
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5 years agomac80211: Fix kernel panic due to use of txq after free
Bhagavathi Perumal S [Tue, 16 Apr 2019 07:24:40 +0000 (12:54 +0530)]
mac80211: Fix kernel panic due to use of txq after free

[ Upstream commit f1267cf3c01b12e0f843fb6a7450a7f0b2efab8a ]

The txq of vif is added to active_txqs list for ATF TXQ scheduling
in the function ieee80211_queue_skb(), but it was not properly removed
before freeing the txq object. It was causing use after free of the txq
objects from the active_txqs list, result was kernel panic
due to invalid memory access.

Fix kernel invalid memory access by properly removing txq object
from active_txqs list before free the object.

Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5 years agoxfrm4: Fix uninitialized memory read in _decode_session4
Steffen Klassert [Tue, 26 Feb 2019 06:04:50 +0000 (07:04 +0100)]
xfrm4: Fix uninitialized memory read in _decode_session4

[ Upstream commit 8742dc86d0c7a9628117a989c11f04a9b6b898f3 ]

We currently don't reload pointers pointing into skb header
after doing pskb_may_pull() in _decode_session4(). So in case
pskb_may_pull() changed the pointers, we read from random
memory. Fix this by putting all the needed infos on the
stack, so that we don't need to access the header pointers
after doing pskb_may_pull().

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5 years agovti4: ipip tunnel deregistration fixes.
Jeremy Sowden [Tue, 19 Mar 2019 15:39:20 +0000 (15:39 +0000)]
vti4: ipip tunnel deregistration fixes.

[ Upstream commit 5483844c3fc18474de29f5d6733003526e0a9f78 ]

If tunnel registration failed during module initialization, the module
would fail to deregister the IPPROTO_COMP protocol and would attempt to
deregister the tunnel.

The tunnel was not deregistered during module-exit.

Fixes: dd9ee3444014e ("vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel")
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5 years agoxfrm6_tunnel: Fix potential panic when unloading xfrm6_tunnel module
Su Yanjun [Thu, 14 Mar 2019 06:59:42 +0000 (14:59 +0800)]
xfrm6_tunnel: Fix potential panic when unloading xfrm6_tunnel module

[ Upstream commit 6ee02a54ef990a71bf542b6f0a4e3321de9d9c66 ]

When unloading xfrm6_tunnel module, xfrm6_tunnel_fini directly
frees the xfrm6_tunnel_spi_kmem. Maybe someone has gotten the
xfrm6_tunnel_spi, so need to wait it.

Fixes: 91cc3bb0b04ff("xfrm6_tunnel: RCU conversion")
Signed-off-by: Su Yanjun <suyj.fnst@cn.fujitsu.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5 years agoxfrm: policy: Fix out-of-bound array accesses in __xfrm_policy_unlink
YueHaibing [Thu, 28 Feb 2019 07:18:59 +0000 (15:18 +0800)]
xfrm: policy: Fix out-of-bound array accesses in __xfrm_policy_unlink

[ Upstream commit b805d78d300bcf2c83d6df7da0c818b0fee41427 ]

UBSAN report this:

UBSAN: Undefined behaviour in net/xfrm/xfrm_policy.c:1289:24
index 6 is out of range for type 'unsigned int [6]'
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.162-514.55.6.9.x86_64+ #13
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
 0000000000000000 1466cf39b41b23c9 ffff8801f6b07a58 ffffffff81cb35f4
 0000000041b58ab3 ffffffff83230f9c ffffffff81cb34e0 ffff8801f6b07a80
 ffff8801f6b07a20 1466cf39b41b23c9 ffffffff851706e0 ffff8801f6b07ae8
Call Trace:
 <IRQ>  [<ffffffff81cb35f4>] __dump_stack lib/dump_stack.c:15 [inline]
 <IRQ>  [<ffffffff81cb35f4>] dump_stack+0x114/0x1a0 lib/dump_stack.c:51
 [<ffffffff81d94225>] ubsan_epilogue+0x12/0x8f lib/ubsan.c:164
 [<ffffffff81d954db>] __ubsan_handle_out_of_bounds+0x16e/0x1b2 lib/ubsan.c:382
 [<ffffffff82a25acd>] __xfrm_policy_unlink+0x3dd/0x5b0 net/xfrm/xfrm_policy.c:1289
 [<ffffffff82a2e572>] xfrm_policy_delete+0x52/0xb0 net/xfrm/xfrm_policy.c:1309
 [<ffffffff82a3319b>] xfrm_policy_timer+0x30b/0x590 net/xfrm/xfrm_policy.c:243
 [<ffffffff813d3927>] call_timer_fn+0x237/0x990 kernel/time/timer.c:1144
 [<ffffffff813d8e7e>] __run_timers kernel/time/timer.c:1218 [inline]
 [<ffffffff813d8e7e>] run_timer_softirq+0x6ce/0xb80 kernel/time/timer.c:1401
 [<ffffffff8120d6f9>] __do_softirq+0x299/0xe10 kernel/softirq.c:273
 [<ffffffff8120e676>] invoke_softirq kernel/softirq.c:350 [inline]
 [<ffffffff8120e676>] irq_exit+0x216/0x2c0 kernel/softirq.c:391
 [<ffffffff82c5edab>] exiting_irq arch/x86/include/asm/apic.h:652 [inline]
 [<ffffffff82c5edab>] smp_apic_timer_interrupt+0x8b/0xc0 arch/x86/kernel/apic/apic.c:926
 [<ffffffff82c5c985>] apic_timer_interrupt+0xa5/0xb0 arch/x86/entry/entry_64.S:735
 <EOI>  [<ffffffff81188096>] ? native_safe_halt+0x6/0x10 arch/x86/include/asm/irqflags.h:52
 [<ffffffff810834d7>] arch_safe_halt arch/x86/include/asm/paravirt.h:111 [inline]
 [<ffffffff810834d7>] default_idle+0x27/0x430 arch/x86/kernel/process.c:446
 [<ffffffff81085f05>] arch_cpu_idle+0x15/0x20 arch/x86/kernel/process.c:437
 [<ffffffff8132abc3>] default_idle_call+0x53/0x90 kernel/sched/idle.c:92
 [<ffffffff8132b32d>] cpuidle_idle_call kernel/sched/idle.c:156 [inline]
 [<ffffffff8132b32d>] cpu_idle_loop kernel/sched/idle.c:251 [inline]
 [<ffffffff8132b32d>] cpu_startup_entry+0x60d/0x9a0 kernel/sched/idle.c:299
 [<ffffffff8113e119>] start_secondary+0x3c9/0x560 arch/x86/kernel/smpboot.c:245

The issue is triggered as this:

xfrm_add_policy
    -->verify_newpolicy_info  //check the index provided by user with XFRM_POLICY_MAX
      //In my case, the index is 0x6E6BB6, so it pass the check.
    -->xfrm_policy_construct  //copy the user's policy and set xfrm_policy_timer
    -->xfrm_policy_insert
--> __xfrm_policy_link //use the orgin dir, in my case is 2
--> xfrm_gen_index   //generate policy index, there is 0x6E6BB6

then xfrm_policy_timer be fired

xfrm_policy_timer
   --> xfrm_policy_id2dir  //get dir from (policy index & 7), in my case is 6
   --> xfrm_policy_delete
      --> __xfrm_policy_unlink //access policy_count[dir], trigger out of range access

Add xfrm_policy_id2dir check in verify_newpolicy_info, make sure the computed dir is
valid, to fix the issue.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: e682adf021be ("xfrm: Try to honor policy index if it's supplied by user")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>