public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be  kernel-related?
Date: Thu, 07 Jan 2010 23:57:00 +0000	[thread overview]
Message-ID: <201001071657.00754.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <d72eeaf61001041440s58b51b9j58e62af378b55224@mail.gmail.com>

On Thursday 07 January 2010 04:02:37 pm Émeric Maschino wrote:
> All,
> 
> I've successfully recompiled 2.6.33-rc3 kernel with the following
> patches from Bjorn Helgaas (thank you!):
> - [PATCH 1/2] ACPICA: acpi_get_object_info(): fixup array -> pointer
> () (http://marc.info/?l=linux-ia64&m\x126289433630090&w=2)
> - [PATCH 2/2] agp/hp: fail gracefully if we don't find an IOC
> (http://marc.info/?l=linux-ia64&m\x126289434030106&w=2).
> 
> I'm still getting the reported drm_mmap_locked error, but now that
> Bjorn fixed the kernel crash in the hp-agp driver ([PATCH 0/2] agp/hp:
> fix zx1_gart_probe oops
> (http://marc.info/?l=linux-ia64&m\x126289433530083&w=2)), dmesg output
> is more verbose:

Thanks a lot for testing these patches!

> [   14.206257] Linux agpgart interface v0.103
> [   14.315142] agpgart: HP ZX1 IOC: IOPDIR shared with sba_iommu
> [   14.315522]  (null): AGP aperture is 512M @ 0x60000000
> [   14.315557] agpgart: HP ZX1 IOC: IOPDIR shared with sba_iommu
> [   14.315592] agpgart: No reserved IO PDIR entry found; GART disabled

Huh, something strange is going on.  On these machines, when we find an
AGP-capable device, we use part of an IOMMU to implement the GART.  We
must have found an AGP device, because the IOMMU has 1G of address
space, and you can see that half of it is reserved for the GART.

The IOMMU driver puts a magic cookie at the beginning of the reserved
area, and the hp-agp driver looks for it.  On your system, it looks
like we reserved the space (and presumably installed the cookie), but
hp-agp didn't find it.  I don't have an AGP device in my box, but I
forced that path on by hand, and I get this, which looks correct:

  IOC: reserving 512Mb of IOVA space at 0x60000000 for agpgart
  IOC: zx1 2.2 HPA 0xfed01000 IOVA space 1024Mb at 0x40000000
  agpgart: HP ZX1 IOC: IOPDIR shared with sba_iommu
   (null): AGP aperture is 512M @ 0x60000000
  agpgart: Detected HP ZX1 HWP0003 AGP chipset (iocþd01000, lbaþd28000)

Can you try the debug patch below, and respond with the entire dmesg
log and the output of "lspci -vv"?

Bjorn


diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index e14c492..8f205d8 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -95,7 +95,7 @@ extern int swiotlb_late_init_with_default_size (size_t size);
 ** longer guaranteed to stay in sync.  The sanity checking code isn't going to
 ** like that.
 */
-#undef DEBUG_SBA_INIT
+#define DEBUG_SBA_INIT
 #undef DEBUG_SBA_RUN
 #undef DEBUG_SBA_RUN_SG
 #undef DEBUG_SBA_RESOURCE
@@ -1656,11 +1656,15 @@ ioc_iova_init(struct ioc *ioc)
 	for_each_pci_dev(device)	
 		agp_found |= pci_find_capability(device, PCI_CAP_ID_AGP);
 
+	agp_found = 1;
 	if (agp_found && reserve_sba_gart) {
 		printk(KERN_INFO PFX "reserving %dMb of IOVA space at 0x%lx for agpgart\n",
 		      ioc->iov_size/2 >> 20, ioc->ibase + ioc->iov_size/2);
 		ioc->pdir_size /= 2;
 		((u64 *)ioc->pdir_base)[PDIR_INDEX(ioc->iov_size/2)] = ZX1_SBA_IOMMU_COOKIE;
+		printk("put cookie at 0x%p: 0x%llx\n",
+		       &((u64 *)ioc->pdir_base)[PDIR_INDEX(ioc->iov_size/2)],
+		       ((u64 *)ioc->pdir_base)[PDIR_INDEX(ioc->iov_size/2)]);
 	}
 #ifdef FULL_VALID_PDIR
 	/*
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c
index 58752b7..ff4d4a6 100644
--- a/drivers/char/agp/hp-agp.c
+++ b/drivers/char/agp/hp-agp.c
@@ -110,6 +110,8 @@ static int __init hp_zx1_ioc_shared(void)
 	hp->io_pdir = phys_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE));
 	hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)];
 
+	printk("GART at 0x%p\n", hp->gatt);
+	printk("read cookie at 0x%p: 0x%llx\n", &hp->gatt[0], hp->gatt[0]);
 	if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) {
 		/* Normal case when no AGP device in system */
 		hp->gatt = NULL;

  parent reply	other threads:[~2010-01-07 23:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-04 22:40 [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be Émeric Maschino
2010-01-04 23:50 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be kernel-related? Bjorn Helgaas
2010-01-07 23:02 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be Émeric Maschino
2010-01-07 23:57 ` Bjorn Helgaas [this message]
2010-01-08 20:06 ` Émeric Maschino
2010-01-08 23:55 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be kernel-related? Bjorn Helgaas
2010-01-09 11:46 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be Émeric Maschino
2010-01-11 17:54 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be kernel-related? Bjorn Helgaas
2010-01-11 18:23 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be Luck, Tony
2010-01-11 18:35 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be kernel-related? Bjorn Helgaas
2010-01-11 21:18 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be Émeric Maschino
2010-01-11 21:40 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be kernel-related? Bjorn Helgaas
2010-01-13  7:15 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be Émeric Maschino
2010-01-13 17:13 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be kernel-related? Bjorn Helgaas
2010-01-14  0:10 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this Dave Airlie
2010-01-14  8:50 ` [drm:drm_mmap_locked] *ERROR* Could not find map: Could this be Émeric Maschino
2010-01-14  8:54 ` Émeric Maschino
2010-01-18 15:44 ` Émeric Maschino
2010-01-22 22:19 ` Émeric Maschino
2010-02-02 21:05 ` Émeric Maschino

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=201001071657.00754.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=linux-ia64@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