From: Lukas Hejtmanek Subject: Re: Permissive devices in Xen Date: Tue, 10 Jul 2007 01:14:25 +0200 Message-ID: <20070709231425.GZ3885@ics.muni.cz> References: <20070708100044.GX3885@ics.muni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Sun, Jul 08, 2007 at 11:10:12AM +0100, Keir Fraser wrote: > This was tracked down by Alex Williamson some time ago. There is code i= n > drivers/xen/pciback/conf_space_capability_pm.c:pm_ctrl_write() to resto= re > bars after a D3->D0 transition. I guess either your kernel does not hav= e > that fix, or the fix needs to be extended slightly to cover whatever ca= se > you are seeing. Would you be happy with patch like this? --- /root/xen-3.1.0-src/linux-2.6-xen-sparse/drivers/xen/pciback/conf_spa= ce_header.c 2007-05-18 16:45:21.000000000 +0200 +++ conf_space_header.c 2007-07-10 01:05:57.165749185 +0200 @@ -75,8 +75,15 @@ */ if (value =3D=3D ~PCI_ROM_ADDRESS_ENABLE) bar->which =3D 1; - else + else { + u32 tmpval; + pci_read_config_dword(dev, offset, &tmpval); + if(tmpval !=3D bar->val && value =3D=3D bar->val) { + /* We are trying to restore bar value. This shoul= d be allowed. */ + pci_write_config_dword(dev, offset, bar->val); + } bar->which =3D 0; + } =20 /* Do we need to support enabling/disabling the rom address here?= */ =20 @@ -102,8 +109,15 @@ */ if (value =3D=3D ~0) bar->which =3D 1; - else + else { + u32 tmpval; + pci_read_config_dword(dev, offset, &tmpval); + if(tmpval !=3D bar->val && value =3D=3D bar->val) { + /* We are trying to restore bar value. This shoul= d be allowed. */ + pci_write_config_dword(dev, offset, bar->val); + } bar->which =3D 0; + } =20 return 0; } --=20 Luk=E1=B9 Hejtm=E1nek