diff options
author | Bob Nelson <rrnelson@linux.vnet.ibm.com> | 2007-08-17 12:06:09 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2007-12-18 19:00:01 -0500 |
commit | a1ef4849fdca379cf51cbacd337e8fa742437d26 (patch) | |
tree | 080b20cdb517702f08d51fad010a9e3aac5bce74 /arch/powerpc/oprofile | |
parent | 29641ce165e5f643b48988cb779c6ba97b647503 (diff) |
[POWERPC] OProfile: fix cbe pm signal routing problem
Fix debug_bus_control and group_control PMU register values set up in
set_pm_event(). Initialize variables before calling set_pm_event().
Delete unused static array and code that initialized it.
Rename constant to better reflect usage.
Signed-off-by: Bob Nelson <rrnelson@us.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/powerpc/oprofile')
-rw-r--r-- | arch/powerpc/oprofile/op_model_cell.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c index bb6bff51ce48..13929771bee7 100644 --- a/arch/powerpc/oprofile/op_model_cell.c +++ b/arch/powerpc/oprofile/op_model_cell.c | |||
@@ -61,7 +61,7 @@ static unsigned int spu_cycle_reset; | |||
61 | #define NUM_THREADS 2 /* number of physical threads in | 61 | #define NUM_THREADS 2 /* number of physical threads in |
62 | * physical processor | 62 | * physical processor |
63 | */ | 63 | */ |
64 | #define NUM_TRACE_BUS_WORDS 4 | 64 | #define NUM_DEBUG_BUS_WORDS 4 |
65 | #define NUM_INPUT_BUS_WORDS 2 | 65 | #define NUM_INPUT_BUS_WORDS 2 |
66 | 66 | ||
67 | #define MAX_SPU_COUNT 0xFFFFFF /* maximum 24 bit LFSR value */ | 67 | #define MAX_SPU_COUNT 0xFFFFFF /* maximum 24 bit LFSR value */ |
@@ -169,7 +169,6 @@ static DEFINE_SPINLOCK(virt_cntr_lock); | |||
169 | 169 | ||
170 | static u32 ctr_enabled; | 170 | static u32 ctr_enabled; |
171 | 171 | ||
172 | static unsigned char trace_bus[NUM_TRACE_BUS_WORDS]; | ||
173 | static unsigned char input_bus[NUM_INPUT_BUS_WORDS]; | 172 | static unsigned char input_bus[NUM_INPUT_BUS_WORDS]; |
174 | 173 | ||
175 | /* | 174 | /* |
@@ -298,7 +297,7 @@ static void set_pm_event(u32 ctr, int event, u32 unit_mask) | |||
298 | 297 | ||
299 | p->signal_group = event / 100; | 298 | p->signal_group = event / 100; |
300 | p->bus_word = bus_word; | 299 | p->bus_word = bus_word; |
301 | p->sub_unit = (unit_mask & 0x0000f000) >> 12; | 300 | p->sub_unit = GET_SUB_UNIT(unit_mask); |
302 | 301 | ||
303 | pm_regs.pm07_cntrl[ctr] = 0; | 302 | pm_regs.pm07_cntrl[ctr] = 0; |
304 | pm_regs.pm07_cntrl[ctr] |= PM07_CTR_COUNT_CYCLES(count_cycles); | 303 | pm_regs.pm07_cntrl[ctr] |= PM07_CTR_COUNT_CYCLES(count_cycles); |
@@ -334,16 +333,16 @@ static void set_pm_event(u32 ctr, int event, u32 unit_mask) | |||
334 | p->bit = signal_bit; | 333 | p->bit = signal_bit; |
335 | } | 334 | } |
336 | 335 | ||
337 | for (i = 0; i < NUM_TRACE_BUS_WORDS; i++) { | 336 | for (i = 0; i < NUM_DEBUG_BUS_WORDS; i++) { |
338 | if (bus_word & (1 << i)) { | 337 | if (bus_word & (1 << i)) { |
339 | pm_regs.debug_bus_control |= | 338 | pm_regs.debug_bus_control |= |
340 | (bus_type << (31 - (2 * i) + 1)); | 339 | (bus_type << (30 - (2 * i))); |
341 | 340 | ||
342 | for (j = 0; j < NUM_INPUT_BUS_WORDS; j++) { | 341 | for (j = 0; j < NUM_INPUT_BUS_WORDS; j++) { |
343 | if (input_bus[j] == 0xff) { | 342 | if (input_bus[j] == 0xff) { |
344 | input_bus[j] = i; | 343 | input_bus[j] = i; |
345 | pm_regs.group_control |= | 344 | pm_regs.group_control |= |
346 | (i << (31 - i)); | 345 | (i << (30 - (2 * j))); |
347 | 346 | ||
348 | break; | 347 | break; |
349 | } | 348 | } |
@@ -450,6 +449,12 @@ static void cell_virtual_cntr(unsigned long data) | |||
450 | hdw_thread = 1 ^ hdw_thread; | 449 | hdw_thread = 1 ^ hdw_thread; |
451 | next_hdw_thread = hdw_thread; | 450 | next_hdw_thread = hdw_thread; |
452 | 451 | ||
452 | pm_regs.group_control = 0; | ||
453 | pm_regs.debug_bus_control = 0; | ||
454 | |||
455 | for (i = 0; i < NUM_INPUT_BUS_WORDS; i++) | ||
456 | input_bus[i] = 0xff; | ||
457 | |||
453 | /* | 458 | /* |
454 | * There are some per thread events. Must do the | 459 | * There are some per thread events. Must do the |
455 | * set event, for the thread that is being started | 460 | * set event, for the thread that is being started |
@@ -619,9 +624,6 @@ static int cell_reg_setup(struct op_counter_config *ctr, | |||
619 | pmc_cntrl[1][i].vcntr = i; | 624 | pmc_cntrl[1][i].vcntr = i; |
620 | } | 625 | } |
621 | 626 | ||
622 | for (i = 0; i < NUM_TRACE_BUS_WORDS; i++) | ||
623 | trace_bus[i] = 0xff; | ||
624 | |||
625 | for (i = 0; i < NUM_INPUT_BUS_WORDS; i++) | 627 | for (i = 0; i < NUM_INPUT_BUS_WORDS; i++) |
626 | input_bus[i] = 0xff; | 628 | input_bus[i] = 0xff; |
627 | 629 | ||