[2/3] Use insert_resource in pci_claim_resource

From: Matthew Wilcox (willy_at_debian.org)
Date: 03/19/04

  • Next message: Mark: "Re: [PATCH,RFT] latest libata (includes Silicon Image work)"
    Date:	Thu, 18 Mar 2004 23:52:17 +0000
    To: Matthew Wilcox <willy@debian.org>
    
    

    On ia64, the parent resources are not necessarily PCI resources and
    so won't get found by pci_find_parent_resource. Use the shiny new
    insert_resource() function instead, which I think we would have used
    here had it been available at the time.

    Index: drivers/pci/setup-res.c
    ===================================================================
    RCS file: /var/cvs/linux-2.6/drivers/pci/setup-res.c,v
    retrieving revision 1.7
    diff -u -p -r1.7 setup-res.c
    --- a/drivers/pci/setup-res.c 10 Mar 2004 02:27:48 -0000 1.7
    +++ b/drivers/pci/setup-res.c 18 Mar 2004 23:40:56 -0000
    @@ -94,13 +94,18 @@ int __init
     pci_claim_resource(struct pci_dev *dev, int resource)
     {
             struct resource *res = &dev->resource[resource];
    - struct resource *root = pci_find_parent_resource(dev, res);
    + struct resource *root = NULL;
             char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
             int err;
     
    + if (res->flags & IORESOURCE_IO)
    + root = &ioport_resource;
    + if (res->flags & IORESOURCE_MEM)
    + root = &iomem_resource;
    +
             err = -EINVAL;
             if (root != NULL)
    - err = request_resource(root, res);
    + err = insert_resource(root, res);
     
             if (err) {
                     printk(KERN_ERR "PCI: %s region %d of %s %s [%lx:%lx]\n",

    -- 
    "Next the statesmen will invent cheap lies, putting the blame upon 
    the nation that is attacked, and every man will be glad of those
    conscience-soothing falsities, and will diligently study them, and refuse
    to examine any refutations of them; and thus he will by and by convince 
    himself that the war is just, and will thank God for the better sleep 
    he enjoys after this process of grotesque self-deception." -- Mark Twain
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Mark: "Re: [PATCH,RFT] latest libata (includes Silicon Image work)"

    Relevant Pages

    • Re: [PATCH x86_64] Live Patching Function on 2.6.11.7
      ... > can not continue service with your suggestion. ... all the session between users and server ... > use the resources which are mainly controlled by kernel. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [BENCHMARK] nproc: netlink access to /proc information
      ... >> financial resources still). ... > concerned) could be addressed with differential notification. ... I'm expecting very very long lifetimes for legacy kernel versions and ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: isa memory address
      ... > different resources in Linux structures, ... > unless you change code elsewhere at the same time. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [ANNOUNCE] Automatic Kernel Tunables
      ... making the kernel able to automatically tune the resources as it sees ... This is a much more complicated feature that will be ... genetic algorithm tuning of I/O and CPU schedulers. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Who changed /proc/<pid>/ in 2.6.0-test5-bk9?
      ... > Your base point that resources shouldn't be shared needlessly is ... non-shared fd tables are slightly faster than shared ... due to reduced cache line transfers between CPUs; fewer fds ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)

    Loading