mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valentin Rothberg <Valentin.Rothberg@lip6.fr>
To: corbet@lwn.net, bhelgaas@google.com, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Valentin Rothberg <Valentin.Rothberg@lip6.fr>
Subject: [PATCH v2] MSI-HOWTO.txt: remove reference on IRQF_DISABLED
Date: Fri, 27 Feb 2015 12:55:16 +0100	[thread overview]
Message-ID: <1425038116-19227-1-git-send-email-Valentin.Rothberg@lip6.fr> (raw)

The IRQF_DISABLED is a NOOP and scheduled to be removed.  According to
Ingo Molnar (e58aa3d2d0cc01ad8d6f7f640a0670433f794922) running IRQ
handlers with interrupts enabled can cause stack overflows when the
interrupt line of the issuing device is still active.

This patch removes IRQF_DISABLED from this documentation.  It was
mentioned to be a solution to avoid deadlocks when a device uses
multiple interrupts.  As the flag is a NOOP this solution does not work
anymore.

Signed-off-by: Valentin Rothberg <Valentin.Rothberg@lip6.fr>
---
v2: Remove following paragraph (If your MSI [...]) since there is only
one solution left.
---
 Documentation/PCI/MSI-HOWTO.txt | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/Documentation/PCI/MSI-HOWTO.txt b/Documentation/PCI/MSI-HOWTO.txt
index 0d920d5..63def8ef 100644
--- a/Documentation/PCI/MSI-HOWTO.txt
+++ b/Documentation/PCI/MSI-HOWTO.txt
@@ -501,18 +501,9 @@ necessary to disable interrupts (Linux guarantees the same interrupt will
 not be re-entered).  If a device uses multiple interrupts, the driver
 must disable interrupts while the lock is held.  If the device sends
 a different interrupt, the driver will deadlock trying to recursively
-acquire the spinlock.
-
-There are two solutions.  The first is to take the lock with
-spin_lock_irqsave() or spin_lock_irq() (see
-Documentation/DocBook/kernel-locking).  The second is to specify
-IRQF_DISABLED to request_irq() so that the kernel runs the entire
-interrupt routine with interrupts disabled.
-
-If your MSI interrupt routine does not hold the lock for the whole time
-it is running, the first solution may be best.  The second solution is
-normally preferred as it avoids making two transitions from interrupt
-disabled to enabled and back again.
+acquire the spinlock.  Such deadlocks can be avoided by using
+spin_lock_irqsave() or spin_lock_irq() which disable local interrupts
+and acquire the lock (see Documentation/DocBook/kernel-locking).
 
 4.6 How to tell whether MSI/MSI-X is enabled on a device
 
-- 
1.9.1


             reply	other threads:[~2015-02-27 11:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 11:55 Valentin Rothberg [this message]
2015-02-27 22:17 ` Jonathan Corbet
2015-02-27 22:22   ` Valentin Rothberg

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=1425038116-19227-1-git-send-email-Valentin.Rothberg@lip6.fr \
    --to=valentin.rothberg@lip6.fr \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 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®