From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Newbury Subject: Re: PCI resources above 4GB Date: Thu, 12 Apr 2012 17:40:41 +0100 Message-ID: <1334248841.2910.6.camel@Nokia-N900> References: <1333968563.5678.19.camel@infinity> <4F84110E.3000400@snewbury.org.uk> <4F8467AA.90305@snewbury.org.uk> <4F848357.3060007@snewbury.org.uk> <4F848E10.1090703@snewbury.org.uk> <1334089568.4083.2.camel@Nokia-N900> <4F84A3EC.6030903@snewbury.org.uk> <1334229754.30606.7.camel@Nokia-N900> Reply-To: Steven Newbury Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Content-ID: <1334248840.2910.5.camel@Nokia-N900> Sender: linux-pci-owner@vger.kernel.org To: Yinghai Lu Cc: "Barnes, Jesse" , Dave Airlie , Bjorn Helgaas , linux-pci@vger.kernel.org, DRI mailing list List-Id: dri-devel@lists.freedesktop.org On Thu, 12 Apr 2012, 17:07:33 BST, Yinghai Lu wrot= e: > On Thu, Apr 12, 2012 at 4:22 AM, Steven Newbury > wrote: > > Thanks, that fixed it! :) I had a similar patch I've been working o= n > > but I had my fix in the wrong place! > >=20 > > In the working case, initially the BIOS has set GMA to within the l= ow > > system DRAM 0xC0000000 obviously invalid. =C2=A0This conflict is de= tected > > and it's relallocated to 0x12000000. > >=20 > > I've attempted to modify probe.c to disable 64-bit BARs not allocat= ed > > above 4G so they get reallocated above when possible later. =C2=A0I= t seemed > > to work, but again broke GMA despite the BAR originally containing = an > > invalid address as mentioned above, it seems for some reason someth= ing > > is different when the conflict is detected and rellocated, compared= to > > disabling it early then allocating a valid value..? > >=20 > > It would be useful to preserve as much low PCI memory address space= as > > possible for hotplug devices (like my Radeon), but the other proble= m > > is small regions get allocated at the bottom, resulting in the > > inability to find large aligned regions later on. =C2=A0I see code = to > > default to top-down allocation was reverted, I guess I'm going to h= ave > > to dig into the archive to find out why... >=20 > for hotplug case, You can work around like: > after hotplug add, > 1. use lspci and /proc/iomem to find out offending device and bridge. > 2. use /sys/.../unbind etc to stop driver for those devices. > 3. use setpci to clear related BAR > 4. use /sys/devices/pci000..../remove to remove those devices > 5. echo 1 > /sys/bus/pci/rescan >=20 > then it should work... >=20 Good idea, I can easily hook that up into the dock event. Is it possibl= e to disable the auto bus scan on hotplug, then trigger it manually as = above? But it still leaves me needing to have at least the Intel GMA cl= eanly reallocated high from boot.