Unable to single step under ppc?

2007-10-28 Thread Wang, Baojun
On Saturday 27 October 2007 07:14:45, you wrote:
 stw r0,INT_FRAME_SIZE+4(r1)
 
 stw r31,INT_FRAME_SIZE+128(r1)
 
 lwz r5,EVENTS_USER_ADDR_OFFSET(r4)
 mr  r31,r5 /* r31 to hold new_domain-events_user_addr */
 
 cmpwi   r3,0
 beq 1f
 
 mtctr   r3

^ whats in R3 then ? Having 0 in r3 seems plain
  wrong !

  hi, If they were not setup properly in tlb, then we should get a
  DataTLBError/InstructionTLBError, I single stepped(stepi) to the `mtctr'
  insn, then set a breakpoint at DataTLBError/InstructionTLBError, but both
  of them were not triggered. Also, when I was at `mtctr', I could not
  single step (use stepi) thus unable to debug the program.

 If you cant single step over this instruction then the address
 you are loading must have some problem.

 hofrat

Hi, I'm using bdi2000/gdb to debug a program which is like a module (the 
excutable is loaded by myself), but I can not single step while executing 
`bctrl', where ctr contains the valid address for the _start() function, it 
is valid because I could use `x' or `disas' command to display the contents 
of register `ctr', however when `bctrl' execute, I got unable to access 
address xxx, what the problem could be? Could somebody give me some hints? 
Thanks very much.


here is a sample debug session:

(gdb) b jump_xm_dom
Breakpoint 1 at 0xc001e694
(gdb) c
Continuing.

Breakpoint 1, 0xc001e694 in jump_xm_dom ()
Current language:  auto; currently asm
(gdb) disas $pc $pc+32
Dump of assembler code from 0xc001e694 to 0xc001e6b4:
0xc001e694 jump_xm_dom+16:lwz r5,36(r4)
0xc001e698 jump_xm_dom+20:mr  r31,r5
0xc001e69c jump_xm_dom+24:cmpwi   r3,0
0xc001e6a0 jump_xm_dom+28:beq-0xc001e6c0 jump_xm_dom+60
0xc001e6a4 jump_xm_dom+32:mfmsr   r11
0xc001e6a8 jump_xm_dom+36:stw r11,240(r1) /* store old msr */
0xc001e6ac jump_xm_dom+40:andi.   r11,r11,16384   /* drop privilege */
0xc001e6b0 jump_xm_dom+44:mtmsr   r11
End of assembler dump.
(gdb) nexti
0xc001e698 in jump_xm_dom ()
(gdb)
0xc001e69c in jump_xm_dom ()
(gdb)
0xc001e6a0 in jump_xm_dom ()
(gdb)
0xc001e6a4 in jump_xm_dom ()
(gdb)
0xc001e6a8 in jump_xm_dom ()
(gdb)
0xc001e6ac in jump_xm_dom ()
(gdb)
0xc001e6b0 in jump_xm_dom ()
(gdb) disas $pc $pc+32
Dump of assembler code from 0xc001e6b0 to 0xc001e6d0:
0xc001e6b0 jump_xm_dom+44:mtmsr   r11
0xc001e6b4 jump_xm_dom+48:mtctr   r3  /* r3 contains _start() address 
*/
0xc001e6b8 jump_xm_dom+52:bctrl
0xc001e6bc jump_xm_dom+56:li  r3,0
0xc001e6c0 jump_xm_dom+60:lwz r31,320(r1) /* restore r31 */
0xc001e6c4 jump_xm_dom+64:lwz r11,240(r1) /* restore msr */
0xc001e6c8 jump_xm_dom+68:mtmsr   r11
0xc001e6cc jump_xm_dom+72:lwz r0,196(r1)
End of assembler dump.
(gdb) nexti
0xc001e6b4 in jump_xm_dom ()
(gdb)
0xc001e6b8 in jump_xm_dom ()
(gdb) info registers
r0 0xc001b908   3221338376
r1 0xd1072e60   3506908768
r2 0xc0549b70   3226770288
r3 0x1094   268435604
r4 0xd106c000   3506880512
r5 0x20033554432
r6 0xc014033c   3222537020
r7 0xc024   3223584768
r8 0x2  131072
r9 0xc02c   3224109056
r100x0  0
r110x0  0
r120x0  0
r130x0  0
r140x0  0
r150x0  0
r160x0  0
r170x0  0
r180x0  0
r190x0  0
r200x0  0
r210x0  0
r220x0  0
r230x0  0
r240x0  0
r250x0  0
r260x0  0
r270x0  0
r280x0  0
r290xc02c   3224109056
r300x0  0
r310x20033554432
pc 0xc001e6b8   3221350072
cr 0x2822   671088674
lr 0xc001b908   3221338376
---Type return to continue, or q return to quit---
ctr0x1094   268435604
xer0x0  0
(gdb) x/32b $r3
0x1094: 0x940x210xff0x400x7c0x080x020xa6
0x109c: 0x900x010x000xc40x7f0xe30xfb0x78
0x10a4: 0x3d0x200x100x010x900x690x070xa0
0x10ac: 0x480x000x020x550x800x010x000xc4
(gdb) disas $r3 $r3+32
Dump of assembler code from 0x1094 to 0x10b4:
0x1094: stwur1,-192(r1)
0x1098: mflrr0
0x109c: stw r0,196(r1)
0x10a0: mr  r3,r31
0x10a4: lis r9,4097
0x10a8: stw r3,1952(r9)
0x10ac: bl  0x1300
0x10b0: lwz r0,196(r1)
End of assembler dump.
(gdb) nexti
Cannot access memory at address 0xd1072e60  /* this 

Re: [PATCH] fix appletouch geyser 1 breakage

2007-10-28 Thread Johannes Berg

 OK, then maybe instead of reverting the change outright we could try the
 patch below?

That patch works, minor comments:

 Older models of fountains do not support change mode request and

I think there's only one fountain model.

 therefore shoudl be excluded from idle reset attempts.

typo

  /* MacBook Pro (Geyser 3  4) initialization constants */

That comment is no longer correct, you should change it.

 -#define ATP_GEYSER3_MODE_READ_REQUEST_ID 1

 + * Reinitialise the device. This usually stops stream of empty packets
 + * coming form it.

typo from

johannes


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH v3] pcmcia: Convert io_req_t to use unsigned int

2007-10-28 Thread Dominik Brodowski
On Fri, Oct 19, 2007 at 03:17:20PM -0500, Olof Johansson wrote:
 Convert the io_req_t members to unsigned int, to allow use on machines
 with more than 16 bits worth of IO ports (i.e. secondary busses on
 ppc64, etc).

Agreed, though I'd prefer if we got rid of kio_addr_t at the same time, and
convert its users to unsigned int as well -- as was pointed out earlier in
this thread, there's no known usage of IO ports larger than 32 bits.

Dominik
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] fix appletouch geyser 1 breakage

2007-10-28 Thread Dmitry Torokhov
On Sunday 28 October 2007, Johannes Berg wrote:
 
  OK, then maybe instead of reverting the change outright we could try the
  patch below?
 
 That patch works,

Any chance Benjamin could also test it? The behaviour is different
from 2.6.24-rc1 since we call atp_geyser_init for all geysers now.
 
 minor comments: 
 
  Older models of fountains do not support change mode request and
 
 I think there's only one fountain model.

I was hoping that FOUNTAIN_TP_ONLY_PRODUCT_ID (0x30A) behaves similar
to Geyser in this regard. If you know that this assumption is incorrect
then we need to rename atp_is_older_fountain() to atp_is_fountain()
anf add this product ID to it.

 
  therefore shoudl be excluded from idle reset attempts.
 
 typo

OK

 
   /* MacBook Pro (Geyser 3  4) initialization constants */
 
 That comment is no longer correct, you should change it.
 

OK

  -#define ATP_GEYSER3_MODE_READ_REQUEST_ID 1
 
  + * Reinitialise the device. This usually stops stream of empty packets
  + * coming form it.
 
 typo from
 

Yep, thanks.

-- 
Dmitry
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] fix appletouch geyser 1 breakage

2007-10-28 Thread Johannes Berg

 I was hoping that FOUNTAIN_TP_ONLY_PRODUCT_ID (0x30A) behaves similar
 to Geyser in this regard. If you know that this assumption is incorrect
 then we need to rename atp_is_older_fountain() to atp_is_fountain()
 anf add this product ID to it.

Ah ok, I forgot about that one. If I were to venture a guess I'd say
that they renamed it to geyser because of this idle behaviour
technology upgrade, but I can't say, nor do I know anybody with such a
version, sorry.

johannes


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] ehea: add kexec support

2007-10-28 Thread Michael Ellerman

On Fri, 2007-10-26 at 14:37 +0200, Jan-Bernd Themann wrote:
 eHEA resources that are allocated via H_CALLs have a unique identifier each.
 These identifiers are necessary to free the resources. A reboot notifier
 is used to free all eHEA resources before the indentifiers get lost, i.e
 before kexec starts a new kernel.
 
 Signed-off-by: Jan-Bernd Themann [EMAIL PROTECTED]
 

How do you plan to support kdump?

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH v2] pcmcia: Remove replace kio_addr_t with unsigned int everywhere

2007-10-28 Thread Stephen Rothwell
Hi Olof,

diffstat output is very useful - especially for patches like this that
touch lots of files.  It makes it easier for potential reviewers to see
if they should be potential reviewers.  :-)

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


pgpEcLfjxg7Hi.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] fix breakage in pegasos_eth (fallout from commit b45d9147f1582333e180e1023624c003874b7312)

2007-10-28 Thread Lennert Buytenhek
On Sat, Oct 27, 2007 at 09:02:32PM +0100, Al Viro wrote:

 diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
 index 3f27239..8df230a 100644
 --- a/include/linux/mv643xx_eth.h
 +++ b/include/linux/mv643xx_eth.h
 @@ -8,6 +8,9 @@
  #define MV643XX_ETH_NAME mv643xx_eth
  #define MV643XX_ETH_SHARED_REGS  0x2000
  #define MV643XX_ETH_SHARED_REGS_SIZE 0x2000
 +#define MV643XX_ETH_BAR_40x220
 +#define MV643XX_ETH_SIZE_REG_4   0x224
 +#define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x0290

Ideally, pegasos_eth shouldn't be poking around in mv643xx_eth
registers directly (but I'll put that on the TODO list to try
and fix later.)
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] Prevent appletouch message log spam on 17 PB

2007-10-28 Thread Joseph Jezak
Perhaps this was a debugging message?  In any case, this printk
causes lots of message log spam on my PB G4 1.67 (PowerBook5,9).

This removes the printk.

Signed-off by: Joseph Jezak [EMAIL PROTECTED]
---

diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index f132702..6c47641 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -433,7 +433,6 @@ static void atp_complete(struct urb* urb)
for (i = (atp_is_geyser_2(dev)?15:16); i  ATP_XSENSORS; i++) {
if (!dev-xy_cur[i]) continue;
 
-   printk(appletouch: 17\ model detected.\n);
if(atp_is_geyser_2(dev))
input_set_abs_params(dev-input, ABS_X, 0,
 (20 - 1) *
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v2] pcmcia: Remove replace kio_addr_t with unsigned int everywhere

2007-10-28 Thread Olof Johansson
On Mon, Oct 29, 2007 at 10:50:05AM +1100, Stephen Rothwell wrote:
 Hi Olof,
 
 diffstat output is very useful - especially for patches like this that
 touch lots of files.  It makes it easier for potential reviewers to see
 if they should be potential reviewers.  :-)

Hi,

Good point. I'll include it next time if I end up re-posting it. I hope
I won't have to. :-)

This is the diffstat from the posted patch:

 Documentation/pcmcia/driver-changes.txt |4 +-
 drivers/bluetooth/bt3c_cs.c |2 -
 drivers/bluetooth/btuart_cs.c   |2 -
 drivers/net/pcmcia/3c574_cs.c   |   49 -
 drivers/net/pcmcia/3c589_cs.c   |   30 +++
 drivers/net/pcmcia/axnet_cs.c   |   26 ++---
 drivers/net/pcmcia/fmvj18x_cs.c |   23 ++-
 drivers/net/pcmcia/nmclan_cs.c  |   24 ++--
 drivers/net/pcmcia/pcnet_cs.c   |   36 +-
 drivers/net/pcmcia/smc91c92_cs.c|   62 
 drivers/net/pcmcia/xirc2ps_cs.c |   51 +-
 drivers/net/wireless/netwave_cs.c   |   24 ++--
 drivers/net/wireless/wavelan_cs.c   |   56 ++--
 drivers/pcmcia/i82092.c |2 -
 drivers/pcmcia/i82365.c |   14 +++
 drivers/pcmcia/m32r_cfc.c   |7 ++-
 drivers/pcmcia/m32r_pcc.c   |5 +-
 drivers/pcmcia/rsrc_nonstatic.c |5 +-
 drivers/serial/serial_cs.c  |6 +--
 include/pcmcia/cs_types.h   |1 
 include/pcmcia/ss.h |6 +--
 21 files changed, 220 insertions(+), 215 deletions(-)



-Olof
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc: Fix demotion of segments to 4K pages

2007-10-28 Thread Benjamin Herrenschmidt
When demoting a process to use 4K HW pages (instead of 64K), which happens
under various circumstances such as doing cache inhibited mappings on 
machines that do not support 64K CI pages, the assembly hash code calls
back into the C function flush_hash_page(). This function prototype was
recently changed to accomodate for 1T segments but the assembly call site
was not updated, causing applications that do demotion to hang. In addition,
when updating the per-CPU PACA for the new sizes, we didn't properly
update the slice map, thus causing the SLB miss code to re-insert
segments for the wrong size.

This fixes both and adds a warning comment next to the C implementation to
try to avoid it next time someone changes it.

Signed-off-by: Benjamin Herrenschmidt [EMAIL PROTECTED]
---

Note that the PACA update bug is also present in 2.6.23, I'll do a patch
for -stable separately, once this one is upstream.

Index: linux-work/arch/powerpc/mm/hash_low_64.S
===
--- linux-work.orig/arch/powerpc/mm/hash_low_64.S   2007-10-29 
10:15:48.0 +1100
+++ linux-work/arch/powerpc/mm/hash_low_64.S2007-10-29 10:22:10.0 
+1100
@@ -331,7 +331,7 @@ htab_pte_insert_failure:
  */
 
 /* _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
- *  pte_t *ptep, unsigned long trap, int local)
+ *  pte_t *ptep, unsigned long trap, int local, int ssize)
  */
 
 /*
@@ -557,7 +557,8 @@ htab_inval_old_hpte:
mr  r4,r31  /* PTE.pte */
li  r5,0/* PTE.hidx */
li  r6,MMU_PAGE_64K /* psize */
-   ld  r7,STK_PARM(r8)(r1) /* local */
+   ld  r7,STK_PARM(r9)(r1) /* ssize */
+   ld  r8,STK_PARM(r8)(r1) /* local */
bl  .flush_hash_page
b   htab_insert_pte

Index: linux-work/arch/powerpc/mm/hash_utils_64.c
===
--- linux-work.orig/arch/powerpc/mm/hash_utils_64.c 2007-10-29 
10:21:55.0 +1100
+++ linux-work/arch/powerpc/mm/hash_utils_64.c  2007-10-29 11:57:06.0 
+1100
@@ -793,8 +793,7 @@ int hash_page(unsigned long ea, unsigned
}
if (user_region) {
if (psize != get_paca()-context.user_psize) {
-   get_paca()-context.user_psize =
-   mm-context.user_psize;
+   get_paca()-context = mm-context;
slb_flush_and_rebolt();
}
} else if (get_paca()-vmalloc_sllp !=
@@ -887,6 +886,9 @@ void hash_preload(struct mm_struct *mm, 
local_irq_restore(flags);
 }
 
+/* WARNING: This is called from hash_low_64.S, if you change this prototype,
+ *  do not forget to update the assembly call site !
+ */
 void flush_hash_page(unsigned long va, real_pte_t pte, int psize, int ssize,
 int local)
 {


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: Fix demotion of segments to 4K pages

2007-10-28 Thread Olof Johansson
Hi Ben,

On Mon, Oct 29, 2007 at 12:05:18PM +1100, Benjamin Herrenschmidt wrote:
 @@ -887,6 +886,9 @@ void hash_preload(struct mm_struct *mm, 
   local_irq_restore(flags);
  }
  
 +/* WARNING: This is called from hash_low_64.S, if you change this prototype,
 + *  do not forget to update the assembly call site !
 + */

Since we're already policing whitespace on this list today: We're normally
not using spaces before exclamation marks.


-Olof
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: Fix demotion of segments to 4K pages

2007-10-28 Thread Benjamin Herrenschmidt

On Sun, 2007-10-28 at 20:50 -0500, Olof Johansson wrote:
 Hi Ben,
 
 On Mon, Oct 29, 2007 at 12:05:18PM +1100, Benjamin Herrenschmidt wrote:
  @@ -887,6 +886,9 @@ void hash_preload(struct mm_struct *mm, 
  local_irq_restore(flags);
   }
   
  +/* WARNING: This is called from hash_low_64.S, if you change this 
  prototype,
  + *  do not forget to update the assembly call site !
  + */
 
 Since we're already policing whitespace on this list today: We're normally
 not using spaces before exclamation marks.

And I don't care, I will continue adding them because the opposite is
fugly :-)

There is a limit to what I accept from the style police, it's not like
Linux has to look like it's written by a single person either.

Ben.
 

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: Fix demotion of segments to 4K pages

2007-10-28 Thread Stephen Rothwell
On Mon, 29 Oct 2007 12:05:18 +1100 Benjamin Herrenschmidt [EMAIL PROTECTED] 
wrote:

Just to be fair to Olof, diffstats are good ...

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


pgpAdyioH39BR.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] Prevent appletouch message log spam on 17 PB

2007-10-28 Thread Dmitry Torokhov
Hi Joseph,

On Sunday 28 October 2007 19:53, Joseph Jezak wrote:
 Perhaps this was a debugging message?  In any case, this printk
 causes lots of message log spam on my PB G4 1.67 (PowerBook5,9).
 
 This removes the printk.
 

I don't think we want do delete this message outright, we just need
to make sure we don't go through size detection when we re-initialize
the device. After all it is unlikely that touchpad will change its
size :)

BTW, could you tell me what product ID your touchpad has?

 Signed-off by: Joseph Jezak [EMAIL PROTECTED]
 ---
 
 diff --git a/drivers/input/mouse/appletouch.c 
 b/drivers/input/mouse/appletouch.c
 index f132702..6c47641 100644
 --- a/drivers/input/mouse/appletouch.c
 +++ b/drivers/input/mouse/appletouch.c
 @@ -433,7 +433,6 @@ static void atp_complete(struct urb* urb)
   for (i = (atp_is_geyser_2(dev)?15:16); i  ATP_XSENSORS; i++) {
   if (!dev-xy_cur[i]) continue;
  
 - printk(appletouch: 17\ model detected.\n);
   if(atp_is_geyser_2(dev))
   input_set_abs_params(dev-input, ABS_X, 0,
(20 - 1) *
 

-- 
Dmitry
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Prevent appletouch message log spam on 17 PB

2007-10-28 Thread Joseph Jezak
Dmitry Torokhov wrote:
 Hi Joseph,
 
 On Sunday 28 October 2007 19:53, Joseph Jezak wrote:
 Perhaps this was a debugging message?  In any case, this printk
 causes lots of message log spam on my PB G4 1.67 (PowerBook5,9).

 This removes the printk.

 
 I don't think we want do delete this message outright, we just need
 to make sure we don't go through size detection when we re-initialize
 the device. After all it is unlikely that touchpad will change its
 size :)
 
 BTW, could you tell me what product ID your touchpad has?
 
 Signed-off by: Joseph Jezak [EMAIL PROTECTED]
 ---

 diff --git a/drivers/input/mouse/appletouch.c 
 b/drivers/input/mouse/appletouch.c
 index f132702..6c47641 100644
 --- a/drivers/input/mouse/appletouch.c
 +++ b/drivers/input/mouse/appletouch.c
 @@ -433,7 +433,6 @@ static void atp_complete(struct urb* urb)
  for (i = (atp_is_geyser_2(dev)?15:16); i  ATP_XSENSORS; i++) {
  if (!dev-xy_cur[i]) continue;
  
 -printk(appletouch: 17\ model detected.\n);
  if(atp_is_geyser_2(dev))
  input_set_abs_params(dev-input, ABS_X, 0,
   (20 - 1) *

 

Sure, that's probably better.  My touchpad is an 0x0214.

-Joe
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[POWERPC] Fix off-by-one error in setting decrementer on Book E

2007-10-28 Thread Paul Mackerras
The decrementer in Book E and 4xx processors interrupts on the
transition from 1 to 0, rather than on the 0 to -1 transition as on
64-bit server and 32-bit classic (6xx/7xx/7xxx) processors.

This fixes the problem by making set_dec subtract 1 from the count for
server and classic processors.  Since set_dec already had a bunch of
ifdefs to handle different processor types, there is no net increase
in ugliness. :)

This also removes a redundant call to set the decrementer to
0x7fff - it was already set to that earlier in timer_interrupt.

Signed-off-by: Paul Mackerras [EMAIL PROTECTED]
---
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 9eb3284..5e253d6 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -586,7 +586,7 @@ void timer_interrupt(struct pt_regs * regs)
/* not time for this event yet */
now = per_cpu(decrementer_next_tb, cpu) - now;
if (now = DECREMENTER_MAX)
-   set_dec((unsigned int)now - 1);
+   set_dec((int)now);
return;
}
old_regs = set_irq_regs(regs);
@@ -601,10 +601,8 @@ void timer_interrupt(struct pt_regs * regs)
 
if (evt-event_handler)
evt-event_handler(evt);
-   else
-   evt-set_next_event(DECREMENTER_MAX, evt);
 
 #ifdef CONFIG_PPC_ISERIES
if (firmware_has_feature(FW_FEATURE_ISERIES)  hvlpevent_is_pending())
@@ -826,9 +824,6 @@ static int decrementer_set_next_event(unsigned long evt,
  struct clock_event_device *dev)
 {
__get_cpu_var(decrementer_next_tb) = get_tb_or_rtc() + evt;
-   /* The decrementer interrupts on the 0 - -1 transition */
-   if (evt)
-   --evt;
set_dec(evt);
return 0;
 }
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index f058955..eed64bd 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -183,6 +183,7 @@ static inline void set_dec(int val)
 #elif defined(CONFIG_8xx_CPU6)
set_dec_cpu6(val);
 #else
+   --val;  /* classic decrementer interrupts when dec goes negative */
 #ifdef CONFIG_PPC_ISERIES
int cur_dec;
 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [POWERPC] Fix duplicate time accounting

2007-10-28 Thread Olof Johansson
On Mon, Oct 29, 2007 at 01:50:34PM +1100, Paul Mackerras wrote:
 Currently, process user and system times are advancing twice as fast
 as they should because they are being accounted in two places - in the
 generic code and in timer_interrupt.  This fixes it by removing the
 call to account_process_time in timer_interrupt.
 
 Signed-off-by: Paul Mackerras [EMAIL PROTECTED]

Tested-by: Olof Johansson [EMAIL PROTECTED]

Thanks for fixing it!

-Olof
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [POWERPC] Fix off-by-one error in setting decrementer on Book E

2007-10-28 Thread Paul Mackerras
I wrote:

 @@ -601,10 +601,8 @@ void timer_interrupt(struct pt_regs * regs)

That should be

@@ -601,8 +601,6 @@ void timer_interrupt(struct pt_regs * regs)

of course.

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc: Fix demotion of segments to 4K pages

2007-10-28 Thread Benjamin Herrenschmidt

On Sun, 2007-10-28 at 22:06 -0500, Olof Johansson wrote:
  And I don't care, I will continue adding them because the opposite
 is
  fugly :-)
 
 Yeah , I know what you mean . This looks so much more natural .

Who said it has to be consistent ? :-)

I use spaces before ? and ! mostly. In fact, it might even be the rule
in french, I'm not too sure :-)

Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 11/16] Use of_get_next_child() in eeh_restore_bars()

2007-10-28 Thread Michael Ellerman

On Fri, 2007-10-26 at 17:29 +1000, Stephen Rothwell wrote:
 On Fri, 26 Oct 2007 16:54:43 +1000 (EST) Michael Ellerman [EMAIL PROTECTED] 
 wrote:
 
  +++ b/arch/powerpc/platforms/pseries/eeh.c
  @@ -841,11 +841,8 @@ void eeh_restore_bars(struct pci_dn *pdn)
  if ((pdn-eeh_mode  EEH_MODE_SUPPORTED)  !IS_BRIDGE(pdn-class_code))
  __restore_bars (pdn);
   
  -   dn = pdn-node-child;
  -   while (dn) {
  +   for (dn = NULL; (dn = of_get_next_child(pdn-node, dn));)
 
 Just wondering if we need
 
 #define for_each_child_node(dn, parent) \
   for (dn = of_get_next_child(parent, NULL); dn; \
   dn = of_get_next_child(parent, dn))

Hmm, perhaps. I count ~30 places we could use it under arch/powerpc, and
about another ~20 in drivers/.

If no one objects, I guess I'll get to it, sigh ... another Yak.

Should we perhaps make it for_each_child_device_node() ?
Otherwise it's slightly non obvious what kind of node it's talking
about, especially in driver code.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] fix appletouch geyser 1 breakage

2007-10-28 Thread Dmitry Torokhov
On Sunday 28 October 2007 11:08, Johannes Berg wrote:
 
  I was hoping that FOUNTAIN_TP_ONLY_PRODUCT_ID (0x30A) behaves similar
  to Geyser in this regard. If you know that this assumption is incorrect
  then we need to rename atp_is_older_fountain() to atp_is_fountain()
  anf add this product ID to it.
 
 Ah ok, I forgot about that one. If I were to venture a guess I'd say
 that they renamed it to geyser because of this idle behaviour
 technology upgrade, but I can't say, nor do I know anybody with such a
 version, sorry.

OK then let's play safe and don't touch fountains at all. How about the
patch below?

-- 
Dmitry

Input: appletouch - idle reset logic broke older Fountains

Fountains do not support change mode request and therefore
should be excluded from idle reset attempts.

Also:
 - do not re-submit URB when we decide that toucvhpad needs to be
   reinicialized
 - do not repeat size detection when reinitializing the touchpad
 - Add missing KERN_* prefixes to messages

Signed-off-by: Dmitry Torokhov [EMAIL PROTECTED]
---
 drivers/input/mouse/appletouch.c |  125 ---
 1 file changed, 77 insertions(+), 48 deletions(-)

Index: work/drivers/input/mouse/appletouch.c
===
--- work.orig/drivers/input/mouse/appletouch.c
+++ work/drivers/input/mouse/appletouch.c
@@ -129,12 +129,12 @@ MODULE_DEVICE_TABLE (usb, atp_table);
  */
 #define ATP_THRESHOLD   5
 
-/* MacBook Pro (Geyser 3  4) initialization constants */
-#define ATP_GEYSER3_MODE_READ_REQUEST_ID 1
-#define ATP_GEYSER3_MODE_WRITE_REQUEST_ID 9
-#define ATP_GEYSER3_MODE_REQUEST_VALUE 0x300
-#define ATP_GEYSER3_MODE_REQUEST_INDEX 0
-#define ATP_GEYSER3_MODE_VENDOR_VALUE 0x04
+/* Geyser initialization constants */
+#define ATP_GEYSER_MODE_READ_REQUEST_ID1
+#define ATP_GEYSER_MODE_WRITE_REQUEST_ID   9
+#define ATP_GEYSER_MODE_REQUEST_VALUE  0x300
+#define ATP_GEYSER_MODE_REQUEST_INDEX  0
+#define ATP_GEYSER_MODE_VENDOR_VALUE   0x04
 
 /* Structure to hold all of our device specific stuff */
 struct atp {
@@ -142,9 +142,11 @@ struct atp {
struct usb_device * udev;   /* usb device */
struct urb *urb;/* usb request block */
signed char *   data;   /* transferred data */
-   int open;   /* non-zero if opened */
-   struct input_dev*input; /* input dev */
-   int valid;  /* are the sensors valid ? */
+   struct input_dev *  input;  /* input dev */
+   unsigned char   open;   /* non-zero if opened */
+   unsigned char   valid;  /* are the sensors valid ? */
+   unsigned char   size_detect_done;
+   unsigned char   overflowwarn;   /* overflow warning printed? */
int x_old;  /* last reported x/y, */
int y_old;  /* used for smoothing */
/* current value of the sensors 
*/
@@ -153,7 +155,6 @@ struct atp {
signed char xy_old[ATP_XSENSORS + ATP_YSENSORS];
/* accumulated sensors */
int xy_acc[ATP_XSENSORS + ATP_YSENSORS];
-   int overflowwarn;   /* overflow warning printed? */
int datalen;/* size of an USB urb transfer 
*/
int idlecount;  /* number of empty packets */
struct work_struct  work;
@@ -170,7 +171,7 @@ struct atp {
 
 #define dprintk(format, a...)  \
do {\
-   if (debug) printk(format, ##a); \
+   if (debug) printk(KERN_DEBUG format, ##a);  
\
} while (0)
 
 MODULE_AUTHOR(Johannes Berg, Stelian Pop, Frank Arnold, Michael Hanselmann);
@@ -188,6 +189,15 @@ static int debug = 1;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, Activate debugging output);
 
+static inline int atp_is_fountain(struct atp *dev)
+{
+   u16 productId = le16_to_cpu(dev-udev-descriptor.idProduct);
+
+   return productId == FOUNTAIN_ANSI_PRODUCT_ID ||
+  productId == FOUNTAIN_ISO_PRODUCT_ID ||
+  productId == FOUNTAIN_TP_ONLY_PRODUCT_ID;
+}
+
 /* Checks if the device a Geyser 2 (ANSI, ISO, JIS) */
 static inline int atp_is_geyser_2(struct atp *dev)
 {
@@ -211,52 +221,63 @@ static inline int atp_is_geyser_3(struct
 }
 
 /*
- * By default Geyser 3 device sends standard USB HID mouse
+ * By default newer Geyser devices send standard USB HID mouse
  * packets (Report ID 2). This code changes device mode, so it
  * sends raw sensor reports (Report ID 5).
  */
-static int 

RE: [PATCH] ucc_geth: add support for netpoll

2007-10-28 Thread Li Yang-r58472
 -Original Message-
 From: Anton Vorontsov [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, October 27, 2007 10:38 PM
 To: Sergei Shtylyov
 Cc: Anton Vorontsov; [EMAIL PROTECTED]; Li Yang-r58472; 
 [EMAIL PROTECTED]; linuxppc-dev@ozlabs.org
 Subject: Re: [PATCH] ucc_geth: add support for netpoll
 
 On Sat, Oct 27, 2007 at 05:09:51PM +0400, Sergei Shtylyov wrote:
  Hello.
  
  Anton Vorontsov wrote:
  
   This patch adds netpoll support for the QE UCC Gigabit Ethernet 
   driver. The approach is very similar to the gianfar driver.
  
  It's rather contrarywise -- this is standard approach 
 and gianfar 
  with its
  3 TSEC IRQs has a quite non-standard poll_controller() 
 implementation.
 
 Oh.. well, right -- gianfar a bit more comlex in that regard.
 
  
   Tested using netconsole.
  
  KGDBoE is considered a better test (I hope you've also 
 tested with it).
 
 At the time of posting it was tested using netconsole only, a 
 few days later it's was tested using KGDBoE also. So, it works indeed.
 
   Signed-off-by: Anton Vorontsov [EMAIL PROTECTED] 
 diff --git 
   a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 
   18a6f48..06807ce 100644
   --- a/drivers/net/ucc_geth.c
   +++ b/drivers/net/ucc_geth.c
   @@ -3691,6 +3691,22 @@ static irqreturn_t 
 ucc_geth_irq_handler(int irq, void *info)
 return IRQ_HANDLED;
}

   +#ifdef CONFIG_NET_POLL_CONTROLLER
   +/*
   + * Polling 'interrupt' - used by things like netconsole to send 
   +skbs
   + * without having to re-enable interrupts. It's not called while
   + * the interrupt routine is executing.
   + */
   +static void ucc_netpoll(struct net_device *dev) {
   + struct ucc_geth_private *ugeth = netdev_priv(dev);
   +
   + disable_irq(ugeth-ug_info-uf_info.irq);
   + ucc_geth_irq_handler(ugeth-ug_info-uf_info.irq, dev);
   + enable_irq(ugeth-ug_info-uf_info.irq);
  
  Why not make it less complex (for a reader and gcc too :-) ?
 
 Yup, I'm agree here but it's too late. Again. ;-)
 
 This patch already accepted into the -mm (a week or so after 
 the silence), so.. now I'd rather not bother Andrew with such 
 really cosmetic changes. But if Jeff would directly apply 
 modfied patch, I'll send it. ;-)

Oops.  The original patch happened to hit the Junk mail box. :(  I think
the patch is good to merge after the cosmetic change.  I can do it in
next pull request to Jeff.

Thanks
- Leo
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev