All of lore.kernel.org
 help / color / mirror / Atom feed
* Kernel Boot Speedup
@ 2003-03-06  0:19 Ro0tSiEgE LKML
  2003-03-06  0:44 ` Andy Pfiffer
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Ro0tSiEgE LKML @ 2003-03-06  0:19 UTC (permalink / raw)
  To: linux-kernel

What are some things I can change/disable/etc. to cut down the boot time
of the kernel (i386) ? I would like to get one to boot in a couple
seconds, tops. Is this possible, and how?




^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: Interpretation of termios flags on a serial driver
@ 2003-03-26 23:33 Ed Vance
  2003-03-27  0:17 ` Henrique Gobbi
  0 siblings, 1 reply; 18+ messages in thread
From: Ed Vance @ 2003-03-26 23:33 UTC (permalink / raw)
  To: 'henrique.gobbi@cyclades.com'
  Cc: linux-kernel, 'linux-serial'

On Wed, Mar 26, 2003 at 6:51 AM, Henrique Gobbi wrote:
> 
> I'm having some problems understanding three flags on the termios 
> struct: PARENB, INPCK, IGNPAR. After reading the termios 
> manual a couple 
> of times I'm still not able to understand the different purposes of 
> these flags.
> 
> What I understood:
> 
> 1 - PARENB: if this flag is set the serial chip must generate parity 
> (odd or even depending on the flag PARODD). If this flag is 
> not set, use 
> parity none.
> 
> 2 - IGNPAR: two cases here:
>     	2.1 - PARENB is set: if IGNPAR is set the driver should 
> ignore 			all 
> parity and framing errors and send the problematic bytes to 	
> 	tty flip 
> buffer as normal data. If this flag is not set the 		
> 	driver must send the 
> problematic data to the tty as problematic 		data.
> 
> 	2.2 - PARENB is not set: disregard IGNPAR
> 
> What I don't understand:
> 
> 3 - Did I really understand the items 1 and 2 ?
> 
> 4 - INPCK flag: What's the purpose of this flag. What's the 
> diference in 
> relation to IGNPAR;

     If INPCK is set, input parity checking  is  enabled.      If
     INPCK is  not  set, input parity checking is disabled.  This
     allows output parity generation without input parity errors.
     Note  that  whether input parity checking is enabled or dis-
     abled is independent of whether parity detection is  enabled
     or disabled. If parity detection is enabled but input parity
     checking is disabled, the hardware to which the terminal  is
     connected  will  recognize  the parity bit, but the terminal
     special file will not check whether this is set correctly or
     not.

     If IGNPAR is set, a  byte  with  framing  or  parity  errors
     (other than break) is ignored. This means that the data byte
     with the error is thrown away  by the  driver as if the byte
     had never been received. 

In short,
If INPCK is _not_ set, then all received data bytes will be delivered 
to the user level, regardless of parity errors.
If IGNPAR is set, then only received data bytes that do not have 
parity errors will be delivered to the user level.
If PARENB is _not_ set, then the receiver hardware will not detect 
bad parity, so all received data bytes are considered free of errors. 
Since there are no data bytes with associated error indications, 
setting IGNPAR would have no effect. All of the data are considered 
error free.

> 
> 5 - If the TTY knows the data status (PARITY, FRAMING, 
> OVERRUN, NORMAL), 
> why the driver has to deal with the flag IGNPAR. Shouldn't 
> the TTY being 
> doing it ?

Not sure I understand the question. Received data does not carry any
information about errors with it after it leaves the driver, unless 
PARMRK is set. 
> 
> Thanks in advance
> Henrique

Cheers,
Ed

---------------------------------------------------------------- 
Ed Vance              edv (at) macrolink (dot) com
Macrolink, Inc.       1500 N. Kellogg Dr  Anaheim, CA  92807
----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: Interpretation of termios flags on a serial driver
@ 2003-03-27  0:59 Ed Vance
  2003-03-27 19:06 ` David Lawyer
  0 siblings, 1 reply; 18+ messages in thread
From: Ed Vance @ 2003-03-27  0:59 UTC (permalink / raw)
  To: 'Henrique Gobbi'
  Cc: Linux Kernel Mailing List, 'linux-serial'

On Wed, Mar 26, 2003 at 4:17 PM, Henrique Gobbi wrote:
> 
> Hello Ed !
> Thanks for the feedback. 
> 
> Please read my coments (doubts actually) below:
> 
> > > 4 - INPCK flag: What's the purpose of this flag. What's the 
> > > diference in 
> > > relation to IGNPAR;
> >      If INPCK is set, input parity checking  is  enabled.      If
> >      INPCK is  not  set, input parity checking is disabled.  This
> >      allows output parity generation without input parity errors.
> >      Note  that  whether input parity checking is enabled or dis-
> >      abled is independent of whether parity detection is  enabled
> >      or disabled. If parity detection is enabled but input parity
> >      checking is disabled, the hardware to which the terminal  is
> >      connected  will  recognize  the parity bit, but the terminal
> >      special file will not check whether this is set correctly or
> >      not.
> > 
> >      If IGNPAR is set, a  byte  with  framing  or  parity  errors
> >      (other than break) is ignored. This means that the data byte
> >      with the error is thrown away  by the  driver as if the byte
> >      had never been received. 
> > 
> > In short,
> > If INPCK is _not_ set, then all received data bytes will be 
> delivered 
> > to the user level, regardless of parity errors.
> > If IGNPAR is set, then only received data bytes that do not have 
> > parity errors will be delivered to the user level.
> > If PARENB is _not_ set, then the receiver hardware will not detect 
> > bad parity, so all received data bytes are considered free 
> of errors. 
> > Since there are no data bytes with associated error indications, 
> > setting IGNPAR would have no effect. All of the data are considered 
> > error free.
> 
> Your explanation makes sense to me. With this information I built the
> table:
>    IGNPAR    INPCK         ACTION:
>      0         0           Deliver all data to the user-level
>      0         1           Check parity. Discard erroneous bytes
>      1         0           ????
>      1         1           Check parity. Discard erroneous bytes 
> 
> What goes on ????   ?

   IGNPAR    INPCK         ACTION:
     0         0           Deliver all data to the user-level, as is.
     0         1           Deliver nulls in place of erroneous bytes
     1         0           Discard erroneous bytes, deliver the rest
     1         1           Discard erroneous bytes, deliver the rest 

IGNPAR gets processed before INPCK: 
(from drivers/char/n_tty.c:488)

static inline void n_tty_receive_parity_error(struct tty_struct *tty,
                                              unsigned char c)
{
        if (I_IGNPAR(tty)) {
                return;          /* discard data */
        }
        if (I_PARMRK(tty)) {
                put_tty_queue('\377', tty);
                put_tty_queue('\0', tty);
                put_tty_queue(c, tty);
        } else  if (I_INPCK(tty))
                put_tty_queue('\0', tty);     /* deliver null */
        else
                put_tty_queue(c, tty);        /* deliver data */
        wake_up_interruptible(&tty->read_wait);
}

> 
> > > 5 - If the TTY knows the data status (PARITY, FRAMING, 
> > > OVERRUN, NORMAL), 
> > > why the driver has to deal with the flag IGNPAR. Shouldn't 
> > > the TTY being 
> > > doing it ?
> > 
> > Not sure I understand the question. Received data does not carry any
> > information about errors with it after it leaves the driver, unless 
> > PARMRK is set. 
> 
> When the driver copy the data from the controler to the flip buffer it
> copies the data to the buffer tty->flip.char_buf_ptr and it set a flag
> (TTY_NORMAL, TTY_PARITY, TTY_FRAME, etc) on the buffer
> tty->flip.flag_buf_ptr telling the TTY how this byte was received. So
> the TTY knows if certain byte was problematic or not. Did you 
> understand my doubt know ?

Yes. I call that part a "line discipline". n_tty is the TTY line 
discipline that implements termio(s) and some legacy functionality.

And yes, for received data with parity errors, the line discipline 
handles IGNPAR, as well INPCK and PARMRK. See snippet of n_tty.c above. 

> 
> Thanks for your patience
> Henrique
> 

Cheers,
Ed

---------------------------------------------------------------- 
Ed Vance              edv (at) macrolink (dot) com
Macrolink, Inc.       1500 N. Kellogg Dr  Anaheim, CA  92807
----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: Interpretation of termios flags on a serial driver
@ 2003-03-27 16:41 Ed Vance
  0 siblings, 0 replies; 18+ messages in thread
From: Ed Vance @ 2003-03-27 16:41 UTC (permalink / raw)
  To: 'root@chaos.analogic.com'; +Cc: henrique.gobbi, linux-kernel

On Wed, Mar 26, 2003 at 5:41 PM, Richard B. Johnson wrote:
> 
> On Wed, 26 Mar 2003, Henrique Gobbi wrote:
> 
> > Thanks for the feedback.
> >
> > > If PARENB is set you generate parity. It is ODD parity if PARODD
> > > is set, otherwise it's EVEN. There is no provision to generate
> > > "stick parity" even though most UARTS will do that. When you
> > > generate parity, you can also ignore parity on received data if
> > > you want.  This is the IGNPAR flag.
> >
> > Ok. But, considering the 2 states of the flag IGNPAR, what 
> should the
> > driver do with the chars that are receiveid with wrong 
> parity, send this
> > data to the TTY with the flag TTY_PARITY or just discard this data ?
> >
> > regards
> > Henrique
> >
> 
> 
> If the IGNPAR flag is true, you keep the data. You pretend it's
> okay. Ignore parity means just that. Ignore it. You do not flag
> it in any way. This is essential. If you have a 7-bit link and
> somebody is sending you stick-parity, you can still use the data.
> 
Hi Richard,

Right idea, wrong flag.  ;-)

IGNPAR = 1  discard received data with parity errors. (ignore data)
INPCK = 0   deliver data with parity errors, as is.   (ignore error)

See 2.4/drivers/char/n_tty.c:~500

Cheers,
Ed

---------------------------------------------------------------- 
Ed Vance              edv (at) macrolink (dot) com
Macrolink, Inc.       1500 N. Kellogg Dr  Anaheim, CA  92807
----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: Interpretation of termios flags on a serial driver
@ 2003-03-27 17:00 Ed Vance
  0 siblings, 0 replies; 18+ messages in thread
From: Ed Vance @ 2003-03-27 17:00 UTC (permalink / raw)
  To: 'henrique.gobbi@cyclades.com'; +Cc: root, linux-kernel

On Wed, Mar 26, 2003 at 7:33 AM, Henrique Gobbi wrote:
> 
> Thanks for the feedback.
> 
> > If PARENB is set you generate parity. It is ODD parity if PARODD
> > is set, otherwise it's EVEN. There is no provision to generate
> > "stick parity" even though most UARTS will do that. When you
> > generate parity, you can also ignore parity on received data if
> > you want.  This is the IGNPAR flag.
> 
> Ok. But, considering the 2 states of the flag IGNPAR, what should the 
> driver do with the chars that are receiveid with wrong 
> parity, send this 
> data to the TTY with the flag TTY_PARITY or just discard this data ?
> 
Hi Henrique,

The driver should send all characters with parity errors to the line
discipline marked with TTY_PARITY. The driver is supposed to handle the
hardware. The line discipline is supposed to handle any higher level
protocol. Ideally, the driver should not know or care about the state of
flags like IGNPAR, that are not needed to configure the hardware. 

Two common exceptions are:

1. "smart" UART hardware that directly handles some of the higher level
protocol, so the driver needs to know the higher level settings so it can
configure the hardware properly.

2. defensive actions to avoid bogging down the whole system with interrupt
storms from noisy or unconnected modem status inputs, where the driver could
mask off interrupts on modem status when the higher level options dictate
that all such status will be ignored.

Cheers,
Ed

---------------------------------------------------------------- 
Ed Vance              edv (at) macrolink (dot) com
Macrolink, Inc.       1500 N. Kellogg Dr  Anaheim, CA  92807
----------------------------------------------------------------


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2003-03-27 19:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-06  0:19 Kernel Boot Speedup Ro0tSiEgE LKML
2003-03-06  0:44 ` Andy Pfiffer
2003-03-06  1:35   ` Adam Sulmicki
2003-03-06 10:01 ` Helge Hafting
2003-03-06 10:40   ` John Bradford
2003-03-26  9:23 ` Daniel Phillips
2003-03-26 14:51   ` Interpretation of termios flags on a serial driver Henrique Gobbi
2003-03-26 23:18     ` Richard B. Johnson
2003-03-26 15:33       ` Henrique Gobbi
2003-03-27  0:24         ` Russell King
2003-03-27  1:41         ` Richard B. Johnson
2003-03-27  1:01     ` Robert White
  -- strict thread matches above, loose matches on Subject: below --
2003-03-26 23:33 Ed Vance
2003-03-27  0:17 ` Henrique Gobbi
2003-03-27  0:59 Ed Vance
2003-03-27 19:06 ` David Lawyer
2003-03-27 16:41 Ed Vance
2003-03-27 17:00 Ed Vance

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.