All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de
To: paulus@samba.org
Cc: linuxppc-dev@ozlabs.org, Bob Nelson <rrnelson@us.ibm.com>
Subject: [POWERPC 02/18] OProfile: fix cbe pm signal routing problem
Date: Tue, 18 Dec 2007 18:48:54 +0100	[thread overview]
Message-ID: <20071218175103.799448000@arndb.de> (raw)
In-Reply-To: 20071218174852.112644000@arndb.de

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>
---
 arch/powerpc/oprofile/op_model_cell.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

Index: linux-2.6-new/arch/powerpc/oprofile/op_model_cell.c
===================================================================
--- linux-2.6-new.orig/arch/powerpc/oprofile/op_model_cell.c
+++ linux-2.6-new/arch/powerpc/oprofile/op_model_cell.c
@@ -61,7 +61,7 @@ static unsigned int spu_cycle_reset;
 #define NUM_THREADS 2         /* number of physical threads in
 			       * physical processor
 			       */
-#define NUM_TRACE_BUS_WORDS 4
+#define NUM_DEBUG_BUS_WORDS 4
 #define NUM_INPUT_BUS_WORDS 2
 
 #define MAX_SPU_COUNT 0xFFFFFF	/* maximum 24 bit LFSR value */
@@ -169,7 +169,6 @@ static DEFINE_SPINLOCK(virt_cntr_lock);
 
 static u32 ctr_enabled;
 
-static unsigned char trace_bus[NUM_TRACE_BUS_WORDS];
 static unsigned char input_bus[NUM_INPUT_BUS_WORDS];
 
 /*
@@ -298,7 +297,7 @@ static void set_pm_event(u32 ctr, int ev
 
 	p->signal_group = event / 100;
 	p->bus_word = bus_word;
-	p->sub_unit = (unit_mask & 0x0000f000) >> 12;
+	p->sub_unit = GET_SUB_UNIT(unit_mask);
 
 	pm_regs.pm07_cntrl[ctr] = 0;
 	pm_regs.pm07_cntrl[ctr] |= PM07_CTR_COUNT_CYCLES(count_cycles);
@@ -334,16 +333,16 @@ static void set_pm_event(u32 ctr, int ev
 		p->bit = signal_bit;
 	}
 
-	for (i = 0; i < NUM_TRACE_BUS_WORDS; i++) {
+	for (i = 0; i < NUM_DEBUG_BUS_WORDS; i++) {
 		if (bus_word & (1 << i)) {
 			pm_regs.debug_bus_control |=
-			    (bus_type << (31 - (2 * i) + 1));
+			    (bus_type << (30 - (2 * i)));
 
 			for (j = 0; j < NUM_INPUT_BUS_WORDS; j++) {
 				if (input_bus[j] == 0xff) {
 					input_bus[j] = i;
 					pm_regs.group_control |=
-					    (i << (31 - i));
+					    (i << (30 - (2 * j)));
 
 					break;
 				}
@@ -450,6 +449,12 @@ static void cell_virtual_cntr(unsigned l
 	hdw_thread = 1 ^ hdw_thread;
 	next_hdw_thread = hdw_thread;
 
+	pm_regs.group_control = 0;
+	pm_regs.debug_bus_control = 0;
+
+	for (i = 0; i < NUM_INPUT_BUS_WORDS; i++)
+		input_bus[i] = 0xff;
+
 	/*
 	 * There are some per thread events.  Must do the
 	 * set event, for the thread that is being started
@@ -619,9 +624,6 @@ static int cell_reg_setup(struct op_coun
 		pmc_cntrl[1][i].vcntr = i;
 	}
 
-	for (i = 0; i < NUM_TRACE_BUS_WORDS; i++)
-		trace_bus[i] = 0xff;
-
 	for (i = 0; i < NUM_INPUT_BUS_WORDS; i++)
 		input_bus[i] = 0xff;
 

-- 

  parent reply	other threads:[~2007-12-18 18:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18 17:48 [POWERPC 00/18] cell patches for 2.6.25 arnd
2007-12-18 17:48 ` [POWERPC 01/18] perfmon2: make pm_interval register read/write arnd
2007-12-18 17:48 ` arnd [this message]
2007-12-18 17:48 ` [POWERPC 03/18] cell: add missing \n arnd
2007-12-18 17:48 ` [POWERPC 04/18] Set archdata.dma_data for direct DMA in cell_dma_dev_setup() arnd
2007-12-18 19:48   ` Benjamin Herrenschmidt
2007-12-18 17:48 ` [POWERPC 05/18] Add celleb_dma_dev_setup() arnd
2007-12-18 19:48   ` Benjamin Herrenschmidt
2007-12-18 17:48 ` [POWERPC 06/18] Use archdata.dma_data in dma_direct_ops arnd
2007-12-18 19:49   ` Benjamin Herrenschmidt
2007-12-18 17:48 ` [POWERPC 07/18] Have cell use its own dma_direct_offset variable arnd
2007-12-18 19:50   ` Benjamin Herrenschmidt
2007-12-18 17:49 ` [POWERPC 08/18] Have celleb " arnd
2007-12-18 19:50   ` Benjamin Herrenschmidt
2007-12-18 17:49 ` [POWERPC 09/18] Remove the global dma_direct_offset arnd
2007-12-18 19:52   ` Benjamin Herrenschmidt
2007-12-18 17:49 ` [POWERPC 10/18] Remove bogus comment in dma_direct_alloc_coherent() arnd
2007-12-18 19:52   ` Benjamin Herrenschmidt
2007-12-18 17:49 ` [POWERPC 11/18] cell: Convert #include of asm/of_{platform, device}.h into linux/of_{platform, device}.h arnd
2007-12-18 17:49 ` [POWERPC 12/18] cell: export force_sig_info() arnd
2007-12-18 17:49 ` [POWERPC 13/18] cell: safer of_has_vicinity routine arnd
2007-12-18 17:49 ` [POWERPC 14/18] cell: handle kernel SLB setup in spu_base.c arnd
2007-12-18 17:49 ` [POWERPC 15/18] cell: use spu_load_slb for SLB setup arnd
2007-12-18 17:49 ` [POWERPC 16/18] cell: add spu_64k_pages_available() check arnd
2007-12-18 17:49 ` [POWERPC 17/18] cell: handle SPE kernel mappings that cross segment boundaries arnd
2007-12-18 17:49 ` [POWERPC 18/18] cell: catch errors from sysfs_create_group() arnd
2007-12-18 20:24 ` [POWERPC 00/18] cell patches for 2.6.25 Arnd Bergmann
2007-12-19  0:11 ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071218175103.799448000@arndb.de \
    --to=arnd@arndb.de \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=rrnelson@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.