From: Ameya Palande on
Hi Greg,

On Fri, Feb 26, 2010 at 2:46 AM, Greg KH <greg(a)kroah.com> wrote:
>
> On Thu, Feb 25, 2010 at 11:40:52PM +0000, Haiyang Zhang wrote:
> > > -----Original Message-----
> > > From: Greg KH [mailto:greg(a)kroah.com]
> > > Sent: Thursday, February 25, 2010 6:07 PM
> > > If so, what is the vendor and product id of this device?
> >
> > The Vendor:Device Id is: 1414:5353
> > 00:08.0 VGA compatible controller [0300]: Microsoft Corporation Device [1414:5353]
> >
> > This hasn't been changed since the first release of HyperV. I will ask
> > around about the future stability of the VGA card (and the DMI).
>
> Ok, below are 2 patches that I will queue up in my tree.
>
> Can you test them to verify that they work properly?
>
> thanks,
>
> greg k-h
>
> From: Greg Kroah-Hartman <gregkh(a)suse.de>
> Subject: Staging: hv: add a pci device table
>
> This allows the HV core to be properly found and autoloaded
> by the system tools.
>
> It uses the Microsoft virtual VGA device to trigger this.
>
> Cc: Haiyang Zhang <haiyangz(a)microsoft.com>
> Cc: Hank Janssen <hjanssen(a)microsoft.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh(a)suse.de>
> ---
>  drivers/staging/hv/vmbus_drv.c |   17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> --- a/drivers/staging/hv/vmbus_drv.c
> +++ b/drivers/staging/hv/vmbus_drv.c
> @@ -24,6 +24,7 @@
>  #include <linux/irq.h>
>  #include <linux/interrupt.h>
>  #include <linux/sysctl.h>
> +#include <linux/pci.h>
>  #include "VersionInfo.h"
>  #include "osd.h"
>  #include "logging.h"
> @@ -974,6 +975,22 @@ static void __exit vmbus_exit(void)
>        return;
>  }
>
> +/*
> + * 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
> + * installed and/or configured.  We don't do anything else with the table, but
> + * it needs to be present.
> + *
> + * We might consider triggering off of DMI table info as well, as that does
> + * decribe the virtual machine being run on, but not all configuration tools
> + * seem to be able to handle DMI device ids properly.
> + */
> +const static struct pci_device_id microsoft_hv_pci_table[] = {

You can have:
const static DEFINE_PCI_DEVICE_TABLE(microsoft_hv_pci_table) = {

> +       { PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */
> +       { 0 }
> +};
> +MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table);
> +

Cheers,
Ameya.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Greg KH on
On Fri, Feb 26, 2010 at 11:47:58AM +0200, Ameya Palande wrote:
> > +const static struct pci_device_id microsoft_hv_pci_table[] = {
>
> You can have:
> const static DEFINE_PCI_DEVICE_TABLE(microsoft_hv_pci_table) = {

Yeah, you could, if you liked that macro, which I certainly do not.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Haiyang Zhang on
> From: Greg KH [mailto:greg(a)kroah.com]
> Sent: Thursday, February 25, 2010 9:57 PM
> In looking at the second patch again, I think you will need to put some
> spaces in the DMI strings to get it to match up properly. Look at what
> the files in:
> /sys/class/dmi/id/
> look like exactly to get it to line up. The module id stuff strips
> spaces out, so I can't get the real value there.

Thanks for your help! I have applied the two patches -- auto loading of hv_vmbus works fine after a space was inserted into the DMI strings ("Microsoft Corporation", "Virtual Machine").

Also, according to our Hyper-V team, we have no plan to change the virtual VGA card id and DMI info.

Thanks,

- Haiyang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Greg KH on
On Fri, Feb 26, 2010 at 07:07:14PM +0000, Haiyang Zhang wrote:
> > From: Greg KH [mailto:greg(a)kroah.com]
> > Sent: Thursday, February 25, 2010 9:57 PM
> > In looking at the second patch again, I think you will need to put some
> > spaces in the DMI strings to get it to match up properly. Look at what
> > the files in:
> > /sys/class/dmi/id/
> > look like exactly to get it to line up. The module id stuff strips
> > spaces out, so I can't get the real value there.
>
> Thanks for your help! I have applied the two patches -- auto loading
> of hv_vmbus works fine after a space was inserted into the DMI strings
> ("Microsoft Corporation", "Virtual Machine").

Great, I'll add a space and then queue them up for the merge window.

> Also, according to our Hyper-V team, we have no plan to change the
> virtual VGA card id and DMI info.

That's good to know, but if it changes in the future, we can trivially
add new device ids.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/