RE: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver
-Original Message- From: Greg KH [mailto:gre...@suse.de] Sent: Sunday, March 13, 2011 11:25 PM To: KY Srinivasan Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; virtualizat...@lists.osdl.org; Haiyang Zhang; Mike Sterling; Abhishek Kane (Mindtree Consulting PVT LTD); Hank Janssen Subject: Re: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver On Sat, Mar 12, 2011 at 11:23:05PM +, KY Srinivasan wrote: Greg, I have redone this patch as well as [PATCH 12/21]. Do you want me send you just these two patches or the entire series including these two. Just resend those two patches if that is easier. Will do. Also, does this patch-set address all of architectural issues you had noted earlier in the vmbus core. Please let us know what else needs to be done to exit staging as far as the vmbus driver is concerned. I want get a head start before the new week begins! Also, we have patches ready for all DPRINT cleanup. Hank is holding them off until we finish addressing the architectural issues first. I do not know if this addresses everything, sorry, I have not had the time to review all of them yet. Give me a few days at the least to go over them and apply them before I will be able to tell you this. Thanks for taking the time to look at this. Also note that there shouldn't be anything holding back the DPRINT stuff, why wait? If they apply on top of yours that should be fine, right? You are right. We will submit the DPRINT patches soon. Regards, K. Y ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization
Re: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver
On Thu, Mar 10, 2011 at 02:08:32PM -0800, K. Y. Srinivasan wrote: Make vmbus driver a platform pci driver. This is in preparation to cleaning up irq allocation for this driver. Now wouldn't this be the root device that everything else hangs off of? Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Mike Sterling mike.sterl...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com --- drivers/staging/hv/vmbus_drv.c | 63 +++- 1 files changed, 36 insertions(+), 27 deletions(-) diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c index 8b9394a..e4855ac 100644 --- a/drivers/staging/hv/vmbus_drv.c +++ b/drivers/staging/hv/vmbus_drv.c @@ -43,6 +43,8 @@ static struct device *root_dev; /* Root device */ +struct pci_dev *hv_pci_dev; Why do you have 2 different devices here? Is the root_dev still needed now? Still confused, greg k-h ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization
Re: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver
On Sat, Mar 12, 2011 at 11:23:05PM +, KY Srinivasan wrote: Greg, I have redone this patch as well as [PATCH 12/21]. Do you want me send you just these two patches or the entire series including these two. Just resend those two patches if that is easier. Also, does this patch-set address all of architectural issues you had noted earlier in the vmbus core. Please let us know what else needs to be done to exit staging as far as the vmbus driver is concerned. I want get a head start before the new week begins! Also, we have patches ready for all DPRINT cleanup. Hank is holding them off until we finish addressing the architectural issues first. I do not know if this addresses everything, sorry, I have not had the time to review all of them yet. Give me a few days at the least to go over them and apply them before I will be able to tell you this. Also note that there shouldn't be anything holding back the DPRINT stuff, why wait? If they apply on top of yours that should be fine, right? thanks, greg k-h ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization
RE: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver
-Original Message- From: Greg KH [mailto:gre...@suse.de] Sent: Thursday, March 10, 2011 5:33 PM To: KY Srinivasan Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; virtualizat...@lists.osdl.org; Haiyang Zhang; Mike Sterling; Abhishek Kane (Mindtree Consulting PVT LTD); Hank Janssen Subject: Re: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver On Thu, Mar 10, 2011 at 10:28:27PM +, KY Srinivasan wrote: -Original Message- From: Greg KH [mailto:gre...@suse.de] Sent: Thursday, March 10, 2011 5:21 PM To: KY Srinivasan Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; virtualizat...@lists.osdl.org; Haiyang Zhang; Mike Sterling; Abhishek Kane (Mindtree Consulting PVT LTD); Hank Janssen Subject: Re: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver On Thu, Mar 10, 2011 at 02:08:32PM -0800, K. Y. Srinivasan wrote: Make vmbus driver a platform pci driver. This is in preparation to cleaning up irq allocation for this driver. The idea is nice, but the nameing is a bit confusing. We have platform drivers which are much different from what you are doing here, you are just creating a normal pci driver. Very minor comments below. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Mike Sterling mike.sterl...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com --- drivers/staging/hv/vmbus_drv.c | 63 +++ - 1 files changed, 36 insertions(+), 27 deletions(-) diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c index 8b9394a..e4855ac 100644 --- a/drivers/staging/hv/vmbus_drv.c +++ b/drivers/staging/hv/vmbus_drv.c @@ -43,6 +43,8 @@ static struct device *root_dev; /* Root device */ +struct pci_dev *hv_pci_dev; + /* Main vmbus driver data structure */ struct vmbus_driver_context { @@ -887,36 +889,24 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id) } } -static struct dmi_system_id __initdata microsoft_hv_dmi_table[] = { - { - .ident = Hyper-V, - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, Microsoft Corporation), - DMI_MATCH(DMI_PRODUCT_NAME, Virtual Machine), - DMI_MATCH(DMI_BOARD_NAME, Virtual Machine), - }, - }, - { }, -}; -MODULE_DEVICE_TABLE(dmi, microsoft_hv_dmi_table); You're sure it's safe to delete this now and just rely on the PCI ids, right? For some wierd reason I thought we needed both to catch all types of systems, but I can't remember why. I have tested this; I don't think we need the dmi table. Ok, if you are sure, that's fine with me. How about hv_bus as a name, as that's what this really is. It's a bus adapter, like USB, Firewire, and all sorts of other bus controllers. Sure; I will make these changes. Would you mind if I submit these name changes as a separate patch. How about just redo this patch? I haven't reviewed the others yet, so you might want to wait a day to see if I don't like any of them either :) Greg, I have redone this patch as well as [PATCH 12/21]. Do you want me send you just these two patches or the entire series including these two. Also, does this patch-set address all of architectural issues you had noted earlier in the vmbus core. Please let us know what else needs to be done to exit staging as far as the vmbus driver is concerned. I want get a head start before the new week begins! Also, we have patches ready for all DPRINT cleanup. Hank is holding them off until we finish addressing the architectural issues first. Regards, K. Y ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization
Re: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver
On Thu, Mar 10, 2011 at 02:08:32PM -0800, K. Y. Srinivasan wrote: Make vmbus driver a platform pci driver. This is in preparation to cleaning up irq allocation for this driver. The idea is nice, but the nameing is a bit confusing. We have platform drivers which are much different from what you are doing here, you are just creating a normal pci driver. Very minor comments below. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Mike Sterling mike.sterl...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com --- drivers/staging/hv/vmbus_drv.c | 63 +++- 1 files changed, 36 insertions(+), 27 deletions(-) diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c index 8b9394a..e4855ac 100644 --- a/drivers/staging/hv/vmbus_drv.c +++ b/drivers/staging/hv/vmbus_drv.c @@ -43,6 +43,8 @@ static struct device *root_dev; /* Root device */ +struct pci_dev *hv_pci_dev; + /* Main vmbus driver data structure */ struct vmbus_driver_context { @@ -887,36 +889,24 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id) } } -static struct dmi_system_id __initdata microsoft_hv_dmi_table[] = { - { - .ident = Hyper-V, - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, Microsoft Corporation), - DMI_MATCH(DMI_PRODUCT_NAME, Virtual Machine), - DMI_MATCH(DMI_BOARD_NAME, Virtual Machine), - }, - }, - { }, -}; -MODULE_DEVICE_TABLE(dmi, microsoft_hv_dmi_table); You're sure it's safe to delete this now and just rely on the PCI ids, right? For some wierd reason I thought we needed both to catch all types of systems, but I can't remember why. -static int __init vmbus_init(void) + +static int __devinit hv_pci_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) { - DPRINT_INFO(VMBUS_DRV, - Vmbus initializing current log level 0x%x (%x,%x), - vmbus_loglevel, HIWORD(vmbus_loglevel), LOWORD(vmbus_loglevel)); - /* Todo: it is used for loglevel, to be ported to new kernel. */ + int err; - if (!dmi_check_system(microsoft_hv_dmi_table)) - return -ENODEV; + hv_pci_dev = pdev; - return vmbus_bus_init(); -} + err = pci_enable_device(pdev); + if (err) + return err; -static void __exit vmbus_exit(void) -{ - vmbus_bus_exit(); - /* Todo: it is used for loglevel, to be ported to new kernel. */ + err = vmbus_bus_init(); + if (err) + pci_disable_device(pdev); + + return err; } /* @@ -931,10 +921,29 @@ static const struct pci_device_id microsoft_hv_pci_table[] = { }; MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table); +static struct pci_driver platform_driver = { hv_bus_driver? + .name = hv-platform-pci, How about hv_bus as a name, as that's what this really is. It's a bus adapter, like USB, Firewire, and all sorts of other bus controllers. + .probe = hv_pci_probe, + .id_table = microsoft_hv_pci_table, +}; + +static int __init hv_pci_init(void) +{ + return pci_register_driver(platform_driver); +} + +static void __exit hv_pci_exit(void) +{ + vmbus_bus_exit(); + pci_unregister_driver(platform_driver); +} + + + MODULE_LICENSE(GPL); MODULE_VERSION(HV_DRV_VERSION); module_param(vmbus_irq, int, S_IRUGO); module_param(vmbus_loglevel, int, S_IRUGO); -module_init(vmbus_init); -module_exit(vmbus_exit); +module_init(hv_pci_init); +module_exit(hv_pci_exit); -- 1.5.5.6 ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization
RE: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver
-Original Message- From: Greg KH [mailto:gre...@suse.de] Sent: Thursday, March 10, 2011 5:21 PM To: KY Srinivasan Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; virtualizat...@lists.osdl.org; Haiyang Zhang; Mike Sterling; Abhishek Kane (Mindtree Consulting PVT LTD); Hank Janssen Subject: Re: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver On Thu, Mar 10, 2011 at 02:08:32PM -0800, K. Y. Srinivasan wrote: Make vmbus driver a platform pci driver. This is in preparation to cleaning up irq allocation for this driver. The idea is nice, but the nameing is a bit confusing. We have platform drivers which are much different from what you are doing here, you are just creating a normal pci driver. Very minor comments below. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Mike Sterling mike.sterl...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com --- drivers/staging/hv/vmbus_drv.c | 63 +++- 1 files changed, 36 insertions(+), 27 deletions(-) diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c index 8b9394a..e4855ac 100644 --- a/drivers/staging/hv/vmbus_drv.c +++ b/drivers/staging/hv/vmbus_drv.c @@ -43,6 +43,8 @@ static struct device *root_dev; /* Root device */ +struct pci_dev *hv_pci_dev; + /* Main vmbus driver data structure */ struct vmbus_driver_context { @@ -887,36 +889,24 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id) } } -static struct dmi_system_id __initdata microsoft_hv_dmi_table[] = { - { - .ident = Hyper-V, - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, Microsoft Corporation), - DMI_MATCH(DMI_PRODUCT_NAME, Virtual Machine), - DMI_MATCH(DMI_BOARD_NAME, Virtual Machine), - }, - }, - { }, -}; -MODULE_DEVICE_TABLE(dmi, microsoft_hv_dmi_table); You're sure it's safe to delete this now and just rely on the PCI ids, right? For some wierd reason I thought we needed both to catch all types of systems, but I can't remember why. I have tested this; I don't think we need the dmi table. -static int __init vmbus_init(void) + +static int __devinit hv_pci_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) { - DPRINT_INFO(VMBUS_DRV, - Vmbus initializing current log level 0x%x (%x,%x), - vmbus_loglevel, HIWORD(vmbus_loglevel), LOWORD(vmbus_loglevel)); - /* Todo: it is used for loglevel, to be ported to new kernel. */ + int err; - if (!dmi_check_system(microsoft_hv_dmi_table)) - return -ENODEV; + hv_pci_dev = pdev; - return vmbus_bus_init(); -} + err = pci_enable_device(pdev); + if (err) + return err; -static void __exit vmbus_exit(void) -{ - vmbus_bus_exit(); - /* Todo: it is used for loglevel, to be ported to new kernel. */ + err = vmbus_bus_init(); + if (err) + pci_disable_device(pdev); + + return err; } /* @@ -931,10 +921,29 @@ static const struct pci_device_id microsoft_hv_pci_table[] = { }; MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table); +static struct pci_driver platform_driver = { hv_bus_driver? + .name = hv-platform-pci, How about hv_bus as a name, as that's what this really is. It's a bus adapter, like USB, Firewire, and all sorts of other bus controllers. Sure; I will make these changes. Would you mind if I submit these name changes as a separate patch. Regards, K. Y ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization
Re: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver
On Thu, Mar 10, 2011 at 10:28:27PM +, KY Srinivasan wrote: -Original Message- From: Greg KH [mailto:gre...@suse.de] Sent: Thursday, March 10, 2011 5:21 PM To: KY Srinivasan Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; virtualizat...@lists.osdl.org; Haiyang Zhang; Mike Sterling; Abhishek Kane (Mindtree Consulting PVT LTD); Hank Janssen Subject: Re: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver On Thu, Mar 10, 2011 at 02:08:32PM -0800, K. Y. Srinivasan wrote: Make vmbus driver a platform pci driver. This is in preparation to cleaning up irq allocation for this driver. The idea is nice, but the nameing is a bit confusing. We have platform drivers which are much different from what you are doing here, you are just creating a normal pci driver. Very minor comments below. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Mike Sterling mike.sterl...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com --- drivers/staging/hv/vmbus_drv.c | 63 +++- 1 files changed, 36 insertions(+), 27 deletions(-) diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c index 8b9394a..e4855ac 100644 --- a/drivers/staging/hv/vmbus_drv.c +++ b/drivers/staging/hv/vmbus_drv.c @@ -43,6 +43,8 @@ static struct device *root_dev; /* Root device */ +struct pci_dev *hv_pci_dev; + /* Main vmbus driver data structure */ struct vmbus_driver_context { @@ -887,36 +889,24 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id) } } -static struct dmi_system_id __initdata microsoft_hv_dmi_table[] = { - { - .ident = Hyper-V, - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, Microsoft Corporation), - DMI_MATCH(DMI_PRODUCT_NAME, Virtual Machine), - DMI_MATCH(DMI_BOARD_NAME, Virtual Machine), - }, - }, - { }, -}; -MODULE_DEVICE_TABLE(dmi, microsoft_hv_dmi_table); You're sure it's safe to delete this now and just rely on the PCI ids, right? For some wierd reason I thought we needed both to catch all types of systems, but I can't remember why. I have tested this; I don't think we need the dmi table. Ok, if you are sure, that's fine with me. How about hv_bus as a name, as that's what this really is. It's a bus adapter, like USB, Firewire, and all sorts of other bus controllers. Sure; I will make these changes. Would you mind if I submit these name changes as a separate patch. How about just redo this patch? I haven't reviewed the others yet, so you might want to wait a day to see if I don't like any of them either :) Regards, K. Y ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization
RE: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver
-Original Message- From: Greg KH [mailto:gre...@suse.de] Sent: Thursday, March 10, 2011 5:33 PM To: KY Srinivasan Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; virtualizat...@lists.osdl.org; Haiyang Zhang; Mike Sterling; Abhishek Kane (Mindtree Consulting PVT LTD); Hank Janssen Subject: Re: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver On Thu, Mar 10, 2011 at 10:28:27PM +, KY Srinivasan wrote: -Original Message- From: Greg KH [mailto:gre...@suse.de] Sent: Thursday, March 10, 2011 5:21 PM To: KY Srinivasan Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; virtualizat...@lists.osdl.org; Haiyang Zhang; Mike Sterling; Abhishek Kane (Mindtree Consulting PVT LTD); Hank Janssen Subject: Re: [PATCH 11/21] Staging: hv: Make vmbus driver a platform pci driver On Thu, Mar 10, 2011 at 02:08:32PM -0800, K. Y. Srinivasan wrote: Make vmbus driver a platform pci driver. This is in preparation to cleaning up irq allocation for this driver. The idea is nice, but the nameing is a bit confusing. We have platform drivers which are much different from what you are doing here, you are just creating a normal pci driver. Very minor comments below. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Mike Sterling mike.sterl...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com --- drivers/staging/hv/vmbus_drv.c | 63 +++ - 1 files changed, 36 insertions(+), 27 deletions(-) diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c index 8b9394a..e4855ac 100644 --- a/drivers/staging/hv/vmbus_drv.c +++ b/drivers/staging/hv/vmbus_drv.c @@ -43,6 +43,8 @@ static struct device *root_dev; /* Root device */ +struct pci_dev *hv_pci_dev; + /* Main vmbus driver data structure */ struct vmbus_driver_context { @@ -887,36 +889,24 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id) } } -static struct dmi_system_id __initdata microsoft_hv_dmi_table[] = { - { - .ident = Hyper-V, - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, Microsoft Corporation), - DMI_MATCH(DMI_PRODUCT_NAME, Virtual Machine), - DMI_MATCH(DMI_BOARD_NAME, Virtual Machine), - }, - }, - { }, -}; -MODULE_DEVICE_TABLE(dmi, microsoft_hv_dmi_table); You're sure it's safe to delete this now and just rely on the PCI ids, right? For some wierd reason I thought we needed both to catch all types of systems, but I can't remember why. I have tested this; I don't think we need the dmi table. Ok, if you are sure, that's fine with me. How about hv_bus as a name, as that's what this really is. It's a bus adapter, like USB, Firewire, and all sorts of other bus controllers. Sure; I will make these changes. Would you mind if I submit these name changes as a separate patch. How about just redo this patch? I haven't reviewed the others yet, so you might want to wait a day to see if I don't like any of them either :) Ok; I will wait for the reviews. Regards, K. Y ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization