Commit graph

603187 commits

Author SHA1 Message Date
Amandeep Singh
d10f17c39d Revert "msm-4.4: dts: mhi: Added and enabled mhi support"
This reverts commit 7475bc3d16.

Change-Id: Ia9f495862c4e10fb2b0f162160538f12c08de872
Signed-off-by: Amandeep Singh <amansing@codeaurora.org>
2018-10-29 07:25:23 -07:00
Amandeep Singh
7475bc3d16 msm-4.4: dts: mhi: Added and enabled mhi support
Added and enabled mhi node in the dts for msm8996 auto.

Change-Id: I3932f4e51844437172b0f9e71731b42de9d5b4c4
Signed-off-by: Amandeep Singh <amansing@codeaurora.org>
2018-10-29 07:16:12 -07:00
Linux Build Service Account
cff9fccb67 Merge "defconfig: Enable CONFIG_BUG_ON_DATA_CORRUPTION" 2018-10-28 22:24:47 -07:00
Linux Build Service Account
cc0e91494c Merge "icnss: NULL terminate the fw build timestamp string" 2018-10-28 07:23:30 -07:00
Linux Build Service Account
86e17dc33a Merge "msm: mdss: Fix potential null pointer dereference" 2018-10-27 12:48:38 -07:00
Linux Build Service Account
edcc07ba51 Merge "drm/msm/sde: ignore scaler v2 data if not enabled" 2018-10-27 12:48:37 -07:00
Linux Build Service Account
e4a7383ace Merge "ARM: dts: msm: update dload type imem offset for MSM8998" 2018-10-26 22:43:01 -07:00
Linux Build Service Account
66e452d86e Merge "clk/msm: fix HDMI PHY registers as per latest programming guide" 2018-10-26 22:42:58 -07:00
Yuanyuan Liu
f6c8e3c802 icnss: NULL terminate the fw build timestamp string
If fw build timestamp passed by QMI is a non-NULL terminated string,
it might result in a out-of-bounds read in icnss_get_soc_info. Hence,
manually NULL terminate the string.

Change-Id: I252196cd12784d841b29303c42591efc59da64f1
CRs-Fixed: 2322317
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
2018-10-26 16:52:18 -07:00
Linux Build Service Account
7f2f2979f9 Merge "msm:ipa:Prevent rt rule deletion if rt rule id is invalid" 2018-10-26 07:44:34 -07:00
Linux Build Service Account
5eee6c6d86 Merge "ion: remove unsafe function ion_handle_get_by_id()" 2018-10-26 07:44:32 -07:00
Linux Build Service Account
e3ef3fd986 Merge "drivers/misc: ignore minimum encryption level change for stream type 1" 2018-10-26 00:09:46 -07:00
Linux Build Service Account
3e4e8be646 Merge "drm/msm: configure AV mute before disabling encryption" 2018-10-26 00:09:44 -07:00
Srinivasarao P
745b79d02b defconfig: Enable CONFIG_BUG_ON_DATA_CORRUPTION
This config will be useful to debug data corruptions without
losing context.

Change-Id: Ic4e3f65f6edffd15c2252393035ee6702e44e13b
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2018-10-26 12:34:58 +05:30
Swetha Chikkaboraiah
8c2b7e3164 ARM: dts: msm: update dload type imem offset for MSM8998
Dload type imem offset is corrected for MSM8998, so that
correct imem address is updated.

Change-Id: I519603641753ec39d86fbf923bd80afcd6b1345d
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
2018-10-25 22:40:47 -07:00
Linux Build Service Account
0fd6f3e2ec Merge "Merge android-4.4.162 (3eb8e73) into msm-4.4" 2018-10-25 13:30:25 -07:00
Abhinav Kumar
fa4c68df8e clk/msm: fix HDMI PHY registers as per latest programming guide
HDMI PHY registers for MSM8998 chipset are not programmed as
per the latest hardware programming guide for the chipset.
This can affect HDMI electrical compliance test cases due
to low signal strength.

Fix up the HDMI PHY driver to use the latest values for the
PHY registers.

Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
Change-Id: I96dd6ffaf127940d34af898c5a2982209a6fc83c
2018-10-25 12:46:52 -07:00
Srinivasarao P
52ad8f0aff ion: remove unsafe function ion_handle_get_by_id()
The function ion_handle_get_by_id() is called from function
msm_ion_custom_ioctl(), so we retained it even though it got
deleted in commit 2c155709e4
("staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free").

This can lead to same use-after-free scenario with
ION_IOC_{CLEAN_CACHES,INV_CACHES,CLEAN_INV_CACHES} so removing
this unsafe function and holding client->lock for entire operation.

Change-Id: I536cfa69465ad692794500e3b31ac137d04940ff
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2018-10-25 15:44:19 +05:30
Linux Build Service Account
a36b6328ef Merge "soc: qcom: Remove smp2p test support" 2018-10-24 13:57:42 -07:00
Mohammed Javid
9ff2be3d72 msm:ipa:Prevent rt rule deletion if rt rule id is invalid
Currently RT is deleted even if rt rule or header proc ctx
is invalid. Add check to prevent it.

Change-Id: Ic37ff9a33fab2b3c0d6393e43452e4b62a91d932
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-10-24 02:00:57 -07:00
Clarence Ip
ce46ccdb6d drm/msm/sde: ignore scaler v2 data if not enabled
The incoming scaler v2 user data isn't guaranteed to be
valid if the 'enable' field is set to zero, so ignore
the entire structure unless the enable is explicitly set
to a non-zero value.

CRs-Fixed: 2052501
Change-Id: Ieeb24122a5caffcd7361007e52219cee94e33eee
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2018-10-23 18:57:56 -07:00
Linux Build Service Account
8d602672c3 Merge "soc: qcom: hab: add rx queue empty check after getting the lock" 2018-10-23 16:29:38 -07:00
Linux Build Service Account
d8bc349f54 Merge "msm: ipa: Check ep empty before reset" 2018-10-23 06:53:28 -07:00
Hardik Arya
b4137f3261 soc: qcom: Remove smp2p test support
Smp2p test code is used internally to test the
functionality of drivers and has no real use case
in end product.

Change-Id: I7a50c077bb71068188b5411424c5782b3d0edbb7
Signed-off-by: Hardik Arya <harya@codeaurora.org>
2018-10-23 06:08:40 -07:00
Linux Build Service Account
869b2c41ea Merge "Merge android-4.4.161 (8e7f196) into msm-4.4" 2018-10-22 23:01:48 -07:00
Linux Build Service Account
8d93d83652 Merge "coresight: fix handling of ETM management register access via sysfs" 2018-10-22 23:01:46 -07:00
Yong Ding
bc856c7cae soc: qcom: hab: add rx queue empty check after getting the lock
Need to do empty check again when we have the lock of the rx queue of
a given virtual channel. Without this check, it is possible that the
list head of the queue will be wrongly taken as a valid message node
if the valid message has already been fetched by some other thread.

Change-Id: I65f73acd86fe2fb709e2af2ffeaa42581b4168ca
Signed-off-by: Yong Ding <yongding@codeaurora.org>
2018-10-23 09:08:34 +08:00
Linux Build Service Account
367b268e6a Merge "soc: qcom: audio: use global lock for single hab socket" 2018-10-22 15:22:18 -07:00
Linux Build Service Account
21aba59a98 Merge "ion: msm_ion: fix incorrect ion_buffer member assignment" 2018-10-22 15:22:16 -07:00
Linux Build Service Account
403ca80f89 Merge "cnss2: Update QMI files with cold cal data changes" 2018-10-22 04:36:45 -07:00
Srinivasarao P
392854fb08 Merge android-4.4.162 (3eb8e73) into msm-4.4
* refs/heads/tmp-3eb8e73
  Linux 4.4.162
  HV: properly delay KVP packets when negotiation is in progress
  Drivers: hv: kvp: fix IP Failover
  Drivers: hv: util: Pass the channel information during the init call
  Drivers: hv: utils: Invoke the poll function after handshake
  usb: gadget: serial: fix oops when data rx'd after close
  ARC: build: Get rid of toolchain check
  powerpc/tm: Avoid possible userspace r1 corruption on reclaim
  powerpc/tm: Fix userspace r13 corruption
  net/mlx4: Use cpumask_available for eq->affinity_mask
  Input: atakbd - fix Atari CapsLock behaviour
  Input: atakbd - fix Atari keymap
  clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs
  media: af9035: prevent buffer overflow on write
  x86/fpu: Finish excising 'eagerfpu'
  x86/fpu: Remove struct fpu::counter
  x86/fpu: Remove use_eager_fpu()
  KVM: x86: remove eager_fpu field of struct kvm_vcpu_arch
  rtnl: limit IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES to 4096
  net: systemport: Fix wake-up interrupt race during resume
  net: mvpp2: Extract the correct ethtype from the skb for tx csum offload
  team: Forbid enslaving team device to itself
  qlcnic: fix Tx descriptor corruption on 82xx devices
  net/usb: cancel pending work when unbinding smsc75xx
  netlabel: check for IPV4MASK in addrinfo_get
  net/ipv6: Display all addresses in output of /proc/net/if_inet6
  net: ipv4: update fnhe_pmtu when first hop's MTU changes
  ipv4: fix use-after-free in ip_cmsg_recv_dstaddr()
  ip_tunnel: be careful when accessing the inner header
  ip6_tunnel: be careful when accessing the inner header
  bonding: avoid possible dead-lock
  bnxt_en: Fix TX timeout during netpoll.
  jffs2: return -ERANGE when xattr buffer is too small
  xhci: Don't print a warning when setting link state for disabled ports
  i2c: i2c-scmi: fix for i2c_smbus_write_block_data
  perf script python: Fix export-to-postgresql.py occasional failure
  mach64: detect the dot clock divider correctly on sparc
  mm/vmstat.c: fix outdated vmstat_text
  ext4: add corruption check in ext4_xattr_set_entry()
  drm/amdgpu: Fix SDMA HQD destroy error on gfx_v7
  ARM: dts: at91: add new compatibility string for macb on sama5d3
  net: macb: disable scatter-gather for macb on sama5d3
  stmmac: fix valid numbers of unicast filter entries
  sound: enable interrupt after dma buffer initialization
  mfd: omap-usb-host: Fix dts probe of children
  selftests/efivarfs: add required kernel configs
  ASoC: sigmadsp: safeload should not have lower byte limit
  ASoC: wm8804: Add ACPI support
  ANDROID: usb: gadget: f_mtp: Return error if count is negative
  ANDROID: x86_64_cuttlefish_defconfig: disable CONFIG_MEMORY_STATE_TIME

Change-Id: Ie69fd3f90302d1ebe0c1217b46d8033fec4180a5
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2018-10-22 14:00:26 +05:30
Erin Yan
0fe0aff023 soc: qcom: audio: use global lock for single hab socket
Need use one global lock to prevent multiple threads visit single hab
socket at same time, as hab can't guarantee that the coming message is
received by the right thread.

Change-Id: I43eca3c1f7010c651612fff949b867e2269a2977
Signed-off-by: Erin Yan <xinyey@codeaurora.org>
2018-10-22 10:35:50 +08:00
Greg Kroah-Hartman
3eb8e73519 This is the 4.4.162 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlvK3sYACgkQONu9yGCS
 aT6Qiw/+OxTScsntrhjtosUt2ZQxjZN4nuUQw57BId0lq/JLvUpOAjKJYCIC+O1t
 Pv8EbZvErpIYVIRN7/anlYVbmIvJj694eCmJXwS/bsYcgvJztEoYjgmJTbDwu2Nb
 /ZfyDWR+tc6tuPzFYe4qWKjpT9MO+RZKEE+ZiMWt1VuB8d5yRGBpGTy1NB8kbVCt
 VtlZ2K8UovD51wY8T5HGCny8DucL3pASunAgSftpssRfEWWhw1ftMWT1iNaaykki
 gAWLOZZdo2ChDjA0vFku2rJWcDdb5MTxLEuFuogjRxOnERqClLfabAoqaa2A9Afe
 gBeQeCOW0uMqX5BoqrQZKQY2cDbJrGjrBmDQ5dTt3ZTC1OzOE5x4mKGZbZXUa61X
 8bhMEYt6kvzxoIwWdK7A+/B8gTYJhwYjRtssfeR4ViXGka8bDFnKAvTSIBo+74eB
 abNf06OReF/hnIEJkRNOmb8OPzPYDkvlEeZlRDVryzUGZUu2zSvwz8W21u+V86de
 og+tq15KvV+5wfiwpCs++SbNFl9RAVAyKdRicgeNXekf1FnEQM/bvhB6WOUWcbmy
 VT5RQjXu1lw+dhBlW7O0/qVihCG/UrgyabMh0rgwhS876evSxZWO9e5eHHDgcutq
 MHQYZwtDaL9dWIqTYF9NLvvl85YoboYc+7wydo4jvZYXxbQgsEo=
 =xW75
 -----END PGP SIGNATURE-----

Merge 4.4.162 into android-4.4

Changes in 4.4.162
	ASoC: wm8804: Add ACPI support
	ASoC: sigmadsp: safeload should not have lower byte limit
	selftests/efivarfs: add required kernel configs
	mfd: omap-usb-host: Fix dts probe of children
	sound: enable interrupt after dma buffer initialization
	stmmac: fix valid numbers of unicast filter entries
	net: macb: disable scatter-gather for macb on sama5d3
	ARM: dts: at91: add new compatibility string for macb on sama5d3
	drm/amdgpu: Fix SDMA HQD destroy error on gfx_v7
	ext4: add corruption check in ext4_xattr_set_entry()
	mm/vmstat.c: fix outdated vmstat_text
	mach64: detect the dot clock divider correctly on sparc
	perf script python: Fix export-to-postgresql.py occasional failure
	i2c: i2c-scmi: fix for i2c_smbus_write_block_data
	xhci: Don't print a warning when setting link state for disabled ports
	jffs2: return -ERANGE when xattr buffer is too small
	bnxt_en: Fix TX timeout during netpoll.
	bonding: avoid possible dead-lock
	ip6_tunnel: be careful when accessing the inner header
	ip_tunnel: be careful when accessing the inner header
	ipv4: fix use-after-free in ip_cmsg_recv_dstaddr()
	net: ipv4: update fnhe_pmtu when first hop's MTU changes
	net/ipv6: Display all addresses in output of /proc/net/if_inet6
	netlabel: check for IPV4MASK in addrinfo_get
	net/usb: cancel pending work when unbinding smsc75xx
	qlcnic: fix Tx descriptor corruption on 82xx devices
	team: Forbid enslaving team device to itself
	net: mvpp2: Extract the correct ethtype from the skb for tx csum offload
	net: systemport: Fix wake-up interrupt race during resume
	rtnl: limit IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES to 4096
	KVM: x86: remove eager_fpu field of struct kvm_vcpu_arch
	x86/fpu: Remove use_eager_fpu()
	x86/fpu: Remove struct fpu::counter
	x86/fpu: Finish excising 'eagerfpu'
	media: af9035: prevent buffer overflow on write
	clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs
	Input: atakbd - fix Atari keymap
	Input: atakbd - fix Atari CapsLock behaviour
	net/mlx4: Use cpumask_available for eq->affinity_mask
	powerpc/tm: Fix userspace r13 corruption
	powerpc/tm: Avoid possible userspace r1 corruption on reclaim
	ARC: build: Get rid of toolchain check
	usb: gadget: serial: fix oops when data rx'd after close
	Drivers: hv: utils: Invoke the poll function after handshake
	Drivers: hv: util: Pass the channel information during the init call
	Drivers: hv: kvp: fix IP Failover
	HV: properly delay KVP packets when negotiation is in progress
	Linux 4.4.162

Change-Id: Ib44f3b764a6005a2891b28315b3dbfa3f6cedcb5
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2018-10-20 16:32:57 +02:00
Greg Kroah-Hartman
24c2342b8e Linux 4.4.162 2018-10-20 09:52:38 +02:00
Long Li
e34c69f209 HV: properly delay KVP packets when negotiation is in progress
commit a3ade8cc474d848676278660e65f5af1e9e094d9 upstream.

The host may send multiple negotiation packets
(due to timeout) before the KVP user-mode daemon
is connected. KVP user-mode daemon is connected.
We need to defer processing those packets
until the daemon is negotiated and connected.
It's okay for guest to respond
to all negotiation packets.

In addition, the host may send multiple staged
KVP requests as soon as negotiation is done.
We need to properly process those packets using one
tasklet for exclusive access to ring buffer.

This patch is based on the work of
Nick Meier <Nick.Meier@microsoft.com>.

The above is the original changelog of
a3ade8cc474d ("HV: properly delay KVP packets when negotiation is in progress"

Here I re-worked the original patch because the mainline version
can't work for the linux-4.4.y branch, on which channel->callback_event
doesn't exist yet. In the mainline, channel->callback_event was added by:
631e63a9f346 ("vmbus: change to per channel tasklet"). Here we don't want
to backport it to v4.4, as it requires extra supporting changes and fixes,
which are unnecessary as to the KVP bug we're trying to resolve.

NOTE: before this patch is used, we should cherry-pick the other related
3 patches from the mainline first:

The background of this backport request is that: recently Wang Jian reported
some KVP issues: https://github.com/LIS/lis-next/issues/593:
e.g. the /var/lib/hyperv/.kvp_pool_* files can not be updated, and sometimes
if the hv_kvp_daemon doesn't timely start, the host may not be able to query
the VM's IP address via KVP.

Reported-by: Wang Jian <jianjian.wang1@gmail.com>
Tested-by: Wang Jian <jianjian.wang1@gmail.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:38 +02:00
Vitaly Kuznetsov
43fea648af Drivers: hv: kvp: fix IP Failover
commit 4dbfc2e68004c60edab7e8fd26784383dd3ee9bc upstream.

Hyper-V VMs can be replicated to another hosts and there is a feature to
set different IP for replicas, it is called 'Failover TCP/IP'. When
such guest starts Hyper-V host sends it KVP_OP_SET_IP_INFO message as soon
as we finish negotiation procedure. The problem is that it can happen (and
it actually happens) before userspace daemon connects and we reply with
HV_E_FAIL to the message. As there are no repetitions we fail to set the
requested IP.

Solve the issue by postponing our reply to the negotiation message till
userspace daemon is connected. We can't wait too long as there is a
host-side timeout (cca. 75 seconds) and if we fail to reply in this time
frame the whole KVP service will become inactive. The solution is not
ideal - if it takes userspace daemon more than 60 seconds to connect
IP Failover will still fail but I don't see a solution with our current
separation between kernel and userspace parts.

Other two modules (VSS and FCOPY) don't require such delay, leave them
untouched.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:38 +02:00
K. Y. Srinivasan
eaee7976cf Drivers: hv: util: Pass the channel information during the init call
commit b9830d120cbe155863399f25eaef6aa8353e767f upstream.

Pass the channel information to the util drivers that need to defer
reading the channel while they are processing a request. This would address
the following issue reported by Vitaly:

Commit 3cace4a61610 ("Drivers: hv: utils: run polling callback always in
interrupt context") removed direct *_transaction.state = HVUTIL_READY
assignments from *_handle_handshake() functions introducing the following
race: if a userspace daemon connects before we get first non-negotiation
request from the server hv_poll_channel() won't set transaction state to
HVUTIL_READY as (!channel) condition will fail, we set it to non-NULL on
the first real request from the server.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reported-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:38 +02:00
K. Y. Srinivasan
f91b8b1fd6 Drivers: hv: utils: Invoke the poll function after handshake
commit 2d0c3b5ad739697a68dc8a444f5b9f4817cf8f8f upstream.

When the handshake with daemon is complete, we should poll the channel since
during the handshake, we will not be processing any messages. This is a
potential bug if the host is waiting for a response from the guest.
I would like to thank Dexuan for pointing this out.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:38 +02:00
Stephen Warren
68a318670c usb: gadget: serial: fix oops when data rx'd after close
commit daa35bd95634a2a2d72d1049c93576a02711cb1a upstream.

When the gadget serial device has no associated TTY, do not pass any
received data into the TTY layer for processing; simply drop it instead.
This prevents the TTY layer from calling back into the gadget serial
driver, which will then crash in e.g. gs_write_room() due to lack of
gadget serial device to TTY association (i.e. a NULL pointer dereference).

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:38 +02:00
Alexey Brodkin
466dda64e4 ARC: build: Get rid of toolchain check
commit 615f64458ad890ef94abc879a66d8b27236e733a upstream.

This check is very naive: we simply test if GCC invoked without
"-mcpu=XXX" has ARC700 define set. In that case we think that GCC
was built with "--with-cpu=arc700" and has libgcc built for ARC700.

Otherwise if ARC700 is not defined we think that everythng was built
for ARCv2.

But in reality our life is much more interesting.

1. Regardless of GCC configuration (i.e. what we pass in "--with-cpu"
   it may generate code for any ARC core).

2. libgcc might be built with explicitly specified "--mcpu=YYY"

That's exactly what happens in case of multilibbed toolchains:
 - GCC is configured with default settings
 - All the libs built for many different CPU flavors

I.e. that check gets in the way of usage of multilibbed
toolchains. And even non-multilibbed toolchains are affected.
OpenEmbedded also builds GCC without "--with-cpu" because
each and every target component later is compiled with explicitly
set "-mcpu=ZZZ".

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:38 +02:00
Michael Neuling
5a51c55493 powerpc/tm: Avoid possible userspace r1 corruption on reclaim
[ Upstream commit 96dc89d526ef77604376f06220e3d2931a0bfd58 ]

Current we store the userspace r1 to PACATMSCRATCH before finally
saving it to the thread struct.

In theory an exception could be taken here (like a machine check or
SLB miss) that could write PACATMSCRATCH and hence corrupt the
userspace r1. The SLB fault currently doesn't touch PACATMSCRATCH, but
others do.

We've never actually seen this happen but it's theoretically
possible. Either way, the code is fragile as it is.

This patch saves r1 to the kernel stack (which can't fault) before we
turn MSR[RI] back on. PACATMSCRATCH is still used but only with
MSR[RI] off. We then copy r1 from the kernel stack to the thread
struct once we have MSR[RI] back on.

Suggested-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:38 +02:00
Michael Neuling
6939b3b00c powerpc/tm: Fix userspace r13 corruption
[ Upstream commit cf13435b730a502e814c63c84d93db131e563f5f ]

When we treclaim we store the userspace checkpointed r13 to a scratch
SPR and then later save the scratch SPR to the user thread struct.

Unfortunately, this doesn't work as accessing the user thread struct
can take an SLB fault and the SLB fault handler will write the same
scratch SPRG that now contains the userspace r13.

To fix this, we store r13 to the kernel stack (which can't fault)
before we access the user thread struct.

Found by running P8 guest + powervm + disable_1tb_segments + TM. Seen
as a random userspace segfault with r13 looking like a kernel address.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:38 +02:00
Nathan Chancellor
0d02fdd080 net/mlx4: Use cpumask_available for eq->affinity_mask
[ Upstream commit 8ac1ee6f4d62e781e3b3fd8b9c42b70371427669 ]

Clang warns that the address of a pointer will always evaluated as true
in a boolean context:

drivers/net/ethernet/mellanox/mlx4/eq.c:243:11: warning: address of
array 'eq->affinity_mask' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        if (!eq->affinity_mask || cpumask_empty(eq->affinity_mask))
            ~~~~~^~~~~~~~~~~~~
1 warning generated.

Use cpumask_available, introduced in commit f7e30f01a9e2 ("cpumask: Add
helper cpumask_available()"), which does the proper checking and avoids
this warning.

Link: https://github.com/ClangBuiltLinux/linux/issues/86
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:37 +02:00
Michael Schmitz
6df8eb6ae2 Input: atakbd - fix Atari CapsLock behaviour
[ Upstream commit 52d2c7bf7c90217fbe875d2d76f310979c48eb83 ]

The CapsLock key on Atari keyboards is not a toggle, it does send the
normal make and break scancodes.

Drop the CapsLock toggle handling code, which did cause the CapsLock
key to merely act as a Shift key.

Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:37 +02:00
Andreas Schwab
d200ea2900 Input: atakbd - fix Atari keymap
[ Upstream commit 9e62df51be993035c577371ffee5477697a56aad ]

Fix errors in Atari keymap (mostly in keypad, help and undo keys).

Patch provided on debian-68k ML by Andreas Schwab <schwab@linux-m68k.org>,
keymap array size and unhandled scancode limit adjusted to 0x73 by me.

Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:37 +02:00
Keerthy
be7e497bf0 clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs
[ Upstream commit 3b7d96a0dbb6b630878597a1838fc39f808b761b ]

The 32k clocksource is NONSTOP for non-am43 SoCs. Hence
add the flag for all the other SoCs.

Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:37 +02:00
Jozef Balga
2a585d4450 media: af9035: prevent buffer overflow on write
[ Upstream commit 312f73b648626a0526a3aceebb0a3192aaba05ce ]

When less than 3 bytes are written to the device, memcpy is called with
negative array size which leads to buffer overflow and kernel panic. This
patch adds a condition and returns -EOPNOTSUPP instead.
Fixes bugzilla issue 64871

[mchehab+samsung@kernel.org: fix a merge conflict and changed the
 condition to match the patch's comment, e. g. len == 3 could
 also be valid]
Signed-off-by: Jozef Balga <jozef.balga@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:37 +02:00
Andy Lutomirski
4e7ef8fc80 x86/fpu: Finish excising 'eagerfpu'
commit e63650840e8b053aa09ad934877e87e9941ed135 upstream.

Now that eagerfpu= is gone, remove it from the docs and some
comments.  Also sync the changes to tools/.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/cf430dd4481d41280e93ac6cf0def1007a67fc8e.1476740397.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:37 +02:00
Rik van Riel
6e7d7bea15 x86/fpu: Remove struct fpu::counter
commit 3913cc3507575273beb165a5e027a081913ed507 upstream.

With the lazy FPU code gone, we no longer use the counter field
in struct fpu for anything. Get rid it.

Signed-off-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: pbonzini@redhat.com
Link: http://lkml.kernel.org/r/1475627678-20788-6-git-send-email-riel@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:37 +02:00
Andy Lutomirski
8c6b69cf4b x86/fpu: Remove use_eager_fpu()
commit c592b57347069abfc0dcad3b3a302cf882602597 upstream.

This removes all the obvious code paths that depend on lazy FPU mode.
It shouldn't change the generated code at all.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Rik van Riel <riel@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: pbonzini@redhat.com
Link: http://lkml.kernel.org/r/1475627678-20788-5-git-send-email-riel@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:37 +02:00