From: Brian Norris <computersforpeace@gmail.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "Rafał Miłecki" <zajec5@gmail.com>,
linux-mtd@lists.infradead.org,
"Maciej W. Rozycki" <macro@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>,
"David Woodhouse" <dwmw2@infradead.org>,
"Cyril Bur" <cyrilbur@gmail.com>,
"Ralf Baechle" <ralf@linux-mips.org>,
"Hauke Mehrtens" <hauke@hauke-m.de>,
"Dan Williams" <dan.j.williams@intel.com>
Subject: Re: [PATCH V2] mtd: bcm47xxsflash: use ioremap_cache() instead of KSEG0ADDR()
Date: Mon, 4 Apr 2016 00:09:58 -0700 [thread overview]
Message-ID: <20160404070958.GF13995@localhost> (raw)
In-Reply-To: <CAKv+Gu8UAugShB0jR_D_2kqwbPsG6KTSaha9auUTC_QgfCry3Q@mail.gmail.com>
On Fri, Mar 18, 2016 at 12:22:05PM +0100, Ard Biesheuvel wrote:
> On 5 March 2016 at 01:54, Brian Norris <computersforpeace@gmail.com> wrote:
> > + others
> >
> > On Fri, Feb 26, 2016 at 11:50:28AM +0100, Rafał Miłecki wrote:
> >> From: Brian Norris <computersforpeace@gmail.com>
> >>
> >> Using KSEG0ADDR makes code highly MIPS dependent and not portable.
> >> Thanks to the fix a68f376 ("MIPS: io.h: Define `ioremap_cache'") we can
> >> use ioremap_cache which is generic and supported on MIPS as well now.
> >>
> >> KSEG0ADDR was translating 0x1c000000 into 0x9c000000. With ioremap_cache
> >> we use MIPS's __ioremap (and then remap_area_pages). This results in
> >> different address (e.g. 0xc0080000) but it still should be cached as
> >> expected and it was successfully tested with BCM47186B0.
> >>
> >> Other than that drivers/bcma/driver_chipcommon_sflash.c nicely setups a
> >> struct resource for access window, but we wren't using it. Use it now
> >> and drop duplicated info.
> >>
> >> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> >> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> >> ---
> >> V2:
> >> 1) Use ioremap_cache as we already have commit a68f376 in l2-mtd
> >> 2) Add iounmap to the error path
> >> 3) Update commit message
> >
> > Hmm, I'm a bit out of the loop on some things here, but it looks like
> > ioremap_cache() is going away. See kernel/memremap.c:
> >
> > /* temporary while we convert existing ioremap_cache users to memremap */
> > __weak void __iomem *ioremap_cache(resource_size_t offset, unsigned long size)
> >
> > Are we supposed to move to using memremap() here? (If so,
> > devm_memremap() can help us.)
> >
>
> I don't think that ioremap_cache() necessarily has to go away, but
> what we do need to address is its abuse to map things like firmware
> tables that reside in normal memory that may not be owned/tracked by
> the kernel. So for that case, we now have memremap() which should just
> give you a mapping of the requested region, either via the linear
> mapping if it happens to be mapped already, or via the vmalloc region
> if it is highmem or otherwise unavailable directly.
>
> However, memory mapped NOR flash remains a special case, since the
> __iomem annotation may or may not be appropriate depending on context
> (i.e., reads and writes may both have either memory or strongly
> ordered semantics)
OK, pushed to l2-mtd.git.
prev parent reply other threads:[~2016-04-04 7:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-17 0:42 [PATCH] mtd: bcm47xxsflash: use ioremap_cachable() instead of KSEG0ADDR() Rafał Miłecki
2016-01-24 20:17 ` Maciej W. Rozycki
2016-01-25 4:04 ` Brian Norris
2016-01-25 19:15 ` Maciej W. Rozycki
2016-01-25 19:30 ` Brian Norris
2016-02-26 10:41 ` Rafał Miłecki
2016-02-26 14:18 ` Maciej W. Rozycki
2016-02-26 16:31 ` Rafał Miłecki
2016-02-26 10:50 ` [PATCH V2] mtd: bcm47xxsflash: use ioremap_cache() " Rafał Miłecki
2016-03-05 0:54 ` Brian Norris
2016-03-18 11:22 ` Ard Biesheuvel
2016-04-04 7:09 ` Brian Norris [this message]
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=20160404070958.GF13995@localhost \
--to=computersforpeace@gmail.com \
--cc=ard.biesheuvel@linaro.org \
--cc=cyrilbur@gmail.com \
--cc=dan.j.williams@intel.com \
--cc=dwmw2@infradead.org \
--cc=fengguang.wu@intel.com \
--cc=hauke@hauke-m.de \
--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).