public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: Massimo CIRILLO <massimo.cirillo@st.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: Wrong cache invalidation in cfi_cmdset0001.c (2.6.21 kernel)
Date: Mon, 26 Nov 2007 18:45:33 +0100	[thread overview]
Message-ID: <20071126174533.GA22844@lazybastard.org> (raw)
In-Reply-To: <000a01c83051$03c9a510$7205960a@nap.st.com>

On Mon, 26 November 2007 18:23:09 +0100, Massimo CIRILLO wrote:
> 
> We found an issue in cfi_cmdset0001.c file of 2.6.21 kernel.
> It is related to cache region invalidation in the buffered
> write procedure.
> 
> The original code performs cache invalidation from "adr" to "adr + len" in
> do_write_buffer() while we modify region from "cmd_adr" to "len2" 
> where len2 is equal to initial value of len.

Could use a better name, initial_len or something like that.  And David
would surely appreciate a Signed-off-by: line.  Otherwise appears to
make sense.

> The following is the patch to apply for 2.6.21 kernel.
> 
> --- a/drivers/mtd/chips/cfi_cmdset_0001.c	2007-11-26 18:06:37.000000000 +0100
> +++ b/drivers/mtd/chips/cfi_cmdset_0001.c	2007-11-26 18:06:44.000000000 +0100
> @@ -1472,6 +1472,7 @@ static int __xipram do_write_buffer(stru
>  	int ret, wbufsize, word_gap, words;
>  	const struct kvec *vec;
>  	unsigned long vec_seek;
> +	int len2=len;
>  
>  	wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
>  	adr += chip->start;
> @@ -1578,7 +1579,7 @@ static int __xipram do_write_buffer(stru
>  	chip->state = FL_WRITING;
>  
>  	ret = INVAL_CACHE_AND_WAIT(map, chip, cmd_adr,
> -				   adr, len,
> +				   cmd_adr, len2,
>  				   chip->buffer_write_time);
>  	if (ret) {
>  		map_write(map, CMD(0x70), cmd_adr);
> 

Jörn

-- 
But this is not to say that the main benefit of Linux and other GPL
software is lower-cost. Control is the main benefit--cost is secondary.
-- Bruce Perens

  reply	other threads:[~2007-11-26 18:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-26 17:23 Wrong cache invalidation in cfi_cmdset0001.c (2.6.21 kernel) Massimo CIRILLO
2007-11-26 17:45 ` Jörn Engel [this message]
2007-11-26 18:36   ` Jared Hulbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071126174533.GA22844@lazybastard.org \
    --to=joern@logfs.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=massimo.cirillo@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox