Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 335608
b: refs/heads/master
c: 4cf2d3b
h: refs/heads/master
v: v3
  • Loading branch information
Ulf Hansson authored and Mike Turquette committed Nov 12, 2012
1 parent ec74792 commit 4f94851
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 130 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70c80dfd579a62e41f8fea024206645cf03cec80
refs/heads/master: 4cf2d3b1b6ff9b7b6af1d2dbf1b63aa465250bc2
19 changes: 18 additions & 1 deletion trunk/drivers/clk/ux500/u8500_clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ void u8500_clk_init(void)

clk = clk_reg_prcc_pclk("p1_pclk2", "per1clk", U8500_CLKRST1_BASE,
BIT(2), 0);
clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.1");

clk = clk_reg_prcc_pclk("p1_pclk3", "per1clk", U8500_CLKRST1_BASE,
BIT(3), 0);
clk = clk_reg_prcc_pclk("p1_pclk4", "per1clk", U8500_CLKRST1_BASE,
Expand All @@ -239,6 +241,7 @@ void u8500_clk_init(void)

clk = clk_reg_prcc_pclk("p1_pclk6", "per1clk", U8500_CLKRST1_BASE,
BIT(6), 0);
clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.2");

clk = clk_reg_prcc_pclk("p1_pclk7", "per1clk", U8500_CLKRST1_BASE,
BIT(7), 0);
Expand All @@ -255,11 +258,14 @@ void u8500_clk_init(void)

clk = clk_reg_prcc_pclk("p1_pclk10", "per1clk", U8500_CLKRST1_BASE,
BIT(10), 0);
clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.4");

clk = clk_reg_prcc_pclk("p1_pclk11", "per1clk", U8500_CLKRST1_BASE,
BIT(11), 0);

clk = clk_reg_prcc_pclk("p2_pclk0", "per2clk", U8500_CLKRST2_BASE,
BIT(0), 0);
clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.3");

clk = clk_reg_prcc_pclk("p2_pclk1", "per2clk", U8500_CLKRST2_BASE,
BIT(1), 0);
Expand All @@ -284,7 +290,6 @@ void u8500_clk_init(void)
BIT(6), 0);
clk_register_clkdev(clk, "apb_pclk", "sdi1");


clk = clk_reg_prcc_pclk("p2_pclk7", "per2clk", U8500_CLKRST2_BASE,
BIT(7), 0);
clk_register_clkdev(clk, "apb_pclk", "sdi3");
Expand Down Expand Up @@ -318,8 +323,10 @@ void u8500_clk_init(void)
BIT(1), 0);
clk = clk_reg_prcc_pclk("p3_pclk2", "per3clk", U8500_CLKRST3_BASE,
BIT(2), 0);

clk = clk_reg_prcc_pclk("p3_pclk3", "per3clk", U8500_CLKRST3_BASE,
BIT(3), 0);
clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.0");

clk = clk_reg_prcc_pclk("p3_pclk4", "per3clk", U8500_CLKRST3_BASE,
BIT(4), 0);
Expand Down Expand Up @@ -401,6 +408,8 @@ void u8500_clk_init(void)

clk = clk_reg_prcc_kclk("p1_i2c1_kclk", "i2cclk",
U8500_CLKRST1_BASE, BIT(2), CLK_SET_RATE_GATE);
clk_register_clkdev(clk, NULL, "nmk-i2c.1");

clk = clk_reg_prcc_kclk("p1_msp0_kclk", "msp02clk",
U8500_CLKRST1_BASE, BIT(3), CLK_SET_RATE_GATE);
clk = clk_reg_prcc_kclk("p1_msp1_kclk", "msp1clk",
Expand All @@ -412,17 +421,23 @@ void u8500_clk_init(void)

clk = clk_reg_prcc_kclk("p1_i2c2_kclk", "i2cclk",
U8500_CLKRST1_BASE, BIT(6), CLK_SET_RATE_GATE);
clk_register_clkdev(clk, NULL, "nmk-i2c.2");

clk = clk_reg_prcc_kclk("p1_slimbus0_kclk", "slimclk",
U8500_CLKRST1_BASE, BIT(3), CLK_SET_RATE_GATE);
/* FIXME: Redefinition of BIT(3). */

clk = clk_reg_prcc_kclk("p1_i2c4_kclk", "i2cclk",
U8500_CLKRST1_BASE, BIT(9), CLK_SET_RATE_GATE);
clk_register_clkdev(clk, NULL, "nmk-i2c.4");

clk = clk_reg_prcc_kclk("p1_msp3_kclk", "msp1clk",
U8500_CLKRST1_BASE, BIT(10), CLK_SET_RATE_GATE);

/* Periph2 */
clk = clk_reg_prcc_kclk("p2_i2c3_kclk", "i2cclk",
U8500_CLKRST2_BASE, BIT(0), CLK_SET_RATE_GATE);
clk_register_clkdev(clk, NULL, "nmk-i2c.3");

clk = clk_reg_prcc_kclk("p2_sdi4_kclk", "sdmmcclk",
U8500_CLKRST2_BASE, BIT(2), CLK_SET_RATE_GATE);
Expand Down Expand Up @@ -452,8 +467,10 @@ void u8500_clk_init(void)
U8500_CLKRST3_BASE, BIT(1), CLK_SET_RATE_GATE);
clk = clk_reg_prcc_kclk("p3_ssp1_kclk", "sspclk",
U8500_CLKRST3_BASE, BIT(2), CLK_SET_RATE_GATE);

clk = clk_reg_prcc_kclk("p3_i2c0_kclk", "i2cclk",
U8500_CLKRST3_BASE, BIT(3), CLK_SET_RATE_GATE);
clk_register_clkdev(clk, NULL, "nmk-i2c.0");

clk = clk_reg_prcc_kclk("p3_sdi2_kclk", "sdmmcclk",
U8500_CLKRST3_BASE, BIT(4), CLK_SET_RATE_GATE);
Expand Down
21 changes: 21 additions & 0 deletions trunk/drivers/leds/ledtrig-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
struct led_trigger_cpu {
char name[MAX_NAME_LEN];
struct led_trigger *_trig;
struct mutex lock;
int lock_is_inited;
};

static DEFINE_PER_CPU(struct led_trigger_cpu, cpu_trig);
Expand All @@ -48,6 +50,12 @@ void ledtrig_cpu(enum cpu_led_event ledevt)
{
struct led_trigger_cpu *trig = &__get_cpu_var(cpu_trig);

/* mutex lock should be initialized before calling mutex_call() */
if (!trig->lock_is_inited)
return;

mutex_lock(&trig->lock);

/* Locate the correct CPU LED */
switch (ledevt) {
case CPU_LED_IDLE_END:
Expand All @@ -67,6 +75,8 @@ void ledtrig_cpu(enum cpu_led_event ledevt)
/* Will leave the LED as it is */
break;
}

mutex_unlock(&trig->lock);
}
EXPORT_SYMBOL(ledtrig_cpu);

Expand Down Expand Up @@ -107,9 +117,14 @@ static int __init ledtrig_cpu_init(void)
for_each_possible_cpu(cpu) {
struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu);

mutex_init(&trig->lock);

snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu);

mutex_lock(&trig->lock);
led_trigger_register_simple(trig->name, &trig->_trig);
trig->lock_is_inited = 1;
mutex_unlock(&trig->lock);
}

register_syscore_ops(&ledtrig_cpu_syscore_ops);
Expand All @@ -127,9 +142,15 @@ static void __exit ledtrig_cpu_exit(void)
for_each_possible_cpu(cpu) {
struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu);

mutex_lock(&trig->lock);

led_trigger_unregister_simple(trig->_trig);
trig->_trig = NULL;
memset(trig->name, 0, MAX_NAME_LEN);
trig->lock_is_inited = 0;

mutex_unlock(&trig->lock);
mutex_destroy(&trig->lock);
}

unregister_syscore_ops(&ledtrig_cpu_syscore_ops);
Expand Down
41 changes: 19 additions & 22 deletions trunk/kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ static int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb,
struct futex_pi_state **ps,
struct task_struct *task, int set_waiters)
{
int lock_taken, ret, force_take = 0;
int lock_taken, ret, ownerdied = 0;
u32 uval, newval, curval, vpid = task_pid_vnr(task);

retry:
Expand Down Expand Up @@ -755,15 +755,17 @@ static int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb,
newval = curval | FUTEX_WAITERS;

/*
* Should we force take the futex? See below.
* There are two cases, where a futex might have no owner (the
* owner TID is 0): OWNER_DIED. We take over the futex in this
* case. We also do an unconditional take over, when the owner
* of the futex died.
*
* This is safe as we are protected by the hash bucket lock !
*/
if (unlikely(force_take)) {
/*
* Keep the OWNER_DIED and the WAITERS bit and set the
* new TID value.
*/
if (unlikely(ownerdied || !(curval & FUTEX_TID_MASK))) {
/* Keep the OWNER_DIED bit */
newval = (curval & ~FUTEX_TID_MASK) | vpid;
force_take = 0;
ownerdied = 0;
lock_taken = 1;
}

Expand All @@ -773,7 +775,7 @@ static int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb,
goto retry;

/*
* We took the lock due to forced take over.
* We took the lock due to owner died take over.
*/
if (unlikely(lock_taken))
return 1;
Expand All @@ -788,25 +790,20 @@ static int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb,
switch (ret) {
case -ESRCH:
/*
* We failed to find an owner for this
* futex. So we have no pi_state to block
* on. This can happen in two cases:
*
* 1) The owner died
* 2) A stale FUTEX_WAITERS bit
*
* Re-read the futex value.
* No owner found for this futex. Check if the
* OWNER_DIED bit is set to figure out whether
* this is a robust futex or not.
*/
if (get_futex_value_locked(&curval, uaddr))
return -EFAULT;

/*
* If the owner died or we have a stale
* WAITERS bit the owner TID in the user space
* futex is 0.
* We simply start over in case of a robust
* futex. The code above will take the futex
* and return happy.
*/
if (!(curval & FUTEX_TID_MASK)) {
force_take = 1;
if (curval & FUTEX_OWNER_DIED) {
ownerdied = 1;
goto retry;
}
default:
Expand Down
5 changes: 3 additions & 2 deletions trunk/scripts/kconfig/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {

#include <assert.h>
#include <stdio.h>
#include "list.h"
#include <sys/queue.h>
#ifndef __cplusplus
#include <stdbool.h>
#endif
Expand Down Expand Up @@ -175,11 +175,12 @@ struct menu {
#define MENU_ROOT 0x0002

struct jump_key {
struct list_head entries;
CIRCLEQ_ENTRY(jump_key) entries;
size_t offset;
struct menu *target;
int index;
};
CIRCLEQ_HEAD(jk_head, jump_key);

#define JUMP_NB 9

Expand Down
91 changes: 0 additions & 91 deletions trunk/scripts/kconfig/list.h

This file was deleted.

4 changes: 2 additions & 2 deletions trunk/scripts/kconfig/lkc_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ P(menu_get_root_menu,struct menu *,(struct menu *menu));
P(menu_get_parent_menu,struct menu *,(struct menu *menu));
P(menu_has_help,bool,(struct menu *menu));
P(menu_get_help,const char *,(struct menu *menu));
P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct list_head
P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct jk_head
*head));
P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct list_head
P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct jk_head
*head));
P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help));

Expand Down
6 changes: 3 additions & 3 deletions trunk/scripts/kconfig/mconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static void set_config_filename(const char *config_filename)


struct search_data {
struct list_head *head;
struct jk_head *head;
struct menu **targets;
int *keys;
};
Expand All @@ -323,7 +323,7 @@ static void update_text(char *buf, size_t start, size_t end, void *_data)
struct jump_key *pos;
int k = 0;

list_for_each_entry(pos, data->head, entries) {
CIRCLEQ_FOREACH(pos, data->head, entries) {
if (pos->offset >= start && pos->offset < end) {
char header[4];

Expand Down Expand Up @@ -375,7 +375,7 @@ static void search_conf(void)

sym_arr = sym_re_search(dialog_input);
do {
LIST_HEAD(head);
struct jk_head head = CIRCLEQ_HEAD_INITIALIZER(head);
struct menu *targets[JUMP_NB];
int keys[JUMP_NB + 1], i;
struct search_data data = {
Expand Down
Loading

0 comments on commit 4f94851

Please sign in to comment.