Commit Graph

615118 Commits

Author SHA1 Message Date
Jeffy Chen
ff12055f98 init/initramfs: Add dump_initrd command line option
Add a dump_initrd option to allow dumping /initrd.image after successful
unpack.

Require BLK_DEV_RAM=y.

Change-Id: I77a41867afa7b4a51604a5153792a49efbab6189
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2018-12-18 14:50:55 +08:00
Cai YiWei
b41c3c70fb media: i2c: ov7251: update regs and exposure
Change-Id: I88f98bc9a326a1f7414d22e4fd51fa735c46472b
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2018-12-18 14:29:21 +08:00
Shawn Lin
45da3b1bff arm64: dts: rockchip: improve max eMMC clock to 200MHz for RK1808 evb
The IO capability for RK1808 was intent to be able work under 200MHz
clock, and the test result seems positive. However, we want a broader
test, so let's improve the max clock to 200MHz for all evb.

Change-Id: Ic7c694af92cb61a5d75edca7515f9f83f6ca98e4
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2018-12-17 15:21:10 +08:00
Sugar Zhang
67248712db dt-bindinds: pinctrl: rockchip: add pinctrl for rv1108 soc
This patch adds pinctrl compatible string for rv1108 soc.

Change-Id: I5a32f96439f337e77aa4288ca6bceccb49e1c976
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-17 15:13:49 +08:00
Sugar Zhang
10e9a421f2 dt-bindings: soc: rockchip: add pmugrf compatible for rv1108 soc
This patch adds pmugrf compatible for rv1108 soc.

Change-Id: I0b2e6fdcbd565ea324e403cddae8b4d56e8a9b46
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-17 15:10:40 +08:00
Sugar Zhang
a7d7fb454d ARM: dts: rockchip: add rv1108-minievb-v10.dts
This patch add support for rv1108 minievb v10 board.

Change-Id: I579ce78c1c4d3ebaebf25f5aa0a22413799ed06d
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-17 14:47:22 +08:00
Sugar Zhang
04ed04fc82 ARM: dts: rockchip: add core dtsi for rv1108
rv1108 is a high performance low power application processor.
embedded with a new generation DSP for digital process and an
arm cortex-a7 single core processor for system and application.

Change-Id: I56f9537467042aa512fb27de974d5ae7dc2ed669
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-17 14:44:11 +08:00
Sugar Zhang
b4f93f7e7b clk: rockchip: add clock controller for rv1108
This patch add the clock tree definition for rv1108.

Change-Id: I9b55cd46c62331057fe8a404c606fe9d08f03388
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-17 14:38:47 +08:00
Sugar Zhang
dae1e6294f clk: rockchip: add dt-binding header for rv1108
Change-Id: I15f39d705c2ab7a19c2f0f7c9c804073ee23631d
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-17 14:33:56 +08:00
Nickey Yang
7369672155 drm/rockchip: vop: rk312x: add missing config for dclk_pol and en
Change-Id: Ica43ea70163f115c3344f480b9374a81c3c524ce
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2018-12-17 09:59:30 +08:00
Mark Brown
b6b5ee6576 Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2018-12-14 11:52:31 +00:00
Mark Brown
5f783fd0a8 Merge tag 'v4.4.167' into linux-linaro-lsk-v4.4
This is the 4.4.167 stable release
2018-12-14 11:11:33 +00:00
Liang Chen
d630b488a5 drivers: cpufreq_interactive: recover tunables when switch governor
Android will switch governor between different applications, so we
must recover tunables for interactive governor.

Change-Id: Ieb3d1f46ec628bf0a70d2656b63dd255f36770e0
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-12-14 17:20:15 +08:00
Hu Kejun
cb38ae649b ARM: dts: rk3288-rkisp1: add interrupt name
Change-Id: Ie9d58d68ec857821a1645741899fb58f3db1a096
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-12-14 17:13:49 +08:00
Hu Kejun
1dad3d275a arm64: dts: rockchip: rk1808: add mi/mipi irq setting
Change-Id: I2025e6de06f0aec1e18289bf0eec8445d5a11820
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-12-14 17:13:22 +08:00
Hu Kejun
4b7f84b478 arm64: dts: rockchip: rk3399: add interrupt name for rkisp
Change-Id: If942773bb18b55463cdd2137493f6573ce747893
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-12-14 17:12:58 +08:00
Hu Kejun
89212f02e2 arm64: dts: rockchip: px30: add mi/mipi irq setting
Change-Id: I2146d37c18d8418b32cf13736ecccb0510a851d9
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-12-14 17:12:40 +08:00
Hu Kejun
993dd376b8 media: rockchip: isp1: request isp irqs independently
Change-Id: Ia43930306e41d6475cddcfb1a80a41c848d38ecc
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-12-14 17:12:34 +08:00
Hu Kejun
fb05f0421c camera: rockchip: add ov5640 driver
Change-Id: I6113fc659ae4eb971aa60774ebb90a106e94f06e
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-12-14 17:12:09 +08:00
Hu Kejun
e9d7e12f68 media: rockchip: isp1: add version number
Change-Id: I4b86a96a2242c97f56ff3e053dafa73ae234184d
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-12-14 17:11:03 +08:00
Chen Lei
5d239ed3da ARM: dts: rk322x: sdmmc add cd-gpios
This modification is to solve the problem of hot plug failure when
SD card is inserted after boot, because det pin is initialized as GPIO

Change-Id: I1cd49faa92fa7502c23dd30c2c35fa712e5d0ea3
Signed-off-by: Chen Lei <lei.chen@rock-chips.com>
2018-12-14 17:08:54 +08:00
Simon Xue
835986100e arm64: dts: rockchip: rk1808: Add missing inbound/outbound win nums
Change-Id: Ibd85ca71f7d6c87d0461eff2ba6dada6b0862040
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2018-12-14 14:57:20 +08:00
Weixin Zhou
7c3dcf45c5 arm64: dts: rockchip: rk3399pro-evb-v11: set vdd_center off in suspend
Change-Id: I6b9c51a0f036a31b51b69b5f8d1d374511135c10
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
2018-12-14 14:42:55 +08:00
Simon Xue
e8aec0b3a6 PCI: rockchip: Support PCIe training controlled by userspace
Change-Id: I875ea3f3558cb1c3ef4b0a821d51f56a3f8431ae
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2018-12-14 11:43:12 +08:00
Simon Xue
37091a2c50 PCI: rockchip: Support PCIe dma transfer on RK3399 platform
Change-Id: I8545ddb459b8275489fa9b7a70e54c6b57cc514c
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2018-12-14 11:43:04 +08:00
Simon Xue
e3e8b9874a PCI: rockchip: enable uDMA interrupt on RK3399 platform
Change-Id: I2ee4cd5de4aa7b4e067b2b8015a833706392e5bd
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2018-12-14 11:40:32 +08:00
Simon Xue
e5ac47b69e PCI: rockchip: Support DW PCIe dma transfer
Change-Id: I52cb60b22919faadfb83d2026a1dd61c01d48fe5
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2018-12-14 11:40:25 +08:00
Alex Zhao
409cd1d0b9 net: wireless: update bcmdhd driver to "1.579.77.41.10 (r)"
Change-Id: I8c8c1f7e6b9e9b686eeebb404f5fae061bbad361
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2018-12-14 11:37:28 +08:00
Sudeep Holla
7f34408740 UPSTREAM: drivers: firmware: psci: unify enable-method binding on ARM {64,32}-bit systems
Currently ARM CPUs DT bindings allows different enable-method value for
PSCI based systems. On ARM 64-bit this property is required and must be
"psci" while on ARM 32-bit systems this property is optional and must
be "arm,psci" if present.

However, "arm,psci" has always been the compatible string for the PSCI
node, and was never intended to be the enable-method. So this is a bug
in the binding and not a deliberate attempt at specifying 32-bit
differently.

This is problematic if 32-bit OS is run on 64-bit system which has
"psci" as enable-method rather than the expected "arm,psci".

So let's unify the value into "psci" and remove support for "arm,psci"
before it finds any users.

Reported-by: Soby Mathew <Soby.Mathew@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
(cherry picked from commit 978fa43623)

Change-Id: Ie75091185d9236595c564081083ffc202f9ba178
2018-12-13 18:08:05 +08:00
Greg Kroah-Hartman
640f85865c Linux 4.4.167 2018-12-13 09:21:37 +01:00
Emmanuel Grumbach
d1deb58639 mac80211: ignore NullFunc frames in the duplicate detection
commit 990d71846a upstream.

NullFunc packets should never be duplicate just like
QoS-NullFunc packets.

We saw a client that enters / exits power save with
NullFunc frames (and not with QoS-NullFunc) despite the
fact that the association supports HT.
This specific client also re-uses a non-zero sequence number
for different NullFunc frames.
At some point, the client had to send a retransmission of
the NullFunc frame and we dropped it, leading to a
misalignment in the power save state.
Fix this by never consider a NullFunc frame as duplicate,
just like we do for QoS NullFunc frames.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=201449

CC: <stable@vger.kernel.org>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:37 +01:00
Felix Fietkau
5a7b2af0c7 mac80211: fix reordering of buffered broadcast packets
commit 9ec1190d06 upstream.

If the buffered broadcast queue contains packets, letting new packets bypass
that queue can lead to heavy reordering, since the driver is probably throttling
transmission of buffered multicast packets after beacons.

Keep buffering packets until the buffer has been cleared (and no client
is in powersave mode).

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:37 +01:00
Felix Fietkau
00512a2e8e mac80211: ignore tx status for PS stations in ieee80211_tx_status_ext
commit a317e65fac upstream.

Make it behave like regular ieee80211_tx_status calls, except for the lack of
filtered frame processing.
This fixes spurious low-ack triggered disconnections with powersave clients
connected to an AP.

Fixes: f027c2aca0 ("mac80211: add ieee80211_tx_status_noskb")
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:37 +01:00
Ben Greear
a315f7154d mac80211: Clear beacon_int in ieee80211_do_stop
commit 5c21e8100d upstream.

This fixes stale beacon-int values that would keep a netdev
from going up.

To reproduce:

Create two VAP on one radio.
vap1 has beacon-int 100, start it.
vap2 has beacon-int 240, start it (and it will fail
  because beacon-int mismatch).
reconfigure vap2 to have beacon-int 100 and start it.
  It will fail because the stale beacon-int 240 will be used
  in the ifup path and hostapd never gets a chance to set the
  new beacon interval.

Cc: stable@vger.kernel.org
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:37 +01:00
Vasyl Vavrychuk
71a8069fb1 mac80211_hwsim: Timer should be initialized before device registered
commit a1881c9b8a upstream.

Otherwise if network manager starts configuring Wi-Fi interface
immidiatelly after getting notification of its creation, we will get
NULL pointer dereference:

  BUG: unable to handle kernel NULL pointer dereference at           (null)
  IP: [<ffffffff95ae94c8>] hrtimer_active+0x28/0x50
  ...
  Call Trace:
   [<ffffffff95ae9997>] ? hrtimer_try_to_cancel+0x27/0x110
   [<ffffffff95ae9a95>] ? hrtimer_cancel+0x15/0x20
   [<ffffffffc0803bf0>] ? mac80211_hwsim_config+0x140/0x1c0 [mac80211_hwsim]

Cc: stable@vger.kernel.org
Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@globallogic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:37 +01:00
Macpaul Lin
9ef13fecf9 kgdboc: fix KASAN global-out-of-bounds bug in param_set_kgdboc_var()
commit dada6a43b0 upstream.

This patch is trying to fix KE issue due to
"BUG: KASAN: global-out-of-bounds in param_set_kgdboc_var+0x194/0x198"
reported by Syzkaller scan."

[26364:syz-executor0][name:report8t]BUG: KASAN: global-out-of-bounds in param_set_kgdboc_var+0x194/0x198
[26364:syz-executor0][name:report&]Read of size 1 at addr ffffff900e44f95f by task syz-executor0/26364
[26364:syz-executor0][name:report&]
[26364:syz-executor0]CPU: 7 PID: 26364 Comm: syz-executor0 Tainted: G W 0
[26364:syz-executor0]Call trace:
[26364:syz-executor0][<ffffff9008095cf8>] dump_bacIctrace+Ox0/0x470
[26364:syz-executor0][<ffffff9008096de0>] show_stack+0x20/0x30
[26364:syz-executor0][<ffffff90089cc9c8>] dump_stack+Oxd8/0x128
[26364:syz-executor0][<ffffff90084edb38>] print_address_description +0x80/0x4a8
[26364:syz-executor0][<ffffff90084ee270>] kasan_report+Ox178/0x390
[26364:syz-executor0][<ffffff90084ee4a0>] _asan_report_loadi_noabort+Ox18/0x20
[26364:syz-executor0][<ffffff9008b092ac>] param_set_kgdboc_var+Ox194/0x198
[26364:syz-executor0][<ffffff900813af64>] param_attr_store+Ox14c/0x270
[26364:syz-executor0][<ffffff90081394c8>] module_attr_store+0x60/0x90
[26364:syz-executor0][<ffffff90086690c0>] sysfs_kl_write+Ox100/0x158
[26364:syz-executor0][<ffffff9008666d84>] kernfs_fop_write+0x27c/0x3a8
[26364:syz-executor0][<ffffff9008508264>] do_loop_readv_writev+0x114/0x1b0
[26364:syz-executor0][<ffffff9008509ac8>] do_readv_writev+0x4f8/0x5e0
[26364:syz-executor0][<ffffff9008509ce4>] vfs_writev+0x7c/Oxb8
[26364:syz-executor0][<ffffff900850ba64>] SyS_writev+Oxcc/0x208
[26364:syz-executor0][<ffffff90080883f0>] elO_svc_naked +0x24/0x28
[26364:syz-executor0][name:report&]
[26364:syz-executor0][name:report&]The buggy address belongs to the variable:
[26364:syz-executor0][name:report&] kgdb_tty_line+Ox3f/0x40
[26364:syz-executor0][name:report&]
[26364:syz-executor0][name:report&]Memory state around the buggy address:
[26364:syz-executor0] ffffff900e44f800: 00 00 00 00 00 04 fa fa fa fa fa fa 00 fa fa fa
[26364:syz-executor0] ffffff900e44f880: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
[26364:syz-executor0]> ffffff900e44f900: fa fa fa fa 04 fa fa fa fa fa fa fa 00 00 00 00
[26364:syz-executor0][name:report&]                                       ^
[26364:syz-executor0] ffffff900e44f980: 00 fa fa fa fa fa fa fa 04 fa fa fa fa fa fa fa
[26364:syz-executor0] ffffff900e44fa00: 04 fa fa fa fa fa fa fa 00 fa fa fa fa fa fa fa
[26364:syz-executor0][name:report&]
[26364:syz-executor0][name:panic&]Disabling lock debugging due to kernel taint
[26364:syz-executor0]------------[cut here]------------

After checking the source code, we've found there might be an out-of-bounds
access to "config[len - 1]" array when the variable "len" is zero.

Signed-off-by: Macpaul Lin <macpaul@gmail.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:37 +01:00
Peter Shih
dc0e573439 tty: serial: 8250_mtk: always resume the device in probe.
commit 100bc3e2be upstream.

serial8250_register_8250_port calls uart_config_port, which calls
config_port on the port before it tries to power on the port. So we need
the port to be on before calling serial8250_register_8250_port. Change
the code to always do a runtime resume in probe before registering port,
and always do a runtime suspend in remove.

This basically reverts the change in commit 68e5fc4a25 ("tty: serial:
8250_mtk: use pm_runtime callbacks for enabling"), but still use
pm_runtime callbacks.

Fixes: 68e5fc4a25 ("tty: serial: 8250_mtk: use pm_runtime callbacks for enabling")
Signed-off-by: Peter Shih <pihsun@chromium.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:37 +01:00
Paulo Alcantara
122775d733 cifs: Fix separator when building path from dentry
commit c988de29ca upstream.

Make sure to use the CIFS_DIR_SEP(cifs_sb) as path separator for
prefixpath too. Fixes a bug with smb1 UNIX extensions.

Fixes: a6b5058faf ("fs/cifs: make share unaccessible at root level mountable")
Signed-off-by: Paulo Alcantara <palcantara@suse.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:36 +01:00
Greg Kroah-Hartman
bcecc9e575 Staging: lustre: remove two build warnings
[for older kernels only, lustre has been removed from upstream]

When someone writes:
	strncpy(dest, source, sizeof(source));
they really are just doing the same thing as:
	strcpy(dest, source);
but somehow they feel better because they are now using the "safe"
version of the string functions.  Cargo-cult programming at its
finest...

gcc-8 rightfully warns you about doing foolish things like this.  Now
that the stable kernels are all starting to be built using gcc-8, let's
get rid of this warning so that we do not have to gaze at this horror.

To dropt the warning, just convert the code to using strcpy() so that if
someone really wants to audit this code and find all of the obvious
problems, it will be easier to do so.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:36 +01:00
Mathias Nyman
7e54089590 xhci: Prevent U1/U2 link pm states if exit latency is too long
commit 0472bf06c6 upstream.

Don't allow USB3 U1 or U2 if the latency to wake up from the U-state
reaches the service interval for a periodic endpoint.

This is according to xhci 1.1 specification section 4.23.5.2 extra note:

"Software shall ensure that a device is prevented from entering a U-state
 where its worst case exit latency approaches the ESIT."

Allowing too long exit latencies for periodic endpoint confuses xHC
internal scheduling, and new devices may fail to enumerate with a
"Not enough bandwidth for new device state" error from the host.

Cc: <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:36 +01:00
Chuck Lever
5f3c652e0f SUNRPC: Fix leak of krb5p encode pages
commit 8dae5398ab upstream.

call_encode can be invoked more than once per RPC call. Ensure that
each call to gss_wrap_req_priv does not overwrite pointers to
previously allocated memory.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: stable@kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:36 +01:00
Halil Pasic
e32c7473a4 virtio/s390: fix race in ccw_io_helper()
commit 78b1a52e05 upstream.

While ccw_io_helper() seems like intended to be exclusive in a sense that
it is supposed to facilitate I/O for at most one thread at any given
time, there is actually nothing ensuring that threads won't pile up at
vcdev->wait_q. If they do, all threads get woken up and see the status
that belongs to some other request than their own. This can lead to bugs.
For an example see:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1788432

This race normally does not cause any problems. The operations provided
by struct virtio_config_ops are usually invoked in a well defined
sequence, normally don't fail, and are normally used quite infrequent
too.

Yet, if some of the these operations are directly triggered via sysfs
attributes, like in the case described by the referenced bug, userspace
is given an opportunity to force races by increasing the frequency of the
given operations.

Let us fix the problem by ensuring, that for each device, we finish
processing the previous request before starting with a new one.

Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Reported-by: Colin Ian King <colin.king@canonical.com>
Cc: stable@vger.kernel.org
Message-Id: <20180925121309.58524-3-pasic@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:36 +01:00
Halil Pasic
e2ae7fd4c1 virtio/s390: avoid race on vcdev->config
commit 2448a299ec upstream.

Currently we have a race on vcdev->config in virtio_ccw_get_config() and
in virtio_ccw_set_config().

This normally does not cause problems, as these are usually infrequent
operations. However, for some devices writing to/reading from the config
space can be triggered through sysfs attributes. For these, userspace can
force the race by increasing the frequency.

Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Cc: stable@vger.kernel.org
Message-Id: <20180925121309.58524-2-pasic@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:36 +01:00
Takashi Iwai
92c01d8f4a ALSA: pcm: Fix interval evaluation with openmin/max
commit 5363857b91 upstream.

As addressed in alsa-lib (commit b420056604f0), we need to fix the
case where the evaluation of PCM interval "(x x+1]" leading to
-EINVAL.  After applying rules, such an interval may be translated as
"(x x+1)".

Fixes: ff2d6acdf6 ("ALSA: pcm: Fix snd_interval_refine first/last with open min/max")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:36 +01:00
Takashi Iwai
1b5c6d035a ALSA: pcm: Call snd_pcm_unlink() conditionally at closing
commit b51abed835 upstream.

Currently the PCM core calls snd_pcm_unlink() always unconditionally
at closing a stream.  However, since snd_pcm_unlink() invokes the
global rwsem down, the lock can be easily contended.  More badly, when
a thread runs in a high priority RT-FIFO, it may stall at spinning.

Basically the call of snd_pcm_unlink() is required only for the linked
streams that are already rare occasion.  For normal use cases, this
code path is fairly superfluous.

As an optimization (and also as a workaround for the RT problem
above in normal situations without linked streams), this patch adds a
check before calling snd_pcm_unlink() and calls it only when needed.

Reported-by: Chanho Min <chanho.min@lge.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:36 +01:00
Chanho Min
2ec5d37754 ALSA: pcm: Fix starvation on down_write_nonblock()
commit b888a5f713 upstream.

Commit 67ec1072b0 ("ALSA: pcm: Fix rwsem deadlock for non-atomic PCM
stream") fixes deadlock for non-atomic PCM stream. But, This patch
causes antother stuck.
If writer is RT thread and reader is a normal thread, the reader
thread will be difficult to get scheduled. It may not give chance to
release readlocks and writer gets stuck for a long time if they are
pinned to single cpu.

The deadlock described in the previous commit is because the linux
rwsem queues like a FIFO. So, we might need non-FIFO writelock, not
non-block one.

My suggestion is that the writer gives reader a chance to be scheduled
by using the minimum msleep() instaed of spinning without blocking by
writer. Also, The *_nonblock may be changed to *_nonfifo appropriately
to this concept.
In terms of performance, when trylock is failed, this minimum periodic
msleep will have the same performance as the tick-based
schedule()/wake_up_q().

[ Although this has a fairly high performance penalty, the relevant
  code path became already rare due to the previous commit ("ALSA:
  pcm: Call snd_pcm_unlink() conditionally at closing").  That is, now
  this unconditional msleep appears only when using linked streams,
  and this must be a rare case.  So we accept this as a quick
  workaround until finding a more suitable one -- tiwai ]

Fixes: 67ec1072b0 ("ALSA: pcm: Fix rwsem deadlock for non-atomic PCM stream")
Suggested-by: Wonmin Jung <wonmin.jung@lge.com>
Signed-off-by: Chanho Min <chanho.min@lge.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:36 +01:00
Kai-Heng Feng
0ced5efd7d ALSA: hda: Add support for AMD Stoney Ridge
commit 3deef52ce1 upstream.

It's similar to other AMD audio devices, it also supports D3, which can
save some power drain.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:36 +01:00
Hui Peng
82fa3e9543 ALSA: usb-audio: Fix UAF decrement if card has no live interfaces in card.c
commit 5f8cf71258 upstream.

If a USB sound card reports 0 interfaces, an error condition is triggered
and the function usb_audio_probe errors out. In the error path, there was a
use-after-free vulnerability where the memory object of the card was first
freed, followed by a decrement of the number of active chips. Moving the
decrement above the atomic_dec fixes the UAF.

[ The original problem was introduced in 3.1 kernel, while it was
  developed in a different form.  The Fixes tag below indicates the
  original commit but it doesn't mean that the patch is applicable
  cleanly. -- tiwai ]

Fixes: 362e4e49ab ("ALSA: usb-audio - clear chip->probing on error exit")
Reported-by: Hui Peng <benquike@gmail.com>
Reported-by: Mathias Payer <mathias.payer@nebelwelt.net>
Signed-off-by: Hui Peng <benquike@gmail.com>
Signed-off-by: Mathias Payer <mathias.payer@nebelwelt.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:36 +01:00
Mathias Payer
c380600bf7 USB: check usb_get_extra_descriptor for proper size
commit 704620afc7 upstream.

When reading an extra descriptor, we need to properly check the minimum
and maximum size allowed, to prevent from invalid data being sent by a
device.

Reported-by: Hui Peng <benquike@gmail.com>
Reported-by: Mathias Payer <mathias.payer@nebelwelt.net>
Co-developed-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Hui Peng <benquike@gmail.com>
Signed-off-by: Mathias Payer <mathias.payer@nebelwelt.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:35 +01:00
Alexander Theissen
c19c1881f2 usb: appledisplay: Add 27" Apple Cinema Display
commit d785990530 upstream.

Add another Apple Cinema Display to the list of supported displays.

Signed-off-by: Alexander Theissen <alex.theissen@me.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:35 +01:00