public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [3/12] remove irda usage of isa_virt_to_bus()
  2004-06-14  0:34   ` [2/12] lower priority of "too many keys" msg in atkbd.c William Lee Irwin III
@ 2004-06-14  0:36     ` William Lee Irwin III
  2004-06-14  8:11       ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: William Lee Irwin III @ 2004-06-14  0:36 UTC (permalink / raw)
  To: linux-kernel

 * Removed uses of isa_virt_to_bus
This resolves Debian BTS #218878.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=218878

	From: Paavo Hartikainen <pahartik@sci.fi>
	To: Debian Bug Tracking System <submit@bugs.debian.org>
	Subject: IrDA modules fail to load
	Message-Id: <E1AGYn5-0000LT-00@mufasa.vip.fi>

When trying to "modprobe irda irtty", it fails with following message:
  FATAL: Error inserting irda (/lib/modules/2.6.0-test9/kernel/net/irda/irda.ko): Unknown symbol in module, or unknown parameter (see dmesg)
And in "dmesg" I see these:
  irda: Unknown symbol isa_virt_to_bus
  irda: Unknown symbol isa_virt_to_bus


Index: linux-2.5/drivers/net/irda/ali-ircc.c
===================================================================
--- linux-2.5.orig/drivers/net/irda/ali-ircc.c	2004-06-13 11:57:17.000000000 -0700
+++ linux-2.5/drivers/net/irda/ali-ircc.c	2004-06-13 12:08:55.000000000 -0700
@@ -33,6 +33,7 @@
 #include <linux/init.h>
 #include <linux/rtnetlink.h>
 #include <linux/serial_reg.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -304,16 +305,18 @@
 	self->tx_buff.truesize = 14384;
 
 	/* Allocate memory if needed */
-	self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize,
-					      GFP_KERNEL |GFP_DMA); 
+	self->rx_buff.head =
+		dma_alloc_coherent(NULL, self->rx_buff.truesize,
+				   &self->rx_buff_dma, GFP_KERNEL); 
 	if (self->rx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto err_out2;
 	}
 	memset(self->rx_buff.head, 0, self->rx_buff.truesize);
 	
-	self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, 
-					      GFP_KERNEL|GFP_DMA); 
+	self->tx_buff.head =
+		dma_alloc_coherent(NULL, self->tx_buff.truesize,
+				   &self->tx_buff_dma, GFP_KERNEL); 
 	if (self->tx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto err_out3;
@@ -362,9 +365,11 @@
 	return 0;
 
  err_out4:
-	kfree(self->tx_buff.head);
+	dma_free_coherent(NULL, self->tx_buff.truesize,
+			  self->tx_buff.head, self->tx_buff_dma);
  err_out3:
-	kfree(self->rx_buff.head);
+	dma_free_coherent(NULL, self->rx_buff.truesize,
+			  self->rx_buff.head, self->rx_buff_dma);
  err_out2:
 	release_region(self->io.fir_base, self->io.fir_ext);
  err_out1:
@@ -398,10 +403,12 @@
 	release_region(self->io.fir_base, self->io.fir_ext);
 
 	if (self->tx_buff.head)
-		kfree(self->tx_buff.head);
+		dma_free_coherent(NULL, self->tx_buff.truesize,
+				  self->tx_buff.head, self->tx_buff_dma);
 	
 	if (self->rx_buff.head)
-		kfree(self->rx_buff.head);
+		dma_free_coherent(NULL, self->rx_buff.truesize,
+				  self->rx_buff.head, self->rx_buff_dma);
 
 	dev_self[self->index] = NULL;
 	free_netdev(self->netdev);
@@ -1572,7 +1579,8 @@
 	self->io.direction = IO_XMIT;
 	
 	irda_setup_dma(self->io.dma, 
-		       self->tx_fifo.queue[self->tx_fifo.ptr].start, 
+		       ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start -
+			self->tx_buff.head) + self->tx_buff_dma,
 		       self->tx_fifo.queue[self->tx_fifo.ptr].len, 
 		       DMA_TX_MODE);
 		
@@ -1724,8 +1732,8 @@
 	self->st_fifo.len = self->st_fifo.pending_bytes = 0;
 	self->st_fifo.tail = self->st_fifo.head = 0;
 		
-	irda_setup_dma(self->io.dma, self->rx_buff.data, 
-		       self->rx_buff.truesize, DMA_RX_MODE);	
+	irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize, 
+		       DMA_RX_MODE);	
 	 
 	/* Set Receive Mode,Brick Wall */
 	//switch_bank(iobase, BANK0);
Index: linux-2.5/drivers/net/irda/ali-ircc.h
===================================================================
--- linux-2.5.orig/drivers/net/irda/ali-ircc.h	2004-06-13 11:57:17.000000000 -0700
+++ linux-2.5/drivers/net/irda/ali-ircc.h	2004-06-13 12:08:55.000000000 -0700
@@ -26,6 +26,7 @@
 
 #include <linux/spinlock.h>
 #include <linux/pm.h>
+#include <linux/types.h>
 #include <asm/io.h>
 
 /* SIR Register */
@@ -198,6 +199,8 @@
 	chipio_t io;               /* IrDA controller information */
 	iobuff_t tx_buff;          /* Transmit buffer */
 	iobuff_t rx_buff;          /* Receive buffer */
+	dma_addr_t tx_buff_dma;
+	dma_addr_t rx_buff_dma;
 
 	__u8 ier;                  /* Interrupt enable register */
 	
Index: linux-2.5/drivers/net/irda/nsc-ircc.c
===================================================================
--- linux-2.5.orig/drivers/net/irda/nsc-ircc.c	2004-06-13 11:57:17.000000000 -0700
+++ linux-2.5/drivers/net/irda/nsc-ircc.c	2004-06-13 12:08:55.000000000 -0700
@@ -52,6 +52,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/rtnetlink.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -307,8 +308,9 @@
 	self->tx_buff.truesize = 14384;
 
 	/* Allocate memory if needed */
-	self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize,
-					      GFP_KERNEL|GFP_DMA);
+	self->rx_buff.head =
+		dma_alloc_coherent(NULL, self->rx_buff.truesize,
+				   &self->rx_buff_dma, GFP_KERNEL);
 	if (self->rx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto out2;
@@ -316,8 +318,9 @@
 	}
 	memset(self->rx_buff.head, 0, self->rx_buff.truesize);
 	
-	self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, 
-					      GFP_KERNEL|GFP_DMA);
+	self->tx_buff.head =
+		dma_alloc_coherent(NULL, self->tx_buff.truesize,
+				   &self->tx_buff_dma, GFP_KERNEL);
 	if (self->tx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto out3;
@@ -368,9 +371,11 @@
 
 	return 0;
  out4:
-	kfree(self->tx_buff.head);
+	dma_free_coherent(NULL, self->tx_buff.truesize,
+			  self->tx_buff.head, self->tx_buff_dma);
  out3:
-	kfree(self->rx_buff.head);
+	dma_free_coherent(NULL, self->rx_buff.truesize,
+			  self->rx_buff.head, self->rx_buff_dma);
  out2:
 	release_region(self->io.fir_base, self->io.fir_ext);
  out1:
@@ -404,10 +409,12 @@
 	release_region(self->io.fir_base, self->io.fir_ext);
 
 	if (self->tx_buff.head)
-		kfree(self->tx_buff.head);
+		dma_free_coherent(NULL, self->tx_buff.truesize,
+				  self->tx_buff.head, self->tx_buff_dma);
 	
 	if (self->rx_buff.head)
-		kfree(self->rx_buff.head);
+		dma_free_coherent(NULL, self->rx_buff.truesize,
+				  self->rx_buff.head, self->rx_buff_dma);
 
 	dev_self[self->index] = NULL;
 	free_netdev(self->netdev);
@@ -1409,7 +1416,8 @@
 	outb(ECR1_DMASWP|ECR1_DMANF|ECR1_EXT_SL, iobase+ECR1);
 	
 	irda_setup_dma(self->io.dma, 
-		       self->tx_fifo.queue[self->tx_fifo.ptr].start, 
+		       ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start -
+			self->tx_buff.head) + self->tx_buff_dma,
 		       self->tx_fifo.queue[self->tx_fifo.ptr].len, 
 		       DMA_TX_MODE);
 
@@ -1566,8 +1574,8 @@
 	self->st_fifo.len = self->st_fifo.pending_bytes = 0;
 	self->st_fifo.tail = self->st_fifo.head = 0;
 	
-	irda_setup_dma(self->io.dma, self->rx_buff.data, 
-		       self->rx_buff.truesize, DMA_RX_MODE);
+	irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize, 
+		       DMA_RX_MODE);
 
 	/* Enable DMA */
 	switch_bank(iobase, BANK0);
Index: linux-2.5/drivers/net/irda/nsc-ircc.h
===================================================================
--- linux-2.5.orig/drivers/net/irda/nsc-ircc.h	2004-06-13 11:57:17.000000000 -0700
+++ linux-2.5/drivers/net/irda/nsc-ircc.h	2004-06-13 12:08:55.000000000 -0700
@@ -32,6 +32,7 @@
 
 #include <linux/spinlock.h>
 #include <linux/pm.h>
+#include <linux/types.h>
 #include <asm/io.h>
 
 /* DMA modes needed */
@@ -255,6 +256,8 @@
 	chipio_t io;               /* IrDA controller information */
 	iobuff_t tx_buff;          /* Transmit buffer */
 	iobuff_t rx_buff;          /* Receive buffer */
+	dma_addr_t tx_buff_dma;
+	dma_addr_t rx_buff_dma;
 
 	__u8 ier;                  /* Interrupt enable register */
 
Index: linux-2.5/drivers/net/irda/smsc-ircc2.c
===================================================================
--- linux-2.5.orig/drivers/net/irda/smsc-ircc2.c	2004-06-13 11:57:18.000000000 -0700
+++ linux-2.5/drivers/net/irda/smsc-ircc2.c	2004-06-13 12:08:55.000000000 -0700
@@ -52,6 +52,7 @@
 #include <linux/init.h>
 #include <linux/rtnetlink.h>
 #include <linux/serial_reg.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -112,6 +113,8 @@
 	chipio_t io;               /* IrDA controller information */
 	iobuff_t tx_buff;          /* Transmit buffer */
 	iobuff_t rx_buff;          /* Receive buffer */
+	dma_addr_t tx_buff_dma;
+	dma_addr_t rx_buff_dma;
 
 	struct qos_info qos;       /* QoS capabilities for this device */
 
@@ -413,16 +416,18 @@
 	self->rx_buff.truesize = SMSC_IRCC2_RX_BUFF_TRUESIZE; 
 	self->tx_buff.truesize = SMSC_IRCC2_TX_BUFF_TRUESIZE;
 
-	self->rx_buff.head = (u8 *) kmalloc(self->rx_buff.truesize,
-					      GFP_KERNEL|GFP_DMA);
+	self->rx_buff.head =
+		dma_alloc_coherent(NULL, self->rx_buff.truesize, 
+				   &self->rx_buff_dma, GFP_KERNEL);
 	if (self->rx_buff.head == NULL) {
 		ERROR("%s, Can't allocate memory for receive buffer!\n",
                       driver_name);
 		goto err_out2;
 	}
 
-	self->tx_buff.head = (u8 *) kmalloc(self->tx_buff.truesize, 
-					      GFP_KERNEL|GFP_DMA);
+	self->tx_buff.head =
+		dma_alloc_coherent(NULL, self->tx_buff.truesize, 
+				   &self->tx_buff_dma, GFP_KERNEL);
 	if (self->tx_buff.head == NULL) {
 		ERROR("%s, Can't allocate memory for transmit buffer!\n",
                       driver_name);
@@ -464,9 +469,11 @@
 
 	return 0;
  err_out4:
-	kfree(self->tx_buff.head);
+	dma_free_coherent(NULL, self->tx_buff.truesize,
+			  self->tx_buff.head, self->tx_buff_dma);
  err_out3:
-	kfree(self->rx_buff.head);
+	dma_free_coherent(NULL, self->rx_buff.truesize,
+			  self->rx_buff.head, self->rx_buff_dma);
  err_out2:
 	free_netdev(self->netdev);
 	dev_self[--dev_count] = NULL;
@@ -1159,7 +1166,7 @@
 	     IRCC_CFGB_DMA_BURST, iobase+IRCC_SCE_CFGB);
 
 	/* Setup DMA controller (must be done after enabling chip DMA) */
-	irda_setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len, 
+	irda_setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len,
 		       DMA_TX_MODE);
 
 	/* Enable interrupt */
@@ -1249,8 +1256,8 @@
 	outb(2050 & 0xff, iobase+IRCC_RX_SIZE_LO);
 
 	/* Setup DMA controller */
-	irda_setup_dma(self->io.dma, self->rx_buff.data,
-		       self->rx_buff.truesize, DMA_RX_MODE);
+	irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize, 
+		       DMA_RX_MODE);
 
 	/* Enable burst mode chip Rx DMA */
 	register_bank(iobase, 1);
@@ -1717,10 +1724,12 @@
 	release_region(self->io.sir_base, self->io.sir_ext);
 
 	if (self->tx_buff.head)
-		kfree(self->tx_buff.head);
+		dma_free_coherent(NULL, self->tx_buff.truesize,
+				  self->tx_buff.head, self->tx_buff_dma);
 	
 	if (self->rx_buff.head)
-		kfree(self->rx_buff.head);
+		dma_free_coherent(NULL, self->rx_buff.truesize,
+				  self->rx_buff.head, self->rx_buff_dma);
 
 	free_netdev(self->netdev);
 
Index: linux-2.5/drivers/net/irda/via-ircc.c
===================================================================
--- linux-2.5.orig/drivers/net/irda/via-ircc.c	2004-06-13 11:57:18.000000000 -0700
+++ linux-2.5/drivers/net/irda/via-ircc.c	2004-06-13 12:08:55.000000000 -0700
@@ -39,6 +39,7 @@
 #include <linux/init.h>
 #include <linux/rtnetlink.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -383,7 +384,8 @@
 
 	/* Allocate memory if needed */
 	self->rx_buff.head =
-	    (__u8 *) kmalloc(self->rx_buff.truesize, GFP_KERNEL | GFP_DMA);
+		dma_alloc_coherent(NULL, self->rx_buff.truesize,
+				   &self->rx_buff_dma, GFP_KERNEL);
 	if (self->rx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto err_out2;
@@ -391,7 +393,8 @@
 	memset(self->rx_buff.head, 0, self->rx_buff.truesize);
 
 	self->tx_buff.head =
-	    (__u8 *) kmalloc(self->tx_buff.truesize, GFP_KERNEL | GFP_DMA);
+		dma_alloc_coherent(NULL, self->tx_buff.truesize,
+				   &self->tx_buff_dma, GFP_KERNEL);
 	if (self->tx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto err_out3;
@@ -432,9 +435,11 @@
 
 	return 0;
  err_out4:
-	kfree(self->tx_buff.head);
+	dma_free_coherent(NULL, self->tx_buff.truesize,
+			  self->tx_buff.head, self->tx_buff_dma);
  err_out3:
-	kfree(self->rx_buff.head);
+	dma_free_coherent(NULL, self->rx_buff.truesize,
+			  self->rx_buff.head, self->rx_buff_dma);
  err_out2:
 	release_region(self->io.fir_base, self->io.fir_ext);
  err_out1:
@@ -468,9 +473,11 @@
 		   __FUNCTION__, self->io.fir_base);
 	release_region(self->io.fir_base, self->io.fir_ext);
 	if (self->tx_buff.head)
-		kfree(self->tx_buff.head);
+		dma_free_coherent(NULL, self->tx_buff.truesize,
+				  self->tx_buff.head, self->tx_buff_dma);
 	if (self->rx_buff.head)
-		kfree(self->rx_buff.head);
+		dma_free_coherent(NULL, self->rx_buff.truesize,
+				  self->rx_buff.head, self->rx_buff_dma);
 	dev_self[self->index] = NULL;
 
 	free_netdev(self->netdev);
@@ -816,7 +823,7 @@
 	EnTXDMA(iobase, ON);
 	EnRXDMA(iobase, OFF);
 
-	irda_setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len,
+	irda_setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len,
 		       DMA_TX_MODE);
 
 	SetSendByte(iobase, self->tx_buff.len);
@@ -897,7 +904,8 @@
 	EnTXDMA(iobase, ON);
 	EnRXDMA(iobase, OFF);
 	irda_setup_dma(self->io.dma,
-		       self->tx_fifo.queue[self->tx_fifo.ptr].start,
+		       ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start -
+			self->tx_buff.head) + self->tx_buff_dma,
 		       self->tx_fifo.queue[self->tx_fifo.ptr].len, DMA_TX_MODE);
 #ifdef	DBGMSG
 	DBG(printk
@@ -1022,8 +1030,8 @@
 	EnAllInt(iobase, ON);
 	EnTXDMA(iobase, OFF);
 	EnRXDMA(iobase, ON);
-	irda_setup_dma(self->io.dma2, self->rx_buff.data,
-		       self->rx_buff.truesize, DMA_RX_MODE);
+	irda_setup_dma(self->io.dma2, self->rx_buff_dma,
+		  self->rx_buff.truesize, DMA_RX_MODE);
 	TXStart(iobase, OFF);
 	RXStart(iobase, ON);
 
Index: linux-2.5/drivers/net/irda/via-ircc.h
===================================================================
--- linux-2.5.orig/drivers/net/irda/via-ircc.h	2004-06-13 11:57:18.000000000 -0700
+++ linux-2.5/drivers/net/irda/via-ircc.h	2004-06-13 12:08:55.000000000 -0700
@@ -33,6 +33,7 @@
 #include <linux/time.h>
 #include <linux/spinlock.h>
 #include <linux/pm.h>
+#include <linux/types.h>
 #include <asm/io.h>
 
 #define MAX_TX_WINDOW 7
@@ -102,6 +103,8 @@
 	chipio_t io;		/* IrDA controller information */
 	iobuff_t tx_buff;	/* Transmit buffer */
 	iobuff_t rx_buff;	/* Receive buffer */
+	dma_addr_t tx_buff_dma;
+	dma_addr_t rx_buff_dma;
 
 	__u8 ier;		/* Interrupt enable register */
 
Index: linux-2.5/drivers/net/irda/w83977af_ir.c
===================================================================
--- linux-2.5.orig/drivers/net/irda/w83977af_ir.c	2004-06-13 11:57:18.000000000 -0700
+++ linux-2.5/drivers/net/irda/w83977af_ir.c	2004-06-13 12:08:55.000000000 -0700
@@ -50,6 +50,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/rtnetlink.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -207,8 +208,9 @@
 	self->tx_buff.truesize = 4000;
 	
 	/* Allocate memory if needed */
-	self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize,
-					      GFP_KERNEL|GFP_DMA);
+	self->rx_buff.head =
+		dma_alloc_coherent(NULL, self->rx_buff.truesize,
+				   &self->rx_buff_dma, GFP_KERNEL);
 	if (self->rx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto err_out1;
@@ -216,8 +218,9 @@
 
 	memset(self->rx_buff.head, 0, self->rx_buff.truesize);
 	
-	self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, 
-					      GFP_KERNEL|GFP_DMA);
+	self->tx_buff.head =
+		dma_alloc_coherent(NULL, self->tx_buff.truesize,
+				   &self->tx_buff_dma, GFP_KERNEL);
 	if (self->tx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto err_out2;
@@ -252,9 +255,11 @@
 	
 	return 0;
 err_out3:
-	kfree(self->tx_buff.head);
+	dma_free_coherent(NULL, self->tx_buff.truesize,
+			  self->tx_buff.head, self->tx_buff_dma);
 err_out2:	
-	kfree(self->rx_buff.head);
+	dma_free_coherent(NULL, self->rx_buff.truesize,
+			  self->rx_buff.head, self->rx_buff_dma);
 err_out1:
 	free_netdev(dev);
 err_out:
@@ -297,10 +302,12 @@
 	release_region(self->io.fir_base, self->io.fir_ext);
 
 	if (self->tx_buff.head)
-		kfree(self->tx_buff.head);
+		dma_free_coherent(NULL, self->tx_buff.truesize,
+				  self->tx_buff.head, self->tx_buff_dma);
 	
 	if (self->rx_buff.head)
-		kfree(self->rx_buff.head);
+		dma_free_coherent(NULL, self->rx_buff.truesize,
+				  self->rx_buff.head, self->rx_buff_dma);
 
 	free_netdev(self->netdev);
 
@@ -606,10 +613,10 @@
 	disable_dma(self->io.dma);
 	clear_dma_ff(self->io.dma);
 	set_dma_mode(self->io.dma, DMA_MODE_READ);
-	set_dma_addr(self->io.dma, isa_virt_to_bus(self->tx_buff.data));
+	set_dma_addr(self->io.dma, self->tx_buff_dma);
 	set_dma_count(self->io.dma, self->tx_buff.len);
 #else
-	irda_setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len, 
+	irda_setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len, 
 		       DMA_MODE_WRITE);	
 #endif
 	self->io.direction = IO_XMIT;
@@ -763,10 +770,10 @@
 	disable_dma(self->io.dma);
 	clear_dma_ff(self->io.dma);
 	set_dma_mode(self->io.dma, DMA_MODE_READ);
-	set_dma_addr(self->io.dma, isa_virt_to_bus(self->rx_buff.data));
+	set_dma_addr(self->io.dma, self->rx_buff_dma);
 	set_dma_count(self->io.dma, self->rx_buff.truesize);
 #else
-	irda_setup_dma(self->io.dma, self->rx_buff.data, self->rx_buff.truesize, 
+	irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize, 
 		       DMA_MODE_READ);
 #endif
 	/* 
Index: linux-2.5/drivers/net/irda/w83977af_ir.h
===================================================================
--- linux-2.5.orig/drivers/net/irda/w83977af_ir.h	2004-06-13 11:57:18.000000000 -0700
+++ linux-2.5/drivers/net/irda/w83977af_ir.h	2004-06-13 12:08:55.000000000 -0700
@@ -26,6 +26,7 @@
 #define W83977AF_IR_H
 
 #include <asm/io.h>
+#include <linux/types.h>
 
 /* Flags for configuration register CRF0 */
 #define ENBNKSEL	0x01
@@ -179,6 +180,8 @@
 	chipio_t io;               /* IrDA controller information */
 	iobuff_t tx_buff;          /* Transmit buffer */
 	iobuff_t rx_buff;          /* Receive buffer */
+	dma_addr_t tx_buff_dma;
+	dma_addr_t rx_buff_dma;
 
 	/* Note : currently locking is *very* incomplete, but this
 	 * will get you started. Check in nsc-ircc.c for a proper
Index: linux-2.5/include/net/irda/irda_device.h
===================================================================
--- linux-2.5.orig/include/net/irda/irda_device.h	2004-06-13 11:57:46.000000000 -0700
+++ linux-2.5/include/net/irda/irda_device.h	2004-06-13 12:08:55.000000000 -0700
@@ -39,11 +39,13 @@
 #ifndef IRDA_DEVICE_H
 #define IRDA_DEVICE_H
 
+#include <linux/config.h>
 #include <linux/tty.h>
 #include <linux/netdevice.h>
 #include <linux/spinlock.h>
 #include <linux/skbuff.h>		/* struct sk_buff */
 #include <linux/irda.h>
+#include <linux/types.h>
 
 #include <net/pkt_sched.h>
 #include <net/irda/irda.h>
@@ -236,7 +238,7 @@
 int irda_device_dongle_cleanup(dongle_t *dongle);
 
 #ifdef CONFIG_ISA
-void irda_setup_dma(int channel, char *buffer, int count, int mode);
+void irda_setup_dma(int channel, dma_addr_t buffer, int count, int mode);
 #endif
 
 void irda_task_delete(struct irda_task *task);
Index: linux-2.5/net/irda/irda_device.c
===================================================================
--- linux-2.5.orig/net/irda/irda_device.c	2004-06-13 11:57:48.000000000 -0700
+++ linux-2.5/net/irda/irda_device.c	2004-06-13 12:08:55.000000000 -0700
@@ -536,7 +536,7 @@
  *    Setup the DMA channel. Commonly used by ISA FIR drivers
  *
  */
-void irda_setup_dma(int channel, char *buffer, int count, int mode)
+void irda_setup_dma(int channel, dma_addr_t buffer, int count, int mode)
 {
 	unsigned long flags;
 
@@ -545,7 +545,7 @@
 	disable_dma(channel);
 	clear_dma_ff(channel);
 	set_dma_mode(channel, mode);
-	set_dma_addr(channel, isa_virt_to_bus(buffer));
+	set_dma_addr(channel, buffer);
 	set_dma_count(channel, count);
 	enable_dma(channel);
 

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

* Re: [3/12] remove irda usage of isa_virt_to_bus()
  2004-06-14  0:36     ` [3/12] remove irda usage of isa_virt_to_bus() William Lee Irwin III
@ 2004-06-14  8:11       ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2004-06-14  8:11 UTC (permalink / raw)
  To: William Lee Irwin III, linux-kernel

On Sun, Jun 13, 2004 at 05:36:05PM -0700, William Lee Irwin III wrote:
>  * Removed uses of isa_virt_to_bus
> This resolves Debian BTS #218878.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=218878
> 
> 	From: Paavo Hartikainen <pahartik@sci.fi>
> 	To: Debian Bug Tracking System <submit@bugs.debian.org>
> 	Subject: IrDA modules fail to load
> 	Message-Id: <E1AGYn5-0000LT-00@mufasa.vip.fi>
> 
> When trying to "modprobe irda irtty", it fails with following message:
>   FATAL: Error inserting irda (/lib/modules/2.6.0-test9/kernel/net/irda/irda.ko): Unknown symbol in module, or unknown parameter (see dmesg)
> And in "dmesg" I see these:
>   irda: Unknown symbol isa_virt_to_bus
>   irda: Unknown symbol isa_virt_to_bus

netdev would be the right list I guess. 


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

* Re: [3/12] remove irda usage of isa_virt_to_bus()
@ 2004-06-15  1:43 Jean Tourrilhes
  2004-06-15  9:12 ` William Lee Irwin III
  0 siblings, 1 reply; 6+ messages in thread
From: Jean Tourrilhes @ 2004-06-15  1:43 UTC (permalink / raw)
  To: Linux kernel mailing list, William Lee Irwin III

William Lee Irwin III wrote :
> 
>  * Removed uses of isa_virt_to_bus
> This resolves Debian BTS #218878.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=218878
> 
> 	From: Paavo Hartikainen <pahartik@sci.fi>
> 	To: Debian Bug Tracking System <submit@bugs.debian.org>
> 	Subject: IrDA modules fail to load
> 	Message-Id: <E1AGYn5-0000LT-00@mufasa.vip.fi>
> 
> When trying to "modprobe irda irtty", it fails with following message:
>   FATAL: Error inserting irda (/lib/modules/2.6.0-test9/kernel/net/irda/irda.ko): \
> Unknown symbol in module, or unknown parameter (see dmesg) And in "dmesg" I see \
> these:  irda: Unknown symbol isa_virt_to_bus
>   irda: Unknown symbol isa_virt_to_bus

	Could you please send this directly to me. I hate scrubbing
large patches from the mailing list archive.
	Note that before even thinking of pushing this patch in the
kernel, we need to perform testing with the hardware on i386 and
potentially on ARM. The author only tried with irtty that doesn't use
this function, so that's not a valid test at all. Finding people test
those changes is going to be tough, as usual.
	I'm also wondering about the validity of those changes, but
that's another matter I need to go through. During 2.5.X, some people
assured me that using isa_virt_to_bus was safe on all platform with an
ISA bus...

	Thanks...

	Jean


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

* Re: [3/12] remove irda usage of isa_virt_to_bus()
  2004-06-15  1:43 [3/12] remove irda usage of isa_virt_to_bus() Jean Tourrilhes
@ 2004-06-15  9:12 ` William Lee Irwin III
  2004-06-15 17:01   ` Jean Tourrilhes
  0 siblings, 1 reply; 6+ messages in thread
From: William Lee Irwin III @ 2004-06-15  9:12 UTC (permalink / raw)
  To: Jean Tourrilhes; +Cc: Linux kernel mailing list

On Mon, Jun 14, 2004 at 06:43:44PM -0700, Jean Tourrilhes wrote:
> 	Could you please send this directly to me. I hate scrubbing
> large patches from the mailing list archive.
> 	Note that before even thinking of pushing this patch in the
> kernel, we need to perform testing with the hardware on i386 and
> potentially on ARM. The author only tried with irtty that doesn't use
> this function, so that's not a valid test at all. Finding people test
> those changes is going to be tough, as usual.
> 	I'm also wondering about the validity of those changes, but
> that's another matter I need to go through. During 2.5.X, some people
> assured me that using isa_virt_to_bus was safe on all platform with an
> ISA bus...

Okay, well, I myself didn't produce this, and I couldn't tell offhand
if it was bogus or not. I presumed bugreporter made happy and spraying
it across the debian userbase was enough to verify it at runtime. From
what you're telling me, this is not the case.

Can you recommend people to do this kind of testing?

Apparently people aren't entirely happy with "dump it on lkml and wait
for an ack or nak", which I've noted for future reference, but probably
won't have a need to consider again (it's very rare that I have to deal
with changes I didn't write myself or are otherwise in areas I don't
have much knowledge about). OTOH, it was easier to find than buried in
a distro BTS and/or cvs, not that that makes it ideal.


-- wli

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

* Re: [3/12] remove irda usage of isa_virt_to_bus()
  2004-06-15  9:12 ` William Lee Irwin III
@ 2004-06-15 17:01   ` Jean Tourrilhes
  2004-06-15 17:35     ` William Lee Irwin III
  0 siblings, 1 reply; 6+ messages in thread
From: Jean Tourrilhes @ 2004-06-15 17:01 UTC (permalink / raw)
  To: William Lee Irwin III, Linux kernel mailing list

On Tue, Jun 15, 2004 at 02:12:19AM -0700, William Lee Irwin III wrote:
> On Mon, Jun 14, 2004 at 06:43:44PM -0700, Jean Tourrilhes wrote:
> > 	Could you please send this directly to me. I hate scrubbing
> > large patches from the mailing list archive.
> > 	Note that before even thinking of pushing this patch in the
> > kernel, we need to perform testing with the hardware on i386 and
> > potentially on ARM. The author only tried with irtty that doesn't use
> > this function, so that's not a valid test at all. Finding people test
> > those changes is going to be tough, as usual.
> > 	I'm also wondering about the validity of those changes, but
> > that's another matter I need to go through. During 2.5.X, some people
> > assured me that using isa_virt_to_bus was safe on all platform with an
> > ISA bus...
> 
> Okay, well, I myself didn't produce this, and I couldn't tell offhand
> if it was bogus or not.

	I can't either, that's why we need to check it.

> I presumed bugreporter made happy and spraying
> it across the debian userbase was enough to verify it at runtime. From
> what you're telling me, this is not the case.

	IrDA is a special case because there are few users and most
are still using 2.4.X.

> Can you recommend people to do this kind of testing?

	Me. I'll also post the patch to the linux-irda mailing list.

> Apparently people aren't entirely happy with "dump it on lkml and wait
> for an ack or nak", which I've noted for future reference, but probably
> won't have a need to consider again (it's very rare that I have to deal
> with changes I didn't write myself or are otherwise in areas I don't
> have much knowledge about).

	I'm not a full time Linux hacker, I follow lkml from the
archive. No big deal.

> OTOH, it was easier to find than buried in
> a distro BTS and/or cvs, not that that makes it ideal.

	Debian is usually very good sending me bug reports (especiall
on wireless tools), so I'm a bit surprised that it did not work this
time. But I've seen a recent trend by Debian to do more Debian
specific stuff for system level config, which I find disturbing.

> -- wli

	Thanks !

	Jean

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

* Re: [3/12] remove irda usage of isa_virt_to_bus()
  2004-06-15 17:01   ` Jean Tourrilhes
@ 2004-06-15 17:35     ` William Lee Irwin III
  0 siblings, 0 replies; 6+ messages in thread
From: William Lee Irwin III @ 2004-06-15 17:35 UTC (permalink / raw)
  To: Jean Tourrilhes; +Cc: Linux kernel mailing list

On Tue, Jun 15, 2004 at 02:12:19AM -0700, William Lee Irwin III wrote:
>> OTOH, it was easier to find than buried in
>> a distro BTS and/or cvs, not that that makes it ideal.

On Tue, Jun 15, 2004 at 10:01:58AM -0700, Jean Tourrilhes wrote:
> 	Debian is usually very good sending me bug reports (especiall
> on wireless tools), so I'm a bit surprised that it did not work this
> time. But I've seen a recent trend by Debian to do more Debian
> specific stuff for system level config, which I find disturbing.

These seem to be the ones that have leaked through the cracks. Apart
from this (and the posting is helping to find all the concerned parties)
things should go largely through normal channels in general.

Also, thanks for doing the footwork to get this thing properly
evaluated, as it was unclear to me the risks involved. I don't want
bogus code going in.


-- wli

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

end of thread, other threads:[~2004-06-15 17:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-15  1:43 [3/12] remove irda usage of isa_virt_to_bus() Jean Tourrilhes
2004-06-15  9:12 ` William Lee Irwin III
2004-06-15 17:01   ` Jean Tourrilhes
2004-06-15 17:35     ` William Lee Irwin III
  -- strict thread matches above, loose matches on Subject: below --
2004-06-14  0:31 [0/12] Debian bugfixes William Lee Irwin III
2004-06-14  0:33 ` [1/12] don't dereference netdev->name before register_netdev() William Lee Irwin III
2004-06-14  0:34   ` [2/12] lower priority of "too many keys" msg in atkbd.c William Lee Irwin III
2004-06-14  0:36     ` [3/12] remove irda usage of isa_virt_to_bus() William Lee Irwin III
2004-06-14  8:11       ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox