netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] solos-pci: Fix DMA support
@ 2012-05-24 14:58 David Woodhouse
  2012-05-24 20:21 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: David Woodhouse @ 2012-05-24 14:58 UTC (permalink / raw)
  To: netdev; +Cc: Nathan Williams

[-- Attachment #1: Type: text/plain, Size: 1753 bytes --]

DMA support has finally made its way to the top of the TODO list, having
realised that a Geode using MMIO can't keep up with two ADSL2+ lines
each running at 21Mb/s.

This patch fixes a couple of bugs in the DMA support in the driver, so
once the corresponding FPGA update is complete and tested everything
should work properly.

We weren't storing the currently-transmitting skb, so we were never
unmapping it and never freeing/popping it when the TX was done.
And the addition of pci_set_master() is fairly self-explanatory.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: stable@kernel.org 
---

(Strictly speaking, it *can* keep up using MMIO. But only if you use MMX
loads/stores to do 64-bit PCI transactions instead of the 32-bit
transactions you get with memcpy_{to,from}io(). But we're not showing
you that code. Some of you might know where we live.)

diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index e8cd652..9851093 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -984,6 +984,7 @@ static uint32_t fpga_tx(struct solos_card *card)
 			} else if (skb && card->using_dma) {
 				SKB_CB(skb)->dma_addr = pci_map_single(card->dev, skb->data,
 								       skb->len, PCI_DMA_TODEVICE);
+				card->tx_skb[port] = skb;
 				iowrite32(SKB_CB(skb)->dma_addr,
 					  card->config_regs + TX_DMA_ADDR(port));
 			}
@@ -1152,7 +1153,8 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
 		db_fpga_upgrade = db_firmware_upgrade = 0;
 	}
 
-	if (card->fpga_version >= DMA_SUPPORTED){
+	if (card->fpga_version >= DMA_SUPPORTED) {
+		pci_set_master(dev);
 		card->using_dma = 1;
 	} else {
 		card->using_dma = 0;

-- 
dwmw2

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]

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

* Re: [PATCH] solos-pci: Fix DMA support
  2012-05-24 14:58 [PATCH] solos-pci: Fix DMA support David Woodhouse
@ 2012-05-24 20:21 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-05-24 20:21 UTC (permalink / raw)
  To: dwmw2; +Cc: netdev, nathan

From: David Woodhouse <dwmw2@infradead.org>
Date: Thu, 24 May 2012 15:58:27 +0100

> DMA support has finally made its way to the top of the TODO list, having
> realised that a Geode using MMIO can't keep up with two ADSL2+ lines
> each running at 21Mb/s.
> 
> This patch fixes a couple of bugs in the DMA support in the driver, so
> once the corresponding FPGA update is complete and tested everything
> should work properly.
> 
> We weren't storing the currently-transmitting skb, so we were never
> unmapping it and never freeing/popping it when the TX was done.
> And the addition of pci_set_master() is fairly self-explanatory.
> 
> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Applied.

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

end of thread, other threads:[~2012-05-24 20:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 14:58 [PATCH] solos-pci: Fix DMA support David Woodhouse
2012-05-24 20:21 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).