Skip to contentSkip to conversation

[Add PCI DMA support to MCB 0/2]

PATCH Superseded Michael Moese 1 participant 4 messages Aug 29, 2016 Men chameleon bus (mcb)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover [Add PCI DMA support to MCB 0/2]

This small series of two patches enable (PCI) DMA support in MCB.

The first patch enables PCI bus mastering by default for all PCI-based MCB devices.

The second patch adds a dma_device to the mcb_device for all devices as a shortcut to mcb_device->bus->carrier.

Michael Moese (2):
Enable PCI bus mastering by default
Add a dma_device to mcb_device

 drivers/mcb/mcb-core.c | 1 +
 drivers/mcb/mcb-pci.c  | 1 +
 include/linux/mcb.h    | 1 +
 3 files changed, 3 insertions(+)

--
2.6.6

#1 lore raw

PATCH 1/2 Enable PCI bus mastering by default

---
 drivers/mcb/mcb-pci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mcb/mcb-pci.c +1 -0
index b15a034..af4d2f2 100644
@@ -46,6 +46,7 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		dev_err(&pdev->dev, "Failed to enable PCI device\n");
 		return -ENODEV;
 	}
+	pci_set_master(pdev);
 
 	priv->mapbase = pci_resource_start(pdev, 0);
 	if (!priv->mapbase) {
Signature · 1 line
2.6.6
#2 lore raw

PATCH 2/2 Add a dma_device to mcb_device

In reply to Michael Moese
---
 drivers/mcb/mcb-core.c | 1 +
 include/linux/mcb.h    | 1 +
 2 files changed, 2 insertions(+)
drivers/mcb/mcb-core.c +1 -0
index 5306966..e74bfea 100644
@@ -233,6 +233,7 @@ int mcb_device_register(struct mcb_bus *bus, struct mcb_device *dev)
 	dev->dev.bus = &mcb_bus_type;
 	dev->dev.parent = bus->dev.parent;
 	dev->dev.release = mcb_release_dev;
+	dev->dma_device = bus->carrier;
 
 	device_id = dev->id;
 	dev_set_name(&dev->dev, "mcb%d-16z%03d-%d:%d:%d",
include/linux/mcb.h +1 -0
index ee5200d..4097ac9 100644
@@ -76,6 +76,7 @@ struct mcb_device {
 	int rev;
 	struct resource irq;
 	struct resource mem;
+	struct device *dma_dev;
 };
 
 static inline struct mcb_device *to_mcb_device(struct device *dev)
Signature · 1 line
2.6.6
#3 lore raw
In reply to Michael Moese

I'm sorry for the errors in the patches.
I'll correct them and resend everything.

Quoted 19 lines · Michael Moese

This small series of two patches enable (PCI) DMA support in MCB.

The first patch enables PCI bus mastering by default for all PCI-based MCB devices.

The second patch adds a dma_device to the mcb_device for all devices as a shortcut to mcb_device->bus->carrier.

Michael Moese (2):
Enable PCI bus mastering by default
Add a dma_device to mcb_device

 drivers/mcb/mcb-core.c | 1 +
 drivers/mcb/mcb-pci.c  | 1 +
 include/linux/mcb.h    | 1 +
 3 files changed, 3 insertions(+)

--
2.6.6