diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-03-11 02:30:14 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-03-17 15:35:15 -0400 |
commit | 860cfe796c793bfad1e666de9600852f2d653c57 (patch) | |
tree | 62d9da3c369195a586043ab43d1656752fb9cc6e /drivers/mmc | |
parent | b33d46c398fd071dccd0815f33620924684860cd (diff) |
mmc: tmio: fix address in kunmap_atomic() calls
Currently kunmap_atomic() doesn't take into account the offset, used
with kmap_atomic(). On platforms, where kunmap_atomic() is not a NOP,
this will lead to problems, when offset != 0.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/tmio_mmc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 0e4998fa6fc..ac52eb65395 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c | |||
@@ -219,9 +219,9 @@ static char *tmio_mmc_kmap_atomic(struct scatterlist *sg, unsigned long *flags) | |||
219 | return kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset; | 219 | return kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset; |
220 | } | 220 | } |
221 | 221 | ||
222 | static void tmio_mmc_kunmap_atomic(void *virt, unsigned long *flags) | 222 | static void tmio_mmc_kunmap_atomic(struct scatterlist *sg, unsigned long *flags, void *virt) |
223 | { | 223 | { |
224 | kunmap_atomic(virt, KM_BIO_SRC_IRQ); | 224 | kunmap_atomic(virt - sg->offset, KM_BIO_SRC_IRQ); |
225 | local_irq_restore(*flags); | 225 | local_irq_restore(*flags); |
226 | } | 226 | } |
227 | 227 | ||
@@ -510,7 +510,7 @@ static void tmio_mmc_pio_irq(struct tmio_mmc_host *host) | |||
510 | 510 | ||
511 | host->sg_off += count; | 511 | host->sg_off += count; |
512 | 512 | ||
513 | tmio_mmc_kunmap_atomic(sg_virt, &flags); | 513 | tmio_mmc_kunmap_atomic(host->sg_ptr, &flags, sg_virt); |
514 | 514 | ||
515 | if (host->sg_off == host->sg_ptr->length) | 515 | if (host->sg_off == host->sg_ptr->length) |
516 | tmio_mmc_next_sg(host); | 516 | tmio_mmc_next_sg(host); |
@@ -770,7 +770,7 @@ static void tmio_check_bounce_buffer(struct tmio_mmc_host *host) | |||
770 | unsigned long flags; | 770 | unsigned long flags; |
771 | void *sg_vaddr = tmio_mmc_kmap_atomic(host->sg_orig, &flags); | 771 | void *sg_vaddr = tmio_mmc_kmap_atomic(host->sg_orig, &flags); |
772 | memcpy(sg_vaddr, host->bounce_buf, host->bounce_sg.length); | 772 | memcpy(sg_vaddr, host->bounce_buf, host->bounce_sg.length); |
773 | tmio_mmc_kunmap_atomic(sg_vaddr, &flags); | 773 | tmio_mmc_kunmap_atomic(host->sg_orig, &flags, sg_vaddr); |
774 | } | 774 | } |
775 | } | 775 | } |
776 | 776 | ||
@@ -897,7 +897,7 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host) | |||
897 | void *sg_vaddr = tmio_mmc_kmap_atomic(sg, &flags); | 897 | void *sg_vaddr = tmio_mmc_kmap_atomic(sg, &flags); |
898 | sg_init_one(&host->bounce_sg, host->bounce_buf, sg->length); | 898 | sg_init_one(&host->bounce_sg, host->bounce_buf, sg->length); |
899 | memcpy(host->bounce_buf, sg_vaddr, host->bounce_sg.length); | 899 | memcpy(host->bounce_buf, sg_vaddr, host->bounce_sg.length); |
900 | tmio_mmc_kunmap_atomic(sg_vaddr, &flags); | 900 | tmio_mmc_kunmap_atomic(sg, &flags, sg_vaddr); |
901 | host->sg_ptr = &host->bounce_sg; | 901 | host->sg_ptr = &host->bounce_sg; |
902 | sg = host->sg_ptr; | 902 | sg = host->sg_ptr; |
903 | } | 903 | } |