Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: x86/PCI: truncate _CRS windows with _LEN > _MAX - _MIN + 1 x86/PCI: for host bridge address space collisions, show conflicting resource frv/PCI: remove redundant warnings x86/PCI: remove redundant warnings PCI: don't say we claimed a resource if we failed PCI quirk: Disable MSI on VIA K8T890 systems PCI quirk: RS780/RS880: work around missing MSI initialization PCI quirk: only apply CX700 PCI bus parking quirk if external VT6212L is present PCI: complain about devices that seem to be broken PCI: print resources consistently with %pR PCI: make disabled window printk style match the enabled ones PCI: break out primary/secondary/subordinate for readability PCI: for address space collisions, show conflicting resource resources: add interfaces that return conflict information PCI: cleanup error return for pcix get and set mmrbc functions PCI: fix access of PCI_X_CMD by pcix get and set mmrbc functions PCI: kill off pci_register_set_vga_state() symbol export. PCI: fix return value from pcix_get_max_mmrbc()
This commit is contained in:
@@ -218,6 +218,23 @@ void release_child_resources(struct resource *r)
|
||||
write_unlock(&resource_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* request_resource_conflict - request and reserve an I/O or memory resource
|
||||
* @root: root resource descriptor
|
||||
* @new: resource descriptor desired by caller
|
||||
*
|
||||
* Returns 0 for success, conflict resource on error.
|
||||
*/
|
||||
struct resource *request_resource_conflict(struct resource *root, struct resource *new)
|
||||
{
|
||||
struct resource *conflict;
|
||||
|
||||
write_lock(&resource_lock);
|
||||
conflict = __request_resource(root, new);
|
||||
write_unlock(&resource_lock);
|
||||
return conflict;
|
||||
}
|
||||
|
||||
/**
|
||||
* request_resource - request and reserve an I/O or memory resource
|
||||
* @root: root resource descriptor
|
||||
@@ -229,9 +246,7 @@ int request_resource(struct resource *root, struct resource *new)
|
||||
{
|
||||
struct resource *conflict;
|
||||
|
||||
write_lock(&resource_lock);
|
||||
conflict = __request_resource(root, new);
|
||||
write_unlock(&resource_lock);
|
||||
conflict = request_resource_conflict(root, new);
|
||||
return conflict ? -EBUSY : 0;
|
||||
}
|
||||
|
||||
@@ -474,25 +489,40 @@ static struct resource * __insert_resource(struct resource *parent, struct resou
|
||||
}
|
||||
|
||||
/**
|
||||
* insert_resource - Inserts a resource in the resource tree
|
||||
* insert_resource_conflict - Inserts resource in the resource tree
|
||||
* @parent: parent of the new resource
|
||||
* @new: new resource to insert
|
||||
*
|
||||
* Returns 0 on success, -EBUSY if the resource can't be inserted.
|
||||
* Returns 0 on success, conflict resource if the resource can't be inserted.
|
||||
*
|
||||
* This function is equivalent to request_resource when no conflict
|
||||
* This function is equivalent to request_resource_conflict when no conflict
|
||||
* happens. If a conflict happens, and the conflicting resources
|
||||
* entirely fit within the range of the new resource, then the new
|
||||
* resource is inserted and the conflicting resources become children of
|
||||
* the new resource.
|
||||
*/
|
||||
int insert_resource(struct resource *parent, struct resource *new)
|
||||
struct resource *insert_resource_conflict(struct resource *parent, struct resource *new)
|
||||
{
|
||||
struct resource *conflict;
|
||||
|
||||
write_lock(&resource_lock);
|
||||
conflict = __insert_resource(parent, new);
|
||||
write_unlock(&resource_lock);
|
||||
return conflict;
|
||||
}
|
||||
|
||||
/**
|
||||
* insert_resource - Inserts a resource in the resource tree
|
||||
* @parent: parent of the new resource
|
||||
* @new: new resource to insert
|
||||
*
|
||||
* Returns 0 on success, -EBUSY if the resource can't be inserted.
|
||||
*/
|
||||
int insert_resource(struct resource *parent, struct resource *new)
|
||||
{
|
||||
struct resource *conflict;
|
||||
|
||||
conflict = insert_resource_conflict(parent, new);
|
||||
return conflict ? -EBUSY : 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user