summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic/host/mic_main.c
diff options
context:
space:
mode:
authorDasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>2013-09-05 16:41:41 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-26 13:50:56 -0700
commita01e28f692088e9789ebb0c374fdac83de59899b (patch)
treeb422484ed67ac5c42111bfc117d7f71b2770c295 /drivers/misc/mic/host/mic_main.c
parentb170d8ce3f81bd97e85756e9184779a56a5f55a7 (diff)
downloadtalos-op-linux-a01e28f692088e9789ebb0c374fdac83de59899b.tar.gz
talos-op-linux-a01e28f692088e9789ebb0c374fdac83de59899b.zip
Intel MIC Host Driver Interrupt/SMPT support.
This patch enables the following features: a) MSIx, MSI and legacy interrupt support. b) System Memory Page Table(SMPT) support. SMPT enables system memory access from the card. On X100 devices the host can program 32 SMPT registers each capable of accessing 16GB of system memory address space from X100 devices. The registers can thereby be used to access a cumulative 512GB of system memory address space from X100 devices at any point in time. Co-author: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Caz Yokoyama <Caz.Yokoyama@intel.com> Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Harshavardhan R Kharche <harshavardhan.r.kharche@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Acked-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mic/host/mic_main.c')
-rw-r--r--drivers/misc/mic/host/mic_main.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/misc/mic/host/mic_main.c b/drivers/misc/mic/host/mic_main.c
index 228c96c04a03..332a15e4215b 100644
--- a/drivers/misc/mic/host/mic_main.c
+++ b/drivers/misc/mic/host/mic_main.c
@@ -23,13 +23,13 @@
* 2) Enable per vring interrupt support.
*/
#include <linux/fs.h>
-#include <linux/idr.h>
#include <linux/module.h>
#include <linux/pci.h>
#include "../common/mic_device.h"
#include "mic_device.h"
#include "mic_x100.h"
+#include "mic_smpt.h"
static const char mic_driver_name[] = "mic";
@@ -75,6 +75,8 @@ static void mic_ops_init(struct mic_device *mdev)
switch (mdev->family) {
case MIC_FAMILY_X100:
mdev->ops = &mic_x100_ops;
+ mdev->intr_ops = &mic_x100_intr_ops;
+ mdev->smpt_ops = &mic_x100_smpt_ops;
break;
default:
break;
@@ -132,6 +134,8 @@ mic_device_init(struct mic_device *mdev, struct pci_dev *pdev)
mdev->stepping = pdev->revision;
mic_ops_init(mdev);
mic_sysfs_init(mdev);
+ mutex_init(&mdev->mic_mutex);
+ mdev->irq_info.next_avail_src = 0;
}
/**
@@ -201,6 +205,18 @@ static int mic_probe(struct pci_dev *pdev,
goto unmap_mmio;
}
+ mdev->intr_ops->intr_init(mdev);
+ rc = mic_setup_interrupts(mdev, pdev);
+ if (rc) {
+ dev_err(&pdev->dev, "mic_setup_interrupts failed %d\n", rc);
+ goto unmap_aper;
+ }
+ rc = mic_smpt_init(mdev);
+ if (rc) {
+ dev_err(&pdev->dev, "smpt_init failed %d\n", rc);
+ goto free_interrupts;
+ }
+
pci_set_drvdata(pdev, mdev);
mdev->sdev = device_create_with_groups(g_mic_class, &pdev->dev,
@@ -210,9 +226,13 @@ static int mic_probe(struct pci_dev *pdev,
rc = PTR_ERR(mdev->sdev);
dev_err(&pdev->dev,
"device_create_with_groups failed rc %d\n", rc);
- goto unmap_aper;
+ goto smpt_uninit;
}
return 0;
+smpt_uninit:
+ mic_smpt_uninit(mdev);
+free_interrupts:
+ mic_free_interrupts(mdev, pdev);
unmap_aper:
iounmap(mdev->aper.va);
unmap_mmio:
@@ -246,6 +266,8 @@ static void mic_remove(struct pci_dev *pdev)
return;
device_destroy(g_mic_class, MKDEV(MAJOR(g_mic_devno), mdev->id));
+ mic_smpt_uninit(mdev);
+ mic_free_interrupts(mdev, pdev);
iounmap(mdev->mmio.va);
iounmap(mdev->aper.va);
pci_release_regions(pdev);
OpenPOWER on IntegriCloud