From: "K. Y. Srinivasan" <kys@microsoft.com>
To: gregkh@suse.de, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, virtualization@lists.osdl.org
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Abhishek Kane <v-abkane@microsoft.com>
Subject: [PATCH 15/49] Staging: hv: vmbus: Make vmbus an acpi bus driver
Date: Mon, 6 Jun 2011 15:49:39 -0700 [thread overview]
Message-ID: <1307400613-13234-15-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1307400613-13234-1-git-send-email-kys@microsoft.com>
Now, make the vmbus driver an ACPI bus driver.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
---
drivers/staging/hv/vmbus_drv.c | 56 ++++++---------------------------------
1 files changed, 9 insertions(+), 47 deletions(-)
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 5d7ecfd..176a8cd 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -39,7 +39,7 @@
#include "hyperv_vmbus.h"
-static struct pci_dev *hv_pci_dev;
+static struct acpi_device *hv_acpi_dev;
static struct tasklet_struct msg_dpc;
static struct tasklet_struct event_dpc;
@@ -49,7 +49,6 @@ EXPORT_SYMBOL(vmbus_loglevel);
/* (ALL_MODULES << 16 | DEBUG_LVL_ENTEREXIT); */
/* (((VMBUS | VMBUS_DRV)<<16) | DEBUG_LVL_ENTEREXIT); */
-static int pci_probe_error;
static struct completion probe_event;
static int irq;
@@ -553,7 +552,7 @@ static int vmbus_bus_init(int irq)
/* Get the interrupt resource */
ret = request_irq(irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
- driver_name, hv_pci_dev);
+ driver_name, hv_acpi_dev);
if (ret != 0) {
pr_err("Unable to request IRQ %d\n",
@@ -574,7 +573,7 @@ static int vmbus_bus_init(int irq)
on_each_cpu(hv_synic_init, (void *)&vector, 1);
ret = vmbus_connect();
if (ret) {
- free_irq(irq, hv_pci_dev);
+ free_irq(irq, hv_acpi_dev);
bus_unregister(&hv_bus);
goto cleanup;
}
@@ -674,7 +673,7 @@ int vmbus_child_device_register(struct hv_device *child_device_obj)
/* The new device belongs to this bus */
child_device_obj->device.bus = &hv_bus; /* device->dev.bus; */
- child_device_obj->device.parent = &hv_pci_dev->dev;
+ child_device_obj->device.parent = &hv_acpi_dev->dev;
child_device_obj->device.release = vmbus_device_release;
/*
@@ -731,6 +730,8 @@ static int vmbus_acpi_add(struct acpi_device *device)
{
acpi_status result;
+ hv_acpi_dev = device;
+
result =
acpi_walk_resources(device->handle, METHOD_NAME__CRS,
vmbus_walk_resources, &irq);
@@ -777,25 +778,6 @@ static void vmbus_acpi_exit(void)
}
-static int __devinit hv_pci_probe(struct pci_dev *pdev,
- const struct pci_device_id *ent)
-{
- hv_pci_dev = pdev;
-
- pci_probe_error = pci_enable_device(pdev);
- if (pci_probe_error)
- goto probe_cleanup;
-
- pci_probe_error = vmbus_bus_init(irq);
-
- if (pci_probe_error)
- pci_disable_device(pdev);
-
-probe_cleanup:
- complete(&probe_event);
- return pci_probe_error;
-}
-
/*
* We use a PCI table to determine if we should autoload this driver This is
* needed by distro tools to determine if the hyperv drivers should be
@@ -808,13 +790,7 @@ static const struct pci_device_id microsoft_hv_pci_table[] = {
};
MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table);
-static struct pci_driver hv_bus_driver = {
- .name = "hv_bus",
- .probe = hv_pci_probe,
- .id_table = microsoft_hv_pci_table,
-};
-
-static int __init hv_pci_init(void)
+static int __init hv_acpi_init(void)
{
int ret;
@@ -835,21 +811,7 @@ static int __init hv_pci_init(void)
return -ENODEV;
}
- vmbus_acpi_exit();
- init_completion(&probe_event);
- ret = pci_register_driver(&hv_bus_driver);
- if (ret)
- return ret;
- /*
- * All the vmbus initialization occurs within the
- * hv_pci_probe() function. Wait for hv_pci_probe()
- * to complete.
- */
- wait_for_completion(&probe_event);
-
- if (pci_probe_error)
- pci_unregister_driver(&hv_bus_driver);
- return pci_probe_error;
+ return vmbus_bus_init(irq);
}
@@ -857,4 +819,4 @@ MODULE_LICENSE("GPL");
MODULE_VERSION(HV_DRV_VERSION);
module_param(vmbus_loglevel, int, S_IRUGO|S_IWUSR);
-module_init(hv_pci_init);
+module_init(hv_acpi_init);
--
1.7.4.1
next prev parent reply other threads:[~2011-06-06 22:44 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-06 22:49 [PATCH 00/49] Staging: hv: Driver cleanup K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 01/49] Staging: hv: vmbus: In vmbus_child_driver_unregister() don't set the bus field to NULL K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 02/49] Staging: hv: storvsc: Cleanup the exit function in storvsc_drv.c K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 03/49] Staging: hv: storvsc: Cleanup the module init " K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 04/49] Staging: hv: storvsc: Fix a bug in the storvsc_remove() function K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 05/49] Staging: hv: storvsc: Cleanup some dated/unnecessary comments K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 06/49] Staging: hv: stor: Get rid of unnecessary DPRINTs in stor vsc_drv.c K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 07/49] Staging: hv: stor: Rename the vriable gStorVscDeviceType in storvsc_drv.c K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 08/49] Staging: hv: stor: Get rid of the unused initialization of the name field K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 09/49] Staging: hv: blk: " K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 10/49] Staging: hv: mouse: " K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 11/49] Staging: hv: vmbus: Don't free the channel when the channel is closed K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 12/49] Staging: hv: storvsc: Add a DMI signature to support auto-loading K. Y. Srinivasan
2011-06-06 23:12 ` Christoph Hellwig
2011-06-07 14:54 ` KY Srinivasan
2011-06-07 18:58 ` Greg KH
2011-06-07 22:19 ` KY Srinivasan
2011-06-07 22:24 ` Greg KH
2011-06-08 2:44 ` KY Srinivasan
2011-06-08 16:22 ` Greg KH
2011-06-06 22:49 ` [PATCH 13/49] Staging: hv: vmbus: Change the signature of vmbus_bus_init() K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 14/49] Staging: hv: vmbus: Use the DSDT specified irq for vmbus K. Y. Srinivasan
2011-06-06 22:49 ` K. Y. Srinivasan [this message]
2011-06-07 20:44 ` [PATCH 15/49] Staging: hv: vmbus: Make vmbus an acpi bus driver Greg KH
2011-06-06 22:49 ` [PATCH 16/49] Staging: hv: vmbus: Get rid of vmbus_acpi_init() by inlining the code K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 17/49] Staging: hv: vmbus: Get rid of vmbus_acpi_exit() " K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 18/49] Staging: hv: vmbus: Add the DSDT _HID name as well K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 19/49] Staging: hv: blkvsc: Fix bugs in the module unload path K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 20/49] Staging: hv: blkvsc: We don't support removable media; get rid of unnecessary state K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 21/49] Staging: hv: vmbus: Get rid of the timer based handling of channel events K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 22/49] Staging: hv: vmbus: Get rid of the call to dump channel state in channel event handler K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 23/49] Staging: hv: vmbus: Directly invoke the channel callback K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 24/49] Staging: hv: vmbus: Get rid of the unused wrapper - vmbus_onchannel_event() K. Y. Srinivasan
2011-06-06 23:15 ` Christoph Hellwig
2011-06-07 14:59 ` KY Srinivasan
2011-06-07 18:58 ` Greg KH
2011-06-07 19:58 ` KY Srinivasan
2011-06-07 20:09 ` Greg KH
2011-06-06 22:49 ` [PATCH 25/49] Staging: hv: vmbus: Get rid of unneeded calls to dump_vmbus_channel K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 26/49] Staging: hv: vmbus: Get rid of the poll timer in the channel state K. Y. Srinivasan
2011-06-06 23:15 ` Christoph Hellwig
2011-06-06 22:49 ` [PATCH 27/49] Staging: hv: vmbus: Fix the memory barrier in hv_ringbuffer_read() K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 28/49] Staging: hv: vmbus: Introduce read dependency in hv_get_ringbuffer_availbytes() K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 29/49] Staging: hv: vmbus: Change the memory barrier in hv_ringbuffer_write() K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 30/49] Staging: hv: vmbus: Get rid of the unused function vmbus_ontimer() K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 31/49] Staging: hv: vmbus: Get rid of some dated comments in channel.c K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 32/49] Staging: hv: vmbus: Correct " K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 33/49] Staging: hv: vmbus: Move the definition of struct vmbus_channel K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 34/49] Staging: hv: vmbus: Embed the state needed to close the channel K. Y. Srinivasan
2011-06-06 22:49 ` [PATCH 35/49] Staging: hv: vmbus: Use the newly introduced state in closing " K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 36/49] Staging: hv: vmbus: Get rid of a dated comment in vmbus_drv.c K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 37/49] Staging: hv: vmbus: Get rid of an unused function in connection.c K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 38/49] Staging: hv: vmbus: Get rid of a dated comment in channel_mgmt.c K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 39/49] Staging: hv: vmbus: Fix a memory barrier call in vmbus_drv.c K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 40/49] Staging: hv: vmbus: Rename local variables " K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 41/49] Staging: hv: vmbus: Increase the timeout for some critical calls K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 42/49] Staging: hv: vmbus: Properly handle memory allocation failure in channel.c K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 43/49] Staging: hv: vmbus: Cleanup some error codes in vmbus_drv.c K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 44/49] Staging: hv: vmbus: Cleanup error handling in vmbus_bus_init() K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 45/49] Staging: hv: vmbus: Cleanup error codes in hv.c K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 46/49] Staging: hv: vmbus: Cleanup error codes in connection.c K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 47/49] Staging: hv: vmbus: Cleanup some error values in channel.c K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 48/49] Staging: hv: vmbus: Change Cleanup to cleanup " K. Y. Srinivasan
2011-06-06 22:50 ` [PATCH 49/49] Staging: hv: vmbus: Increase the timeout value in vmbus_request_offers() K. Y. Srinivasan
2011-06-07 20:45 ` Greg KH
2011-06-07 21:20 ` KY Srinivasan
2011-06-07 21:28 ` Greg KH
2011-06-07 21:39 ` KY Srinivasan
2011-06-07 20:48 ` [PATCH 00/49] Staging: hv: Driver cleanup Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1307400613-13234-15-git-send-email-kys@microsoft.com \
--to=kys@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@suse.de \
--cc=haiyangz@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=v-abkane@microsoft.com \
--cc=virtualization@lists.osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome