From: Stephen Hemminger <stephen@networkplumber.org>
To: "Zhou, Danny" <danny.zhou@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 1/2 kernel] uio: add irq control support to uio_pci_generic
Date: Wed, 15 Apr 2015 09:36:31 -0700 [thread overview]
Message-ID: <20150415093631.04e61313@urahara> (raw)
In-Reply-To: <20150415093420.6fc93b76@urahara>
The driver already supported INTX interrupts but had no in kernel
function to enable and disable them.
It is possible for userspace to do this by accessing PCI config
directly, but this racy and better handled by same mechanism
that already exists in kernel.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
Patch against latest 4.0 upstream kernel
--- a/drivers/uio/uio_pci_generic.c 2015-04-15 08:50:15.543900681 -0700
+++ b/drivers/uio/uio_pci_generic.c 2015-04-15 09:00:01.658609786 -0700
@@ -53,6 +53,18 @@ static irqreturn_t irqhandler(int irq, s
return IRQ_HANDLED;
}
+static int irqcontrol(struct uio_info *info, s32 irq_on)
+{
+ struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
+ struct pci_dev *pdev = gdev->pdev;
+
+ pci_cfg_access_lock(pdev);
+ pci_intx(pdev, irq_on);
+ pci_cfg_access_unlock(pdev);
+
+ return 0;
+}
+
static int probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
@@ -89,6 +101,7 @@ static int probe(struct pci_dev *pdev,
gdev->info.irq = pdev->irq;
gdev->info.irq_flags = IRQF_SHARED;
gdev->info.handler = irqhandler;
+ gdev->info.irqcontrol = irqcontrol;
gdev->pdev = pdev;
err = uio_register_device(&pdev->dev, &gdev->info);
next prev parent reply other threads:[~2015-04-15 16:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 1:06 [dpdk-dev] UIO pci-generic support broke igb_uio Stephen Hemminger
2015-04-15 7:19 ` Zhou, Danny
2015-04-15 15:57 ` Stephen Hemminger
2015-04-15 16:34 ` [dpdk-dev] [PATCH 0/2] fix UIO support broken by 2.0 Stephen Hemminger
2015-04-15 16:36 ` Stephen Hemminger [this message]
2015-04-15 16:38 ` [dpdk-dev] [PATCH 2/2 dpdk] uio: fix pci generic driver breakage Stephen Hemminger
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=20150415093631.04e61313@urahara \
--to=stephen@networkplumber.org \
--cc=danny.zhou@intel.com \
--cc=dev@dpdk.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).