linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Joakim Tjernlund" <Joakim.Tjernlund@lumentis.se>
To: "Dan Malek" <dan@embeddededge.com>
Cc: "Linuxppc-Embedded@Lists. Linuxppc. Org"
	<linuxppc-embedded@lists.linuxppc.org>
Subject: Re: [PATCH] 8xx_io/uart.c
Date: Mon, 10 Feb 2003 01:29:25 +0100	[thread overview]
Message-ID: <003b01c2d09b$77863e70$020120b0@jockeXP> (raw)
In-Reply-To: 3E46BF7E.3080408@embeddededge.com


> Joakim Tjernlund wrote:
>
> > Early printk's will call it too.
>
> They shouldn't.  All printk's prior to serial device initialization
> are queued in the log buffer.  After the serial device is initialized,
> the debug console is configured and only at that time will the printk
> information flow through the driver.  Anything queued up to that point
> is blasted out the driver.  There are lots of console drivers that
> will fail if Linux chooses to change this behavior.

Still the first half of the printk's has the if expression true, then it switch
to false for the remaing one's and stayed there during boot up.
This is how I tested it:
remove the *cp = 13 line and add:
if ((uint)(bdp->cbd_bufaddr) > (uint)IMAP_ADDR){
   cp = (u_char *)(bdp->cbd_bufaddr);
   *cp = 64;
} else {
   cp = info->tx_va_base + ((bdp - info->tx_bd_base) * TX_BUF_SIZE);
  *cp = 65;
}
Then just watch the a normal boot.
>
> > Now, why do you do the same thing just a few lines up if it wasn't needed?
>
> It is needed there.  These same functions support xmon and kgdb.  In order
> to do that the serial port is used in three different phases.  One, as it
> was configured by the boot rom/loader, two, by an early serial initialization
> before general memory management and buffering is available, and finally
> after the driver has been completely initialized.  None of this is needed
> to simply support the Linux console.  This has all been discussed too many
> times before....

I don't buy that it is needed only in one place but not the other.
Either none of them is needed or both. After a little investigation it looks like
none of them is needed, but I need to test that first to be sure.

These comments are also in there:
/*
 * We need to gracefully shut down the transmitter, disable
 * interrupts, then send our bytes out.
 */
and
/*
 * Finally, Wait for transmitter & holding register to empty
 *  and restore the IER
 */
and yet there is no sign of trying to do any of that.
Once user space gets going won't printk's from the kernel risk confusing
the real serial driver since interrupts are active?
This driver is not very easy to understand.

Also, the last 'if(info)' is rendundant. 'info' will never be NULL.
>
> > How about checking your own facts and provide an accurate analysis before
> > bitching at me for trying to help out?
>
> All I asked is you somehow show it is broken, and that something has
> been fixed before we start patching things.  If there is really something
> wrong with it, I would like to know what that is and how it is triggered.

OK, I was a little harsh, but your answer wasn't helping me much

>
> > I tested my how much I had increase them until I didn't lose any chars.
> > I don't think this has anything to do with HW flow control. The
> > smc runs out of BD's when trying to echo back the chars.
>
> Then, someone upstream isn't watching return values from these functions
> when the driver indicates there isn't space to output the characters.
> It isn't the responsibility of the serial driver to provide sufficient
> queueing for an arbitrary output request.  The depth of the fifo on the 8xx
> is much deeper than most silicon uarts, and if that isn't enough I suspect
> something outside of this driver is amiss (or interfaces have changed and
> this driver wasn't updated).

Yes, Paul Ruhland has found a bug in drivers/char/n_tty.c that explains
some of the problems I have seen.

   Jocke
PS.
    Could you please also comment on the enet.c driver patch I sent.
>
> Thanks.
>
> -- Dan


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2003-02-10  0:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-07 13:36 [PATCH] 8xx_io/uart.c Joakim Tjernlund
2003-02-07 16:08 ` Dan Malek
2003-02-07 17:21   ` Joakim Tjernlund
2003-02-09 20:52     ` Dan Malek
2003-02-10  0:29       ` Joakim Tjernlund [this message]
2003-02-10  1:08       ` Murray Jensen
2003-02-10 18:52         ` Dan Malek
2003-02-11  1:13           ` Murray Jensen
2003-02-11 16:40             ` Dan Malek
2003-02-11 23:11               ` Murray Jensen
2003-02-11 23:16               ` Murray Jensen
2003-02-11 18:56             ` Tom Rini
2003-02-11 11:16           ` Joakim Tjernlund
2003-02-11 16:03             ` Dan Malek
2003-02-11 18:07               ` Joakim Tjernlund
2003-02-11 23:54                 ` Paul Mackerras
2003-02-14 15:13                 ` Joakim Tjernlund
2003-02-14 20:12                   ` Dan Malek
2003-02-19  8:43   ` Joakim Tjernlund
  -- strict thread matches above, loose matches on Subject: below --
2003-02-07 16:54 Ruhland, Paul
2003-02-07 18:43 ` Joakim Tjernlund
2003-02-10 14:45 ` Joakim Tjernlund
2003-02-10 17:25   ` Tom Rini
2003-02-11  8:33     ` Joakim Tjernlund
     [not found] <dan@embeddededge.com>
     [not found] ` <3C98DA15.50302@embeddededge.com>
2002-03-21  1:11   ` EV-64260-BP & GT64260 bi_recs Murray Jensen
2002-03-21  6:50     ` Dan Malek
2002-03-21 11:05       ` Murray Jensen

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='003b01c2d09b$77863e70$020120b0@jockeXP' \
    --to=joakim.tjernlund@lumentis.se \
    --cc=dan@embeddededge.com \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).