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

Re: [Xen-devel] Permissive devices in Xen



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 in
> drivers/xen/pciback/conf_space_capability_pm.c:pm_ctrl_write() to restore
> bars after a D3->D0 transition. I guess either your kernel does not have
> that fix, or the fix needs to be extended slightly to cover whatever case
> 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_space_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 == ~PCI_ROM_ADDRESS_ENABLE)
                bar->which = 1;
-       else
+       else {
+               u32 tmpval;
+               pci_read_config_dword(dev, offset, &tmpval);
+               if(tmpval != bar->val && value == bar->val) {
+                       /* We are trying to restore bar value. This should be 
allowed. */
+                       pci_write_config_dword(dev, offset, bar->val);
+               }
                bar->which = 0;
+       }
 
        /* Do we need to support enabling/disabling the rom address here? */
 
@@ -102,8 +109,15 @@
         */
        if (value == ~0)
                bar->which = 1;
-       else
+       else {
+               u32 tmpval;
+               pci_read_config_dword(dev, offset, &tmpval);
+               if(tmpval != bar->val && value == bar->val) {
+                       /* We are trying to restore bar value. This should be 
allowed. */
+                       pci_write_config_dword(dev, offset, bar->val);
+               }
                bar->which = 0;
+       }
 
        return 0;
 }


-- 
Lukáš Hejtmánek

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.