Skip to contentSkip to conversation

virtio: set pci bus master enable bit

PATCH In review Michael S. Tsirkin 3 participants 5 messages Nov 29, 2009 – Dec 4, 2009

Subsystems (2)
lore
Share & tools
lore

Michael S. Tsirkin

author maintainer
#0 lore raw

PATCH 1/1 virtio: set pci bus master enable bit

As all virtio devices perform DMA, we
must enable bus mastering for them to be
spec compliant.

---
 drivers/virtio/virtio_pci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/virtio/virtio_pci.c +1 -0
index 28d9cf7..717bae1 100644
@@ -648,6 +648,7 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev,
 		goto out_req_regions;
 
 	pci_set_drvdata(pci_dev, vp_dev);
+	pci_set_master(pci_dev);
 
 	/* we use the subsystem vendor/device id as the virtio vendor/device
 	 * id.  this allows us to use the same PCI vendor/device id for all
Signature · 1 line
1.6.5.2.143.g8cc62
#1 lore raw
Quoted 14 lines · Michael S. Tsirkin

As all virtio devices perform DMA, we
must enable bus mastering for them to be
spec compliant.

---
 drivers/virtio/virtio_pci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/virtio/virtio_pci.c +0 -0
index 28d9cf7..717bae1 100644

drivers/virtio/virtio_pci.c static int __devinit virtio_pci_probe(struct pci_dev *pci_dev, · line 651

Quoted 4 lines
drivers/virtio/virtio_pci.c +1 -0
@@ -648,6 +648,7 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev,
 		goto out_req_regions;
 
 	pci_set_drvdata(pci_dev, vp_dev);
+	pci_set_master(pci_dev);

I can believe this, but I have no idea if it's right. I've applied it, and hope Jesse will comment if there's something wrong with it.

Thanks,
Rusty.

#2 lore raw
In reply to Michael S. Tsirkin
Quoted 14 lines · Michael S. Tsirkin

As all virtio devices perform DMA, we
must enable bus mastering for them to be
spec compliant.

---
 drivers/virtio/virtio_pci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/virtio/virtio_pci.c +0 -0
index 28d9cf7..717bae1 100644

drivers/virtio/virtio_pci.c static int __devinit virtio_pci_probe(struct pci_dev *pci_dev, · line 651

Quoted 4 lines
drivers/virtio/virtio_pci.c +1 -0
@@ -648,6 +648,7 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev,
 		goto out_req_regions;
 
 	pci_set_drvdata(pci_dev, vp_dev);
+	pci_set_master(pci_dev);

I can believe this, but I have no idea if it's right. I've applied it, and hope Jesse will comment if there's something wrong with it.

Thanks,
Rusty.

#3 lore raw
Quoted 17 lines · On Tue, 1 Dec 2009 10:34:01 +1030 Rusty Russell <[email protected]> wrote:
Quoted 16 lines · Michael S. Tsirkin

As all virtio devices perform DMA, we
must enable bus mastering for them to be
spec compliant.

---
 drivers/virtio/virtio_pci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/drivers/virtio/virtio_pci.c index 28d9cf7..717bae1 100644

drivers/virtio/virtio_pci.c +0 -0
@@ -648,6 +648,7 @@ static int __devinit virtio_pci_probe(struct
 pci_dev *pci_dev, goto out_req_regions;
 
Quoted 5 lines

drivers/virtio/virtio_pci.c static int __devinit virtio_pci_probe(struct pci_dev *pci_dev, · line 651

Quoted 2 lines
drivers/virtio/virtio_pci.c +1 -0
 	pci_set_drvdata(pci_dev, vp_dev);
+	pci_set_master(pci_dev);

I can believe this, but I have no idea if it's right. I've applied it, and hope Jesse will comment if there's something wrong with it.

Nope, nothing wrong with that afaict.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#4 lore raw
In reply to Rusty Russell
Quoted 17 lines · On Tue, 1 Dec 2009 10:34:01 +1030 Rusty Russell <[email protected]> wrote:
Quoted 16 lines · Michael S. Tsirkin

As all virtio devices perform DMA, we
must enable bus mastering for them to be
spec compliant.

---
 drivers/virtio/virtio_pci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/drivers/virtio/virtio_pci.c index 28d9cf7..717bae1 100644

drivers/virtio/virtio_pci.c +0 -0
@@ -648,6 +648,7 @@ static int __devinit virtio_pci_probe(struct
 pci_dev *pci_dev, goto out_req_regions;
 
Quoted 5 lines

drivers/virtio/virtio_pci.c static int __devinit virtio_pci_probe(struct pci_dev *pci_dev, · line 651

Quoted 2 lines
drivers/virtio/virtio_pci.c +1 -0
 	pci_set_drvdata(pci_dev, vp_dev);
+	pci_set_master(pci_dev);

I can believe this, but I have no idea if it's right. I've applied it, and hope Jesse will comment if there's something wrong with it.

Nope, nothing wrong with that afaict.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center