public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Reference counting in console uarts
Date: Sun, 8 Dec 2002 10:18:38 +0000	[thread overview]
Message-ID: <20021208101838.A30105@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20021208024336.A23637@devserv.devel.redhat.com>; from zaitcev@redhat.com on Sun, Dec 08, 2002 at 02:43:36AM -0500

On Sun, Dec 08, 2002 at 02:43:36AM -0500, Pete Zaitcev wrote:
> I boot my 2.5 boxes using "console=ttyS0,9600" argument,
> and I noticed that something is not right with reference
> counting in this case. It seems that when the console
> is open by kernel initially, this is not accounted
> as an open, and uart_startup is not called. This is ok,
> because the serial console is set up separately. However, later
> every script or a program run by init causes a startup
> and shutdown, literally dozens of them. These oscillations only
> stop when daemons are started and keep console open.

That is correct.  We are unable to call uart_startup when the serial
console is initialised because it may need to allocate memory (as
request_irq does) and the memory allocators may not have been
initialised.

There are two ways around this problem:

1. initialise the port into a state where it can send characters in the
   console write method.

2. don't do the actual hardware shutdown in your shutdown() method (but
   do the normal software shutdown - ie, free irqs etc)

8250 ports in effect implement the first - they don't really care about
their setup to send characters.  We just disable all interrupts from the
chip and then perform polled IO to the port.

In essence, you need your console write method to be able to send
charcters whether or not the port has been initialised or shutdown
by the conventional tty driver methods.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

      reply	other threads:[~2002-12-08 10:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-08  7:43 Reference counting in console uarts Pete Zaitcev
2002-12-08 10:18 ` Russell King [this message]

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=20021208101838.A30105@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --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