WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Permissive devices in Xen

To: Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Permissive devices in Xen
From: Lukas Hejtmanek <xhejtman@xxxxxxxxxxx>
Date: Tue, 10 Jul 2007 01:14:25 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 09 Jul 2007 16:11:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C2B67694.A7EB%keir@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070708100044.GX3885@xxxxxxxxxxx> <C2B67694.A7EB%keir@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.16 (2007-06-11)
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