public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Linus Torvalds <torvalds@transmeta.com>,
	linux-kernel@vger.kernel.org,
	Linux Frame Buffer Device Development 
	<linux-fbdev-devel@lists.sourceforge.net>,
	Marcelo Tosatti <marcelo@conectiva.com.br>
Subject: [patch] Re: Framebuffer, mmap(), hanging in D state, root FS unmount  failure.
Date: Sun, 30 Dec 2001 00:34:21 -0800	[thread overview]
Message-ID: <3C2ED18D.FA550F1A@zip.com.au> (raw)
In-Reply-To: <20011227195037.GA229@znex> <3C2D0D13.CB1C5683@zip.com.au>

Andrew Morton wrote:
> 
> However I don't see why _any_ architecture wants framebuffer contents
> to be included in core files.  It sounds risky.
> 
> So the setting of VM_IO could be simply hoisted outside the forest
> of ifdefs.  Comments, anyone?

Well nobody has objected....

The patch marks fbdev mappings as VM_IO for *all* architectures.

This prevents a kernel deadlock (mmap_sem) which occurs on x86 when a
program which has mmapped an fbdev tries to dump core.


--- linux-2.4.18-pre1/drivers/video/fbmem.c	Fri Dec 21 11:19:14 2001
+++ linux-akpm/drivers/video/fbmem.c	Sun Dec 30 00:23:15 2001
@@ -576,12 +576,13 @@ fb_mmap(struct file *file, struct vm_are
 		return -EINVAL;
 	off += start;
 	vma->vm_pgoff = off >> PAGE_SHIFT;
+	/* This is an IO map - tell maydump to skip this VMA */
+	vma->vm_flags |= VM_IO;
 #if defined(__sparc_v9__)
 	vma->vm_flags |= (VM_SHM | VM_LOCKED);
 	if (io_remap_page_range(vma->vm_start, off,
 				vma->vm_end - vma->vm_start, vma->vm_page_prot, 0))
 		return -EAGAIN;
-	vma->vm_flags |= VM_IO;
 #else
 #if defined(__mc68000__)
 #if defined(CONFIG_SUN3)
@@ -607,8 +608,6 @@ fb_mmap(struct file *file, struct vm_are
 	pgprot_val(vma->vm_page_prot) |= _CACHE_UNCACHED;
 #elif defined(__arm__)
 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-	/* This is an IO map - tell maydump to skip this VMA */
-	vma->vm_flags |= VM_IO;
 #elif defined(__sh__)
 	pgprot_val(vma->vm_page_prot) &= ~_PAGE_CACHABLE;
 #else


-

  reply	other threads:[~2001-12-30  8:37 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-27 19:50 Framebuffer, mmap(), hanging in D state, root FS unmount failure Mark J Roberts
2001-12-29  0:23 ` Andrew Morton
2001-12-30  8:34   ` Andrew Morton [this message]
2001-12-30 21:13     ` [patch] Re: Framebuffer...Why oh Why??? Timothy Covell
     [not found]       ` <3C2F8727.5D4AAE21@zip.com.au>
2001-12-30 22:27         ` Timothy Covell
2001-12-31  1:51           ` James Simmons
2001-12-31  2:49             ` Andrew Morton
2001-12-31  3:23               ` James Simmons
2001-12-31 12:07               ` Geert Uytterhoeven
2001-12-31 13:18                 ` Alan Cox
2001-12-31 21:53                   ` Oliver Xymoron
2001-12-31  0:19       ` Linus Torvalds
2001-12-31  1:54         ` [Linux-fbdev-devel] " James Simmons
2001-12-31  8:03         ` gmack
2001-12-31  9:05         ` Benjamin Herrenschmidt
2001-12-31 21:41         ` Rob Landley
2002-01-01  7:00           ` Werner Puschitz
2002-01-03 22:26             ` Marco Ermini
2002-01-04 13:27               ` [OT] " Tommi Kyntola
2002-01-04 14:04                 ` Marco Ermini
2002-01-01  7:00           ` Timothy Covell
2002-01-01 10:42             ` Alan Cox
2002-01-01 20:36               ` Rob Landley
2002-01-02 11:36               ` Daniel Phillips
2002-01-01 14:31           ` Marius Gedminas
2001-12-31 21:42         ` Scott McDermott
2001-12-31 21:56           ` Arnaldo Carvalho de Melo
2001-12-31 22:26             ` James Simmons
2001-12-31 22:31               ` Arnaldo Carvalho de Melo
2002-01-01  2:43                 ` Bill Nottingham
2002-01-01  6:15                   ` Arnaldo Carvalho de Melo
2002-01-01 18:42                   ` Joachim Steiger
2002-01-01 10:21                 ` Alan Cox
2002-01-01  0:23         ` Ken Moffat
2002-01-01  7:03           ` Timothy Covell
2001-12-31 12:10       ` Geert Uytterhoeven

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=3C2ED18D.FA550F1A@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=torvalds@transmeta.com \
    /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