From: Brian Norris <computersforpeace@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-mtd@lists.infradead.org,
David Woodhouse <dwmw2@infradead.org>,
Boris BREZILLON <boris.brezillon@free-electrons.com>,
Frans Klaver <fransklaver@gmail.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org,
Simon Horman <horms@verge.net.au>,
Magnus Damm <magnus.damm@gmail.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] mtd: sh_flctl: pass FIFO as physical address
Date: Fri, 18 Dec 2015 18:27:37 -0800 [thread overview]
Message-ID: <20151219022737.GC109450@google.com> (raw)
In-Reply-To: <3152458.D3kElfhRW2@wuerfel>
On Tue, Dec 08, 2015 at 04:38:12PM +0100, Arnd Bergmann wrote:
> By convention, the FIFO address we pass using dmaengine_slave_config
> is a physical address in the form that is understood by the DMA
> engine, as a dma_addr_t, phys_addr_t or resource_size_t.
>
> The sh_flctl driver however passes a virtual __iomem address that
> gets cast to dma_addr_t in the slave driver. This happens to work
> on shmobile because that platform sets up an identity mapping for
> its MMIO regions, but such code is not portable to other platforms,
> and prevents us from ever changing the platform mapping or reusing
> the driver on other architectures like ARM64 that might not have the
> mapping.
>
> We also get a warning about a type mismatch for the case that
> dma_addr_t is wider than a pointer, i.e. when CONFIG_LPAE is set:
>
> drivers/mtd/nand/sh_flctl.c: In function 'flctl_setup_dma':
> drivers/mtd/nand/sh_flctl.c:163:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> cfg.dst_addr = (dma_addr_t)FLDTFIFO(flctl);
>
> This changes the driver to instead pass the physical address of
> the FIFO that is extracted from the MMIO resource, making the
> code more portable and avoiding the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied
WARNING: multiple messages have this Message-ID (diff)
From: Brian Norris <computersforpeace@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] mtd: sh_flctl: pass FIFO as physical address
Date: Sat, 19 Dec 2015 02:27:37 +0000 [thread overview]
Message-ID: <20151219022737.GC109450@google.com> (raw)
In-Reply-To: <3152458.D3kElfhRW2@wuerfel>
On Tue, Dec 08, 2015 at 04:38:12PM +0100, Arnd Bergmann wrote:
> By convention, the FIFO address we pass using dmaengine_slave_config
> is a physical address in the form that is understood by the DMA
> engine, as a dma_addr_t, phys_addr_t or resource_size_t.
>
> The sh_flctl driver however passes a virtual __iomem address that
> gets cast to dma_addr_t in the slave driver. This happens to work
> on shmobile because that platform sets up an identity mapping for
> its MMIO regions, but such code is not portable to other platforms,
> and prevents us from ever changing the platform mapping or reusing
> the driver on other architectures like ARM64 that might not have the
> mapping.
>
> We also get a warning about a type mismatch for the case that
> dma_addr_t is wider than a pointer, i.e. when CONFIG_LPAE is set:
>
> drivers/mtd/nand/sh_flctl.c: In function 'flctl_setup_dma':
> drivers/mtd/nand/sh_flctl.c:163:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> cfg.dst_addr = (dma_addr_t)FLDTFIFO(flctl);
>
> This changes the driver to instead pass the physical address of
> the FIFO that is extracted from the MMIO resource, making the
> code more portable and avoiding the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied
WARNING: multiple messages have this Message-ID (diff)
From: computersforpeace@gmail.com (Brian Norris)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mtd: sh_flctl: pass FIFO as physical address
Date: Fri, 18 Dec 2015 18:27:37 -0800 [thread overview]
Message-ID: <20151219022737.GC109450@google.com> (raw)
In-Reply-To: <3152458.D3kElfhRW2@wuerfel>
On Tue, Dec 08, 2015 at 04:38:12PM +0100, Arnd Bergmann wrote:
> By convention, the FIFO address we pass using dmaengine_slave_config
> is a physical address in the form that is understood by the DMA
> engine, as a dma_addr_t, phys_addr_t or resource_size_t.
>
> The sh_flctl driver however passes a virtual __iomem address that
> gets cast to dma_addr_t in the slave driver. This happens to work
> on shmobile because that platform sets up an identity mapping for
> its MMIO regions, but such code is not portable to other platforms,
> and prevents us from ever changing the platform mapping or reusing
> the driver on other architectures like ARM64 that might not have the
> mapping.
>
> We also get a warning about a type mismatch for the case that
> dma_addr_t is wider than a pointer, i.e. when CONFIG_LPAE is set:
>
> drivers/mtd/nand/sh_flctl.c: In function 'flctl_setup_dma':
> drivers/mtd/nand/sh_flctl.c:163:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> cfg.dst_addr = (dma_addr_t)FLDTFIFO(flctl);
>
> This changes the driver to instead pass the physical address of
> the FIFO that is extracted from the MMIO resource, making the
> code more portable and avoiding the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied
next prev parent reply other threads:[~2015-12-19 2:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-08 15:38 [PATCH] mtd: sh_flctl: pass FIFO as physical address Arnd Bergmann
2015-12-08 15:38 ` Arnd Bergmann
2015-12-08 15:38 ` Arnd Bergmann
2015-12-08 16:30 ` Geert Uytterhoeven
2015-12-08 16:30 ` Geert Uytterhoeven
2015-12-08 16:30 ` Geert Uytterhoeven
2015-12-10 2:21 ` Brian Norris
2015-12-10 2:21 ` Brian Norris
2015-12-10 2:21 ` Brian Norris
2015-12-10 9:02 ` Geert Uytterhoeven
2015-12-10 9:02 ` Geert Uytterhoeven
2015-12-10 9:02 ` Geert Uytterhoeven
2015-12-10 9:27 ` Arnd Bergmann
2015-12-10 9:27 ` Arnd Bergmann
2015-12-10 9:27 ` Arnd Bergmann
2015-12-19 2:27 ` Brian Norris [this message]
2015-12-19 2:27 ` Brian Norris
2015-12-19 2:27 ` Brian Norris
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=20151219022737.GC109450@google.com \
--to=computersforpeace@gmail.com \
--cc=arnd@arndb.de \
--cc=boris.brezillon@free-electrons.com \
--cc=dwmw2@infradead.org \
--cc=fransklaver@gmail.com \
--cc=horms@verge.net.au \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.