diff mbox

pci/multi function bit: fix v582c686.c.

Message ID d440460f4e1b16adb061ff2e6d7267d36d706371.1278919032.git.yamahata@valinux.co.jp
State New
Headers show

Commit Message

Isaku Yamahata July 12, 2010, 7:18 a.m. UTC
The file, v582c686.c, was added after the change set of
b80d4a9887fa4b6cc63f8c3a13ab2a45054d3e5c and
fecb93c45c749a4c994d8d12bdee17ce2012de9e
are created, but before the patch series was commit.
So similar fix is needed to v582c686.c.

Cc: Huacai Chen <zltjiangshi@gmail.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

---
This is only compile tested.
Huacai, can you please test it? Or provide me pmon_fulong2e.bin?
I wasn't able to find it, and tried the source repository,
http://www.loongson.cn/support/git/pmon, but wasn't able to clone.

$ git clone http://www.loongson.cn/support/git/pmon
Cloning into pmon...
fatal: http://www.loongson.cn/support/git/pmon/info/refs not found: did you run git update-server-info on the server?
---
 hw/vt82c686.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

Comments

Michael S. Tsirkin July 12, 2010, 11:05 a.m. UTC | #1
On Mon, Jul 12, 2010 at 04:18:01PM +0900, Isaku Yamahata wrote:
> The file, v582c686.c, was added after the change set of
> b80d4a9887fa4b6cc63f8c3a13ab2a45054d3e5c and
> fecb93c45c749a4c994d8d12bdee17ce2012de9e
> are created, but before the patch series was commit.
> So similar fix is needed to v582c686.c.
> 
> Cc: Huacai Chen <zltjiangshi@gmail.com>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
> 
> ---
> This is only compile tested.
> Huacai, can you please test it? Or provide me pmon_fulong2e.bin?
> I wasn't able to find it, and tried the source repository,
> http://www.loongson.cn/support/git/pmon, but wasn't able to clone.
> 
> $ git clone http://www.loongson.cn/support/git/pmon
> Cloning into pmon...
> fatal: http://www.loongson.cn/support/git/pmon/info/refs not found: did you run git update-server-info on the server?

Yea, submodules are evil like that. We should really look into switching to
subtrees IMO.

> ---
>  hw/vt82c686.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/vt82c686.c b/hw/vt82c686.c
> index a0c5747..cacc217 100644
> --- a/hw/vt82c686.c
> +++ b/hw/vt82c686.c
> @@ -468,7 +468,6 @@ static int vt82c686b_pm_initfn(PCIDevice *dev)
>      pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIA_ACPI);
>      pci_config_set_class(pci_conf, PCI_CLASS_BRIDGE_OTHER);
>      pci_config_set_revision(pci_conf, 0x40);
> -    pci_conf[PCI_HEADER_TYPE] = PCI_HEADER_TYPE_NORMAL; // header_type
>  
>      pci_set_word(pci_conf + PCI_COMMAND, 0);
>      pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_FAST_BACK |
> @@ -556,8 +555,6 @@ static int vt82c686b_initfn(PCIDevice *d)
>      pci_config_set_class(pci_conf, PCI_CLASS_BRIDGE_ISA);
>      pci_config_set_prog_interface(pci_conf, 0x0);
>      pci_config_set_revision(pci_conf,0x40); /* Revision 4.0 */
> -    pci_conf[PCI_HEADER_TYPE] =
> -        PCI_HEADER_TYPE_NORMAL | PCI_HEADER_TYPE_MULTI_FUNCTION;
>  
>      wmask = d->wmask;
>      for (i = 0x00; i < 0xff; i++) {
> @@ -575,7 +572,7 @@ int vt82c686b_init(PCIBus *bus, int devfn)
>  {
>      PCIDevice *d;
>  
> -    d = pci_create_simple(bus, devfn, "VT82C686B");
> +    d = pci_create_simple_multifunction(bus, devfn, true, "VT82C686B");
>  
>      return d->devfn;
>  }
> -- 
> 1.7.1.1
Isaku Yamahata July 12, 2010, 11:55 a.m. UTC | #2
On Mon, Jul 12, 2010 at 07:18:16PM +0800, chen huacai wrote:
> I have tested, this patch is OK.
> The git repository of PMON is unavailable currently, so you can get a
> binary version of PMON in the attachment.
> BTW, the PCI_HEADER_TYPE setting in hw/ide/via.c can also be removed.

Thank you for testing. I should have used grep -r.
I sent out updated version, so please test it again.

thanks,

> 
> On Mon, Jul 12, 2010 at 3:18 PM, Isaku Yamahata <yamahata@valinux.co.jp> wrote:
> > The file, v582c686.c, was added after the change set of
> > b80d4a9887fa4b6cc63f8c3a13ab2a45054d3e5c and
> > fecb93c45c749a4c994d8d12bdee17ce2012de9e
> > are created, but before the patch series was commit.
> > So similar fix is needed to v582c686.c.
> >
> > Cc: Huacai Chen <zltjiangshi@gmail.com>
> > Cc: Aurelien Jarno <aurelien@aurel32.net>
> > Cc: Michael S. Tsirkin <mst@redhat.com>
> > Cc: Blue Swirl <blauwirbel@gmail.com>
> > Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
> >
> > ---
> > This is only compile tested.
> > Huacai, can you please test it? Or provide me pmon_fulong2e.bin?
> > I wasn't able to find it, and tried the source repository,
> > http://www.loongson.cn/support/git/pmon, but wasn't able to clone.
> >
> > $ git clone http://www.loongson.cn/support/git/pmon
> > Cloning into pmon...
> > fatal: http://www.loongson.cn/support/git/pmon/info/refs not found: did you run git update-server-info on the server?
> > ---
> > ??hw/vt82c686.c | ?? ??5 +----
> > ??1 files changed, 1 insertions(+), 4 deletions(-)
> >
> > diff --git a/hw/vt82c686.c b/hw/vt82c686.c
> > index a0c5747..cacc217 100644
> > --- a/hw/vt82c686.c
> > +++ b/hw/vt82c686.c
> > @@ -468,7 +468,6 @@ static int vt82c686b_pm_initfn(PCIDevice *dev)
> > ?? ?? pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIA_ACPI);
> > ?? ?? pci_config_set_class(pci_conf, PCI_CLASS_BRIDGE_OTHER);
> > ?? ?? pci_config_set_revision(pci_conf, 0x40);
> > - ?? ??pci_conf[PCI_HEADER_TYPE] = PCI_HEADER_TYPE_NORMAL; // header_type
> >
> > ?? ?? pci_set_word(pci_conf + PCI_COMMAND, 0);
> > ?? ?? pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_FAST_BACK |
> > @@ -556,8 +555,6 @@ static int vt82c686b_initfn(PCIDevice *d)
> > ?? ?? pci_config_set_class(pci_conf, PCI_CLASS_BRIDGE_ISA);
> > ?? ?? pci_config_set_prog_interface(pci_conf, 0x0);
> > ?? ?? pci_config_set_revision(pci_conf,0x40); /* Revision 4.0 */
> > - ?? ??pci_conf[PCI_HEADER_TYPE] =
> > - ?? ?? ?? ??PCI_HEADER_TYPE_NORMAL | PCI_HEADER_TYPE_MULTI_FUNCTION;
> >
> > ?? ?? wmask = d->wmask;
> > ?? ?? for (i = 0x00; i < 0xff; i++) {
> > @@ -575,7 +572,7 @@ int vt82c686b_init(PCIBus *bus, int devfn)
> > ??{
> > ?? ?? PCIDevice *d;
> >
> > - ?? ??d = pci_create_simple(bus, devfn, "VT82C686B");
> > + ?? ??d = pci_create_simple_multifunction(bus, devfn, true, "VT82C686B");
> >
> > ?? ?? return d->devfn;
> > ??}
> > --
> > 1.7.1.1
> >
> >
> 
> 
> 
> -- 
> Huacai Chen
diff mbox

Patch

diff --git a/hw/vt82c686.c b/hw/vt82c686.c
index a0c5747..cacc217 100644
--- a/hw/vt82c686.c
+++ b/hw/vt82c686.c
@@ -468,7 +468,6 @@  static int vt82c686b_pm_initfn(PCIDevice *dev)
     pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIA_ACPI);
     pci_config_set_class(pci_conf, PCI_CLASS_BRIDGE_OTHER);
     pci_config_set_revision(pci_conf, 0x40);
-    pci_conf[PCI_HEADER_TYPE] = PCI_HEADER_TYPE_NORMAL; // header_type
 
     pci_set_word(pci_conf + PCI_COMMAND, 0);
     pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_FAST_BACK |
@@ -556,8 +555,6 @@  static int vt82c686b_initfn(PCIDevice *d)
     pci_config_set_class(pci_conf, PCI_CLASS_BRIDGE_ISA);
     pci_config_set_prog_interface(pci_conf, 0x0);
     pci_config_set_revision(pci_conf,0x40); /* Revision 4.0 */
-    pci_conf[PCI_HEADER_TYPE] =
-        PCI_HEADER_TYPE_NORMAL | PCI_HEADER_TYPE_MULTI_FUNCTION;
 
     wmask = d->wmask;
     for (i = 0x00; i < 0xff; i++) {
@@ -575,7 +572,7 @@  int vt82c686b_init(PCIBus *bus, int devfn)
 {
     PCIDevice *d;
 
-    d = pci_create_simple(bus, devfn, "VT82C686B");
+    d = pci_create_simple_multifunction(bus, devfn, true, "VT82C686B");
 
     return d->devfn;
 }