Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1311017

Re: [PATCH] mtd: bcm47xxsflash: use devm_ioremap_nocache() instead of KSEG0ADDR()

From "Maciej W. Rozycki" <macro@linux-mips.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mtd: bcm47xxsflash: use devm_ioremap_nocache() instead of KSEG0ADDR()
Date 2016-01-16 20:40 +0100
Message-ID <qRERA-mf-5@gated-at.bofh.it> (permalink)
References (5 earlier) <qOA7M-3BQ-15@gated-at.bofh.it> <qOFTR-7OQ-19@gated-at.bofh.it> <qOKqu-2lS-29@gated-at.bofh.it> <qORBE-7kb-15@gated-at.bofh.it> <qRn4l-5eL-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, 16 Jan 2016, Rafał Miłecki wrote:

> >  This code is in a function called `bcm47xxsflash_read' and reads from an
> > MMIO region, presumably flash memory which behaves like ordinary memory on
> > reads (i.e. no side effects).  Therefore using a cached mapping will in
> > most cases result in much better performance as the CPU will load
> > (prefetch) data in cacheline-sized quantities rather than hitting the
> > external bus every time with a word-sized quantity transferred only.
> 
> So I wanted to stick to the cached mapping, but it appears it's not
> possible with devm_*. We have two options:
> 1) devm_ioremap_nocache - it obviously won't be cached mapping
> 2) devm_ioremap_resource - it uses devm_ioremap which uses ioremap
> which is nocache on MIPS
> 
> Should I introduce a new
> devm_ioremap_resource_cache
> with some
> devm_ioremap_cache
> helper? And then use it in bcm47xxsflash?

 This sounds like a plan to me, except that with `devm_ioremap_wc' also in 
the view and all the three `devm_ioremap*' functions being identical -- 
except from the use of a different `ioremap_*' call -- it looks to me it 
really asks for a `mode' argument and all the code to be unified.  
Compatibility macros (or, perhaps better, static inline functions) could 
be provided to preserve the internal API for the existing code.

 I.e. there would be a new `devm_ioremap_resource_mode' entry point which 
calls `devm_ioremap_mode', which then selects, perhaps with `switch' on 
`mode', from the available `ioremap*' calls.

  Maciej

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] mtd: bcm47xxsflash: use devm_ioremap_nocache() instead of KSEG0ADDR() Rafał Miłecki <zajec5@gmail.com> - 2016-01-16 01:40 +0100
  Re: [PATCH] mtd: bcm47xxsflash: use devm_ioremap_nocache() instead  of KSEG0ADDR() "Maciej W. Rozycki" <macro@linux-mips.org> - 2016-01-16 20:40 +0100
  Re: [PATCH] mtd: bcm47xxsflash: use devm_ioremap_nocache() instead  of KSEG0ADDR() Brian Norris <computersforpeace@gmail.com> - 2016-01-23 23:00 +0100
    Re: [PATCH] mtd: bcm47xxsflash: use devm_ioremap_nocache() instead of KSEG0ADDR() Rafał Miłecki <zajec5@gmail.com> - 2016-01-24 10:50 +0100
    Re: [PATCH] mtd: bcm47xxsflash: use devm_ioremap_nocache() instead  of KSEG0ADDR() "Maciej W. Rozycki" <macro@imgtec.com> - 2016-01-24 21:30 +0100
      Re: [PATCH] mtd: bcm47xxsflash: use devm_ioremap_nocache() instead of KSEG0ADDR() Rafał Miłecki <zajec5@gmail.com> - 2016-01-24 22:40 +0100
        Re: [PATCH] mtd: bcm47xxsflash: use devm_ioremap_nocache() instead  of KSEG0ADDR() "Maciej W. Rozycki" <macro@imgtec.com> - 2016-01-25 00:10 +0100

csiph-web