public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: avorontsov@ru.mvista.com
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Steven Rostedt <rostedt@goodmis.org>,
	Daniel Walker <dwalker@mvista.com>
Subject: Re: [PATCH] serial: 8250: fix shared interrupts issues with SMP and RT kernels
Date: Tue, 1 Jul 2008 14:43:53 +0100	[thread overview]
Message-ID: <20080701144353.7285805d@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <20080701134343.GA1865@polina.dev.rtsoft.ru>

> > again, please let the -rt maintainers sort out which patches need to be 
> > propagated to upstream maintainers.
> 
> This appears to be not only RT issue though. In theory, this can be

Agreed - RT is showing up a real bug here.

> triggered on SMP also. Thanks to Daniel Walker for pointing this out.

It looks correct to me except that you cannot use spin_lock/disable_irq
in that way safely. You must always disable_irq before taking the lock,
or prove it is safe and use disable_irq_nosync

The reason:
		CPU#0 spin_lock_... [taken]
		CPU#1 IRQ
		CPU#1 spin_lock [waits]
		CPU#0 disable_irq (deadlock)

Note that is also not generally safe to do

		disable IRQ on device
		spin_lock
		disable_irq

because IRQ propogation occurs asynchronously to PCI bus traffic even on
PC class systems (especially Pentium-PII era boxes with SMP). You can
disable the device IRQ and still have an IRQ 'in flight' that arrives
afterwards.

So the fix needs some reworking in its ordering I think

Alan

  reply	other threads:[~2008-07-01 14:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23 23:29 [PATCH -rt] serial: 8250: fix shared interrupts issues under RT kernels Anton Vorontsov
2008-06-24  0:12 ` Ingo Molnar
2008-07-01 13:43   ` [PATCH] serial: 8250: fix shared interrupts issues with SMP and " Anton Vorontsov
2008-07-01 13:43     ` Alan Cox [this message]
2008-07-01 15:02       ` [PATCH v2] " Anton Vorontsov
2008-07-09 19:29         ` Anton Vorontsov
2008-07-09 19:21           ` Alan Cox

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=20080701144353.7285805d@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=avorontsov@ru.mvista.com \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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