All of lore.kernel.org
 help / color / mirror / Atom feed
* + goku_udc-remove-crude-cache-coherency-code.patch added to -mm tree
@ 2007-02-28  6:30 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2007-02-28  6:30 UTC (permalink / raw)
  To: mm-commits; +Cc: ralf, greg


The patch titled
     usb: goku_udc: Remove crude cache coherency code
has been added to the -mm tree.  Its filename is
     goku_udc-remove-crude-cache-coherency-code.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: usb: goku_udc: Remove crude cache coherency code
From: Ralf Baechle <ralf@linux-mips.org>

This is deep architecture specific magic and does should not to exist in a
driver.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/usb/gadget/goku_udc.c |   29 -----------------------------
 1 file changed, 29 deletions(-)

diff -puN drivers/usb/gadget/goku_udc.c~goku_udc-remove-crude-cache-coherency-code drivers/usb/gadget/goku_udc.c
--- a/drivers/usb/gadget/goku_udc.c~goku_udc-remove-crude-cache-coherency-code
+++ a/drivers/usb/gadget/goku_udc.c
@@ -297,27 +297,6 @@ goku_free_request(struct usb_ep *_ep, st
 
 /*-------------------------------------------------------------------------*/
 
-#undef USE_KMALLOC
-
-/* many common platforms have dma-coherent caches, which means that it's
- * safe to use kmalloc() memory for all i/o buffers without using any
- * cache flushing calls.  (unless you're trying to share cache lines
- * between dma and non-dma activities, which is a slow idea in any case.)
- *
- * other platforms need more care, with 2.6 having a moderately general
- * solution except for the common "buffer is smaller than a page" case.
- */
-#if	defined(CONFIG_X86)
-#define USE_KMALLOC
-
-#elif	defined(CONFIG_MIPS) && !defined(CONFIG_DMA_NONCOHERENT)
-#define USE_KMALLOC
-
-#elif	defined(CONFIG_PPC) && !defined(CONFIG_NOT_COHERENT_CACHE)
-#define USE_KMALLOC
-
-#endif
-
 /* allocating buffers this way eliminates dma mapping overhead, which
  * on some platforms will mean eliminating a per-io buffer copy.  with
  * some kinds of system caches, further tweaks may still be needed.
@@ -334,11 +313,6 @@ goku_alloc_buffer(struct usb_ep *_ep, un
 		return NULL;
 	*dma = DMA_ADDR_INVALID;
 
-#if	defined(USE_KMALLOC)
-	retval = kmalloc(bytes, gfp_flags);
-	if (retval)
-		*dma = virt_to_phys(retval);
-#else
 	if (ep->dma) {
 		/* the main problem with this call is that it wastes memory
 		 * on typical 1/N page allocations: it allocates 1-N pages.
@@ -348,7 +322,6 @@ goku_alloc_buffer(struct usb_ep *_ep, un
 				bytes, dma, gfp_flags);
 	} else
 		retval = kmalloc(bytes, gfp_flags);
-#endif
 	return retval;
 }
 
@@ -356,7 +329,6 @@ static void
 goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes)
 {
 	/* free memory into the right allocator */
-#ifndef	USE_KMALLOC
 	if (dma != DMA_ADDR_INVALID) {
 		struct goku_ep	*ep;
 
@@ -365,7 +337,6 @@ goku_free_buffer(struct usb_ep *_ep, voi
 			return;
 		dma_free_coherent(&ep->dev->pdev->dev, bytes, buf, dma);
 	} else
-#endif
 		kfree (buf);
 }
 
_

Patches currently in -mm which might be from ralf@linux-mips.org are

linux-sysdevh-needs-to-include-linux-moduleh.patch
git-mips.patch
mips-remove-smp_tune_scheduling.patch
mips-remove-unreferenced-_ioc_slmask-macro-in-ioctlh.patch
serial-driver-pmc-msp71xx.patch
rm9000-serial-driver.patch
rm9000-serial-driver-tidy.patch
serial-serial_txx9-driver-update.patch
serial-serial_txx9-driver-update-fix.patch
goku_udc-remove-crude-cache-coherency-code.patch
simplify-the-stacktrace-code.patch
fixes-and-cleanups-for-earlyprintk-aka-boot-console.patch
mips-convert-to-use-shared-apm-emulation-fix.patch
atomich-add-atomic64-cmpxchg-xchg-and-add_unless-to-mips.patch
local_t-mips-extension.patch
local_t-mips-extension-fix.patch
local_t-mips-extension-shrink-duplicated-mips-32-64-bits-functions-from-localh.patch
local_t-mips-extension-shrink-duplicated-mips-32-64-bits-functions-from-localh-fix.patch

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

only message in thread, other threads:[~2007-02-28  6:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-28  6:30 + goku_udc-remove-crude-cache-coherency-code.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.