The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: preining@logic.at, linux-kernel@vger.kernel.org, zwane@holomorphy.com
Subject: Re: 2.6.11-rc2-mm1 strange messages
Date: Thu, 24 Feb 2005 22:33:08 -0800	[thread overview]
Message-ID: <20050224223308.778ef62e.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.58.0502242210360.9237@ppc970.osdl.org>

Linus Torvalds <torvalds@osdl.org> wrote:
>
> On Thu, 24 Feb 2005, Andrew Morton wrote:
>  > 
>  > Although a better fix might be to make __iounmap() behave symmetrically:
>  > 
>  > 	if ((long)addr >= phys_to_virt(0xA0000) &&
>  > 			(long)addr < phys_to_virt(0x100000))
>  > 		return;
>  > 
>  > but that's not quite right, because we're assuming that the range to be
>  > unmapped is wholly within the PCI/ISA region.  Without a VMA there just
>  > isn't enough info to determine that.
>  > 
>  > Does anyone have any preferences?
> 
>  I think the "as symmetric as possible" thing is probably the thing to do. 
>  It might not be perfect in theory, but hey, practice is what matters. And 
>  in practice it's the "right thing", I think.

OK..

Norbert, does this make the warnings go away?

--- 25/arch/i386/mm/ioremap.c~iounmap-isa-special-case	2005-02-24 22:24:24.000000000 -0800
+++ 25-akpm/arch/i386/mm/ioremap.c	2005-02-24 22:32:08.000000000 -0800
@@ -17,6 +17,9 @@
 #include <asm/tlbflush.h>
 #include <asm/pgtable.h>
 
+#define ISA_START_ADDRESS	0xa0000
+#define ISA_END_ADDRESS		0x100000
+
 static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
 	unsigned long phys_addr, unsigned long flags)
 {
@@ -129,7 +132,7 @@ void __iomem * __ioremap(unsigned long p
 	/*
 	 * Don't remap the low PCI/ISA area, it's always mapped..
 	 */
-	if (phys_addr >= 0xA0000 && last_addr < 0x100000)
+	if (phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS)
 		return (void __iomem *) phys_to_virt(phys_addr);
 
 	/*
@@ -230,7 +233,17 @@ void iounmap(volatile void __iomem *addr
 {
 	struct vm_struct *p;
 	if ((void __force *) addr <= high_memory) 
-		return; 
+		return;
+
+	/*
+	 * __ioremap special-cases the PCI/ISA range by not instantiating a
+	 * vm_area and by simply returning an address into the kernel mapping
+	 * of ISA space.   So handle that here.
+	 */
+	if (addr >= (void *)virt_to_phys((void *)ISA_START_ADDRESS) &&
+			addr < (void *)virt_to_phys((void *)ISA_END_ADDRESS))
+		return;
+
 	p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr));
 	if (!p) { 
 		printk("__iounmap: bad address %p\n", addr);
@@ -261,7 +274,7 @@ void __init *bt_ioremap(unsigned long ph
 	/*
 	 * Don't remap the low PCI/ISA area, it's always mapped..
 	 */
-	if (phys_addr >= 0xA0000 && last_addr < 0x100000)
+	if (phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS)
 		return phys_to_virt(phys_addr);
 
 	/*
_


  reply	other threads:[~2005-02-25  6:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-25 12:17 2.6.11-rc2-mm1 strange messages Norbert Preining
2005-01-25 18:28 ` Andrew Morton
2005-01-27  0:01   ` Len Brown
2005-01-27  6:24     ` Norbert Preining
2005-01-27 12:52   ` Norbert Preining
2005-02-24 14:10   ` Norbert Preining
2005-02-24 23:03     ` Andrew Morton
2005-02-25  1:23       ` Norbert Preining
2005-02-25  2:14         ` Andrew Morton
2005-02-25  6:12           ` Linus Torvalds
2005-02-25  6:33             ` Andrew Morton [this message]
2005-02-25  9:15               ` Norbert Preining
2005-02-25  9:52                 ` Andrew Morton
2005-02-25 13:27                   ` Norbert Preining

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=20050224223308.778ef62e.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=preining@logic.at \
    --cc=torvalds@osdl.org \
    --cc=zwane@holomorphy.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