From: Brian Norris <computersforpeace@gmail.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>,
Ralf Baechle <ralf@linux-mips.org>,
Javier Martinez Canillas <javier@osg.samsung.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Fengguang Wu <fengguang.wu@intel.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Luis de Bethencourt <luisbg@osg.samsung.com>,
Jeremy Kerr <jk@ozlabs.org>,
Neelesh Gupta <neelegup@linux.vnet.ibm.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
David Woodhouse <dwmw2@infradead.org>,
Cyril Bur <cyrilbur@gmail.com>
Subject: Re: [PATCH] mtd: bcm47xxsflash: use devm_ioremap_nocache() instead of KSEG0ADDR()
Date: Sat, 23 Jan 2016 13:49:18 -0800 [thread overview]
Message-ID: <20160123214918.GC24744@localhost> (raw)
In-Reply-To: <CACna6rwAfXQxX8o0+DxroB6vOGZax70VVdPOAjeoGGUsDjdNhA@mail.gmail.com>
On Sat, Jan 16, 2016 at 01:38:11AM +0100, Rafał Miłecki wrote:
> So I wanted to stick to the cached mapping, [...]
I mentioned this earlier on, but I don't feel like I've gotten a clear
answer. Is a cached mapping actually safe here? From the looks of it,
the memory mapping is a read-only memory-mapped flash, and flash writes
/ erasures are done through a different bus (register writes vis BCMA
bus). So if we have a cached mapping of that memory, it doens't
naturally synchronize with any write/erase operations. Doesn't this mean
you might get stale data if you do a sequence of read / erase / read,
for instance, since the 2nd read will return cached data from the 1st
read?
IIUC, this could be solved by:
(a) using an uncached mapping or
(b) explicitly invalidating the relevant region after doing flash writes
or erasures
But I wonder why you haven't seen any problems if you've been using
KSEG0 (cached) this whole time. Maybe just luck? Or you don't actually
write to the flash that much?
Brian
next prev parent reply other threads:[~2016-01-23 21:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 9:04 [PATCH] mtd: Make MTD_BCM47XXSFLASH to depend on MIPS Javier Martinez Canillas
2015-10-14 16:25 ` Brian Norris
2015-11-04 9:04 ` Rafał Miłecki
2015-11-04 18:53 ` Brian Norris
2016-01-07 21:06 ` Maciej W. Rozycki
2016-01-07 23:05 ` [PATCH] mtd: bcm47xxsflash: use devm_ioremap_nocache() instead of KSEG0ADDR() Brian Norris
2016-01-08 7:53 ` Rafał Miłecki
2016-01-08 14:01 ` Maciej W. Rozycki
2016-01-08 15:26 ` Rafał Miłecki
2016-01-09 2:12 ` Maciej W. Rozycki
2016-01-08 18:51 ` Brian Norris
2016-01-09 2:10 ` Maciej W. Rozycki
2016-01-16 0:38 ` Rafał Miłecki
2016-01-16 19:36 ` Maciej W. Rozycki
2016-01-23 21:49 ` Brian Norris [this message]
2016-01-24 9:44 ` Rafał Miłecki
2016-01-24 20:26 ` Maciej W. Rozycki
2016-01-24 21:31 ` Rafał Miłecki
2016-01-24 23:07 ` Maciej W. Rozycki
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=20160123214918.GC24744@localhost \
--to=computersforpeace@gmail.com \
--cc=cyrilbur@gmail.com \
--cc=dwmw2@infradead.org \
--cc=fengguang.wu@intel.com \
--cc=javier@osg.samsung.com \
--cc=jk@ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=luisbg@osg.samsung.com \
--cc=macro@linux-mips.org \
--cc=mpe@ellerman.id.au \
--cc=neelegup@linux.vnet.ibm.com \
--cc=ralf@linux-mips.org \
--cc=zajec5@gmail.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;
as well as URLs for NNTP newsgroup(s).