[PATCH] CS89x0 demands too many pages

Hugh Dickins (hugh@veritas.com)
Fri, 2 Mar 2001 21:39:18 +0000 (GMT)


The CS89x0 driver wants a 16KB or 64KB dma_buff (if use_dma and
ANY_ISA_DMA), thinks it's asking __get_dma_pages() for 4 or 16
pages, but actually it's demanding order 4 or order 16 buffer.
Patch below against 2.4.2-ac9 or 2.4.2, offset against 2.4.[01].

Hugh

--- 2.4.2-ac9/drivers/net/cs89x0.c Tue Feb 13 21:15:05 2001
+++ linux/drivers/net/cs89x0.c Fri Mar 2 18:23:42 2001
@@ -1075,7 +1075,7 @@
if (lp->isa_config & ANY_ISA_DMA) {
unsigned long flags;
lp->dma_buff = (unsigned char *)__get_dma_pages(GFP_KERNEL,
- (lp->dmasize * 1024) / PAGE_SIZE);
+ get_order(lp->dmasize * 1024));

if (!lp->dma_buff) {
printk(KERN_ERR "%s: cannot get %dK memory for DMA\n", dev->name, lp->dmasize);
@@ -1456,7 +1456,7 @@
static void release_dma_buff(struct net_local *lp)
{
if (lp->dma_buff) {
- free_pages((unsigned long)(lp->dma_buff), (lp->dmasize * 1024) / PAGE_SIZE);
+ free_pages((unsigned long)(lp->dma_buff), get_order(lp->dmasize * 1024));
lp->dma_buff = 0;
}
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/