LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Diego Calleja <diegocg@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org
Subject: Re: BUG?: "Cannot map mmconfig aperture"
Date: Thu, 21 Feb 2008 21:26:56 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.1.00.0802212124231.7583@apollo.tec.linutronix.de> (raw)
In-Reply-To: <20080221164105.145d0cbb.diegocg@gmail.com>

On Thu, 21 Feb 2008, Diego Calleja wrote:
> > Hmm, that's confusing. Can you please provide a complete boot log ?
> > 
> > Thanks,
> 
> Sure

Thanks. Nothing new there. Can you please apply the patch below and
provide the output of the ioremap code ?

Thanks,

	tglx

Index: linux-2.6/arch/x86/mm/ioremap.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/ioremap.c
+++ linux-2.6/arch/x86/mm/ioremap.c
@@ -112,6 +112,7 @@ static void __iomem *__ioremap(unsigned 
 	unsigned long pfn, offset, last_addr, vaddr;
 	struct vm_struct *area;
 	pgprot_t prot;
+	int err;
 
 	/* Don't allow wraparound or zero size */
 	last_addr = phys_addr + size - 1;
@@ -130,8 +131,11 @@ static void __iomem *__ioremap(unsigned 
 	for (pfn = phys_addr >> PAGE_SHIFT; pfn < max_pfn_mapped &&
 	     (pfn << PAGE_SHIFT) < last_addr; pfn++) {
 		if (page_is_ram(pfn) && pfn_valid(pfn) &&
-		    !PageReserved(pfn_to_page(pfn)))
+		    !PageReserved(pfn_to_page(pfn))) {
+			printk(KERN_INFO "ioremap: (RAM) %lx %lu\n", phys_addr,
+			       size);
 			return NULL;
+		}
 	}
 
 	WARN_ON_ONCE(page_is_ram(pfn));
@@ -157,16 +161,23 @@ static void __iomem *__ioremap(unsigned 
 	 * Ok, go for it..
 	 */
 	area = get_vm_area(size, VM_IOREMAP);
-	if (!area)
+	if (!area) {
+		printk(KERN_INFO "ioremap: !area PR %lx %lu\n", phys_addr,
+		       size);
 		return NULL;
+	}
 	area->phys_addr = phys_addr;
 	vaddr = (unsigned long) area->addr;
 	if (ioremap_page_range(vaddr, vaddr + size, phys_addr, prot)) {
 		remove_vm_area((void *)(vaddr & PAGE_MASK));
+		printk(KERN_INFO "ioremap: IPR %lx %lu\n", phys_addr, size);
 		return NULL;
 	}
 
-	if (ioremap_change_attr(vaddr, size, mode) < 0) {
+	err = ioremap_change_attr(vaddr, size, mode);
+	if (err < 0) {
+		printk(KERN_INFO "ioremap: CPA %lx %lu %d\n", phys_addr, size,
+		       err);
 		vunmap(area->addr);
 		return NULL;
 	}

  reply	other threads:[~2008-02-21 20:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 21:31 Diego Calleja
2008-02-21  7:53 ` Thomas Gleixner
2008-02-21 15:41   ` Diego Calleja
2008-02-21 20:26     ` Thomas Gleixner [this message]
2008-02-22 20:22       ` Diego Calleja
     [not found] <fa.ta6yFP+Jk2cm3xbIaPPD8L82kEs@ifi.uio.no>
2008-02-20 23:47 ` Robert Hancock

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=alpine.LFD.1.00.0802212124231.7583@apollo.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=diegocg@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --subject='Re: BUG?: "Cannot map mmconfig aperture"' \
    /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

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).