public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] implement dma_mapping_error
@ 2004-03-27  0:00 Jesse Barnes
  0 siblings, 0 replies; only message in thread
From: Jesse Barnes @ 2004-03-27  0:00 UTC (permalink / raw)
  To: linux-ia64

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

On sn2, dma_mapping_error is trivial.  pci_map_single was already returning 0 
in case of failure (0 is an invalid DMA address on sn2), so make 
dma_mapping_error check for that.

Thanks,
Jesse

[-- Attachment #2: pci-dma-mapping-error-2.patch --]
[-- Type: text/plain, Size: 878 bytes --]

===== arch/ia64/sn/io/machvec/pci_dma.c 1.29 vs edited =====
--- 1.29/arch/ia64/sn/io/machvec/pci_dma.c	Mon Mar 22 06:34:46 2004
+++ edited/arch/ia64/sn/io/machvec/pci_dma.c	Fri Mar 26 14:33:08 2004
@@ -391,11 +391,9 @@
 	dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, PCIIO_DMA_DATA | 
 				     MINIMAL_ATE_FLAG(phys_addr, size));
 
-	if (!dma_map) {
-		printk(KERN_ERR "pci_map_single: Unable to allocate anymore "
-		       "32 bit page map entries.\n");
+	/* PMU out of entries */
+	if (!dma_map)
 		return 0;
-	}
 
 	dma_addr = (dma_addr_t) pcibr_dmamap_addr(dma_map, phys_addr, size);
 	dma_map->bd_dma_addr = dma_addr;
@@ -655,6 +653,12 @@
 int
 sn_dma_mapping_error(dma_addr_t dma_addr)
 {
+	/*
+	 * We can only run out of page mapping entries, so if there's
+	 * an error, tell the caller to try again later.
+	 */
+	if (!dma_addr)
+		return -EAGAIN;
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-27  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-27  0:00 [PATCH] implement dma_mapping_error Jesse Barnes

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