lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 12 May 2010 14:19:29 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Nicolas Ferre <nicolas.ferre@...el.com>
Cc:	linux-arm-kernel@...ts.infradead.org, linux-mmc@...r.kernel.org,
	avictor.za@...il.com, linux@....linux.org.uk,
	linux-kernel@...r.kernel.org,
	James Bottomley <James.Bottomley@...senPartnership.com>
Subject: Re: [PATCH] MMC: at91_mci: modify cache flush routines

On Tue, 11 May 2010 19:09:53 +0200
Nicolas Ferre <nicolas.ferre@...el.com> wrote:

> As we were using an internal dma flushing routine, this patch changes to the
> DMA API flush_kernel_dcache_page(). Driver is able to compile now.
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@...el.com>
> ---
>  drivers/mmc/host/at91_mci.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
> index a6dd7da..813d208 100644
> --- a/drivers/mmc/host/at91_mci.c
> +++ b/drivers/mmc/host/at91_mci.c
> @@ -315,7 +315,7 @@ static void at91_mci_post_dma_read(struct at91mci_host *host)
>  		}
>  
>  		kunmap_atomic(sgbuffer, KM_BIO_SRC_IRQ);
> -		dmac_flush_range((void *)sgbuffer, ((void *)sgbuffer) + amount);
> +		flush_kernel_dcache_page(sg_page(sg));
>  		data->bytes_xfered += amount;
>  		if (size == 0)
>  			break;

The flush_kernel_dcache_page() documentation specifically says that
thou shalt run flush_kernel_dcache_page() _prior_ to kunmapping the
page.

I don't know if that makes a difference in the real world, but heck why
not:

--- a/drivers/mmc/host/at91_mci.c~mmc-at91_mci-modify-cache-flush-routines-fix
+++ a/drivers/mmc/host/at91_mci.c
@@ -314,8 +314,8 @@ static void at91_mci_post_dma_read(struc
 			dmabuf = (unsigned *)tmpv;
 		}
 
-		kunmap_atomic(sgbuffer, KM_BIO_SRC_IRQ);
 		flush_kernel_dcache_page(sg_page(sg));
+		kunmap_atomic(sgbuffer, KM_BIO_SRC_IRQ);
 		data->bytes_xfered += amount;
 		if (size == 0)
 			break;
_

However, I'm wondering why you chose flush_kernel_dcache_page() instead
of plain old flush_dcache_page().  Is this a pagecache or possibly
direct-io page we're dealing with here?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ