From: santosh.shilimkar@ti.com (Santosh Shilimkar)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC/RFT PATCH 4/5] ARM: mm: change max*pfn to include the physical offset of memory
Date: Wed, 31 Jul 2013 22:14:41 -0400 [thread overview]
Message-ID: <51F9C491.8070808@ti.com> (raw)
In-Reply-To: <20130731105643.GW24642@n2100.arm.linux.org.uk>
On Wednesday 31 July 2013 06:56 AM, Russell King - ARM Linux wrote:
> On Fri, Jul 12, 2013 at 05:48:13PM -0400, Santosh Shilimkar wrote:
>> diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
>> index 5b579b9..b2d5937 100644
>> --- a/arch/arm/include/asm/dma-mapping.h
>> +++ b/arch/arm/include/asm/dma-mapping.h
>> @@ -47,12 +47,12 @@ static inline int dma_set_mask(struct device *dev, u64 mask)
>> #ifndef __arch_pfn_to_dma
>> static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
>> {
>> - return (dma_addr_t)__pfn_to_bus(pfn);
>> + return (dma_addr_t)__pfn_to_bus(pfn + PHYS_PFN_OFFSET);
>> }
>>
>> static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr)
>> {
>> - return __bus_to_pfn(addr);
>> + return __bus_to_pfn(addr) - PHYS_PFN_OFFSET;
>> }
>>
>> static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
>> @@ -64,15 +64,16 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
>> {
>> return (dma_addr_t)__virt_to_bus((unsigned long)(addr));
>> }
>> +
>> #else
>> static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
>> {
>> - return __arch_pfn_to_dma(dev, pfn);
>> + return __arch_pfn_to_dma(dev, pfn + PHYS_PFN_OFFSET);
>> }
>>
>> static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr)
>> {
>> - return __arch_dma_to_pfn(dev, addr);
>> + return __arch_dma_to_pfn(dev, addr) - PHYS_PFN_OFFSET;
>> }
>>
>> static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
>> @@ -86,6 +87,13 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
>> }
>> #endif
>
> Note that I don't think the above are correct - the 'pfn' argument to the
> above functions already includes the PFN offset of physical memory -
> they're all physical_address >> PAGE_SHIFT values.
>
Right.
Updated patch pushed into the patch system. (patch 7805/1)
Regards,
Santosh
WARNING: multiple messages have this Message-ID (diff)
From: Santosh Shilimkar <santosh.shilimkar@ti.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Nicolas Pitre <nicolas.pitre@linaro.org>
Subject: Re: [RFC/RFT PATCH 4/5] ARM: mm: change max*pfn to include the physical offset of memory
Date: Wed, 31 Jul 2013 22:14:41 -0400 [thread overview]
Message-ID: <51F9C491.8070808@ti.com> (raw)
In-Reply-To: <20130731105643.GW24642@n2100.arm.linux.org.uk>
On Wednesday 31 July 2013 06:56 AM, Russell King - ARM Linux wrote:
> On Fri, Jul 12, 2013 at 05:48:13PM -0400, Santosh Shilimkar wrote:
>> diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
>> index 5b579b9..b2d5937 100644
>> --- a/arch/arm/include/asm/dma-mapping.h
>> +++ b/arch/arm/include/asm/dma-mapping.h
>> @@ -47,12 +47,12 @@ static inline int dma_set_mask(struct device *dev, u64 mask)
>> #ifndef __arch_pfn_to_dma
>> static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
>> {
>> - return (dma_addr_t)__pfn_to_bus(pfn);
>> + return (dma_addr_t)__pfn_to_bus(pfn + PHYS_PFN_OFFSET);
>> }
>>
>> static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr)
>> {
>> - return __bus_to_pfn(addr);
>> + return __bus_to_pfn(addr) - PHYS_PFN_OFFSET;
>> }
>>
>> static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
>> @@ -64,15 +64,16 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
>> {
>> return (dma_addr_t)__virt_to_bus((unsigned long)(addr));
>> }
>> +
>> #else
>> static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
>> {
>> - return __arch_pfn_to_dma(dev, pfn);
>> + return __arch_pfn_to_dma(dev, pfn + PHYS_PFN_OFFSET);
>> }
>>
>> static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr)
>> {
>> - return __arch_dma_to_pfn(dev, addr);
>> + return __arch_dma_to_pfn(dev, addr) - PHYS_PFN_OFFSET;
>> }
>>
>> static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
>> @@ -86,6 +87,13 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
>> }
>> #endif
>
> Note that I don't think the above are correct - the 'pfn' argument to the
> above functions already includes the PFN offset of physical memory -
> they're all physical_address >> PAGE_SHIFT values.
>
Right.
Updated patch pushed into the patch system. (patch 7805/1)
Regards,
Santosh
next prev parent reply other threads:[~2013-08-01 2:14 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-12 21:48 [RFC/RFT PATCH 0/5] mm: ARM nobootmem and few dma_mask fixes Santosh Shilimkar
2013-07-12 21:48 ` Santosh Shilimkar
2013-07-12 21:48 ` [RFC/RFT PATCH 1/5] block: Rename parameter dma_mask to max_addr for blk_queue_bounce_limit() Santosh Shilimkar
2013-07-12 21:48 ` Santosh Shilimkar
2013-07-12 21:48 ` [RFC/RFT PATCH 2/5] mm: dma-mapping: Add dma_max_pfn(dev) helper function Santosh Shilimkar
2013-07-12 21:48 ` Santosh Shilimkar
2013-07-12 21:48 ` [RFC/RFT PATCH 3/5] scsi: Use dma_max_pfn(dev) helper for bounce_limit calculations Santosh Shilimkar
2013-07-12 21:48 ` Santosh Shilimkar
2013-07-12 21:48 ` Santosh Shilimkar
2013-07-12 21:55 ` Sergei Shtylyov
2013-07-12 21:55 ` Sergei Shtylyov
2013-07-12 22:25 ` Russell King - ARM Linux
2013-07-12 22:25 ` Russell King - ARM Linux
2013-07-12 23:08 ` Sergei Shtylyov
2013-07-12 23:08 ` Sergei Shtylyov
2013-07-12 23:42 ` Sergei Shtylyov
2013-07-12 23:42 ` Sergei Shtylyov
2013-07-12 23:57 ` Russell King - ARM Linux
2013-07-12 23:57 ` Russell King - ARM Linux
2013-07-12 21:48 ` [RFC/RFT PATCH 4/5] ARM: mm: change max*pfn to include the physical offset of memory Santosh Shilimkar
2013-07-12 21:48 ` Santosh Shilimkar
2013-07-13 0:14 ` Russell King - ARM Linux
2013-07-13 0:14 ` Russell King - ARM Linux
2013-07-31 10:56 ` Russell King - ARM Linux
2013-07-31 10:56 ` Russell King - ARM Linux
2013-08-01 2:14 ` Santosh Shilimkar [this message]
2013-08-01 2:14 ` Santosh Shilimkar
2013-07-12 21:48 ` [RFC/RFT PATCH 5/5] ARM: mm: Remove bootmem code and switch to NO_BOOTMEM Santosh Shilimkar
2013-07-12 21:48 ` Santosh Shilimkar
2013-07-26 15:10 ` [RFC/RFT PATCH 0/5] mm: ARM nobootmem and few dma_mask fixes Russell King - ARM Linux
2013-07-26 15:10 ` Russell King - ARM Linux
2013-07-26 16:28 ` Santosh Shilimkar
2013-07-26 16:28 ` Santosh Shilimkar
2013-07-26 16:28 ` Santosh Shilimkar
2013-07-29 11:15 ` Russell King - ARM Linux
2013-07-29 11:15 ` Russell King - ARM Linux
2013-07-29 13:26 ` Santosh Shilimkar
2013-07-29 13:26 ` Santosh Shilimkar
2013-07-29 13:40 ` Russell King - ARM Linux
2013-07-29 13:40 ` Russell King - ARM Linux
2013-07-29 13:42 ` Santosh Shilimkar
2013-07-29 13:42 ` Santosh Shilimkar
2013-07-29 13:42 ` Santosh Shilimkar
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=51F9C491.8070808@ti.com \
--to=santosh.shilimkar@ti.com \
--cc=linux-arm-kernel@lists.infradead.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.