]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Drivers: hv: fcopy: switch to using the hvutil_device_state state machine
authorVitaly Kuznetsov <vkuznets@redhat.com>
Sun, 12 Apr 2015 01:07:49 +0000 (18:07 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 26 Feb 2016 02:28:39 +0000 (18:28 -0800)
commit70acd6fec229cacaa718e9ad045d087cb927e86c
treed5a932b9127d491f1b4a644d00d5a8c41a672200
parent490d9ef7930cf36d32262964f7e6500cddfbd58f
Drivers: hv: fcopy: switch to using the hvutil_device_state state machine

Switch to using the hvutil_device_state state machine from using 3 different state variables:
fcopy_transaction.active, opened, and in_hand_shake.

State transitions are:
-> HVUTIL_DEVICE_INIT when driver loads or on device release
-> HVUTIL_READY if the handshake was successful
-> HVUTIL_HOSTMSG_RECEIVED when there is a non-negotiation message from the host
-> HVUTIL_USERSPACE_REQ after userspace daemon read the message
   -> HVUTIL_USERSPACE_RECV after/if userspace has replied
-> HVUTIL_READY after we respond to the host
-> HVUTIL_DEVICE_DYING on driver unload

In hv_fcopy_onchannelcallback() process ICMSGTYPE_NEGOTIATE messages even when
the userspace daemon is disconnected, otherwise we can make the host think
we don't support FCOPY and disable the service completely.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Tested-by: Alex Ng <alexng@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4c93ccccf47e32d605b81207eb575cce3b12facc)

Orabug: 21886720
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
drivers/hv/hv_fcopy.c