All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] pcie: Fix incorrect write to device ctl2 register
@ 2014-08-21  8:31 arei.gonglei
  2014-08-21  8:58 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: arei.gonglei @ 2014-08-21  8:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: weidong.huang, marcel.a, mst, knut.omang, Gonglei, pbonzini

From: Gonglei <arei.gonglei@huawei.com>

ARI Forwarding Enable bit locate
Device Control 2 Register (Offset 28h).
Maybe a typo.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 hw/pci/pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index a123c01..3f4b319 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -504,7 +504,7 @@ void pcie_cap_ari_init(PCIDevice *dev)
     uint32_t pos = dev->exp.exp_cap;
     pci_long_test_and_set_mask(dev->config + pos + PCI_EXP_DEVCAP2,
                                PCI_EXP_DEVCAP2_ARI);
-    pci_long_test_and_set_mask(dev->wmask + pos + PCI_EXP_DEVCTL2,
+    pci_long_test_and_set_mask(dev->config + pos + PCI_EXP_DEVCTL2,
                                PCI_EXP_DEVCTL2_ARI);
 }
 
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] pcie: Fix incorrect write to device ctl2 register
  2014-08-21  8:31 [Qemu-devel] [PATCH] pcie: Fix incorrect write to device ctl2 register arei.gonglei
@ 2014-08-21  8:58 ` Paolo Bonzini
  2014-08-21  9:11   ` Gonglei (Arei)
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2014-08-21  8:58 UTC (permalink / raw)
  To: arei.gonglei, qemu-devel; +Cc: knut.omang, mst, weidong.huang, marcel.a

Il 21/08/2014 10:31, arei.gonglei@huawei.com ha scritto:
> +++ b/hw/pci/pcie.c
> @@ -504,7 +504,7 @@ void pcie_cap_ari_init(PCIDevice *dev)
>      uint32_t pos = dev->exp.exp_cap;
>      pci_long_test_and_set_mask(dev->config + pos + PCI_EXP_DEVCAP2,
>                                 PCI_EXP_DEVCAP2_ARI);
> -    pci_long_test_and_set_mask(dev->wmask + pos + PCI_EXP_DEVCTL2,
> +    pci_long_test_and_set_mask(dev->config + pos + PCI_EXP_DEVCTL2,
>                                 PCI_EXP_DEVCTL2_ARI);
>  }
>  

IIUC the code is correct, it means that the bit can be written in
devctl2.  You don't want to set it, the firmware or OS can do it if they
understand ARI.

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] pcie: Fix incorrect write to device ctl2 register
  2014-08-21  8:58 ` Paolo Bonzini
@ 2014-08-21  9:11   ` Gonglei (Arei)
  0 siblings, 0 replies; 3+ messages in thread
From: Gonglei (Arei) @ 2014-08-21  9:11 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel@nongnu.org
  Cc: knut.omang@oracle.com, mst@redhat.com, Huangweidong (C),
	marcel.a@redhat.com

> -----Original Message-----
> From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo
> Bonzini
> Sent: Thursday, August 21, 2014 4:59 PM
> To: Gonglei (Arei); qemu-devel@nongnu.org
> Cc: Huangweidong (C); marcel.a@redhat.com; mst@redhat.com;
> knut.omang@oracle.com
> Subject: Re: [PATCH] pcie: Fix incorrect write to device ctl2 register
> 
> Il 21/08/2014 10:31, arei.gonglei@huawei.com ha scritto:
> > +++ b/hw/pci/pcie.c
> > @@ -504,7 +504,7 @@ void pcie_cap_ari_init(PCIDevice *dev)
> >      uint32_t pos = dev->exp.exp_cap;
> >      pci_long_test_and_set_mask(dev->config + pos + PCI_EXP_DEVCAP2,
> >                                 PCI_EXP_DEVCAP2_ARI);
> > -    pci_long_test_and_set_mask(dev->wmask + pos + PCI_EXP_DEVCTL2,
> > +    pci_long_test_and_set_mask(dev->config + pos + PCI_EXP_DEVCTL2,
> >                                 PCI_EXP_DEVCTL2_ARI);
> >  }
> >
> 
> IIUC the code is correct, it means that the bit can be written in
> devctl2.  You don't want to set it, the firmware or OS can do it if they
> understand ARI.
> 
> Paolo

Oh, yes. You are right. 

Forgot the noise pls, thanks! 

Best regards,
-Gonglei

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-21  9:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-21  8:31 [Qemu-devel] [PATCH] pcie: Fix incorrect write to device ctl2 register arei.gonglei
2014-08-21  8:58 ` Paolo Bonzini
2014-08-21  9:11   ` Gonglei (Arei)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.