mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Vandrovec <vandrove@vc.cvut.cz>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Pete Zaitcev <zaitcev@redhat.com>,
	Linux Kernel Development <linux-kernel@vger.kernel.org>,
	jsimmons@infradead.org
Subject: Re: Little console problem in 2.5.30
Date: Tue, 20 Aug 2002 03:25:08 +0200	[thread overview]
Message-ID: <20020820012508.GE6988@ppc.vc.cvut.cz> (raw)
In-Reply-To: <Pine.GSO.4.21.0208191433430.23654-100000@vervain.sonytel.be>

On Mon, Aug 19, 2002 at 02:36:25PM +0200, Geert Uytterhoeven wrote:
> On Mon, 19 Aug 2002, Pete Zaitcev wrote:
> > I would appreciate if someone would explain me if the attached patch
> > does the right thing. The problem is that I do not use the framebuffer,
> > and use a serial console. Whenever a legacy /sbin/init tries to
> > open /dev/tty0, the system oopses dereferencing conswitchp in
> > visual_init().
> 
> And this worked before?

I was simillary surprised when it happened (between 2.5.25 and 2.5.26 if
my memory serves correctly).
 
> conswitchp must never be NULL, say `conswitchp = &dummy_con;' in your setup.c
> if you have a serial console.

No, it does not work that way for very loooong... Just remove VGA device from
your box, VGA con_startup will fail and conswitchp will become NULL... And
in 2.5.26 more than 50% of archs (including i386) does not use dummy_con, it
leaves conswitchp uninitialized (== NULL).
 
> > diff -ur -X dontdiff linux-2.5.30-sp_pbk/drivers/char/console.c linux-2.5.30-sparc/drivers/char/console.c
> > --- linux-2.5.30-sp_pbk/drivers/char/console.c	Thu Aug  1 14:16:34 2002
> > +++ linux-2.5.30-sparc/drivers/char/console.c	Sun Aug 18 23:14:20 2002
> > @@ -652,7 +652,7 @@
> >  
> >  int vc_allocate(unsigned int currcons)	/* return 0 on success */
> >  {
> > -	if (currcons >= MAX_NR_CONSOLES)
> > +	if (currcons >= MAX_NR_CONSOLES || conswitchp == NULL)
> >  		return -ENXIO;
> >  	if (!vc_cons[currcons].d) {
> >  	    long p, q;

In 2.5.25 con_init and vty_init was one function, which checked conswitchp == NULL
at beginning. In 2.5.26 it was spilt down, and vty_init does no conswitchp checking,
it blindly registers console tty driver. Proper fix is putting

if (!conswitchp) return;

at the beginning of vty_init(), unless we support hotplug tty. If we support hotplug tty,
then your fix is probably correct, but it needs deeper inspection, as no tty code
ever expected conswitchp == NULL.
								Petr Vandrovec
								vandrove@vc.cvut.cz

  reply	other threads:[~2002-08-20  1:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-19  6:37 Pete Zaitcev
2002-08-19 12:36 ` Geert Uytterhoeven
2002-08-20  1:25   ` Petr Vandrovec [this message]
2002-08-24  4:57   ` Pete Zaitcev
2002-08-24  4:49     ` David S. Miller

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=20020820012508.GE6988@ppc.vc.cvut.cz \
    --to=vandrove@vc.cvut.cz \
    --cc=geert@linux-m68k.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zaitcev@redhat.com \
    /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

all inboxes | Powered by JetHome®