DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yongxin Liu <yongxin.liu@windriver.com>
To: <dev@dpdk.org>
Cc: <david.w.su@intel.com>, <stephen@networkplumber.org>,
	<ferruh.yigit@intel.com>, <anuj.mittal@intel.com>,
	<Kexin.Hao@windriver.com>, <Liezhi.Yang@windriver.com>
Subject: [dpdk-dev] [RFC] igb_uio: change ISR to be threaded when using with RT kernel
Date: Fri, 20 Sep 2019 08:45:25 +0800	[thread overview]
Message-ID: <20190920004525.18259-1-yongxin.liu@windriver.com> (raw)

When igb_uio driver is used with RT kernel, the interrupt handler
should not use IRQF_NO_THREAD as a flag, since uio_event_notify will
call rt_spin_lock which might sleep.

Here is the calltrace.

[ 2034.457805] Call Trace:
[ 2034.460818]  <IRQ>
[ 2034.463397]  dump_stack+0x70/0x9a
[ 2034.467281]  ___might_sleep.cold+0xe1/0xf2
[ 2034.471943]  rt_spin_lock+0x55/0x70
[ 2034.475994]  ? __wake_up_common_lock+0x61/0xb0
[ 2034.481004]  __wake_up_common_lock+0x61/0xb0
[ 2034.485842]  __wake_up+0x13/0x20
[ 2034.489635]  uio_event_notify+0x2c/0x50 [uio]
[ 2034.494560]  igbuio_pci_irqhandler+0x1f/0x40 [igb_uio]
[ 2034.500262]  __handle_irq_event_percpu+0x5f/0x3f0
[ 2034.505532]  ? cpuidle_enter_state+0xd3/0x500
[ 2034.510454]  handle_irq_event_percpu+0x4b/0x90
[ 2034.515462]  handle_irq_event+0x3c/0x5b
[ 2034.519864]  handle_edge_irq+0xbb/0x210
[ 2034.524264]  handle_irq+0x23/0x30
[ 2034.528143]  do_IRQ+0x7e/0x150
[ 2034.531764]  common_interrupt+0xf/0xf
[ 2034.535990]  </IRQ>

Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
---
 kernel/linux/igb_uio/igb_uio.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/kernel/linux/igb_uio/igb_uio.c b/kernel/linux/igb_uio/igb_uio.c
index 039f5a5f6..9d7380fb7 100644
--- a/kernel/linux/igb_uio/igb_uio.c
+++ b/kernel/linux/igb_uio/igb_uio.c
@@ -221,7 +221,6 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 		msix_entry.entry = 0;
 		if (pci_enable_msix(udev->pdev, &msix_entry, 1) == 0) {
 			dev_dbg(&udev->pdev->dev, "using MSI-X");
-			udev->info.irq_flags = IRQF_NO_THREAD;
 			udev->info.irq = msix_entry.vector;
 			udev->mode = RTE_INTR_MODE_MSIX;
 			break;
@@ -229,7 +228,6 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 #else
 		if (pci_alloc_irq_vectors(udev->pdev, 1, 1, PCI_IRQ_MSIX) == 1) {
 			dev_dbg(&udev->pdev->dev, "using MSI-X");
-			udev->info.irq_flags = IRQF_NO_THREAD;
 			udev->info.irq = pci_irq_vector(udev->pdev, 0);
 			udev->mode = RTE_INTR_MODE_MSIX;
 			break;
@@ -241,7 +239,6 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 #ifndef HAVE_ALLOC_IRQ_VECTORS
 		if (pci_enable_msi(udev->pdev) == 0) {
 			dev_dbg(&udev->pdev->dev, "using MSI");
-			udev->info.irq_flags = IRQF_NO_THREAD;
 			udev->info.irq = udev->pdev->irq;
 			udev->mode = RTE_INTR_MODE_MSI;
 			break;
@@ -249,7 +246,6 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 #else
 		if (pci_alloc_irq_vectors(udev->pdev, 1, 1, PCI_IRQ_MSI) == 1) {
 			dev_dbg(&udev->pdev->dev, "using MSI");
-			udev->info.irq_flags = IRQF_NO_THREAD;
 			udev->info.irq = pci_irq_vector(udev->pdev, 0);
 			udev->mode = RTE_INTR_MODE_MSI;
 			break;
@@ -259,7 +255,7 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 	case RTE_INTR_MODE_LEGACY:
 		if (pci_intx_mask_supported(udev->pdev)) {
 			dev_dbg(&udev->pdev->dev, "using INTX");
-			udev->info.irq_flags = IRQF_SHARED | IRQF_NO_THREAD;
+			udev->info.irq_flags = IRQF_SHARED;
 			udev->info.irq = udev->pdev->irq;
 			udev->mode = RTE_INTR_MODE_LEGACY;
 			break;
-- 
2.14.4


             reply	other threads:[~2019-09-20  0:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20  0:45 Yongxin Liu [this message]
2019-09-20  0:58 ` Liu, Yongxin

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=20190920004525.18259-1-yongxin.liu@windriver.com \
    --to=yongxin.liu@windriver.com \
    --cc=Kexin.Hao@windriver.com \
    --cc=Liezhi.Yang@windriver.com \
    --cc=anuj.mittal@intel.com \
    --cc=david.w.su@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).