Drivers: hv: vmbus: Cleanup hv_post_message()
commit897ede3425a094a37cc6f1a34560de05aec7fdcd
authorK. Y. Srinivasan <kys@microsoft.com>
Fri, 29 Aug 2014 01:29:52 +0000 (28 18:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Oct 2014 16:40:13 +0000 (30 09:40 -0700)
tree337259676b0fe7f50018aecf8bdda98e1d9b06eb
parent7ff8dd5262d4d1b9cd002c4c03d5e00aa30d1b35
Drivers: hv: vmbus: Cleanup hv_post_message()

commit b29ef3546aecb253a5552b198cef23750d56e1e4 upstream.

Minimize failures in this function by pre-allocating the buffer
for posting messages. The hypercall for posting the message can fail
for a number of reasons:

        1. Transient resource related issues
        2. Buffer alignment
        3. Buffer cannot span a page boundry

We address issues 2 and 3 by preallocating a per-cpu page for the buffer.
Transient resource related failures are handled by retrying by the callers
of this function.

This patch is based on the investigation
done by Dexuan Cui <decui@microsoft.com>.

I would like to thank Sitsofe Wheeler <sitsofe@yahoo.com>
for reporting the issue and helping in debuggging.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/hv.c
drivers/hv/hyperv_vmbus.h