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.
Ray [Wed, 20 Mar 2019 09:47:26 +0000 (10:47 +0100)]
vh265: less kernel log spam
Ray [Wed, 20 Mar 2019 08:36:41 +0000 (09:36 +0100)]
vvc1: less pr_info spam
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.
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
Ray [Fri, 24 May 2019 11:11:45 +0000 (13:11 +0200)]
amlogic/decoder/vh264: use stretchblt_noalpha_noblk to not block ge2d
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
afl1 [Wed, 15 May 2019 22:20:13 +0000 (00:20 +0200)]
EXPORT_SYMBOL(videosync_pcrscr_update)
afl1 [Wed, 15 May 2019 21:06:50 +0000 (23:06 +0200)]
type override
Ray [Fri, 3 May 2019 09:51:29 +0000 (11:51 +0200)]
amstream.c: Tweak video buffers
afl1 [Fri, 29 Mar 2019 05:17:00 +0000 (06:17 +0100)]
enable build amlvideodri.ko
Ray [Fri, 3 May 2019 09:56:51 +0000 (11:56 +0200)]
amlogic/vh264: Set enable_switch_fense to 0
afl1 [Sun, 10 Mar 2019 07:51:06 +0000 (08:51 +0100)]
amlogic/vh264: non-idr or non-I frame will set pts_valid
afl1 [Sun, 10 Mar 2019 07:03:35 +0000 (08:03 +0100)]
amlogic/vh264: use error_recovery_mode = 1 for H264
Ray [Wed, 6 Mar 2019 08:22:42 +0000 (09:22 +0100)]
amlogic/vmpeg4: 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
Ray [Wed, 6 Mar 2019 08:25:36 +0000 (09:25 +0100)]
AML: v4l2_qbuf
Ray [Fri, 3 May 2019 09:55:30 +0000 (11:55 +0200)]
deinterlace.c: bypass on progressive
afl1 [Wed, 1 May 2019 09:53:04 +0000 (11:53 +0200)]
TSin: fix FEC_INPUT_CONTROL
Ray [Mon, 29 Apr 2019 13:31:17 +0000 (15:31 +0200)]
tee: disable by default
Fixes weird h264 reset bug
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.
Ray [Tue, 16 Apr 2019 07:17:44 +0000 (09:17 +0200)]
vpp: disable super_scaler
fixes cartoon like bleeding effects
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.
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.
Arthur Liberman [Sat, 9 Mar 2019 13:23:35 +0000 (15:23 +0200)]
drivers/amlogic: fix 'dobly' typos to 'dolby'
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.
afl1 [Sat, 9 Mar 2019 16:10:51 +0000 (17:10 +0100)]
sound/soc/auge: fix clock for DD+
afl1 [Wed, 6 Mar 2019 20:18:55 +0000 (21:18 +0100)]
sound/soc/auge: fix HD audio passthrough
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.
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
adamg [Fri, 22 Feb 2019 11:08:02 +0000 (11:08 +0000)]
drivers/amlogic/media/osd: fix potentially incorrect hw/pxp modes
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Nick [Tue, 4 Jun 2019 13:11:02 +0000 (21:11 +0800)]
config: enable framebuffer console rotation
Signed-off-by: Nick <nick@khadas.com>
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
Nick [Tue, 4 Jun 2019 03:18:06 +0000 (11:18 +0800)]
arm64: config: enable RAID
Signed-off-by: Nick <nick@khadas.com>
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>
Nick [Tue, 4 Jun 2019 01:51:54 +0000 (09:51 +0800)]
arm64: dts: VIM1/VIM2: add remote support
Nick [Mon, 3 Jun 2019 14:08:24 +0000 (22:08 +0800)]
add MCU control driver
Signed-off-by: Nick <nick@khadas.com>
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>
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>
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>
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>
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>
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>
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>
Nick [Sat, 1 Jun 2019 09:45:33 +0000 (17:45 +0800)]
osd/fb: VIM2: disable afbc
Signed-off-by: Nick <nick@khadas.com>
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>
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>
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>
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>
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>
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
Greg Kroah-Hartman [Sat, 25 May 2019 16:26:58 +0000 (18:26 +0200)]
Linux 4.9.179
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Mikulas Patocka [Thu, 25 Apr 2019 16:07:54 +0000 (12:07 -0400)]
dm delay: fix a crash when invalid device is specified
commit
81bc6d150ace6250503b825d9d0c10f7bbd24095 upstream.
When the target line contains an invalid device, delay_ctr() will call
delay_dtr() with NULL workqueue. Attempting to destroy the NULL
workqueue causes a crash.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Mätje [Fri, 29 Mar 2019 17:07:35 +0000 (18:07 +0100)]
PCI: Work around Pericom PCIe-to-PCI bridge Retrain Link erratum
commit
4ec73791a64bab25cabf16a6067ee478692e506d upstream.
Due to an erratum in some Pericom PCIe-to-PCI bridges in reverse mode
(conventional PCI on primary side, PCIe on downstream side), the Retrain
Link bit needs to be cleared manually to allow the link training to
complete successfully.
If it is not cleared manually, the link training is continuously restarted
and no devices below the PCI-to-PCIe bridge can be accessed. That means
drivers for devices below the bridge will be loaded but won't work and may
even crash because the driver is only reading 0xffff.
See the Pericom Errata Sheet PI7C9X111SLB_errata_rev1.2_102711.pdf for
details. Devices known as affected so far are: PI7C9X110, PI7C9X111SL,
PI7C9X130.
Add a new flag, clear_retrain_link, in struct pci_dev. Quirks for affected
devices set this bit.
Note that pcie_retrain_link() lives in aspm.c because that's currently the
only place we use it, but this erratum is not specific to ASPM, and we may
retrain links for other reasons in the future.
Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
[bhelgaas: apply regardless of CONFIG_PCIEASPM]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
CC: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Mätje [Fri, 29 Mar 2019 17:07:34 +0000 (18:07 +0100)]
PCI: Factor out pcie_retrain_link() function
commit
86fa6a344209d9414ea962b1f1ac6ade9dd7563a upstream.
Factor out pcie_retrain_link() to use for Pericom Retrain Link quirk. No
functional change intended.
Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
CC: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
James Prestwood [Mon, 7 Jan 2019 21:32:48 +0000 (13:32 -0800)]
PCI: Mark Atheros AR9462 to avoid bus reset
commit
6afb7e26978da5e86e57e540fdce65c8b04f398a upstream.
When using PCI passthrough with this device, the host machine locks up
completely when starting the VM, requiring a hard reboot. Add a quirk to
avoid bus resets on this device.
Fixes:
c3e59ee4e766 ("PCI: Mark Atheros AR93xx to avoid bus reset")
Link: https://lore.kernel.org/linux-pci/20190107213248.3034-1-james.prestwood@linux.intel.com
Signed-off-by: James Prestwood <james.prestwood@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: stable@vger.kernel.org # v3.14+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Yifeng Li [Mon, 1 Apr 2019 15:46:59 +0000 (17:46 +0200)]
fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting
commit
f627caf55b8e735dcec8fa6538e9668632b55276 upstream.
On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), blanking the display
or starting the X server will crash and freeze the system, or garble the
display.
Experiments showed this problem can mostly be solved by adjusting the
order of register writes. Also, sm712fb failed to consider the difference
of clock frequency when unblanking the display, and programs the clock for
SM712 to SM720.
Fix them by adjusting the order of register writes, and adding an
additional check for SM720 for programming the clock frequency.
Signed-off-by: Yifeng Li <tomli@tomli.me>
Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Yifeng Li [Mon, 1 Apr 2019 15:46:59 +0000 (17:46 +0200)]
fbdev: sm712fb: use 1024x768 by default on non-MIPS, fix garbled display
commit
4ed7d2ccb7684510ec5f7a8f7ef534bc6a3d55b2 upstream.
Loongson MIPS netbooks use 1024x600 LCD panels, which is the original
target platform of this driver, but nearly all old x86 laptops have
1024x768. Lighting 768 panels using 600's timings would partially
garble the display. Since it's not possible to distinguish them reliably,
we change the default to 768, but keep 600 as-is on MIPS.
Further, earlier laptops, such as IBM Thinkpad 240X, has a 800x600 LCD
panel, this driver would probably garbled those display. As we don't
have one for testing, the original behavior of the driver is kept as-is,
but the problem has been documented is the comments.
Signed-off-by: Yifeng Li <tomli@tomli.me>
Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Yifeng Li [Mon, 1 Apr 2019 15:46:59 +0000 (17:46 +0200)]
fbdev: sm712fb: fix support for 1024x768-16 mode
commit
6053d3a4793e5bde6299ac5388e76a3bf679ff65 upstream.
In order to support the 1024x600 panel on Yeeloong Loongson MIPS
laptop, the original 1024x768-16 table was modified to 1024x600-16,
without leaving the original. It causes problem on x86 laptop as
the 1024x768-16 support was still claimed but not working.
Fix it by introducing the 1024x768-16 mode.
Signed-off-by: Yifeng Li <tomli@tomli.me>
Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Yifeng Li [Mon, 1 Apr 2019 15:46:59 +0000 (17:46 +0200)]
fbdev: sm712fb: fix crashes during framebuffer writes by correctly mapping VRAM
commit
9e0e59993df0601cddb95c4f6c61aa3d5e753c00 upstream.
On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), running fbtest or X
will crash the machine instantly, because the VRAM/framebuffer is not
mapped correctly.
On SM712, the framebuffer starts at the beginning of address space, but
SM720's framebuffer starts at the 1 MiB offset from the beginning. However,
sm712fb fails to take this into account, as a result, writing to the
framebuffer will destroy all the registers and kill the system immediately.
Another problem is the driver assumes 8 MiB of VRAM for SM720, but some
SM720 system, such as this IBM Thinkpad, only has 4 MiB of VRAM.
Fix this problem by removing the hardcoded VRAM size, adding a function to
query the amount of VRAM from register MCR76 on SM720, and adding proper
framebuffer offset.
Please note that the memory map may have additional problems on Big-Endian
system, which is not available for testing by myself. But I highly suspect
that the original code is also broken on Big-Endian machines for SM720, so
at least we are not making the problem worse. More, the driver also assumed
SM710/SM712 has 4 MiB of VRAM, but it has a 2 MiB version as well, and used
in earlier laptops, such as IBM Thinkpad 240X, the driver would probably
crash on them. I've never seen one of those machines and cannot fix it, but
I have documented these problems in the comments.
Signed-off-by: Yifeng Li <tomli@tomli.me>
Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Yifeng Li [Mon, 1 Apr 2019 15:46:59 +0000 (17:46 +0200)]
fbdev: sm712fb: fix boot screen glitch when sm712fb replaces VGA
commit
ec1587d5073f29820e358f3a383850d61601d981 upstream.
When the machine is booted in VGA mode, loading sm712fb would cause
a glitch of random pixels shown on the screen. To prevent it from
happening, we first clear the entire framebuffer, and we also need
to stop calling smtcfb_setmode() during initialization, the fbdev
layer will call it for us later when it's ready.
Signed-off-by: Yifeng Li <tomli@tomli.me>
Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Yifeng Li [Mon, 1 Apr 2019 15:46:58 +0000 (17:46 +0200)]
fbdev: sm712fb: fix white screen of death on reboot, don't set CR3B-CR3F
commit
8069053880e0ee3a75fd6d7e0a30293265fe3de4 upstream.
On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), rebooting with
sm712fb framebuffer driver would cause a white screen of death on
the next POST, presumably the proper timings for the LCD panel was
not reprogrammed properly by the BIOS.
Experiments showed a few CRTC Scratch Registers, including CRT3D,
CRT3E and CRT3F may be used internally by BIOS as some flags. CRT3B is
a hardware testing register, we shouldn't mess with it. CRT3C has
blanking signal and line compare control, which is not needed for this
driver.
Stop writing to CR3B-CR3F (a.k.a CRT3B-CRT3F) registers. Even if these
registers don't have side-effect on other systems, writing to them is
also highly questionable.
Signed-off-by: Yifeng Li <tomli@tomli.me>
Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Yifeng Li [Mon, 1 Apr 2019 15:46:58 +0000 (17:46 +0200)]
fbdev: sm712fb: fix VRAM detection, don't set SR70/71/74/75
commit
dcf9070595e100942c539e229dde4770aaeaa4e9 upstream.
On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), the amount of Video
RAM is not detected correctly by the xf86-video-siliconmotion driver.
This is because sm712fb overwrites the GPR71 Scratch Pad Register, which
is set by BIOS on x86 and used to indicate amount of VRAM.
Other Scratch Pad Registers, including GPR70/74/75, don't have the same
side-effect, but overwriting to them is still questionable, as they are
not related to modesetting.
Stop writing to SR70/71/74/75 (a.k.a GPR70/71/74/75).
Signed-off-by: Yifeng Li <tomli@tomli.me>
Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>