public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: linux-sh@vger.kernel.org
Subject: Re: Crash dumping on sh7372 Mackerel
Date: Tue, 21 Jun 2011 05:46:08 +0000	[thread overview]
Message-ID: <20110621054602.GA14369@verge.net.au> (raw)
In-Reply-To: <BANLkTi=DgEtZwiigMvm4XptoB3uKqpXvLA@mail.gmail.com>

On Mon, Jun 20, 2011 at 10:07:40PM +0900, Magnus Damm wrote:

[snip]

> Linux-3.0-rc or more exactly linux-2.6 git
> 95d17b7168eacf1f97f2d1d087ebe7a648c30051 is known to be working, but
> the attached prototype patch
> "linux-3.0-arm-crash-copy-oldmem-page-ioremap-fix-20110618.patch" is
> needed to properly access the /proc/vmcore file. Build the kernel as a
> regular uImage. This image is referred to as uImage-crash.

[snip]

Hi Magnus,

do you have any plans to submit this patch for inclusion upstream?

> From: Magnus Damm <damm@opensource.se>
> 
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
> 
>  arch/arm/kernel/crash_dump.c |   14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> --- 0001/arch/arm/kernel/crash_dump.c
> +++ work/arch/arm/kernel/crash_dump.c	2011-06-18 20:59:49.000000000 +0900
> @@ -39,9 +39,13 @@ ssize_t copy_oldmem_page(unsigned long p
>  	if (!csize)
>  		return 0;
>  
> -	vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
> -	if (!vaddr)
> -		return -ENOMEM;
> +	if (pfn_valid(pfn)) {
> +		vaddr = phys_to_virt(pfn << PAGE_SHIFT);
> +	} else {
> +		vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
> +		if (!vaddr)
> +			return -ENOMEM;
> +	}
>  
>  	if (userbuf) {
>  		if (copy_to_user(buf, vaddr + offset, csize)) {
> @@ -52,6 +56,8 @@ ssize_t copy_oldmem_page(unsigned long p
>  		memcpy(buf, vaddr + offset, csize);
>  	}
>  
> -	iounmap(vaddr);
> +	if (!pfn_valid(pfn))
> +		iounmap(vaddr);
> +
>  	return csize;
>  }


  reply	other threads:[~2011-06-21  5:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-20 13:07 Crash dumping on sh7372 Mackerel Magnus Damm
2011-06-21  5:46 ` Simon Horman [this message]
2011-06-21 10:28 ` Magnus Damm
2011-06-21 10:57 ` Simon Horman

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=20110621054602.GA14369@verge.net.au \
    --to=horms@verge.net.au \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox