Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-11 Thread Joerg Roedel
On Wed, Jun 10, 2015 at 09:00:31AM -0700, Dan Williams wrote: > > So sg_phys() turns out to be 'page_to_phys(sg_page(s)) + s->offset', > > which makes the above statement to: > > > > page_to_phys(sg_page(s)) + s->offset - s->offset; > > > > The compiler will probably optimize that away,

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-11 Thread Joerg Roedel
On Wed, Jun 10, 2015 at 09:00:31AM -0700, Dan Williams wrote: So sg_phys() turns out to be 'page_to_phys(sg_page(s)) + s-offset', which makes the above statement to: page_to_phys(sg_page(s)) + s-offset - s-offset; The compiler will probably optimize that away, but it still

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-10 Thread Dan Williams
On Wed, Jun 10, 2015 at 10:13 AM, Russell King - ARM Linux wrote: > On Wed, Jun 10, 2015 at 09:57:06AM -0700, Dan Williams wrote: >> On Wed, Jun 10, 2015 at 9:31 AM, Russell King - ARM Linux >> wrote: >> > Why? The aim of the code is not to detect whether the address is aligned >> > to a page

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-10 Thread Russell King - ARM Linux
On Wed, Jun 10, 2015 at 09:57:06AM -0700, Dan Williams wrote: > On Wed, Jun 10, 2015 at 9:31 AM, Russell King - ARM Linux > wrote: > > Why? The aim of the code is not to detect whether the address is aligned > > to a page (if it were, it'd be testing for a zero s->offset, or it would > > be

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-10 Thread Dan Williams
On Wed, Jun 10, 2015 at 9:31 AM, Russell King - ARM Linux wrote: > On Wed, Jun 10, 2015 at 09:00:31AM -0700, Dan Williams wrote: >> On Wed, Jun 10, 2015 at 2:32 AM, Joerg Roedel wrote: >> > On Tue, Jun 09, 2015 at 12:27:10PM -0400, Dan Williams wrote: >> >> diff --git a/arch/arm/mm/dma-mapping.c

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-10 Thread Russell King - ARM Linux
On Wed, Jun 10, 2015 at 09:00:31AM -0700, Dan Williams wrote: > On Wed, Jun 10, 2015 at 2:32 AM, Joerg Roedel wrote: > > On Tue, Jun 09, 2015 at 12:27:10PM -0400, Dan Williams wrote: > >> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c > >> index 7e7583ddd607..9f6ff6671f01

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-10 Thread Dan Williams
On Wed, Jun 10, 2015 at 2:32 AM, Joerg Roedel wrote: > On Tue, Jun 09, 2015 at 12:27:10PM -0400, Dan Williams wrote: >> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c >> index 7e7583ddd607..9f6ff6671f01 100644 >> --- a/arch/arm/mm/dma-mapping.c >> +++

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-10 Thread Joerg Roedel
On Tue, Jun 09, 2015 at 12:27:10PM -0400, Dan Williams wrote: > diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c > index 7e7583ddd607..9f6ff6671f01 100644 > --- a/arch/arm/mm/dma-mapping.c > +++ b/arch/arm/mm/dma-mapping.c > @@ -1502,7 +1502,7 @@ static int __map_sg_chunk(struct

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-10 Thread Joerg Roedel
On Tue, Jun 09, 2015 at 12:27:10PM -0400, Dan Williams wrote: diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 7e7583ddd607..9f6ff6671f01 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1502,7 +1502,7 @@ static int __map_sg_chunk(struct

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-10 Thread Dan Williams
On Wed, Jun 10, 2015 at 2:32 AM, Joerg Roedel j...@8bytes.org wrote: On Tue, Jun 09, 2015 at 12:27:10PM -0400, Dan Williams wrote: diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 7e7583ddd607..9f6ff6671f01 100644 --- a/arch/arm/mm/dma-mapping.c +++

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-10 Thread Russell King - ARM Linux
On Wed, Jun 10, 2015 at 09:00:31AM -0700, Dan Williams wrote: On Wed, Jun 10, 2015 at 2:32 AM, Joerg Roedel j...@8bytes.org wrote: On Tue, Jun 09, 2015 at 12:27:10PM -0400, Dan Williams wrote: diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-10 Thread Dan Williams
On Wed, Jun 10, 2015 at 9:31 AM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: On Wed, Jun 10, 2015 at 09:00:31AM -0700, Dan Williams wrote: On Wed, Jun 10, 2015 at 2:32 AM, Joerg Roedel j...@8bytes.org wrote: On Tue, Jun 09, 2015 at 12:27:10PM -0400, Dan Williams wrote: diff --git

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-10 Thread Dan Williams
On Wed, Jun 10, 2015 at 10:13 AM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: On Wed, Jun 10, 2015 at 09:57:06AM -0700, Dan Williams wrote: On Wed, Jun 10, 2015 at 9:31 AM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: Why? The aim of the code is not to detect whether the

Re: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-10 Thread Russell King - ARM Linux
On Wed, Jun 10, 2015 at 09:57:06AM -0700, Dan Williams wrote: On Wed, Jun 10, 2015 at 9:31 AM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: Why? The aim of the code is not to detect whether the address is aligned to a page (if it were, it'd be testing for a zero s-offset, or it

RE: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-09 Thread Elliott, Robert (Server Storage)
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org [mailto:linux-kernel- > ow...@vger.kernel.org] On Behalf Of Dan Williams > Sent: Tuesday, June 09, 2015 10:27 AM > Subject: [PATCH 1/2] scatterlist: use sg_phys() > ... > diff --git a/arch/microblaz

[PATCH 1/2] scatterlist: use sg_phys()

2015-06-09 Thread Dan Williams
Coccinelle cleanup to replace open coded sg to physical address translations. This is in preparation for introducing scatterlists that reference __pfn_t. // sg_phys.cocci: convert usage page_to_phys(sg_page(sg)) to sg_phys(sg) // usage: make coccicheck COCCI=sg_phys.cocci MODE=patch virtual

[PATCH 1/2] scatterlist: use sg_phys()

2015-06-09 Thread Dan Williams
Coccinelle cleanup to replace open coded sg to physical address translations. This is in preparation for introducing scatterlists that reference __pfn_t. // sg_phys.cocci: convert usage page_to_phys(sg_page(sg)) to sg_phys(sg) // usage: make coccicheck COCCI=sg_phys.cocci MODE=patch virtual

RE: [PATCH 1/2] scatterlist: use sg_phys()

2015-06-09 Thread Elliott, Robert (Server Storage)
-Original Message- From: linux-kernel-ow...@vger.kernel.org [mailto:linux-kernel- ow...@vger.kernel.org] On Behalf Of Dan Williams Sent: Tuesday, June 09, 2015 10:27 AM Subject: [PATCH 1/2] scatterlist: use sg_phys() ... diff --git a/arch/microblaze/kernel/dma.c b/arch/microblaze