Re: Trace

2008-09-04 Thread Sébastien Chrétien
I followed your advice : I used the UART layer. It is easier. Thanks Benjamin Herrenschmidt a écrit : On Tue, 2008-09-02 at 09:34 +0200, Sébastien Chrétien wrote: ok is it a bad way to write a tty driver ? why ? Not necessarily, it's just overkill. The UART layer handles a lot of st

Re: Trace

2008-09-02 Thread Sébastien Chrétien
ok. I will try the serial layer 2008/9/2, Benjamin Herrenschmidt <[EMAIL PROTECTED]>: > > On Tue, 2008-09-02 at 09:34 +0200, Sébastien Chrétien wrote: > > ok is it a bad way to write a tty driver ? why ? > > > Not necessarily, it's just overkill. The UART layer handles a lot > of stuff for you. Th

Re: Trace

2008-09-02 Thread Benjamin Herrenschmidt
On Tue, 2008-09-02 at 09:34 +0200, Sébastien Chrétien wrote: > ok is it a bad way to write a tty driver ? why ? Not necessarily, it's just overkill. The UART layer handles a lot of stuff for you. The tty layer is tricky to get right. Cheers, Ben. ___ L

Re: Trace

2008-09-02 Thread Sébastien Chrétien
ok is it a bad way to write a tty driver ? why ? 2008/9/2, Benjamin Herrenschmidt <[EMAIL PROTECTED]>: > > On Tue, 2008-09-02 at 07:13 +0200, Sébastien CHRETIEN wrote: > > My board has only a uart device on a FPGA. I don't use the serial layer > > because it isn't documented in Linux Device Driver

Re: Trace

2008-09-01 Thread Sébastien CHRETIEN
linuxppc-dev@ozlabs.org Subject: RE: Trace I'm not sure that is a failure. Why can't tty have value 0x5741 ? I think the code in tty_io.c initialises driver->ttys and you shouldn't need to do anything in your driver. If you are not already aware, a useful way to

Re: Trace

2008-09-01 Thread Benjamin Herrenschmidt
On Tue, 2008-09-02 at 07:13 +0200, Sébastien CHRETIEN wrote: > My board has only a uart device on a FPGA. I don't use the serial layer > because it isn't documented in Linux Device Driver 3rd. Only the tty > layer is documented You won't go very far in linux kernel dev. with using books like tha

Re: Trace

2008-09-01 Thread Benjamin Herrenschmidt
! > > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jenkins, > > Clive > > Sent: 01 September 2008 14:54 > > To: Sébastien Chrétien > > Cc: linuxppc-dev@ozlabs.org > > Subject: RE: Trace > > &g

Re: Trace

2008-09-01 Thread Sébastien Chrétien
d is not word-aligned! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jenkins, Clive Sent: 01 September 2008 14:54 To: Sébastien Chrétien Cc: linuxppc-dev@ozlabs.org Subject: RE: Trace I'm not sure that is a failure. Why can't tty have value 0x

RE: Trace

2008-09-01 Thread Jenkins, Clive
xppc-dev@ozlabs.org Subject: RE: Trace I'm not sure that is a failure. Why can't tty have value 0x5741 ? I think the code in tty_io.c initialises driver->ttys and you shouldn't need to do anything in your driver. If you are not already aware, a useful way to explore kerne

RE: Trace

2008-09-01 Thread Jenkins, Clive
x.no/linux+v2.6.26/include/linux/tty_driver.h#L212 This may help you understand the tty code. Good luck! From: Sébastien Chrétien [mailto:[EMAIL PROTECTED] Sent: 01 September 2008 13:25 To: Jenkins, Clive Cc: linuxppc-dev@ozlabs.org Subject: Re: Trace I

Re: Trace

2008-09-01 Thread Sébastien Chrétien
I found where is the failure with your advices In init_dev (tty_io.c), init_dev calls "tty = driver->ttys[idx]" after this call, tty value is : tty = 0x5741 Have I to initialize driver->ttys in my driver. If yes, how have I to Initialize this ? The driver tty is used in order to have a consol

RE: Trace

2008-09-01 Thread Jenkins, Clive
The instruction that caused the fault is at this address: > NIP [c0110ddc] init_dev+0x2bc/0x584 The hex value of the instruction is also highlighted between <> here: > Instruction dump: > 7d808120 4e800020 7c832378 4bfa9ea9 7c7f1b79 418201f0 a81e0062 2f81 > 409efd98 83ff00d0 2c1f 4182fd90

Re: Trace

2008-09-01 Thread Benjamin Herrenschmidt
On Mon, 2008-09-01 at 11:16 +0200, Sébastien Chrétien wrote: > Hello, > > I am triying to write a tty_driver under ppc. And I get a kernel > panic. > Can somebody explain me how finding the source of the error with a > kernel panic trace : > thanks What kind of device are you writing a tty drive