linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Anatolij Gustschin <agust@denx.de>,
	dhowells@redhat.com, Sasha Levin <levinsasha928@gmail.com>,
	suresh.b.siddha@intel.com,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-mtd@lists.infradead.org, linux-mm <linux-mm@kvack.org>,
	Dave Jones <davej@redhat.com>
Subject: Re: mtd: kernel BUG at arch/x86/mm/pat.c:279!
Date: Sat, 29 Sep 2012 17:34:10 +0100	[thread overview]
Message-ID: <1348936450.2036.158.camel@shinybook.infradead.org> (raw)
In-Reply-To: <1348935073.2036.147.camel@shinybook.infradead.org>

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

On Sat, 2012-09-29 at 17:11 +0100, David Woodhouse wrote:
> 
> That check seems to have been missing from David's commit 402d3265 in
> which he introduced the mtd_mmap() operation, and wasn't fixed in commit
> dd02b67d5 where Anatolij fixed things to actually *work* in the MMU code
> path. This should fix it:

> +               if (map->phys == NO_XIP)
> +                       return -EINVAL; 

Hm, but there's another problem. That 'map' variable is pulled from
mtd->priv but there's a clue in the name 'priv'.... it isn't guaranteed
to *be* a device that goes through the map abstraction.

Anatolij? Your patch dd02b67d5 might have worked on your test case, but
it fails disgracefully in any of the cases where it *isn't* expected to
work.

I think it needs to use mtd_unmapped_area() on the device in question
just like the !CONFIG_MMU code path does, and avoid grubbing around in
things that it shouldn't be looking at directly.

David, you made mtd_unmapped_area() return the *virtual* address... but
there's no reason that couldn't have been the physical address, right?
You were only using it in the !CONFIG_MMU case anyway, where they're
equal.

In the meantime, I think the quick fix is just to disable mtdchar_mmap
in the CONFIG_MMU case. It was broken from the moment David introduced
it, and Anatolij's fix was insufficient. I'll do that.

-- 
dwmw2

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]

  reply	other threads:[~2012-09-29 16:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-29  8:48 mtd: kernel BUG at arch/x86/mm/pat.c:279! Sasha Levin
2012-07-30 11:00 ` Sasha Levin
2012-09-07 16:55 ` Sasha Levin
2012-09-07 18:14   ` Linus Torvalds
2012-09-07 22:42     ` Suresh Siddha
2012-09-07 23:09       ` Linus Torvalds
2012-09-07 23:54         ` Suresh Siddha
2012-09-08 19:57           ` Linus Torvalds
2012-09-09 14:56             ` Suresh Siddha
2012-09-09 15:31               ` Linus Torvalds
2012-09-09 17:01                 ` H. Peter Anvin
2012-09-12 10:50               ` Sasha Levin
2012-09-12 10:56                 ` Sasha Levin
2012-09-28  9:00                   ` Sasha Levin
2012-09-28 16:44                     ` Linus Torvalds
2012-09-28 18:05                       ` Artem Bityutskiy
2012-09-28 19:13                         ` Linus Torvalds
2012-09-28 19:44                           ` Sasha Levin
2012-09-28 19:04                       ` David Woodhouse
2012-09-28 19:15                         ` richard -rw- weinberger
2012-09-28 19:18                           ` richard -rw- weinberger
2012-09-29 16:11                         ` David Woodhouse
2012-09-29 16:34                           ` David Woodhouse [this message]
2012-09-09 16:56             ` H. Peter Anvin
2012-09-09 19:04               ` David Woodhouse
2012-09-09 20:33                 ` H. Peter Anvin
2012-09-10  5:17               ` Sasha Levin
2012-09-08  8:10         ` Sasha Levin

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=1348936450.2036.158.camel@shinybook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=agust@denx.de \
    --cc=akpm@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=suresh.b.siddha@intel.com \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).