<br><font size=2 face="sans-serif">Hello Nelson.</font>
<br><font size=2 face="sans-serif">Thanks for your reply.</font>
<br>
<br><font size=2 face="sans-serif">cbe-oss-dev-bounces+takashi02_yamamoto=hq.scei.sony.co.jp@ozlabs.org wrote on 2007/08/15 05:16:02:<br>
> Yamamoto-san,<br>
> <br>
> On Friday 10 August 2007 03:13:29 am Takashi02 Yamamoto wrote:<br>
> > This patch fixes the cbe pm signal routing problem.<br>
> <br>
> Is this a documented problem? Where? I haven't seen anything mentioned<br>
> previously.</font>
<br>
<br><font size=2 face="sans-serif">Sorry. My explanation was not enough.</font>
<br><font size=2 face="sans-serif">The word0-3 fields of debug_bus_control register and the group_0-1 fields of group_control register</font>
<br><font size=2 face="sans-serif">are not set correctly. And the target signal is not routed to the correct counter.</font>
<br><font size=2 face="sans-serif">I used OProfile on QS20 and found this problem.</font>
<br><font size=2 face="sans-serif"><br>
> ><br>
> > We can confirm the fix by the following oprofile event parameter.<br>
> > "opcontrol --event=cache_hit:10000:0x42"<br>
> <br>
> Why are you setting the unit mask? This is not something you should be <br>
> doing<br>
> in general, you should use the default values for the unit mask.</font>
<br>
<br><font size=2 face="sans-serif">I usually don't set the unit mask.</font>
<br><font size=2 face="sans-serif">But 0x42(unit mask) is good to reproduce the problem and confirm the fix.</font>
<br><font size=2 face="sans-serif"><br>
> ><br>
> > Signed-off-by: Takashi Yamamoto <br>
> <Takashi02_Yamamoto@hq.scei.sony.co.jp><br>
> ><br>
> > Index: linux-2.6.22.1/arch/powerpc/oprofile/op_model_cell.c<br>
> > ===================================================================<br>
> > --- linux-2.6.22.1.orig/arch/powerpc/oprofile/op_model_cell.c<br>
> > +++ linux-2.6.22.1/arch/powerpc/oprofile/op_model_cell.c<br>
> > @@ -291,13 +291,13 @@ static void set_pm_event(u32 ctr, int ev<br>
> > for (i = 0; i < NUM_TRACE_BUS_WORDS; i++) {<br>
> > if (bus_word & (1 << i)) {<br>
> > pm_regs.debug_bus_control |=<br>
> > - (bus_type << (31 - (2 * i) + 1));<br>
</font>
<br><font size=2 face="sans-serif">If i is 0, bus_type overflows.</font>
<br>
<br><font size=2 face="sans-serif">> > + (bus_type << (30 - (2 * i)));<br>
> ><br>
> > for (j = 0; j < NUM_INPUT_BUS_WORDS; j++) {<br>
> > if (input_bus[j] == 0xff) {<br>
> > input_bus[j] = i;<br>
> > pm_regs.group_control |=<br>
> > - (i << (31 - i));<br>
</font>
<br><font size=2 face="sans-serif">If i is 0, the group_0 field(bit0 and bit1) is not set correctly.</font>
<br>
<br><font size=2 face="sans-serif">> > + (input_bus[j] << (30 - (2 <br>
> *<br>
> > j)));<br>
> I think your change may work for your particular testcase setting the <br>
> unit<br>
> mask, but it looks to me like it is going to break almost everything <br>
> else. I<br>
> am going to take a more thorough look at the module but I can't see how <br>
> this<br>
> doesn't change/break some case(s) other than your test above.</font>
<br>
<br><font size=2 face="sans-serif">The default unit mask uses word_0, and </font>
<br><font size=2 face="sans-serif">it seems to work well without setting the word0 field of debug_bus_control register.</font>
<br><font size=2 face="sans-serif">So, it is difficult for us to find this problem.</font>
<br>
<br><font size=2 face="sans-serif">Thanks.</font>
<br><font size=2 face="sans-serif">Takashi Yamamoto.</font>