linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mips: Move __virt_addr_valid() to a place for MIPS 64
@ 2013-01-25 18:13 Steven Rostedt
  2013-01-26 20:15 ` Aaro Koskinen
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2013-01-25 18:13 UTC (permalink / raw)
  To: LKML, linux-mips; +Cc: Ralf Baechle

Commit d3ce88431892 "MIPS: Fix modpost error in modules attepting to use
virt_addr_valid()" moved __virt_addr_valid() from a macro in a header
file to a function in ioremap.c. But ioremap.c is only compiled for MIPS
32, and not for MIPS 64.

When compiling for my yeeloong2, which supposedly supports hibernation,
which compiles kernel/power/snapshot.c which calls virt_addr_valid(), I
got this error:

  LD      init/built-in.o
kernel/built-in.o: In function `memory_bm_free':
snapshot.c:(.text+0x4c9c4): undefined reference to `__virt_addr_valid'
snapshot.c:(.text+0x4ca58): undefined reference to `__virt_addr_valid'
kernel/built-in.o: In function `snapshot_write_next':
(.text+0x4e44c): undefined reference to `__virt_addr_valid'
kernel/built-in.o: In function `snapshot_write_next':
(.text+0x4e890): undefined reference to `__virt_addr_valid'
make[1]: *** [vmlinux] Error 1
make: *** [sub-make] Error 2

I suspect that __virt_addr_valid() is fine for mips 64. I moved it to
mmap.c such that it gets compiled for mips 64 and 32.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c
index 7657fd2..cacfd31 100644
--- a/arch/mips/mm/ioremap.c
+++ b/arch/mips/mm/ioremap.c
@@ -190,9 +190,3 @@ void __iounmap(const volatile void __iomem *addr)
 
 EXPORT_SYMBOL(__ioremap);
 EXPORT_SYMBOL(__iounmap);
-
-int __virt_addr_valid(const volatile void *kaddr)
-{
-	return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
-}
-EXPORT_SYMBOL_GPL(__virt_addr_valid);
diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c
index d9be754..7e5fe27 100644
--- a/arch/mips/mm/mmap.c
+++ b/arch/mips/mm/mmap.c
@@ -192,3 +192,9 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
 
 	return ret;
 }
+
+int __virt_addr_valid(const volatile void *kaddr)
+{
+	return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
+}
+EXPORT_SYMBOL_GPL(__virt_addr_valid);



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mips: Move __virt_addr_valid() to a place for MIPS 64
  2013-01-25 18:13 [PATCH] mips: Move __virt_addr_valid() to a place for MIPS 64 Steven Rostedt
@ 2013-01-26 20:15 ` Aaro Koskinen
  2013-01-26 21:01   ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Aaro Koskinen @ 2013-01-26 20:15 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, linux-mips, Ralf Baechle

Hi,

On Fri, Jan 25, 2013 at 01:13:15PM -0500, Steven Rostedt wrote:
> Commit d3ce88431892 "MIPS: Fix modpost error in modules attepting to use
> virt_addr_valid()" moved __virt_addr_valid() from a macro in a header
> file to a function in ioremap.c. But ioremap.c is only compiled for MIPS
> 32, and not for MIPS 64.
> 
> When compiling for my yeeloong2, which supposedly supports hibernation,
> which compiles kernel/power/snapshot.c which calls virt_addr_valid(), I
> got this error:

This has been reported also here:

	http://marc.info/?l=linux-mips&m=135788867604856&w=2

and here:

	http://marc.info/?l=linux-mips&m=135876719403187&w=2

It's pretty sad that MIPS has been pretty much broken during the whole
3.8-rc cycle. :-(

A.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mips: Move __virt_addr_valid() to a place for MIPS 64
  2013-01-26 20:15 ` Aaro Koskinen
@ 2013-01-26 21:01   ` Steven Rostedt
  2013-01-26 21:19     ` Aaro Koskinen
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2013-01-26 21:01 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: LKML, linux-mips, Ralf Baechle

On Sat, 2013-01-26 at 22:15 +0200, Aaro Koskinen wrote:
> Hi,
> 
> On Fri, Jan 25, 2013 at 01:13:15PM -0500, Steven Rostedt wrote:
> > Commit d3ce88431892 "MIPS: Fix modpost error in modules attepting to use
> > virt_addr_valid()" moved __virt_addr_valid() from a macro in a header
> > file to a function in ioremap.c. But ioremap.c is only compiled for MIPS
> > 32, and not for MIPS 64.
> > 
> > When compiling for my yeeloong2, which supposedly supports hibernation,
> > which compiles kernel/power/snapshot.c which calls virt_addr_valid(), I
> > got this error:
> 
> This has been reported also here:
> 
> 	http://marc.info/?l=linux-mips&m=135788867604856&w=2
> 
> and here:
> 
> 	http://marc.info/?l=linux-mips&m=135876719403187&w=2
> 

Hmm, interesting. Although, I prefer my change as it doesn't require
compiling all of ioremap.c where it's not needed.

> It's pretty sad that MIPS has been pretty much broken during the whole
> 3.8-rc cycle. :-(
> 

Yeah, that happens.

-- Steve


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mips: Move __virt_addr_valid() to a place for MIPS 64
  2013-01-26 21:01   ` Steven Rostedt
@ 2013-01-26 21:19     ` Aaro Koskinen
  0 siblings, 0 replies; 4+ messages in thread
From: Aaro Koskinen @ 2013-01-26 21:19 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, linux-mips, Ralf Baechle

Hi,

On Sat, Jan 26, 2013 at 04:01:44PM -0500, Steven Rostedt wrote:
> On Sat, 2013-01-26 at 22:15 +0200, Aaro Koskinen wrote:
> > On Fri, Jan 25, 2013 at 01:13:15PM -0500, Steven Rostedt wrote:
> > > Commit d3ce88431892 "MIPS: Fix modpost error in modules attepting to use
> > > virt_addr_valid()" moved __virt_addr_valid() from a macro in a header
> > > file to a function in ioremap.c. But ioremap.c is only compiled for MIPS
> > > 32, and not for MIPS 64.
> > > 
> > > When compiling for my yeeloong2, which supposedly supports hibernation,
> > > which compiles kernel/power/snapshot.c which calls virt_addr_valid(), I
> > > got this error:
> > 
> > This has been reported also here:
> > 
> > 	http://marc.info/?l=linux-mips&m=135788867604856&w=2
> > 
> > and here:
> > 
> > 	http://marc.info/?l=linux-mips&m=135876719403187&w=2
> > 
> 
> Hmm, interesting. Although, I prefer my change as it doesn't require
> compiling all of ioremap.c where it's not needed.

Yes, I think your solution is fine.

A.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-26 21:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-25 18:13 [PATCH] mips: Move __virt_addr_valid() to a place for MIPS 64 Steven Rostedt
2013-01-26 20:15 ` Aaro Koskinen
2013-01-26 21:01   ` Steven Rostedt
2013-01-26 21:19     ` Aaro Koskinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).