All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: TLB reset on SH7780
Date: Thu, 28 Feb 2008 10:04:20 +0000	[thread overview]
Message-ID: <20080228100420.GA27540@linux-sh.org> (raw)
In-Reply-To: <20080228.184540.68563408.saito@densan.co.jp>

On Thu, Feb 28, 2008 at 06:45:40PM +0900, Hideo Saito wrote:
> 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;
>  }
>  
Given that this is under an ARCH_HAS_VALID_PHYS_ADDR_RANGE check, how
about just defining this and providing a custom implementation?

  reply	other threads:[~2008-02-28 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-28  9:45 TLB reset on SH7780 Hideo Saito
2008-02-28 10:04 ` Paul Mundt [this message]
2008-03-06  6:38 ` Paul Mundt
2008-03-06  7:55 ` Hideo Saito

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=20080228100420.GA27540@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@vger.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.