* [PATCH] MIPS: page.h: define virt_to_pfn()
@ 2017-03-09 21:11 Florian Fainelli
2017-11-08 23:15 ` James Hogan
0 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2017-03-09 21:11 UTC (permalink / raw)
To: linux-mips; +Cc: ralf, james.hogan, paul.burton, macro, Florian Fainelli
Based on the existing definition of virt_to_page() which already does a
PFN_DOWN(vir_to_phys(kaddr)).
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
arch/mips/include/asm/page.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 5f987598054f..ad461216b5a1 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -240,8 +240,8 @@ static inline int pfn_valid(unsigned long pfn)
#endif
-#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \
- (kaddr))))
+#define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
+#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
extern int __virt_addr_valid(const volatile void *kaddr);
#define virt_addr_valid(kaddr) \
--
2.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] MIPS: page.h: define virt_to_pfn()
@ 2017-11-08 23:15 ` James Hogan
0 siblings, 0 replies; 6+ messages in thread
From: James Hogan @ 2017-11-08 23:15 UTC (permalink / raw)
To: Florian Fainelli; +Cc: linux-mips, ralf, paul.burton, macro
[-- Attachment #1: Type: text/plain, Size: 1114 bytes --]
Hi Florian,
On Thu, Mar 09, 2017 at 01:11:49PM -0800, Florian Fainelli wrote:
> Based on the existing definition of virt_to_page() which already does a
> PFN_DOWN(vir_to_phys(kaddr)).
I was just wondering if there was a particular motivation for this
change?
Cheers
James
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> arch/mips/include/asm/page.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
> index 5f987598054f..ad461216b5a1 100644
> --- a/arch/mips/include/asm/page.h
> +++ b/arch/mips/include/asm/page.h
> @@ -240,8 +240,8 @@ static inline int pfn_valid(unsigned long pfn)
>
> #endif
>
> -#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \
> - (kaddr))))
> +#define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
> +#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
>
> extern int __virt_addr_valid(const volatile void *kaddr);
> #define virt_addr_valid(kaddr) \
> --
> 2.9.3
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] MIPS: page.h: define virt_to_pfn()
@ 2017-11-08 23:15 ` James Hogan
0 siblings, 0 replies; 6+ messages in thread
From: James Hogan @ 2017-11-08 23:15 UTC (permalink / raw)
To: Florian Fainelli; +Cc: linux-mips, ralf, paul.burton, macro
[-- Attachment #1: Type: text/plain, Size: 1114 bytes --]
Hi Florian,
On Thu, Mar 09, 2017 at 01:11:49PM -0800, Florian Fainelli wrote:
> Based on the existing definition of virt_to_page() which already does a
> PFN_DOWN(vir_to_phys(kaddr)).
I was just wondering if there was a particular motivation for this
change?
Cheers
James
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> arch/mips/include/asm/page.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
> index 5f987598054f..ad461216b5a1 100644
> --- a/arch/mips/include/asm/page.h
> +++ b/arch/mips/include/asm/page.h
> @@ -240,8 +240,8 @@ static inline int pfn_valid(unsigned long pfn)
>
> #endif
>
> -#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \
> - (kaddr))))
> +#define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
> +#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
>
> extern int __virt_addr_valid(const volatile void *kaddr);
> #define virt_addr_valid(kaddr) \
> --
> 2.9.3
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] MIPS: page.h: define virt_to_pfn()
2017-11-08 23:15 ` James Hogan
(?)
@ 2017-11-09 0:05 ` Florian Fainelli
2017-11-09 15:43 ` James Hogan
-1 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2017-11-09 0:05 UTC (permalink / raw)
To: James Hogan; +Cc: linux-mips, ralf, paul.burton, macro
On 11/08/2017 03:15 PM, James Hogan wrote:
> Hi Florian,
>
> On Thu, Mar 09, 2017 at 01:11:49PM -0800, Florian Fainelli wrote:
>> Based on the existing definition of virt_to_page() which already does a
>> PFN_DOWN(vir_to_phys(kaddr)).
>
> I was just wondering if there was a particular motivation for this
> change?
Initially that was a part of an experiment to try to build and use ION
on MIPS, but I think this dependency somehow got removed. I might have
thought about using it for CONFIG_DEBUG_VIRTUAL too.
In then end I sent it because it sounded like a simple change that could
have some use later.
Thanks for going through the patch queue :)
>
> Cheers
> James
>
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>> arch/mips/include/asm/page.h | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
>> index 5f987598054f..ad461216b5a1 100644
>> --- a/arch/mips/include/asm/page.h
>> +++ b/arch/mips/include/asm/page.h
>> @@ -240,8 +240,8 @@ static inline int pfn_valid(unsigned long pfn)
>>
>> #endif
>>
>> -#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \
>> - (kaddr))))
>> +#define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
>> +#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
>>
>> extern int __virt_addr_valid(const volatile void *kaddr);
>> #define virt_addr_valid(kaddr) \
>> --
>> 2.9.3
>>
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] MIPS: page.h: define virt_to_pfn()
@ 2017-11-09 15:43 ` James Hogan
0 siblings, 0 replies; 6+ messages in thread
From: James Hogan @ 2017-11-09 15:43 UTC (permalink / raw)
To: Florian Fainelli; +Cc: linux-mips, ralf, paul.burton, macro
[-- Attachment #1: Type: text/plain, Size: 795 bytes --]
On Wed, Nov 08, 2017 at 04:05:28PM -0800, Florian Fainelli wrote:
> On 11/08/2017 03:15 PM, James Hogan wrote:
> > Hi Florian,
> >
> > On Thu, Mar 09, 2017 at 01:11:49PM -0800, Florian Fainelli wrote:
> >> Based on the existing definition of virt_to_page() which already does a
> >> PFN_DOWN(vir_to_phys(kaddr)).
> >
> > I was just wondering if there was a particular motivation for this
> > change?
>
> Initially that was a part of an experiment to try to build and use ION
> on MIPS, but I think this dependency somehow got removed. I might have
> thought about using it for CONFIG_DEBUG_VIRTUAL too.
>
> In then end I sent it because it sounded like a simple change that could
> have some use later.
Okay thanks for clarifying. I've applied for 4.15.
Cheers
James
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] MIPS: page.h: define virt_to_pfn()
@ 2017-11-09 15:43 ` James Hogan
0 siblings, 0 replies; 6+ messages in thread
From: James Hogan @ 2017-11-09 15:43 UTC (permalink / raw)
To: Florian Fainelli; +Cc: linux-mips, ralf, paul.burton, macro
[-- Attachment #1: Type: text/plain, Size: 795 bytes --]
On Wed, Nov 08, 2017 at 04:05:28PM -0800, Florian Fainelli wrote:
> On 11/08/2017 03:15 PM, James Hogan wrote:
> > Hi Florian,
> >
> > On Thu, Mar 09, 2017 at 01:11:49PM -0800, Florian Fainelli wrote:
> >> Based on the existing definition of virt_to_page() which already does a
> >> PFN_DOWN(vir_to_phys(kaddr)).
> >
> > I was just wondering if there was a particular motivation for this
> > change?
>
> Initially that was a part of an experiment to try to build and use ION
> on MIPS, but I think this dependency somehow got removed. I might have
> thought about using it for CONFIG_DEBUG_VIRTUAL too.
>
> In then end I sent it because it sounded like a simple change that could
> have some use later.
Okay thanks for clarifying. I've applied for 4.15.
Cheers
James
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-11-09 15:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-09 21:11 [PATCH] MIPS: page.h: define virt_to_pfn() Florian Fainelli
2017-11-08 23:15 ` James Hogan
2017-11-08 23:15 ` James Hogan
2017-11-09 0:05 ` Florian Fainelli
2017-11-09 15:43 ` James Hogan
2017-11-09 15:43 ` James Hogan
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.