{"id":472,"date":"2010-01-07T14:22:41","date_gmt":"2010-01-07T14:22:41","guid":{"rendered":"http:\/\/www.codingfriends.com\/?p=472"},"modified":"2010-01-11T22:39:22","modified_gmt":"2010-01-11T22:39:22","slug":"bar-15-bar-1-no-parent-nvidia-graphics-card-does-not-work","status":"publish","type":"post","link":"https:\/\/www.codingfriends.com\/index.php\/2010\/01\/07\/bar-15-bar-1-no-parent-nvidia-graphics-card-does-not-work\/","title":{"rendered":"BAR 15 &#8211; BAR 1 &#8211; no parent &#8211; nvidia graphics card does not work"},"content":{"rendered":"<p>I have come up with a fix for the problem that I was having regarding upgrading my 2GB of RAM to 4GB of RAM, when the nvidia was trying to place its memory request into the new system RAM place, as described in more detail <a href=\"http:\/\/www.codingfriends.com\/index.php\/2009\/10\/18\/4gb-32bit-northbridge-bar1-error\/\">here<\/a>.<\/p>\n<p>This was the error that I was getting, where the BAR 1 for pci 0000:01:00.0 means the nvidia geforce 7600 256MB graphics card.<\/p>\n<pre lang=\"bash\">\r\n[    0.397452] pci 0000:00:01.0: BAR 15: address space collision on of bridge [0xb0000000-0xbfffffff]\r\n[    0.397452] pci 0000:00:01.0: BAR 15: cant allocate resource start :0xb0000000-0xbfffffff\r\n[    0.397452] pci 0000:01:00.0: BAR 1: no parent found for of device [0xb0000000-0xbfffffff]\r\n<\/pre>\n<p>Also the problem with trying to apply the nvnews fix, which meant just blocking out the 0xc0000000-0xd0000000 range was that there was other devices using that and thus they was gaining that memory range before the nvidia could try to access it. What I have done is to hard code (shall try and do a better fix next), so that if anything tries to gain the memory resource 0xc0000000-0xcfffffff it will block the request and they will re-assign the memory in a later process (great linux kernel there \ud83d\ude42 ).  Then if there is a request for the ranges 0xb0000000 &#8211; 0xbfffffff (which is where the ACER BIOS tries to say to put the memory for the nvidia graphics card), move that to the 0xc0000000-0xcfffffff.   I have placed at the bottom how the memory is organized before and after the update, where the pci devices that was in the 0xc0 -0xcf ranges are now placed further down in the memory allocation table.<\/p>\n<p>So what I have done is to alter the linux-kernel-source-code \/arch\/x86\/pci\/i386.c file, by adding into the function pcibios_allocate_bus_resources come code.  I have included the full code for the function below and also just the bit that I have updated further down, it is the bit just after the \/* Ian Porter *\/ \ud83d\ude42<\/p>\n<pre lang=\"c\">\r\nstatic void __init pcibios_allocate_bus_resources(struct list_head *bus_list)\r\n{                                                                            \r\n        struct pci_bus *bus;                                                 \r\n        struct pci_dev *dev;                                                 \r\n        int idx;                                                             \r\n        struct resource *r;                                                  \r\n\r\n        \/* Depth-First Search on bus tree *\/\r\n        list_for_each_entry(bus, bus_list, node) {\r\n                if ((dev = bus->self)) {          \r\n                        for (idx = PCI_BRIDGE_RESOURCES;\r\n                            idx < PCI_NUM_RESOURCES; idx++) {\r\n                                r = &#038;dev->resource[idx];     \r\n\r\n\r\n\/*\r\nIan Porter added, to test for the nvidia problem\r\n\r\n[0xb0000000-0xbfffffff] is where the BIOS is telling nvidia to get the memory,\r\nbut with 4GB this is where the system memory is.                              \r\n\r\na better way of doing this, would be to run the BIOS find memory process twice\r\nand then if no resources can gain memory, e.g. nvidia in this case, flag it for the\r\nsecond run to then give that the starting area and re-do the rest of them, because \r\nmainly it is the graphics card that needs the most memory..e.g. 256-512 etc.       \r\n*\/                                                                                 \r\n                                if ((r->start >= 0xc0000000) && (r->end <= 0xcfffffff)) {\r\n                                        dev_info(&#038;dev->dev,                              \r\n                                                 \" not allocating resource 0xc - 0xcf %pR\\n\",\r\n                                                 r);                                         \r\n                                        \/*                                                   \r\n                                                stop any resources gaining the 0xc0000000 - 0xcfffffff\r\n                                                region, the linux kernel will re-place them.          \r\n                                        *\/                                                            \r\n                                        r->flags = 0;                                                 \r\n                                }                                                                     \r\n\r\n                                \/* where the nvidia is going and replace in the above region *\/\r\n                                if ((r->start == 0xb0000000) && (r->end == 0xbfffffff)) {      \r\n                                        r->start = 0xc0000000;                                 \r\n                                        r->end = 0xcfffffff;                                   \r\n                                }                                                              \r\n\/* stop insert *\/\r\n\r\n                                if (!r->flags)\r\n                                        continue;\r\n                                if (!r->start || \r\n                                    pci_claim_resource(dev, idx) < 0) {\r\n                                        dev_warn(&#038;dev->dev, \"BAR %d: can't allocate resource\\n\", idx);\r\n                                        \/*                                                            \r\n                                         * Something is wrong with the region.                        \r\n                                         * Invalidate the resource to prevent                         \r\n                                         * child resource allocations in this                         \r\n                                         * range.                                                     \r\n                                         *\/                                                           \r\n                                        r->flags = 0;                                                 \r\n                                }                                                                     \r\n                        }                                                                             \r\n                }                                                                                     \r\n                pcibios_allocate_bus_resources(&bus->children);                                       \r\n        }                                                                                             \r\n}                                           \r\n<\/pre>\n<p>Basically just place this code<\/p>\n<pre lang=\"c\">\r\n\/*\r\nIan Porter added, to test for the nvidia problem\r\n\r\n[0xb0000000-0xbfffffff] is where the BIOS is telling nvidia to get the memory,\r\nbut with 4GB this is where the system memory is.                              \r\n\r\na better way of doing this, would be to run the BIOS find memory process twice\r\nand then if no resources can gain memory, e.g. nvidia in this case, flag it for the\r\nsecond run to then give that the starting area and re-do the rest of them, because \r\nmainly it is the graphics card that needs the most memory..e.g. 256-512 etc.       \r\n*\/                                                                                 \r\n                                if ((r->start >= 0xc0000000) && (r->end <= 0xcfffffff)) {\r\n                                        dev_info(&#038;dev->dev,                              \r\n                                                 \" not allocating resource 0xc - 0xcf %pR\\n\",\r\n                                                 r);                                         \r\n                                        \/*                                                   \r\n                                                stop any resources gaining the 0xc0000000 - 0xcfffffff\r\n                                                region, the linux kernel will re-place them.          \r\n                                        *\/                                                            \r\n                                        r->flags = 0;                                                 \r\n                                }                                                                     \r\n\r\n                                \/* where the nvidia is going and replace in the above region *\/\r\n                                if ((r->start == 0xb0000000) && (r->end == 0xbfffffff)) {      \r\n                                        r->start = 0xc0000000;                                 \r\n                                        r->end = 0xcfffffff;                                   \r\n                                }                                                              \r\n<\/pre>\n<p>after the <\/p>\n<pre lang=\"c\">\r\n  r = &dev->resource[idx]; \r\n<\/pre>\n<p>in the for loop<\/p>\n<p>compile up the <a href=\"http:\/\/www.codingfriends.com\/index.php\/2010\/01\/07\/compile-a-kubuntu-kernel\/\">kernel<\/a> as on this post, the basics are<\/p>\n<pre lang=\"bash\">\r\ncd \/usr\/src\/\r\napt-get install fakeroot kernel-wedge build-essential makedumpfile\r\n \r\napt-get build-dep linux\r\n \r\napt-get build-dep linux-image-$(uname -r)\r\napt-get source linux-image-$(uname -r)\r\n \r\ndebian\/rules updateconfigs\r\n \r\ncd debian.master\/scripts\/misc \r\nchmod a+x *\r\ncd -\r\ndebian\/rules updateconfigs\r\n<\/pre>\n<p>make the changes as described in the file arch\/x86\/pci\/i386.c as above, and then<\/p>\n<pre lang=\"bash\">\r\nfakeroot debian\/rules clean\r\nCONCURRENCY_LEVEL=2 AUTOBUILD=1 NOEXTRAS=1 fakeroot debian\/rules binary-generic\r\n<\/pre>\n<p>this will create a linux image and headers debian file, after a long wait in the \/usr\/src directory there will be couple of deb files (Of course change the files names for the header and image that you may have)<\/p>\n<pre lang=\"bash\">\r\ncd ..\r\ndpkg -i  linux-headers-2.6.31-17-generic_2.6.31-17.54_amd64.deb\r\ndpkg -i linux-image-2.6.31-17-generic_2.6.31-17.54_amd64.deb \r\n<\/pre>\n<p>To stop the aptitude from trying to update the linux-image back to the stock one I just did (again change to the image and headers that you have)<\/p>\n<pre lang=\"bash\">\r\naptitude hold linux-image-2.6.31-17-generic_2.6.31-17.54_amd64.deb \r\naptitude hold  linux-headers-2.6.31-17-generic_2.6.31-17.54_amd64.deb\r\n<\/pre>\n<p>Also had to do<\/p>\n<pre lang=\"bash\">\r\necho linux-headers-2.6.31-17-generic hold | dpkg --set-selections\r\necho linux-image-2.6.31-17-generic hold | dpkg --set-selections\r\n<\/pre>\n<p>To stop the apt-get upgrade\/update as well.<\/p>\n<p>IOMEM of a none working 4GB graphics card, if you note that there is not enough chunck of memory to house the nvidia 256MB memory grab, but there is space enough if the items between the 0xc0000000 &#8211; 0xcfffffff are moved about then there is enough space.<\/p>\n<pre lang=\"bash\">\r\n00000000-00000fff : System RAM         \r\n00001000-00005fff : reserved           \r\n00006000-0009b3ff : System RAM         \r\n0009b400-0009ffff : reserved           \r\n000dc000-000dffff : reserved           \r\n000e4000-000fffff : reserved           \r\n00100000-bfe8ffff : System RAM         \r\n  01000000-01530dd8 : Kernel code      \r\n  01530dd9-018236af : Kernel data      \r\n  018d5000-019e4ccb : Kernel bss       \r\n  02000000-09ffffff : Crash kernel     \r\nbfe90000-bfe99fff : ACPI Non-volatile Storage\r\nbfe9a000-bfffffff : reserved                 \r\nc0000000-c1ffffff : PCI Bus 0000:03          \r\nc2000000-c3ffffff : PCI Bus 0000:05          \r\nc4000000-c5ffffff : PCI Bus 0000:02          \r\n  c4000000-c401ffff : 0000:02:00.0           \r\nc6000000-c7ffffff : PCI Bus 0000:07          \r\nc8000000-c9ffffff : PCI Bus 0000:03          \r\nca000000-cbffffff : PCI Bus 0000:05          \r\ncc000000-cdffffff : PCI Bus 0000:02          \r\n  cc000000-cc003fff : 0000:02:00.0           \r\n    cc000000-cc003fff : sky2                 \r\nce000000-cfffffff : PCI Bus 0000:07          \r\n  ce000000-ce000fff : 0000:07:00.0           \r\n    ce000000-ce000fff : iwl3945              \r\nd0000000-d1ffffff : PCI Bus 0000:01\r\n  d0000000-d0ffffff : 0000:01:00.0\r\n  d1000000-d1ffffff : 0000:01:00.0\r\nd2000000-d20fffff : PCI Bus 0000:09\r\n  d2000000-d2003fff : 0000:09:06.1\r\n  d2004000-d2004fff : 0000:09:06.2\r\n    d2004000-d2004fff : tifm_7xx1\r\n  d2005000-d20057ff : 0000:09:04.0\r\n    d2005000-d20057ff : saa7133[0]\r\n  d2005800-d2005fff : 0000:09:06.1\r\n    d2005800-d2005fff : ohci1394\r\n  d2006000-d20060ff : 0000:09:06.3\r\n    d2006000-d20060ff : mmc0\r\n  d2007000-d2007fff : 0000:09:06.0\r\n    d2007000-d2007fff : yenta_socket\r\nd2300000-d2303fff : 0000:00:1b.0\r\n  d2300000-d2303fff : ICH HD audio\r\nd2304000-d23043ff : 0000:00:1d.7\r\n  d2304000-d23043ff : ehci_hcd\r\nd2304400-d23047ff : 0000:00:1f.2\r\n  d2304400-d23047ff : ahci\r\nd4000000-d7ffffff : PCI Bus 0000:09\r\n  d4000000-d7ffffff : PCI CardBus 0000:0a\r\nd8000000-dbffffff : PCI CardBus 0000:0a\r\ne0000000-efffffff : PCI MMCONFIG 0 [00-ff]\r\n  e0000000-efffffff : reserved\r\n    e0000000-efffffff : pnp 00:01\r\nfec00000-fec0ffff : reserved\r\n  fec00000-fec00fff : IOAPIC 0\r\nfed00000-fed003ff : HPET 0\r\n  fed00000-fed003ff : reserved\r\nfed14000-fed19fff : reserved\r\n  fed14000-fed17fff : pnp 00:01\r\n  fed18000-fed18fff : pnp 00:01\r\n  fed19000-fed19fff : pnp 00:01\r\nfed1c000-fed8ffff : reserved\r\n  fed1c000-fed1ffff : pnp 00:01\r\n  fed20000-fed3ffff : pnp 00:01\r\n  fed45000-fed8ffff : pnp 00:01\r\nfee00000-fee00fff : Local APIC\r\n  fee00000-fee00fff : reserved\r\nff000000-ffffffff : reserved\r\n<\/pre>\n<p>Working IOMEM 4GB graphics nvidia geforce 7600 256MB card, the items that was in the 0xc0000000 &#8211; 0xcfffffff ranges are now placed further down in the memory allocations, if you look for sky2 ,  iwl3945 , which are kinder needed for the wireless capabilities of the laptop.<\/p>\n<pre lang=\"bash\">\r\n00000000-00000fff : System RAM               \r\n00001000-00005fff : reserved                 \r\n00006000-0009b3ff : System RAM               \r\n0009b400-0009ffff : reserved                 \r\n000dc000-000dffff : reserved                 \r\n000e4000-000fffff : reserved                 \r\n00100000-bfe8ffff : System RAM               \r\n  01000000-01530f79 : Kernel code            \r\n  01530f7a-018216ef : Kernel data            \r\n  018d3000-019e2ccb : Kernel bss             \r\n  02000000-09ffffff : Crash kernel           \r\nbfe90000-bfe99fff : ACPI Non-volatile Storage\r\nbfe9a000-bfffffff : reserved                 \r\nc0000000-cfffffff : PCI Bus 0000:01          \r\n  c0000000-cfffffff : 0000:01:00.0           \r\nd0000000-d1ffffff : PCI Bus 0000:01          \r\n  d0000000-d0ffffff : 0000:01:00.0           \r\n  d1000000-d1ffffff : 0000:01:00.0           \r\n    d1000000-d1ffffff : nvidia               \r\nd2000000-d20fffff : PCI Bus 0000:09          \r\n  d2000000-d2003fff : 0000:09:06.1           \r\n  d2004000-d2004fff : 0000:09:06.2           \r\n    d2004000-d2004fff : tifm_7xx1            \r\n  d2005000-d20057ff : 0000:09:04.0           \r\n    d2005000-d20057ff : saa7133[0]\r\n  d2005800-d2005fff : 0000:09:06.1\r\n    d2005800-d2005fff : ohci1394\r\n  d2006000-d20060ff : 0000:09:06.3\r\n    d2006000-d20060ff : mmc0\r\n  d2007000-d2007fff : 0000:09:06.0\r\n    d2007000-d2007fff : yenta_socket\r\nd2100000-d21fffff : PCI Bus 0000:02\r\n  d2100000-d2103fff : 0000:02:00.0\r\n    d2100000-d2103fff : sky2\r\nd2200000-d22fffff : PCI Bus 0000:02\r\n  d2200000-d221ffff : 0000:02:00.0\r\nd2300000-d2303fff : 0000:00:1b.0\r\n  d2300000-d2303fff : ICH HD audio\r\nd2304000-d23043ff : 0000:00:1d.7\r\n  d2304000-d23043ff : ehci_hcd\r\nd2304400-d23047ff : 0000:00:1f.2\r\n  d2304400-d23047ff : ahci\r\nd2400000-d24fffff : PCI Bus 0000:07\r\n  d2400000-d2400fff : 0000:07:00.0\r\n    d2400000-d2400fff : iwl3945\r\nd4000000-d7ffffff : PCI Bus 0000:09\r\n  d4000000-d7ffffff : PCI CardBus 0000:0a\r\nd8000000-dbffffff : PCI CardBus 0000:0a\r\ne0000000-efffffff : PCI MMCONFIG 0 [00-ff]\r\n  e0000000-efffffff : reserved\r\n    e0000000-efffffff : pnp 00:01\r\nfec00000-fec0ffff : reserved\r\n  fec00000-fec00fff : IOAPIC 0\r\nfed00000-fed003ff : HPET 0\r\n  fed00000-fed003ff : reserved\r\nfed14000-fed19fff : reserved\r\n  fed14000-fed17fff : pnp 00:01\r\n  fed18000-fed18fff : pnp 00:01\r\n  fed19000-fed19fff : pnp 00:01\r\nfed1c000-fed8ffff : reserved\r\n  fed1c000-fed1ffff : pnp 00:01\r\n  fed20000-fed3ffff : pnp 00:01\r\n  fed45000-fed8ffff : pnp 00:01\r\nfee00000-fee00fff : Local APIC\r\n  fee00000-fee00fff : reserved\r\nff000000-ffffffff : reserved\r\n<\/pre>\n<p>hope this post helps other people to get around the nvidia laptop memory grab, hopefully I am going to write a pci kernel update so that it does not have to block out a set part of memory.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have come up with a fix for the problem that I was having regarding upgrading my 2GB of RAM to 4GB of RAM, when the nvidia was trying to place its memory request into the new system RAM place, as described in more detail here. This was the error that I was getting, where &hellip; <a href=\"https:\/\/www.codingfriends.com\/index.php\/2010\/01\/07\/bar-15-bar-1-no-parent-nvidia-graphics-card-does-not-work\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">BAR 15 &#8211; BAR 1 &#8211; no parent &#8211; nvidia graphics card does not work<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[55,52,54,53],"class_list":["post-472","post","type-post","status-publish","format-standard","hentry","category-c_and_cpp","tag-256mb","tag-bar","tag-graphics-card","tag-nvidia"],"_links":{"self":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/comments?post=472"}],"version-history":[{"count":5,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/472\/revisions"}],"predecessor-version":[{"id":481,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/472\/revisions\/481"}],"wp:attachment":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/media?parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/categories?post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/tags?post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}