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-changelog

[Xen-changelog] [xen-4.0-testing] pv-drivers: use PCI interfaces to requ

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] pv-drivers: use PCI interfaces to request IO and MEM resources on platform device
From: "Xen patchbot-4.0-testing" <patchbot-4.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Jan 2011 07:52:32 -0800
Delivery-date: Mon, 17 Jan 2011 07:54:14 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1294993027 0
# Node ID 619a52d94f8992e191b8900d4cf63bb4db278875
# Parent  ed02b8e286e5c87763506705874ec13ef37251ba
pv-drivers: use PCI interfaces to request IO and MEM resources on platform 
device

This is the correct interface to use and something has broken the use
of the previous incorrect interface (which fails because the request
conflicts with the resources assigned for the PCI device itself
instead of nesting like the PCI interfaces do).

pci_request_region() has been available since at least Linux 2.6.5.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
xen-unstable changeset:   22747:7bc5e072d986
xen-unstable date:        Fri Jan 14 08:02:26 2011 +0000
---
 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c |   24 ++++++---------
 1 files changed, 10 insertions(+), 14 deletions(-)

diff -r ed02b8e286e5 -r 619a52d94f89 
unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c  Fri Jan 14 
08:14:00 2011 +0000
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c  Fri Jan 14 
08:17:07 2011 +0000
@@ -377,18 +377,13 @@ static int __devinit platform_pci_init(s
                return -ENOENT;
        }
 
-       if (request_mem_region(mmio_addr, mmio_len, DRV_NAME) == NULL) {
-               printk(KERN_ERR ":MEM I/O resource 0x%lx @ 0x%lx busy\n",
-                      mmio_addr, mmio_len);
-               return -EBUSY;
-       }
-
-       if (request_region(ioaddr, iolen, DRV_NAME) == NULL) {
-               printk(KERN_ERR DRV_NAME ":I/O resource 0x%lx @ 0x%lx busy\n",
-                      iolen, ioaddr);
-               release_mem_region(mmio_addr, mmio_len);
-               return -EBUSY;
-       }
+       ret = pci_request_region(pdev, 1, DRV_NAME);
+       if (ret < 0)
+               return ret;
+
+       ret = pci_request_region(pdev, 0, DRV_NAME);
+       if (ret < 0)
+               goto mem_out;
 
        platform_mmio = mmio_addr;
        platform_mmiolen = mmio_len;
@@ -424,8 +419,9 @@ static int __devinit platform_pci_init(s
 
  out:
        if (ret) {
-               release_mem_region(mmio_addr, mmio_len);
-               release_region(ioaddr, iolen);
+               pci_release_region(pdev, 0);
+mem_out:
+               pci_release_region(pdev, 1);
        }
 
        return ret;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] pv-drivers: use PCI interfaces to request IO and MEM resources on platform device, Xen patchbot-4.0-testing <=