mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <andrewm@uow.edu.au>
To: James Simmons <jsimmons@suse.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	FrameBuffer List <linux-fbdev@vuser.vu.union.edu>,
	Linux console project <linuxconsole-dev@lists.sourceforge.net>
Subject: Re: console spin_lock
Date: Thu, 18 Jan 2001 00:49:37 +1100	[thread overview]
Message-ID: <3A65A2F1.690CD6CF@uow.edu.au> (raw)
In-Reply-To: <Pine.LNX.4.21.0101161554550.450-100000@euclid.oak.suse.com>


James Simmons wrote:
> 
> Some time ago a intel i810 framebuffer driver was written. It only worked
> for 2.2.X. With 2.4.X a spinlock is used in the upper layers of the
> console system. Sooner or later we are going to run into the situtation
> where we will have graphics hardware which has no vga core and wih be
> purely DMA/irq based (i.e i810). In this case using the current
> console_lock will block the driver itself. I have thought about a
> possible solution. A semaphore can't be used since their is a spin_lock
> in the console_softirq. Since this is in a interrupt context a
> semaphore can't be used. Another idea was to do a
> 
> void get_vc_lock(void)
> {
>         while (test_and_set_bit(0, &vc_var))
>                 ;
> }
> 
> Any better ideas?
> 

heh.

I'm actually planning on grabbing console_lock and thoroughly strangling
it
next week.  It can block interrupts for up to a second. That just isn't
civil.

- Use a semaphore for serialisation.
- For printk in interrupt context, grab the
  semaphore (yes, you can do this).
- If it couldn't be acquired from interrupt context,
  buffer the text in the log buffer and return.  The text will be
  printed by whoever holds the semaphore before they
  drop it.
- Special "system booting" mode which bypasses all this
  stuff.
- Special "oops in progress" mode which just
  punches through everything.
- Get rid of the special printk buffer - share the
  log buffer.  (Implies writes to console
  devices will be broken into two writes when they
  wrap around).
- Teach vsprintf to print into a circular buffer
  (snprintf thus comes for free).
- Get rid of all the printk deadlock opportunities (fourth
  attempt).
- Get rid of console_tasklet.  Do it in process context callback
  or just do it synchronously.

Assumption:
- Once the system is up and running, it's always safe to
  call down() when in_interrupt() returns false - probably
  not the case in parts of the exit path - tough.


Anyway, that's the thoughtware.  Sound sane?

-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-17 13:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-17  0:05 James Simmons
2001-01-17 13:49 ` Andrew Morton [this message]
2001-01-17 18:22   ` Roman Zippel
2001-01-17 23:40   ` James Simmons
2001-01-18 12:42     ` Andrew Morton
2001-01-18 21:50       ` Russell King
2001-01-19  1:23       ` James Simmons

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=3A65A2F1.690CD6CF@uow.edu.au \
    --to=andrewm@uow.edu.au \
    --cc=jsimmons@suse.com \
    --cc=linux-fbdev@vuser.vu.union.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxconsole-dev@lists.sourceforge.net \
    /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®