Skip to contentSkip to conversation

MCB patches for v4.9

PATCH In review Johannes Thumshirn 2 participants 7 messages Sep 14, 2016 – Sep 27, 2016 Men chameleon bus (mcb)

lore
Share & tools
lore
#0 lore raw

cover MCB patches for v4.9

Hi Greg,

Here are the additional MCB patches for v4.9.

They're around enabling of DMA for devices on an MCBus, are tested and apply cleanly against your char-misc-next tree.

Thanks,
Johannes

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(+)
Signature · 1 line
1.8.5.6
#1 lore raw

PATCH 1/2 Enable PCI bus mastering by default

From: Michael Moese <[email protected]>

In order to successfully perform DMA operations on PCI devices, it is necessary to enble PCI bus mastering, so enable it 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
1.8.5.6
#2 lore raw

Re: [PATCH 1/2] Enable PCI bus mastering by default

Quoted 10 lines · Johannes Thumshirn

From: Michael Moese <[email protected]>

In order to successfully perform DMA operations on PCI devices, it is necessary to enble PCI bus mastering, so enable it by default.

---
 drivers/mcb/mcb-pci.c | 1 +
 1 file changed, 1 insertion(+)

Please put a prefix on your subject lines to show what driver you are talking about, otherwise a generic subject like this doesn't make sense in the whole kernel tree.

I'll go fix it up...

greg k-h

#3 lore raw

PATCH 2/2 Add a dma_device to mcb_device

In reply to Johannes Thumshirn

From: Michael Moese <[email protected]>

When performing DMA operations on a MCB device, the device needed for using the DMA API is "mcb_device->bus_carrier".
This is rather lengthy, so a shortcut is introduced to struct mcb_device in order to ensure the MCB device driver uses the correct device for DMA operations.

---
 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..921a5d2 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_dev = 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
1.8.5.6
#4 lore raw
In reply to Johannes Thumshirn
Quoted 10 lines · Johannes Thumshirn

Hi Greg,

Here are the additional MCB patches for v4.9.

They're around enabling of DMA for devices on an MCBus, are tested and apply cleanly against your char-misc-next tree.

Thanks,
Johannes

Quoted 12 lines

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(+)
Signature · 1 line
1.8.5.6

Gentle ping on this...

Signature · 6 lines
Johannes Thumshirn                                          Storage
[email protected]                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#5 lore raw
Quoted 20 lines · Johannes Thumshirn
Quoted 19 lines · Johannes Thumshirn

Hi Greg,

Here are the additional MCB patches for v4.9.

They're around enabling of DMA for devices on an MCBus, are tested and apply cleanly against your char-misc-next tree.

Thanks,
Johannes

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(+)
Quoted 5 lines
Quoted 3 lines
Signature · 1 line
1.8.5.6

Gentle ping on this...

Sorry about that, will get to it today...

#6 lore raw
Quoted 21 lines · Greg KH
Quoted 20 lines · Johannes Thumshirn
Quoted 19 lines · Johannes Thumshirn

Hi Greg,

Here are the additional MCB patches for v4.9.

They're around enabling of DMA for devices on an MCBus, are tested and apply cleanly against your char-misc-next tree.

Thanks,
Johannes

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(+)
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Signature · 1 line
1.8.5.6

Gentle ping on this...

Sorry about that, will get to it today...

Thanks :-)

Signature · 6 lines
Johannes Thumshirn                                          Storage
[email protected]                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850