From 5c809064a94ddb6b10f9d10b1eb0498c9c02470d Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Tue, 4 May 2010 11:09:27 +0200 Subject: [PATCH] --- yaml --- r: 190541 b: refs/heads/master c: e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 h: refs/heads/master i: 190539: 818f51c2362dccb4fd290cd7a3c79906fb3680c4 v: v3 --- [refs] | 2 +- trunk/Documentation/i2c/writing-clients | 5 +++++ trunk/drivers/i2c/i2c-core.c | 8 ++++++-- trunk/kernel/cgroup_freezer.c | 5 +---- trunk/kernel/perf_event.c | 2 +- trunk/kernel/sched.c | 18 ++++-------------- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/[refs] b/[refs] index ba24cf1cda73..b52a18d93326 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f5fa05d97252b23b12749a7cd02710870c0762b0 +refs/heads/master: e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 diff --git a/trunk/Documentation/i2c/writing-clients b/trunk/Documentation/i2c/writing-clients index 3219ee0dbfef..5ebf5af1d716 100644 --- a/trunk/Documentation/i2c/writing-clients +++ b/trunk/Documentation/i2c/writing-clients @@ -74,6 +74,11 @@ structure at all. You should use this to keep device-specific data. /* retrieve the value */ void *i2c_get_clientdata(const struct i2c_client *client); +Note that starting with kernel 2.6.34, you don't have to set the `data' field +to NULL in remove() or if probe() failed anymore. The i2c-core does this +automatically on these occasions. Those are also the only times the core will +touch this field. + Accessing the client ==================== diff --git a/trunk/drivers/i2c/i2c-core.c b/trunk/drivers/i2c/i2c-core.c index 3202a86f420e..b9306b1a6baa 100644 --- a/trunk/drivers/i2c/i2c-core.c +++ b/trunk/drivers/i2c/i2c-core.c @@ -117,8 +117,10 @@ static int i2c_device_probe(struct device *dev) dev_dbg(dev, "probe\n"); status = driver->probe(client, i2c_match_id(driver->id_table, client)); - if (status) + if (status) { client->driver = NULL; + i2c_set_clientdata(client, NULL); + } return status; } @@ -139,8 +141,10 @@ static int i2c_device_remove(struct device *dev) dev->driver = NULL; status = 0; } - if (status == 0) + if (status == 0) { client->driver = NULL; + i2c_set_clientdata(client, NULL); + } return status; } diff --git a/trunk/kernel/cgroup_freezer.c b/trunk/kernel/cgroup_freezer.c index e5c0244962b0..da5e13975531 100644 --- a/trunk/kernel/cgroup_freezer.c +++ b/trunk/kernel/cgroup_freezer.c @@ -205,12 +205,9 @@ static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task) * No lock is needed, since the task isn't on tasklist yet, * so it can't be moved to another cgroup, which means the * freezer won't be removed and will be valid during this - * function call. Nevertheless, apply RCU read-side critical - * section to suppress RCU lockdep false positives. + * function call. */ - rcu_read_lock(); freezer = task_freezer(task); - rcu_read_unlock(); /* * The root cgroup is non-freezable, so we can skip the diff --git a/trunk/kernel/perf_event.c b/trunk/kernel/perf_event.c index 3d1552d3c12b..2f3fbf84215a 100644 --- a/trunk/kernel/perf_event.c +++ b/trunk/kernel/perf_event.c @@ -4897,7 +4897,7 @@ SYSCALL_DEFINE5(perf_event_open, err_free_put_context: if (err < 0) - free_event(event); + kfree(event); err_put_context: if (err < 0) diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 3c2a54f70ffe..6af210a7de70 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -323,15 +323,6 @@ static inline struct task_group *task_group(struct task_struct *p) /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */ static inline void set_task_rq(struct task_struct *p, unsigned int cpu) { - /* - * Strictly speaking this rcu_read_lock() is not needed since the - * task_group is tied to the cgroup, which in turn can never go away - * as long as there are tasks attached to it. - * - * However since task_group() uses task_subsys_state() which is an - * rcu_dereference() user, this quiets CONFIG_PROVE_RCU. - */ - rcu_read_lock(); #ifdef CONFIG_FAIR_GROUP_SCHED p->se.cfs_rq = task_group(p)->cfs_rq[cpu]; p->se.parent = task_group(p)->se[cpu]; @@ -341,7 +332,6 @@ static inline void set_task_rq(struct task_struct *p, unsigned int cpu) p->rt.rt_rq = task_group(p)->rt_rq[cpu]; p->rt.parent = task_group(p)->rt_se[cpu]; #endif - rcu_read_unlock(); } #else @@ -3790,7 +3780,7 @@ int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner) * the mutex owner just released it and exited. */ if (probe_kernel_address(&owner->cpu, cpu)) - return 0; + goto out; #else cpu = owner->cpu; #endif @@ -3800,14 +3790,14 @@ int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner) * the cpu field may no longer be valid. */ if (cpu >= nr_cpumask_bits) - return 0; + goto out; /* * We need to validate that we can do a * get_cpu() and that we have the percpu area. */ if (!cpu_online(cpu)) - return 0; + goto out; rq = cpu_rq(cpu); @@ -3826,7 +3816,7 @@ int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner) cpu_relax(); } - +out: return 1; } #endif