All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sinan Kaya <okaya@codeaurora.org>
To: Robin Murphy <robin.murphy@arm.com>,
	linux-arm-kernel@lists.infradead.org, timur@codeaurora.org,
	cov@codeaurora.org, nwatters@codeaurora.org
Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org,
	linux-xtensa@linux-xtensa.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Max Filippov <jcmvbkbc@gmail.com>,
	Chris Metcalf <cmetcalf@ezchip.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>,
	Florian Fainelli <f.fainelli@gmail.com>,
	x86@kernel.org, Ingo Molnar <mingo@redhat.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Akinobu Mita <akinobu.mita@gmail.com>,
	Geliang Tang <geliangtang@163.com>,
	Zhen Lei <thunder.leizhen@huawei.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Valentin Rothberg <valentinrothberg@gmail.com>,
	Chris Zankel <chris@zankel.net>, Tony Luck <tony.luck@intel.com>,
	linux-kernel@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>,
	"Suthikulpanit, Suravee" <Suravee.Suthikulpanit@amd.com>,
	Joe Perches <joe@perches.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 3/3] dma-mapping: move swiotlb dma-phys functions to common header
Date: Fri, 18 Mar 2016 13:55:21 +0000	[thread overview]
Message-ID: <56EC08C9.3080809@codeaurora.org> (raw)
In-Reply-To: <56EBE71F.2080203@arm.com>

On 3/18/2016 7:31 AM, Robin Murphy wrote:
> On 17/03/16 22:02, Sinan Kaya wrote:
>> Moving the default implementation of swiotlb_dma_to_phys and
>> swiotlb_phys_to_dma functions to dma-mapping.h so that we can get
>> rid of the duplicate code in multiple ARCH.
>>
>> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
>> ---
>>   arch/arm64/include/asm/dma-mapping.h               | 14 --------------
>>   arch/ia64/include/asm/dma-mapping.h                | 14 --------------
>>   arch/mips/include/asm/mach-generic/dma-coherence.h | 16 ----------------
>>   arch/tile/include/asm/dma-mapping.h                | 14 --------------
>>   arch/unicore32/include/asm/dma-mapping.h           | 14 --------------
>>   arch/x86/include/asm/dma-mapping.h                 | 13 -------------
>>   arch/xtensa/include/asm/dma-mapping.h              | 14 --------------
>>   include/linux/dma-mapping.h                        | 14 ++++++++++++++
>>   8 files changed, 14 insertions(+), 99 deletions(-)
> 
> [...]
> 
>> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
>> index 728ef07..871d620 100644
>> --- a/include/linux/dma-mapping.h
>> +++ b/include/linux/dma-mapping.h
>> @@ -683,4 +683,18 @@ static inline int dma_mmap_writecombine(struct device *dev,
>>   #define dma_unmap_len_set(PTR, LEN_NAME, VAL)    do { } while (0)
>>   #endif
>>
>> +#ifndef swiotlb_phys_to_dma
>> +static inline dma_addr_t swiotlb_phys_to_dma(struct device *dev, phys_addr_t paddr)
>> +{
>> +         return paddr;
>> +}
>> +#endif
>> +
>> +#ifndef swiotlb_dma_to_phys
>> +static inline phys_addr_t swiotlb_dma_to_phys(struct device *dev, dma_addr_t daddr)
>> +{
>> +        return daddr;
>> +}
>> +#endif
>> +
>>   #endif
>>
> 
> Could the default definition not be pushed all the way down into swiotlb.c (or at least swiotlb.h)?

I can do that but then we lose the inlining capability of the compiler. This could cost
performance penalty on architectures using it.

I tried moving it to swiotlb.h. swiotlb.h seems to be only used by swiotlb.c file. I could try 
including it into dma-mapping.h and then moving the definitions into swiotlb.h file. 

Let me give this a try.

> 
> Robin.
> 


-- 
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

WARNING: multiple messages have this Message-ID (diff)
From: Sinan Kaya <okaya@codeaurora.org>
To: Robin Murphy <robin.murphy@arm.com>,
	linux-arm-kernel@lists.infradead.org, timur@codeaurora.org,
	cov@codeaurora.org, nwatters@codeaurora.org
Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org,
	linux-xtensa@linux-xtensa.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Max Filippov <jcmvbkbc@gmail.com>,
	Chris Metcalf <cmetcalf@ezchip.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>,
	Florian Fainelli <f.fainelli@gmail.com>,
	x86@kernel.org, Ingo Molnar <mingo@redhat.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Akinobu Mita <akinobu.mita@gmail.com>,
	Geliang Tang <geliangtang@163.com>,
	Zhen Lei <thunder.leizhen@huawei.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Valentin Rothberg <valentinrothberg@gmail.com>,
	Chris Zankel <chris@zankel.net>, Tony Luck <tony.luck@intel.com>,
	linux-kernel@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>,
	"Suthikulpanit, Suravee" <Suravee.Suthikulpanit@amd.com>,
	Joe Perches <joe@perches.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 3/3] dma-mapping: move swiotlb dma-phys functions to common header
Date: Fri, 18 Mar 2016 09:55:21 -0400	[thread overview]
Message-ID: <56EC08C9.3080809@codeaurora.org> (raw)
In-Reply-To: <56EBE71F.2080203@arm.com>

On 3/18/2016 7:31 AM, Robin Murphy wrote:
> On 17/03/16 22:02, Sinan Kaya wrote:
>> Moving the default implementation of swiotlb_dma_to_phys and
>> swiotlb_phys_to_dma functions to dma-mapping.h so that we can get
>> rid of the duplicate code in multiple ARCH.
>>
>> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
>> ---
>>   arch/arm64/include/asm/dma-mapping.h               | 14 --------------
>>   arch/ia64/include/asm/dma-mapping.h                | 14 --------------
>>   arch/mips/include/asm/mach-generic/dma-coherence.h | 16 ----------------
>>   arch/tile/include/asm/dma-mapping.h                | 14 --------------
>>   arch/unicore32/include/asm/dma-mapping.h           | 14 --------------
>>   arch/x86/include/asm/dma-mapping.h                 | 13 -------------
>>   arch/xtensa/include/asm/dma-mapping.h              | 14 --------------
>>   include/linux/dma-mapping.h                        | 14 ++++++++++++++
>>   8 files changed, 14 insertions(+), 99 deletions(-)
> 
> [...]
> 
>> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
>> index 728ef07..871d620 100644
>> --- a/include/linux/dma-mapping.h
>> +++ b/include/linux/dma-mapping.h
>> @@ -683,4 +683,18 @@ static inline int dma_mmap_writecombine(struct device *dev,
>>   #define dma_unmap_len_set(PTR, LEN_NAME, VAL)    do { } while (0)
>>   #endif
>>
>> +#ifndef swiotlb_phys_to_dma
>> +static inline dma_addr_t swiotlb_phys_to_dma(struct device *dev, phys_addr_t paddr)
>> +{
>> +         return paddr;
>> +}
>> +#endif
>> +
>> +#ifndef swiotlb_dma_to_phys
>> +static inline phys_addr_t swiotlb_dma_to_phys(struct device *dev, dma_addr_t daddr)
>> +{
>> +        return daddr;
>> +}
>> +#endif
>> +
>>   #endif
>>
> 
> Could the default definition not be pushed all the way down into swiotlb.c (or at least swiotlb.h)?

I can do that but then we lose the inlining capability of the compiler. This could cost
performance penalty on architectures using it.

I tried moving it to swiotlb.h. swiotlb.h seems to be only used by swiotlb.c file. I could try 
including it into dma-mapping.h and then moving the definitions into swiotlb.h file. 

Let me give this a try.

> 
> Robin.
> 


-- 
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

WARNING: multiple messages have this Message-ID (diff)
From: okaya@codeaurora.org (Sinan Kaya)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] dma-mapping: move swiotlb dma-phys functions to common header
Date: Fri, 18 Mar 2016 09:55:21 -0400	[thread overview]
Message-ID: <56EC08C9.3080809@codeaurora.org> (raw)
In-Reply-To: <56EBE71F.2080203@arm.com>

On 3/18/2016 7:31 AM, Robin Murphy wrote:
> On 17/03/16 22:02, Sinan Kaya wrote:
>> Moving the default implementation of swiotlb_dma_to_phys and
>> swiotlb_phys_to_dma functions to dma-mapping.h so that we can get
>> rid of the duplicate code in multiple ARCH.
>>
>> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
>> ---
>>   arch/arm64/include/asm/dma-mapping.h               | 14 --------------
>>   arch/ia64/include/asm/dma-mapping.h                | 14 --------------
>>   arch/mips/include/asm/mach-generic/dma-coherence.h | 16 ----------------
>>   arch/tile/include/asm/dma-mapping.h                | 14 --------------
>>   arch/unicore32/include/asm/dma-mapping.h           | 14 --------------
>>   arch/x86/include/asm/dma-mapping.h                 | 13 -------------
>>   arch/xtensa/include/asm/dma-mapping.h              | 14 --------------
>>   include/linux/dma-mapping.h                        | 14 ++++++++++++++
>>   8 files changed, 14 insertions(+), 99 deletions(-)
> 
> [...]
> 
>> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
>> index 728ef07..871d620 100644
>> --- a/include/linux/dma-mapping.h
>> +++ b/include/linux/dma-mapping.h
>> @@ -683,4 +683,18 @@ static inline int dma_mmap_writecombine(struct device *dev,
>>   #define dma_unmap_len_set(PTR, LEN_NAME, VAL)    do { } while (0)
>>   #endif
>>
>> +#ifndef swiotlb_phys_to_dma
>> +static inline dma_addr_t swiotlb_phys_to_dma(struct device *dev, phys_addr_t paddr)
>> +{
>> +         return paddr;
>> +}
>> +#endif
>> +
>> +#ifndef swiotlb_dma_to_phys
>> +static inline phys_addr_t swiotlb_dma_to_phys(struct device *dev, dma_addr_t daddr)
>> +{
>> +        return daddr;
>> +}
>> +#endif
>> +
>>   #endif
>>
> 
> Could the default definition not be pushed all the way down into swiotlb.c (or at least swiotlb.h)?

I can do that but then we lose the inlining capability of the compiler. This could cost
performance penalty on architectures using it.

I tried moving it to swiotlb.h. swiotlb.h seems to be only used by swiotlb.c file. I could try 
including it into dma-mapping.h and then moving the definitions into swiotlb.h file. 

Let me give this a try.

> 
> Robin.
> 


-- 
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

  reply	other threads:[~2016-03-18 13:55 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17 22:02 [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with dma_map_single Sinan Kaya
2016-03-17 22:02 ` Sinan Kaya
2016-03-17 22:02 ` [PATCH 2/3] swiotlb: prefix dma_to_phys and phys_to_dma functions Sinan Kaya
2016-03-17 22:02   ` Sinan Kaya
2016-03-17 22:02   ` Sinan Kaya
2016-03-18 12:12   ` Robin Murphy
2016-03-18 12:12     ` Robin Murphy
2016-03-18 12:12     ` Robin Murphy
2016-03-18 15:00     ` Sinan Kaya
2016-03-18 15:00       ` Sinan Kaya
2016-03-18 15:00       ` Sinan Kaya
2016-03-28 18:29       ` Konrad Rzeszutek Wilk
2016-03-28 18:29         ` Konrad Rzeszutek Wilk
2016-03-28 18:29         ` Konrad Rzeszutek Wilk
2016-03-29 12:44         ` Stefano Stabellini
2016-03-29 12:44           ` Stefano Stabellini
2016-03-29 12:44           ` Stefano Stabellini
2016-03-29 12:57           ` Sinan Kaya
2016-03-29 12:57             ` Sinan Kaya
2016-03-29 12:57             ` Sinan Kaya
2016-03-29 19:32         ` Arnd Bergmann
2016-03-29 19:32           ` Arnd Bergmann
2016-03-29 19:32           ` Arnd Bergmann
2016-03-17 22:02 ` [PATCH 3/3] dma-mapping: move swiotlb dma-phys functions to common header Sinan Kaya
2016-03-17 22:02   ` Sinan Kaya
2016-03-17 22:02   ` Sinan Kaya
2016-03-18 11:31   ` Robin Murphy
2016-03-18 11:31     ` Robin Murphy
2016-03-18 13:55     ` Sinan Kaya [this message]
2016-03-18 13:55       ` Sinan Kaya
2016-03-18 13:55       ` Sinan Kaya
2016-03-17 22:54 ` [PATCH 1/3] crypto: marvell/cesa - replace dma_to_phys with dma_map_single Russell King - ARM Linux
2016-03-17 22:54   ` Russell King - ARM Linux
2016-03-17 23:17   ` okaya
2016-03-17 23:17     ` okaya at codeaurora.org
2016-03-17 23:50     ` Russell King - ARM Linux
2016-03-17 23:50       ` Russell King - ARM Linux
2016-03-18  9:30       ` Boris Brezillon
2016-03-18  9:30         ` Boris Brezillon
2016-03-18 11:25         ` Robin Murphy
2016-03-18 11:25           ` Robin Murphy
2016-03-18 11:32           ` Boris Brezillon
2016-03-18 11:32             ` Boris Brezillon
2016-03-18 13:51           ` Sinan Kaya
2016-03-18 13:51             ` Sinan Kaya
2016-03-18 14:00             ` Sinan Kaya
2016-03-18 14:00               ` Sinan Kaya
2016-03-18 14:20             ` Boris Brezillon
2016-03-18 14:20               ` Boris Brezillon
2016-03-18 14:21               ` Sinan Kaya
2016-03-18 14:21                 ` Sinan Kaya
2016-03-18 20:18 ` kbuild test robot
2016-03-18 20:18   ` kbuild test robot

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=56EC08C9.3080809@codeaurora.org \
    --to=okaya@codeaurora.org \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=chris@zankel.net \
    --cc=cmetcalf@ezchip.com \
    --cc=cov@codeaurora.org \
    --cc=dvlasenk@redhat.com \
    --cc=f.fainelli@gmail.com \
    --cc=fenghua.yu@intel.com \
    --cc=geliangtang@163.com \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=hpa@zytor.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=linux@roeck-us.net \
    --cc=mingo@redhat.com \
    --cc=nwatters@codeaurora.org \
    --cc=ralf@linux-mips.org \
    --cc=robin.murphy@arm.com \
    --cc=tglx@linutronix.de \
    --cc=thunder.leizhen@huawei.com \
    --cc=timur@codeaurora.org \
    --cc=tony.luck@intel.com \
    --cc=valentinrothberg@gmail.com \
    --cc=will.deacon@arm.com \
    --cc=x86@kernel.org \
    /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.