Commit graph

603253 commits

Author SHA1 Message Date
Rajasekaran Kalidoss
7a18627fbf cnss2: call remove driver_ops in cnss_wlan_unregister
rmmod of wlan triggers cnss_wlan_unregister. wlan driver_ops
remove should be called for QCN7605 standalone and
composite devices to finish the rmmod path.

Change-Id: I0047eb65b68b7e81b9b9c9fd79825a0d3f27c640
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2018-10-30 01:46:39 -07:00
Yajun Li
67b38b0496 soc: hab: Fix a memory leakage when unexport
When the remote vchan is closed and unexport happens
in local at the same time, function hab_get_vchan_fromvcid
will return null in hab unexport, which will cause memory leak.

Change-Id: I8dac4f4154f24734dc2a11aa73f726cd705cc291
Signed-off-by: Yajun Li <yajunl@codeaurora.org>
2018-10-30 16:27:47 +08:00
Yajun Li
32782582c3 soc: hab: fix uninitialized variable and relocate vchan refcnt
Init hab msg pointer to avoid accessing an uninitialized
pointer.

The format specifier "%p" can leak kernel addresses. Use
"%pK" instead.

Check the status of the pfn_table, because of wrong pagetable
coming from the corresponding hab client unexpectedly.

Change-Id: Ic8c6ba0243d27007d014165f2869a5775a96c09d
Signed-off-by: Yajun Li <yajunl@codeaurora.org>
2018-10-30 15:54:26 +08:00
Linux Build Service Account
0773fb50d4 Merge "ASoC: msm: PP event handling support for loopback driver" into msm-4.4 2018-10-29 11:11:00 -07:00
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
E V Ravi
8b482a3f50 ais: cam_soc_api: Moved the Debug statement to the if-condition
Debug statement is dereferencing a pointer with vdd_info[i]->vdd
Though it is debug statement, it might dereference a null pointer.

Change-Id: Id2c3bb9ccc6ed6d23d7da54bb3b4364009ebb1aa
Signed-off-by: E V Ravi <evenka@codeaurora.org>
2018-10-29 17:25:55 +05:30
Madhanraj Chelladurai
363aa31036 pps: DR_SYNC pulse needs to be connected to Linux PPS driver
DR_SYNC pulse needs to be connected to Linux PPS driver for
GNSS driver to receive pps_event. DR_SYNC pulse is generated
by GSS firmware in modem, GNSS driver needs to receive
pps_event of this pulse to get the kernel timestamp to
synchronize time/data to finer quality.

Change-Id: I1c686fcf6306e890cc0a5c3296cdcaff49282e2f
CRs-Fixed: 1068214
Signed-off-by: Madhanraj Chelladurai <mchellad@codeaurora.org>
2018-10-29 04:09:45 -07:00
puneet
a552ff86f3 ARCH: arm: defconfig: BMI160 and IAM20680 sensor enablement
Enabled the bmi160 & iam20680 sensor code compilation

Change-Id: I69db96c17eb361f96beab3053c3bca22cd2a38c8
Signed-off-by: puneet <puneet@codeaurora.org>
2018-10-29 04:04:20 -07:00
puneet
01b30f1206 drivers: iio: imu: enabled bmi and iam sensor compilation
Did makefile changes to allow the sensor driver compilation

Change-Id: I435597d950fe789faffbf65e278bcafa8b4ca184
Signed-off-by: puneet <puneet@codeaurora.org>
2018-10-29 04:03:37 -07:00
Deepak Kumar
82150f24c0 msm: kgsl: Don't halt dispatcher if device is not in SUSPEND state
Add a check to make sure device actually transitioned to SUSPEND
state before halting dispatcher in adreno_suspend_device function.
kgsl_pwrctrl_change_state(device,KGSL_STATE_SUSPEND) in
kgsl_suspend_device can return zero without actually changing state
to SUSPEND if device state is NONE or INIT.

Change-Id: I4a5a69007c71651ea2cf7fa7360c960c6856031e
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
2018-10-29 15:14:01 +05:30
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
Yimin Peng
bff5aad709 ARM: dts: msm: Add pcie-ep device for msm8996
With the pcie-ep device, pcie0 can work in endpoint mode.
But it's disabled by default for the function conflict with
pcie0 in host mode.

Change-Id: Ia39edf8dd8fc2a1b3ed79db13aa6f85065ebf7b0
Signed-off-by: Yimin Peng <yiminp@codeaurora.org>
2018-10-24 17:32:21 +08:00
Yimin Peng
ef6d23ad26 msm: ep_pcie: add PCIe endpoint driver for 8996AU
The MSM PCIE core is enabled in endpoint mode and handles the
link from PCIE root complex on host side.

Change-Id: I5a23ea1a41fede2d57850ff032bf2b1a92d02463
Signed-off-by: Yimin Peng <yiminp@codeaurora.org>
2018-10-24 17:11:18 +08: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
E V Ravi
6bf50d959e msm: ais: Fix arbitrary kernel write
In 64 bit kernel and 32 bit userspace,ioctl_ptr from
kernel space, should NOT call the copy_from_user.
In 64 bit kernel and 64 bit userspace,ioctl_ptr from
user space, use the copy_from_user to copy data.
use the is_compat_task to distinguish two condition

Change-Id: Ib420168bbae1b7f950a1124f3e54b48d434952ca
Signed-off-by: E V Ravi <evenka@codeaurora.org>
2018-10-24 12:56:41 +05:30
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
Rahul Sharma
ce5921891b ASoC: msm: PP event handling support for loopback driver
Adding mixer controls for supporting PP evnets in
loopback driver

Change-Id: Ibdcbaa4180fea3bd885b67af4b2a211380279b4e
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
2018-10-22 09:56:01 +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
Chao Bi
69cca92b8e soc: qcom: hab: benchmark cross VM schdule latency
Develop a mechanism to measure the latency of cross-vm scheduling.
It makes use of mpm_timer and leverage hab driver to record the time
when previous vm is scheduled out and when next vm is schduled in,
and pass these values to habtest to calculate the latency of schduling.

Change-Id: I0051d5a42979826b8e249ac704fcc7ed87d8d581
Signed-off-by: Chao Bi <chaobi@codeaurora.org>
2018-10-22 09:55:40 +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