From patchwork Wed Mar 30 23:48:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jake Oshins X-Patchwork-Id: 8705411 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E87E3C0553 for ; Wed, 30 Mar 2016 22:13:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 17F1A2037E for ; Wed, 30 Mar 2016 22:13:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F33F20253 for ; Wed, 30 Mar 2016 22:13:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753860AbcC3WLv (ORCPT ); Wed, 30 Mar 2016 18:11:51 -0400 Received: from p3plsmtps2ded04.prod.phx3.secureserver.net ([208.109.80.198]:34420 "EHLO p3plsmtps2ded04.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753420AbcC3WLu (ORCPT ); Wed, 30 Mar 2016 18:11:50 -0400 Received: from linuxonhyperv.com ([72.167.245.219]) by : HOSTING RELAY : with SMTP id lOI8aWUdlmYAClOI8ab7hb; Wed, 30 Mar 2016 15:08:44 -0700 x-originating-ip: 72.167.245.219 Received: by linuxonhyperv.com (Postfix, from userid 520) id DA881190304; Wed, 30 Mar 2016 16:49:08 -0700 (PDT) From: Jake Oshins To: linux-pci@vger.kernel.org, gregkh@linuxfoundation.org, kys@microsoft.com, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, haiyangz@microsoft.com, haddenh@microsoft.com Cc: Jake Oshins Subject: [PATCH v2 2/7] drivers:hv: Make a function to free mmio regions through vmbus Date: Wed, 30 Mar 2016 16:48:42 -0700 Message-Id: <1459381727-25039-3-git-send-email-jakeo@microsoft.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1459381727-25039-1-git-send-email-jakeo@microsoft.com> References: <1459381727-25039-1-git-send-email-jakeo@microsoft.com> X-CMAE-Envelope: MS4wfFFCr6np+pDuroh0PM09J2TJl9tfuxYE+ZzocMYLCrlzbaGNepUv5YRM1CL38rObxAktFeOWcUTstJrgZ7JPGNk+j8gR9cJ6/rixiyfTtptMS0ZZBYTL pk6Jo4MsokYEvk6QWsEbrqim4E+LPL98/sN6DpOi1X48QmI+d1eM2j7e+VRBCttVgacsPLISEcNw/uQXxPWRsfoTwS9hxQEEZwdCRzojHdOFc3Ap2coC9Smi L74MdR+gKD3emUFlzZMB3RWYoudRLeFZf/Lua/GCK2gD2IjCW61KP2uJ8fK5jU6JtuAJ0qM3Dq6iNUlFozhaWH8r8tex3ZX4DmVo5Pp5ilk2xvKCLPZ2wf+G xFzRiQd/EhGM0yJ2TxP4BZJ0gYQguFiPB5Mn3JEyCx3XdO1JfDvuLjyUq26SwPQokGcINMm05XbmuTAhoC17dSeHxY6SQDM+Dykuv0JkFoGH7PI2NCnBE6lM qeDCadb0gtvsz/BBfLyySBLVXPCuf7JEwCJ4CJkCqDN+tBItpgtrT7E6czY= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces a function that reverses everything done by vmbus_allocate_mmio(). Existing code just called release_mem_region(). Future patches in this series require a more complex sequence of actions, so this function is introduced to wrap those actions. Signed-off-by: Jake Oshins --- drivers/hv/vmbus_drv.c | 15 +++++++++++++++ include/linux/hyperv.h | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 799518b..60553c1 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1188,6 +1188,21 @@ exit: EXPORT_SYMBOL_GPL(vmbus_allocate_mmio); /** + * vmbus_free_mmio() - Free a memory-mapped I/O range. + * @start: Base address of region to release. + * @size: Size of the range to be allocated + * + * This function releases anything requested by + * vmbus_mmio_allocate(). + */ +void vmbus_free_mmio(resource_size_t start, resource_size_t size) +{ + release_mem_region(start, size); + +} +EXPORT_SYMBOL_GPL(vmbus_free_mmio); + +/** * vmbus_cpu_number_to_vp_number() - Map CPU to VP. * @cpu_number: CPU number in Linux terms * diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index aa0fadc..ecd81c3 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -1091,7 +1091,7 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj, resource_size_t min, resource_size_t max, resource_size_t size, resource_size_t align, bool fb_overlap_ok); - +void vmbus_free_mmio(resource_size_t start, resource_size_t size); int vmbus_cpu_number_to_vp_number(int cpu_number); u64 hv_do_hypercall(u64 control, void *input, void *output);