Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-16 Thread Thierry Reding
On Wed, Jan 16, 2013 at 11:25:56AM +, Russell King - ARM Linux wrote: > On Wed, Jan 16, 2013 at 11:18:22AM +0100, Thierry Reding wrote: > > err = ioremap_page_range(virt, virt + SZ_64K - 1, phys, > > Why -1 here? Right, I forgot that end in these functions always means one byte af

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-16 Thread Russell King - ARM Linux
On Wed, Jan 16, 2013 at 11:18:22AM +0100, Thierry Reding wrote: > err = ioremap_page_range(virt, virt + SZ_64K - 1, phys, Why -1 here? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-16 Thread Thierry Reding
On Thu, Jan 10, 2013 at 12:24:17PM -0700, Jason Gunthorpe wrote: > On Thu, Jan 10, 2013 at 08:03:27PM +0100, Thierry Reding wrote: > > > > > You'd piece a mapping together, each bus requires 16 64k mappings, a > > > > simple 2d array of busnr*16 of pointers would do the trick. A more > > > > cleve

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-10 Thread Jason Gunthorpe
On Thu, Jan 10, 2013 at 09:20:07PM +0100, Thierry Reding wrote: > > Arnd's version is good too, but you would be restricted to aligned > > powers of two for the bus number range in the DT, which is probably > > not that big a deal either? > > Stephen suggested on IRC that we could try to keep a b

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-10 Thread Thierry Reding
On Thu, Jan 10, 2013 at 12:24:17PM -0700, Jason Gunthorpe wrote: > On Thu, Jan 10, 2013 at 08:03:27PM +0100, Thierry Reding wrote: > > > > > You'd piece a mapping together, each bus requires 16 64k mappings, a > > > > simple 2d array of busnr*16 of pointers would do the trick. A more > > > > cleve

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-10 Thread Jason Gunthorpe
On Thu, Jan 10, 2013 at 08:03:27PM +0100, Thierry Reding wrote: > > > You'd piece a mapping together, each bus requires 16 64k mappings, a > > > simple 2d array of busnr*16 of pointers would do the trick. A more > > > clever solution would be to allocate contiguous virtual memory and > > > split t

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-10 Thread Thierry Reding
On Thu, Jan 10, 2013 at 07:55:05PM +0100, Thierry Reding wrote: > On Thu, Jan 10, 2013 at 11:20:07AM -0700, Jason Gunthorpe wrote: > > On Thu, Jan 10, 2013 at 11:25:44AM +0100, Thierry Reding wrote: > > > On Thu, Jan 10, 2013 at 09:17:19AM +, Arnd Bergmann wrote: > > > > On Thursday 10 January

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-10 Thread Thierry Reding
On Thu, Jan 10, 2013 at 06:26:55PM +, Arnd Bergmann wrote: > On Thursday 10 January 2013, Thierry Reding wrote: > > I don't understand how this would help. The encoding is like this: > > > > [27:24] extended register number > > [23:16] bus number > > [15:11] device numb

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-10 Thread Thierry Reding
On Thu, Jan 10, 2013 at 11:20:07AM -0700, Jason Gunthorpe wrote: > On Thu, Jan 10, 2013 at 11:25:44AM +0100, Thierry Reding wrote: > > On Thu, Jan 10, 2013 at 09:17:19AM +, Arnd Bergmann wrote: > > > On Thursday 10 January 2013, Thierry Reding wrote: > > > > On Wed, Jan 09, 2013 at 04:17:58PM -

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-10 Thread Arnd Bergmann
On Thursday 10 January 2013, Thierry Reding wrote: > I don't understand how this would help. The encoding is like this: > > [27:24] extended register number > [23:16] bus number > [15:11] device number > [10: 8] function number > [ 7: 0] register number > >

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-10 Thread Jason Gunthorpe
On Thu, Jan 10, 2013 at 11:25:44AM +0100, Thierry Reding wrote: > On Thu, Jan 10, 2013 at 09:17:19AM +, Arnd Bergmann wrote: > > On Thursday 10 January 2013, Thierry Reding wrote: > > > On Wed, Jan 09, 2013 at 04:17:58PM -0700, Jason Gunthorpe wrote: > > > > On Wed, Jan 09, 2013 at 04:12:31PM -

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-10 Thread Thierry Reding
On Thu, Jan 10, 2013 at 09:17:19AM +, Arnd Bergmann wrote: > On Thursday 10 January 2013, Thierry Reding wrote: > > On Wed, Jan 09, 2013 at 04:17:58PM -0700, Jason Gunthorpe wrote: > > > On Wed, Jan 09, 2013 at 04:12:31PM -0700, Stephen Warren wrote: > > > You could decrease the size of the map

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-10 Thread Arnd Bergmann
On Thursday 10 January 2013, Thierry Reding wrote: > On Wed, Jan 09, 2013 at 04:17:58PM -0700, Jason Gunthorpe wrote: > > On Wed, Jan 09, 2013 at 04:12:31PM -0700, Stephen Warren wrote: > > You could decrease the size of the mapping to only span the bus > > numbers that are configured for use via D

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-09 Thread Thierry Reding
On Wed, Jan 09, 2013 at 04:17:58PM -0700, Jason Gunthorpe wrote: > On Wed, Jan 09, 2013 at 04:12:31PM -0700, Stephen Warren wrote: > > On 01/09/2013 03:10 PM, Arnd Bergmann wrote: > > > On Wednesday 09 January 2013, Thierry Reding wrote: > > >> What happens on Tegra is that we need to map 256 MiB o

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-09 Thread Thierry Reding
On Wed, Jan 09, 2013 at 10:10:49PM +, Arnd Bergmann wrote: > On Wednesday 09 January 2013, Thierry Reding wrote: > > What happens on Tegra is that we need to map 256 MiB of physical memory > > to access all the PCIe extended configuration space. However, ioremap() > > on such a large region fai

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-09 Thread Jason Gunthorpe
On Wed, Jan 09, 2013 at 04:12:31PM -0700, Stephen Warren wrote: > On 01/09/2013 03:10 PM, Arnd Bergmann wrote: > > On Wednesday 09 January 2013, Thierry Reding wrote: > >> What happens on Tegra is that we need to map 256 MiB of physical memory > >> to access all the PCIe extended configuration spac

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-09 Thread Stephen Warren
On 01/09/2013 03:10 PM, Arnd Bergmann wrote: > On Wednesday 09 January 2013, Thierry Reding wrote: >> What happens on Tegra is that we need to map 256 MiB of physical memory >> to access all the PCIe extended configuration space. However, ioremap() >> on such a large region fails if not enough vmal

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-09 Thread Arnd Bergmann
On Wednesday 09 January 2013, Thierry Reding wrote: > What happens on Tegra is that we need to map 256 MiB of physical memory > to access all the PCIe extended configuration space. However, ioremap() > on such a large region fails if not enough vmalloc() space is available. > > This was observed w

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-09 Thread Thierry Reding
On Wed, Jan 09, 2013 at 09:28:47PM +, Russell King - ARM Linux wrote: > On Wed, Jan 09, 2013 at 09:43:05PM +0100, Thierry Reding wrote: > > The I/O map cache is used to map large regions of physical memory in > > smaller chunks to avoid running out of vmalloc()/ioremap() space. > > > > Signed-

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-09 Thread Thierry Reding
On Wed, Jan 09, 2013 at 09:19:56PM +, Arnd Bergmann wrote: > On Wednesday 09 January 2013, Thierry Reding wrote: > > The I/O map cache is used to map large regions of physical memory in > > smaller chunks to avoid running out of vmalloc()/ioremap() space. > > > > Signed-off-by: Thierry Reding

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-09 Thread Russell King - ARM Linux
On Wed, Jan 09, 2013 at 09:43:05PM +0100, Thierry Reding wrote: > The I/O map cache is used to map large regions of physical memory in > smaller chunks to avoid running out of vmalloc()/ioremap() space. > > Signed-off-by: Thierry Reding We already have a means where we record the mappings which

Re: [PATCH 05/14] lib: Add I/O map cache implementation

2013-01-09 Thread Arnd Bergmann
On Wednesday 09 January 2013, Thierry Reding wrote: > The I/O map cache is used to map large regions of physical memory in > smaller chunks to avoid running out of vmalloc()/ioremap() space. > > Signed-off-by: Thierry Reding Can you explain why this is necessary and which problem it solves? The

[PATCH 05/14] lib: Add I/O map cache implementation

2013-01-09 Thread Thierry Reding
The I/O map cache is used to map large regions of physical memory in smaller chunks to avoid running out of vmalloc()/ioremap() space. Signed-off-by: Thierry Reding --- include/linux/io.h | 12 +++ lib/ioremap.c | 266 + 2 files changed,