All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David H. Lynch Jr." <dhlii@dlasys.net>
To: Peter Korsgaard <jacmet@sunsite.dk>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: [PATCH] Xilinx UART Lite 2.6.18 driver
Date: Fri, 27 Oct 2006 23:29:14 -0400	[thread overview]
Message-ID: <4542CE8A.9030904@dlasys.net> (raw)
In-Reply-To: <877iylreca.fsf@sleipner.barco.com>

Peter Korsgaard wrote:
>
>  static int __init ulite_console_setup(struct console *co, char *options)
>  {
> +	int i, ret;
>  	struct uart_port *port;
> -
> +	struct platform_device *pdev;
> +	
>  	if (co->index < 0 || co->index >= ULITE_NR_UARTS)
>  		return -EINVAL;
>
>  	port = &ports[co->index];
>
>  	/* not initialized yet? */
> -	if (!port->membase)
> -		return -ENODEV;
> +	if (!port->membase) {
> +		/* We might be early console */
>
> Is this really necessary? The platform probe get's called quite early, E.G.:
>
> Breakpoint 2, ulite_probe (pdev=0xc01c84d0) at drivers/serial/uartlite.c:392
    There is a substantial time/code difference between the time  
ulite_console_setup() is called and the time the platform device is 
initiallized.
    If you are actually doing board bringup, you want output as soon as 
you can get it and you do not want to have to stuff calls to 
ppc_md.progress() to do so.

    Regardless, I think this is an issue of style and personal preference.
   
> 392     {
> (gdb) print __log_buf 
> $1 = "<5>Linux version 2.6.19-rc3 (peko@sleipner) (gcc version 3.4.5) #19 Fri Oct 27 16:39:00 CEST 2006\n<6>Barco ThinLite (V2P) <peter.korsgaard@barco.com>\n<7>Entering add_active_range(0, 0, 15360) 0 entrie"...
>
> You can always use the ppc_md.progress() stuff for really early
> debugging if needed. I would prefer to keep this workaround out of
> uartlite.c if it isn't needed.
>
>   
   
    
   I will absolutely agree that trying to resolve the the 
dissimilarities between the console_setup() call and the platform device 
init  is ugly.
    But I would have changed the platform device init code to use 
the uart_port structure in the platform device data as all the other 
drivers that have early console support do.

    At some point I suspect a cleaner more structured approach to 
modularizing the relationship between  early serial code and serial 
drivers will force this issue one way or another.

    But for now, if you are not going to bother making console_settup() 
work you might as well not put the rest of the early serial code in at all.


-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein

  reply	other threads:[~2006-10-28  6:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-10 20:49 [PATCH] Xilinx UART Lite 2.6.18 driver David Bolcsfoldi
2006-10-10 22:04 ` Grant Likely
2006-10-11 22:06 ` David H. Lynch Jr.
2006-10-12 10:34 ` Peter Korsgaard
2006-10-12 21:12   ` David Bolcsfoldi
2006-10-13  5:21     ` David Bolcsfoldi
2006-10-13  7:04       ` David H. Lynch Jr.
2006-10-13  7:22         ` Peter Korsgaard
     [not found]           ` <45329C42.3030000@dlasys.net>
2006-10-16 19:42             ` Peter Korsgaard
2006-10-13  7:11       ` Peter Korsgaard
2006-10-15 23:48         ` David Bolcsfoldi
2006-10-20 19:41           ` Peter Korsgaard
2006-10-27 15:03             ` Peter Korsgaard
2006-10-28  3:29               ` David H. Lynch Jr. [this message]
2006-10-30  8:23                 ` Peter Korsgaard
2006-10-31 17:26                   ` David H. Lynch Jr.
2006-10-30 19:45               ` David Bolcsfoldi
2006-11-06 15:44                 ` Peter Korsgaard
2006-10-13  6:48     ` David H. Lynch Jr.
2006-10-13  7:15       ` Peter Korsgaard
2006-10-15 21:02         ` David H. Lynch Jr.
2006-10-16 19:49           ` Peter Korsgaard
2006-10-16 19:52           ` Peter Korsgaard
2006-10-13  7:08     ` Peter Korsgaard

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=4542CE8A.9030904@dlasys.net \
    --to=dhlii@dlasys.net \
    --cc=jacmet@sunsite.dk \
    --cc=linuxppc-embedded@ozlabs.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 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.