OSDN Git Service

uio_hv_generic: defer opening vmbus until first use
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 14 Sep 2018 16:10:20 +0000 (09:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Sep 2018 18:33:24 +0000 (20:33 +0200)
commitcdfa835c6e5e87d145f9f632b58843de97509f2b
treeb7ae393e6ef9425d64975cc117a4727d75dc4425
parent9da197f1df40c838f0f06abf94cd23b4ed81e522
uio_hv_generic: defer opening vmbus until first use

This fixes two design flaws in hv_uio_generic.

Since hv_uio_probe is called from vmbus_probe with lock held
it potentially can cause sleep in an atomic section because
vmbus_open will wait for response from host.

The hv_uio_generic driver could not handle applications
exiting and restarting because the vmbus channel was
persistent.  Change the semantics so that the buffers are
allocated on probe, but not attached to host until
device is opened.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio_hv_generic.c