Re: [Bug 14437] Re: PCI IOMEM fix in latest kernel ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Bjorn,

Yes you are correct on your reports and I also forgot to say that
there is a patch from nvidia for a older kernel

sudo apt-get build-dep linux-image-2.6.24-17-rt
sudo apt-get source linux-image-2.6.24-17-rt

# Install Kernel Modules Sources
sudo apt-get build-dep linux-ubuntu-modules-2.6.24-17-rt
sudo apt-get source linux-ubuntu-modules-2.6.24-17-rt

# Apply NVRM patch (download the patch first!)
sudo patch -p0 < NVRM_512M_fix.txt

# Build debs for linux-image & linux-headers
cd linux-2.6.24/
sudo cp /boot/config-2.6.24-17-rt debian/config/amd64/config.rt
sudo CONCURRENCY_LEVEL=2 AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules
custom-binary-rt
cd ..

# Build Kernel Modules
cd linux-ubuntu-modules-2.6.24-2.6.24/
sudo CONCURRENCY_LEVEL=2 fakeroot debian/rules binary-debs
cd ..

and the patch being for 268MB allocation.

diff -Naur linux-2.6.24.orig/arch/x86/pci/i386.c
linux-2.6.24/arch/x86/pci/i386.c
--- linux-2.6.24.orig/arch/x86/pci/i386.c	2008-06-03 20:24:26.000000000 -0400
+++ linux-2.6.24/arch/x86/pci/i386.c	2008-06-03 20:25:40.000000000 -0400
@@ -122,6 +122,10 @@
 				r = &dev->resource[idx];
 				if (!r->flags)
 					continue;
+				if ((r->start == 0xbdf00000) && (r->end == 0xddefffff)) {
+					r->start = 0xc0000000;
+					r->end = 0xd0000000;
+				}
 				pr = pci_find_parent_resource(dev, r);
 				if (!r->start || !pr ||
 				    request_resource(pr, r) < 0) {

But I cannot find this in the present 2.6.31, I can find similar
lines, but not the same ones

                                r = &dev->resource[idx];
                                if (!r->flags)
                                        continue;
                                if (!r->start ||
                                    pci_claim_resource(dev, idx) < 0) {
                                        dev_warn(&dev->dev, "BAR %d:
can't allocate resource\n", idx);
                                        /*
                                         * Something is wrong with the region.
                                         * Invalidate the resource to prevent
                                         * child resource allocations in this
                                         * range.
                                         */
                                        r->flags = 0;
                                }

as a guess could I do this instead ?

                                r = &dev->resource[idx];
                                if (!r->flags)
                                        continue;
				if ((r->start == 0xbdf00000) && (r->end == 0xddefffff)) {
					r->start = 0xc0000000;
					r->end = 0xd0000000;
				}
 				pr = pci_find_parent_resource(dev, r);
                                if (!r->start ||
                                    pci_claim_resource(dev, idx) < 0) {
                                        dev_warn(&dev->dev, "BAR %d:
can't allocate resource\n", idx);
                                        /*
                                         * Something is wrong with the region.
                                         * Invalidate the resource to prevent
                                         * child resource allocations in this
                                         * range.
                                         */
                                        r->flags = 0;
                                }
Regards
Ian

On Mon, Oct 19, 2009 at 6:42 PM, Bjorn Helgaas <bjorn.helgaas@xxxxxx> wrote:
> Correct me if I'm wrong, but I think your complaint is that the nVidia
> card works when you have only 2GB of memory, but stops working when you
> have 4GB of memory.  (With 4GB, it probably still works in plain VGA
> mode, but not in modes that use the 256MB frame buffer.)
>
> The nVidia device is at 0000:01:00.0 and requires these resources:
>
>  BAR 0 (0x10): mem  16MB (32-bit BAR)
>  BAR 1 (0x14): mem 256MB (64-bit BAR, prefetchable (frame buffer))
>  BAR 3 (0x1c): mem  16MB (64-bit BAR)
>  BAR 5 (0x24): io  128 ports
>  ROM   (0x30): mem 128KB (32-bit BAR)
>
> With 2GB of RAM, you have memory from 0-0x80000000, and the 1.5GB region
> from 0x80000000-0xE0000000 is available for PCI devices.  With 4GB of
> RAM, you have memory from 0-0xC0000000, and only the 512MB region from
> 0xC0000000-0xE0000000 is left for PCI.
>
> Even 512MB should be enough to accommodate the devices you have, but
> the BIOS divided it up in such a way that only 32MB is actually routed
> to bus 0000:01, and I don't think Linux is smart enough to redistribute
> things and fix that.  The dynamic allocation work you mentioned might
> be able to do it, but it is not in the mainline kernel, and I haven't
> seen any discussion about it.
>
> The frame buffer is a 64-bit BAR, and you seem to be running the
> 32-bit Ubuntu kernel.  I don't know whether the 64-bit kernel would
> make a difference here or not.  It might be worth trying a live CD
> or something.
>
> Bjorn
>
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux