public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* TLB reset on SH7780
@ 2008-02-28  9:45 Hideo Saito
  2008-02-28 10:04 ` Paul Mundt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hideo Saito @ 2008-02-28  9:45 UTC (permalink / raw)
  To: linux-sh

Hi Paul,

When /dev/mem is accessed as follows, it causes TLB reset on SH7780, because our physical memory is mapped from 0x08000000, the PMB entry does not map all of the P1 area.

# dd if=/dev/mem <return>

How about following changes though the code is in the machine independent part?

--- ./drivers/char/mem.c.org	2008-01-25 07:58:37.000000000 +0900
+++ ./drivers/char/mem.c	2008-02-28 17:56:11.000000000 +0900
@@ -91,17 +91,18 @@ static inline int uncached_access(struct
 		return 1;
 	return addr >= __pa(high_memory);
 #endif
 }
 
 #ifndef ARCH_HAS_VALID_PHYS_ADDR_RANGE
 static inline int valid_phys_addr_range(unsigned long addr, size_t count)
 {
-	if (addr + count > __pa(high_memory))
+	if (addr < __pa(high_memory - (num_physpages << PAGE_SHIFT)) ||
+	    addr + count > __pa(high_memory))
 		return 0;
 
 	return 1;
 }
 
 static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
 {
 	return 1;

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

end of thread, other threads:[~2008-03-06  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-28  9:45 TLB reset on SH7780 Hideo Saito
2008-02-28 10:04 ` Paul Mundt
2008-03-06  6:38 ` Paul Mundt
2008-03-06  7:55 ` Hideo Saito

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox