public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: arnd@arndb•de (Arnd Bergmann)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v4] Add basic address decoding support for Marvell 370/XP
Date: Tue, 11 Sep 2012 19:29:39 +0000	[thread overview]
Message-ID: <201209111929.39549.arnd@arndb.de> (raw)
In-Reply-To: <20120911174501.2ddec831@skate>

On Tuesday 11 September 2012, Thomas Petazzoni wrote:
> Le Tue, 11 Sep 2012 13:10:00 +0000,
> Arnd Bergmann <arnd@arndb•de> a ?crit :
> 
> > Excellent!
> > 
> > Acked-by: Arnd Bergmann <arnd@arndb•de>
> 
> Related to this patch set, I have a question: wouldn't it make sense to
> make the .virtual field of struct map_desc anvoid __iomem pointer as
> well instead of an unsigned long? This would avoid all the (unsigned
> long) casts in map_descs array definitions, and would be a bit more
> consistent, no?
> 

I've actually tried this before, and got stuck at the point where we set
up mappings that are not __iomem in mm/mmu.c: We have a bunch of calls
to create_mapping that are not at all related to MMIO access, and as Russell
pointed out back then, those should not take an __iomem pointer.

We can probably solve this by changing the prototype for create_mapping to 

static void __init create_mapping(unsigned long virtual, unsigned long pfn,
			        unsigned long length, unsigned int type);

and leave a single type cast in the iotable_init() function. There are
a few callers that we'd have to change manually then:

arch/arm/mm/dma-mapping.c:dma_contiguous_remap()
arch/arm/kernel/tcm.c:tcm_init()
arch/arm/mach-davinci/d*.c:SRAM_VIRT
arch/arm/mach-omap2/io.c:MT_MEMORY_SO
arch/arm/mach-omap2/omap4-common.c:OMAP4_DRAM_BARRIER_VA

My feeling is that we can special-case dma_contiguous_remap by introducing
a different helper like

extern void __init create_dma_ready_mapping(unsigned long virtual, size_t length);

and add casts to __iomem for the other four.

	Arnd

  reply	other threads:[~2012-09-11 19:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11 12:27 [PATCH v4] Add basic address decoding support for Marvell 370/XP Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 01/17] arm: mach-dove: use plus instead of or for address definitions Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 02/17] arm: mach-kirkwood: " Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 03/17] arm: mach-mv78xx0: " Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 04/17] arm: mach-orion5x: " Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 05/17] arm: mach-dove: use IOMEM() for base " Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 06/17] arm: mach-kirkwood: " Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 07/17] arm: mach-mv78xx0: " Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 08/17] arm: mach-orion5x: " Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 09/17] arm: mach-mvebu: " Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 10/17] arm: plat-orion: use void __iomem pointers for UART registration functions Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 11/17] arm: plat-orion: use void __iomem pointers for MPP functions Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 12/17] arm: plat-orion: use void __iomem pointers for time functions Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 13/17] arm: plat-orion: use void __iomem pointers for addr-map functions Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 14/17] arm: plat-orion: introduce PLAT_ORION_LEGACY hidden config option Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 15/17] arm: plat-orion: make bridge_virt_base non-const to support DT use case Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 16/17] arm: mvebu: add basic address decoding support to Armada 370/XP Thomas Petazzoni
2012-09-11 12:27 ` [PATCH v4 17/17] arm: mvebu: add address decoding controller to the DT Thomas Petazzoni
2012-09-11 13:10 ` [PATCH v4] Add basic address decoding support for Marvell 370/XP Arnd Bergmann
2012-09-11 13:49   ` Thomas Petazzoni
2012-09-11 15:45   ` Thomas Petazzoni
2012-09-11 19:29     ` Arnd Bergmann [this message]
2012-09-20  5:18 ` Thomas Petazzoni
2012-09-20 12:37   ` Jason Cooper
2012-09-21 13:14 ` Andrew Lunn
2012-09-21 19:04   ` Thomas Petazzoni
2012-10-17 15:07     ` Jason Cooper

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=201209111929.39549.arnd@arndb.de \
    --to=arnd@arndb$(echo .)de \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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