All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [ARM] omap: resource: Make resource_refresh() thread safe.
@ 2009-09-03 23:18 Mike Chan
  2009-09-08 22:45 ` Kevin Hilman
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Chan @ 2009-09-03 23:18 UTC (permalink / raw)
  To: linux-omap; +Cc: khilman, Mike Chan

Need to lock the res_mutex when traversing the res_list.

Signed-off-by: Mike Chan <mike@android.com>
---
 arch/arm/plat-omap/resource.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/resource.c b/arch/arm/plat-omap/resource.c
index 25072cd..4631912 100644
--- a/arch/arm/plat-omap/resource.c
+++ b/arch/arm/plat-omap/resource.c
@@ -234,11 +234,13 @@ int resource_refresh(void)
 	struct shared_resource *resp = NULL;
 	int ret = 0;
 
+	down(&res_mutex);
 	list_for_each_entry(resp, &res_list, node) {
 		ret = update_resource_level(resp);
 		if (ret)
 			break;
 	}
+	up(&res_mutex);
 	return ret;
 }
 
-- 
1.5.4.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-11 22:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-03 23:18 [PATCH] [ARM] omap: resource: Make resource_refresh() thread safe Mike Chan
2009-09-08 22:45 ` Kevin Hilman
2009-09-11  4:12   ` Mike Turquette
2009-09-11 21:10     ` Kevin Hilman
2009-09-11 22:50       ` Mike Chan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.