login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
May
»
21
Re: [PATCH] Fix Oops with Atmel SPI
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Andrew Morton
Subject:
Re: [PATCH] Fix Oops with Atmel SPI
Date: Friday, May 21, 2010 - 12:01 pm
On Wed, 19 May 2010 13:05:00 +0200 Anders Larsen <al@alarsen.net> wrote:
quoted text
> On 2010-04-22 00:24:10, Andrew Morton wrote: > > Finally.. Wouldn't it be better to just fix the atmel SPI driver so > > that it doesn't barf when handed vmalloc'ed memory? Who do we ridicule > > about that? <checks, adds cc> > > You mean something like this instead?
That looks simple enough. How do we get it tested, changelogged and merged up? Haavard, can you please take a look?
quoted text
> diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c > index c4e0442..a9ad5e8 100644 > --- a/drivers/spi/atmel_spi.c > +++ b/drivers/spi/atmel_spi.c > @@ -352,16 +352,30 @@ atmel_spi_dma_map_xfer(struct atmel_spi *as, struct spi_transfer *xfer) > > xfer->tx_dma = xfer->rx_dma = INVALID_DMA_ADDRESS; > if (xfer->tx_buf) { > - xfer->tx_dma = dma_map_single(dev, > - (void *) xfer->tx_buf, xfer->len, > - DMA_TO_DEVICE); > + if (is_vmalloc_addr(xfer->tx_buf)) > + xfer->tx_dma = dma_map_page(dev, > + vmalloc_to_page(xfer->tx_buf), > + (unsigned long)xfer->tx_buf & (PAGE_SIZE-1), > + xfer->len, > + DMA_TO_DEVICE); > + else > + xfer->tx_dma = dma_map_single(dev, > + (void *) xfer->tx_buf, xfer->len, > + DMA_TO_DEVICE); > if (dma_mapping_error(dev, xfer->tx_dma)) > return -ENOMEM; > } > if (xfer->rx_buf) { > - xfer->rx_dma = dma_map_single(dev, > - xfer->rx_buf, xfer->len, > - DMA_FROM_DEVICE); > + if (is_vmalloc_addr(xfer->rx_buf)) > + xfer->rx_dma = dma_map_page(dev, > + vmalloc_to_page(xfer->rx_buf), > + (unsigned long)xfer->rx_buf & (PAGE_SIZE-1), > + xfer->len, > + DMA_FROM_DEVICE); > + else > + xfer->rx_dma = dma_map_single(dev, > + xfer->rx_buf, xfer->len, > + DMA_FROM_DEVICE); > if (dma_mapping_error(dev, xfer->rx_dma)) { > if (xfer->tx_buf) > dma_unmap_single(dev, >
--
unsubscribe notice
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/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] Fix Oops with Atmel SPI
, Anders Larsen
, (Tue Apr 13, 4:31 am)
Re: [PATCH] Fix Oops with Atmel SPI
, Iwo Mergler
, (Wed Apr 14, 12:30 am)
Re: [PATCH] Fix Oops with Atmel SPI
, Anders Larsen
, (Wed Apr 14, 12:57 am)
Re: [PATCH] Fix Oops with Atmel SPI
, Kevin Cernekee
, (Wed Apr 14, 11:13 am)
Re: [PATCH] Fix Oops with Atmel SPI
, Iwo Mergler
, (Thu Apr 15, 12:32 am)
Re: [PATCH] Fix Oops with Atmel SPI
, Andrew Morton
, (Wed Apr 21, 3:24 pm)
Re: [PATCH] Fix Oops with Atmel SPI
, Artem Bityutskiy
, (Tue Apr 27, 5:57 am)
Re: [PATCH] Fix Oops with Atmel SPI
, Anders Larsen
, (Wed May 19, 4:05 am)
Re: [PATCH] Fix Oops with Atmel SPI
, Andrew Morton
, (Fri May 21, 12:01 pm)
Re: [PATCH] Fix Oops with Atmel SPI
, Ian McDonnell
, (Mon May 24, 8:09 am)
Re: [PATCH] Fix Oops with Atmel SPI
, Haavard Skinnemoen
, (Fri May 28, 2:27 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Fortier,Vincent [Montreal]
2.6.21.5 june 30th to july 1st date hang?
Jeff Dike
[ PATCH 2/6 ] UML - Formatting fixes around os_{read_write}_file callers
Liam Girdwood
[PATCH 07/13] regulator: regulator test harness
Oleg Nesterov
Re: Getting the new RxRPC patches upstream
Stefan Seyfried
Re: 2.6.19-rc5: grub is much slower resuming from suspend-to-disk than in 2.6.18
linux-netdev
:
Arnaud Ebalard
Re: [REGRESSION,BISECTED] MIPv6 support broken by f4f914b58019f0
Jan Engelhardt
Re: [PATCH iptables] extension: add xt_cpu match
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Sebastian Andrzej Siewior
[PATCH 8/8] net/emergency: remove locking from reycling pool if emergncy pools are...
David Miller
Re: [PATCH] qlcnic: dont assume NET_IP_ALIGN is 2
git
:
Jakub Narebski
Re: git on MacOSX and files with decomposed utf-8 file names
Brandon Casey
Re: Thunderbird and patches (was Re: [PATCH v2] Enable setting attach as the def...
Christian Couder
[PATCH 1/3] rev-parse: add test script for "--verify"
Ramkumar Ramachandra
Re: [GSoC update] git-remote-svn: The final one
Junio C Hamano
Re: git-rm isn't the inverse action of git-add
openbsd-misc
:
Joachim Schipper
Re: UVC Webcams
Florin Andrei
SOLVED [was: firewall is very slow, something's wrong]
Todd Alan Smith
Re: Microsoft gets the Most Secure Operating Systems award
Neal Hogan
Re: Need Advice: Thinkpad T60 or T61?
Sam Fourman Jr.
Re: Real men don't attack straw men
git-commits-head
:
Linux Kernel Mailing List
ACPI: Disable ARB_DISABLE on platforms where it is not needed
Linux Kernel Mailing List
m68knommu: add read_barrier_depends() and irqs_disabled_flags()
Linux Kernel Mailing List
[MTD] Add mtd panic_write function pointer
Linux Kernel Mailing List
[ARM] pxa: remove duplicate select statements from Kconfig
Linux Kernel Mailing List
mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
Colocation donated by:
Syndicate