netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH] remove unneeded check in bcm43xx
@ 2006-04-10  4:01 Benoit Boissinot
       [not found] ` <20060410040120.GA4860-vYW+cPY1g1pWj0EZb7rXcA@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Benoit Boissinot @ 2006-04-10  4:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, bcm43xx-dev

Since the driver already sets the correct dma_mask, there is no reason
to bail there. In fact if you have an iommu, I think you can have a
address above 1G which will be ok for the device (if it isn't true then
the powerpc dma_alloc_coherent with iommu needs to be fixed because it
doesn't respect the the dma_mask).

Please comment or apply.

Signed-off-by: Benoit Boissinot <benoit.boissinot@ens-lyon.fr>

Index: linux/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
===================================================================
--- linux.orig/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
+++ linux/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
@@ -194,14 +194,6 @@ static int alloc_ringmemory(struct bcm43
 		printk(KERN_ERR PFX "DMA ringmemory allocation failed\n");
 		return -ENOMEM;
 	}
-	if (ring->dmabase + BCM43xx_DMA_RINGMEMSIZE > BCM43xx_DMA_BUSADDRMAX) {
-		printk(KERN_ERR PFX ">>>FATAL ERROR<<<  DMA RINGMEMORY >1G "
-				    "(0x%08x, len: %lu)\n",
-		       ring->dmabase, BCM43xx_DMA_RINGMEMSIZE);
-		dma_free_coherent(dev, BCM43xx_DMA_RINGMEMSIZE,
-				  ring->vbase, ring->dmabase);
-		return -ENOMEM;
-	}
 	assert(!(ring->dmabase & 0x000003FF));
 	memset(ring->vbase, 0, BCM43xx_DMA_RINGMEMSIZE);
 
@@ -303,14 +295,6 @@ static int setup_rx_descbuffer(struct bc
 	if (unlikely(!skb))
 		return -ENOMEM;
 	dmaaddr = map_descbuffer(ring, skb->data, ring->rx_buffersize, 0);
-	if (unlikely(dmaaddr + ring->rx_buffersize > BCM43xx_DMA_BUSADDRMAX)) {
-		unmap_descbuffer(ring, dmaaddr, ring->rx_buffersize, 0);
-		dev_kfree_skb_any(skb);
-		printk(KERN_ERR PFX ">>>FATAL ERROR<<<  DMA RX SKB >1G "
-				    "(0x%08x, len: %u)\n",
-		       dmaaddr, ring->rx_buffersize);
-		return -ENOMEM;
-	}
 	meta->skb = skb;
 	meta->dmaaddr = dmaaddr;
 	skb->dev = ring->bcm->net_dev;
@@ -726,13 +710,6 @@ static int dma_tx_fragment(struct bcm43x
 
 	meta->skb = skb;
 	meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
-	if (unlikely(meta->dmaaddr + skb->len > BCM43xx_DMA_BUSADDRMAX)) {
-		return_slot(ring, slot);
-		printk(KERN_ERR PFX ">>>FATAL ERROR<<<  DMA TX SKB >1G "
-				    "(0x%08x, len: %u)\n",
-		       meta->dmaaddr, skb->len);
-		return -ENOMEM;
-	}
 
 	desc_addr = (u32)(meta->dmaaddr + ring->memoffset);
 	desc_ctl = BCM43xx_DMADTOR_FRAMESTART | BCM43xx_DMADTOR_FRAMEEND;

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

end of thread, other threads:[~2006-04-11 23:04 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-10  4:01 [RFC/PATCH] remove unneeded check in bcm43xx Benoit Boissinot
     [not found] ` <20060410040120.GA4860-vYW+cPY1g1pWj0EZb7rXcA@public.gmane.org>
2006-04-10  4:07   ` Michael Buesch
2006-04-10  4:22     ` Benoit Boissinot
     [not found]       ` <20060410042228.GN27596-vYW+cPY1g1pWj0EZb7rXcA@public.gmane.org>
2006-04-10  4:28         ` Michael Buesch
2006-04-10  4:38           ` Benoit Boissinot
2006-04-10 13:46           ` John W. Linville
2006-04-10 16:18             ` Arjan van de Ven
2006-04-10 22:13             ` Benoit Boissinot
2006-04-10 22:28               ` David S. Miller
2006-04-11  1:47               ` Benjamin Herrenschmidt
2006-04-11  1:46       ` Benjamin Herrenschmidt
     [not found]         ` <1144719972.19353.24.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2006-04-11  1:53           ` Michael Buesch
2006-04-11  2:23             ` Benoit Boissinot
2006-04-11  5:49         ` David S. Miller
     [not found]           ` <20060410.224933.39567033.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2006-04-11 16:05             ` Michael Buesch
2006-04-11 20:49           ` Benjamin Herrenschmidt
2006-04-11 21:34             ` David S. Miller
2006-04-11 22:20               ` Benjamin Herrenschmidt
2006-04-11 22:21               ` Benjamin Herrenschmidt
2006-04-11 22:30                 ` Benoit Boissinot
     [not found]                   ` <20060411223024.GA6543-vYW+cPY1g1pWj0EZb7rXcA@public.gmane.org>
2006-04-11 22:35                     ` Benjamin Herrenschmidt
     [not found]                 ` <1144794077.19353.53.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2006-04-11 23:04                   ` Michael Buesch

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).