On 10/27/2015 02:54 PM, Yinghai Lu wrote: > Hi, > > After 5b28541552ef (PCI: Restrict 64-bit prefetchable bridge windows > to 64-bit resources), we have several reports on resource allocation > failure, and we try to fix the problem with resource clip, and find > more problems. > > One is realloc fail with two graphics cards above 4G. > One is from sparc that have problem with clip as we don't parse > mem64 for it. > > Other report is about pci remove/rescan does not work on some setup > when BIOS tend to allocate small bus size. > > This patchset enhance resource allocation to address those problems. > > patch 1-11: parse MEM64 for sparc and other system with OF > patch 12-16: MMIO64 allocation enhancement > treat non-pref mmio64 if parent bridges are all pcie. > restore old pref allocation logic if hostbridge does not support mmio64. > patch 17-19: FIXED resource handling during realloc > don't realloc resource if device firmware does not support bar change. > patch 20-23: bridge MMIO allocation with hotplug and last try. > treat optional as required on first try when hotplug. > MMIO size set to 0 for last try during realloc > patch 24-57: enhancement for mmio resource allocation: > optimize bus mmio alignment calculation. > optimize bus mmio optional alignment calculation. > add support for alt size to prefer small bus size to small bus alignment. > treat ROM bar as optional resource. > during allocation, will pick up best fit resource, and allocate near end. > patch 58: add pci=assign_pref_bars to clear and assign pref bars. > patch 59-60: don't clear resource when allocation fails > patch 61: don't try io port allocation if root bus does not have io port. > Hi Yinghai, I applied patches 1-8 and 11-16 to 4.3.0-rc7 to test on sparc platforms. I am seeing a "can't claim BAR" message on a T4: pci 0000:04:00.0: can't claim BAR 6 [mem 0x84000000000-0x8400000ffff]: address conflict with 0000:04:00.0 [mem 0x84000000000-0x840007fffff] I have attached boot up log, /proc/iomem, and output from "lspci -tv" and "lsspci -vvxxx". These patches worked fine on a T7 and there were no PCI issues in the log. Thanks, Khalid