diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-05-22 02:36:56 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-05-22 02:36:56 -0400 |
commit | cf9b59e9d3e008591d1f54830f570982bb307a0d (patch) | |
tree | 113478ce8fd8c832ba726ffdf59b82cb46356476 /kernel/resource.c | |
parent | 44504b2bebf8b5823c59484e73096a7d6574471d (diff) | |
parent | f4b87dee923342505e1ddba8d34ce9de33e75050 (diff) |
Merge remote branch 'origin' into secretlab/next-devicetree
Merging in current state of Linus' tree to deal with merge conflicts and
build failures in vio.c after merge.
Conflicts:
drivers/i2c/busses/i2c-cpm.c
drivers/i2c/busses/i2c-mpc.c
drivers/net/gianfar.c
Also fixed up one line in arch/powerpc/kernel/vio.c to use the
correct node pointer.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'kernel/resource.c')
-rw-r--r-- | kernel/resource.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/kernel/resource.c b/kernel/resource.c index 9c358e263534..7b36976e5dea 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
16 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
17 | #include <linux/proc_fs.h> | 17 | #include <linux/proc_fs.h> |
18 | #include <linux/sched.h> | ||
18 | #include <linux/seq_file.h> | 19 | #include <linux/seq_file.h> |
19 | #include <linux/device.h> | 20 | #include <linux/device.h> |
20 | #include <linux/pfn.h> | 21 | #include <linux/pfn.h> |
@@ -681,6 +682,8 @@ resource_size_t resource_alignment(struct resource *res) | |||
681 | * release_region releases a matching busy region. | 682 | * release_region releases a matching busy region. |
682 | */ | 683 | */ |
683 | 684 | ||
685 | static DECLARE_WAIT_QUEUE_HEAD(muxed_resource_wait); | ||
686 | |||
684 | /** | 687 | /** |
685 | * __request_region - create a new busy resource region | 688 | * __request_region - create a new busy resource region |
686 | * @parent: parent resource descriptor | 689 | * @parent: parent resource descriptor |
@@ -693,6 +696,7 @@ struct resource * __request_region(struct resource *parent, | |||
693 | resource_size_t start, resource_size_t n, | 696 | resource_size_t start, resource_size_t n, |
694 | const char *name, int flags) | 697 | const char *name, int flags) |
695 | { | 698 | { |
699 | DECLARE_WAITQUEUE(wait, current); | ||
696 | struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); | 700 | struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); |
697 | 701 | ||
698 | if (!res) | 702 | if (!res) |
@@ -717,7 +721,15 @@ struct resource * __request_region(struct resource *parent, | |||
717 | if (!(conflict->flags & IORESOURCE_BUSY)) | 721 | if (!(conflict->flags & IORESOURCE_BUSY)) |
718 | continue; | 722 | continue; |
719 | } | 723 | } |
720 | 724 | if (conflict->flags & flags & IORESOURCE_MUXED) { | |
725 | add_wait_queue(&muxed_resource_wait, &wait); | ||
726 | write_unlock(&resource_lock); | ||
727 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
728 | schedule(); | ||
729 | remove_wait_queue(&muxed_resource_wait, &wait); | ||
730 | write_lock(&resource_lock); | ||
731 | continue; | ||
732 | } | ||
721 | /* Uhhuh, that didn't work out.. */ | 733 | /* Uhhuh, that didn't work out.. */ |
722 | kfree(res); | 734 | kfree(res); |
723 | res = NULL; | 735 | res = NULL; |
@@ -791,6 +803,8 @@ void __release_region(struct resource *parent, resource_size_t start, | |||
791 | break; | 803 | break; |
792 | *p = res->sibling; | 804 | *p = res->sibling; |
793 | write_unlock(&resource_lock); | 805 | write_unlock(&resource_lock); |
806 | if (res->flags & IORESOURCE_MUXED) | ||
807 | wake_up(&muxed_resource_wait); | ||
794 | kfree(res); | 808 | kfree(res); |
795 | return; | 809 | return; |
796 | } | 810 | } |