]> git.openfabrics.org - ~emulex/for-vlad/compat-rdma.git/commitdiff
IB/qib: 3.12 backport patches
authorDennis Dalessandro <dennis.dalessandro@intel.com>
Mon, 30 Dec 2013 16:30:06 +0000 (11:30 -0500)
committerDennis Dalessandro <dennis.dalessandro@intel.com>
Thu, 9 Jan 2014 15:44:50 +0000 (10:44 -0500)
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
patches/0006-IB-qib-backport-qib_fs.c-before-2.6.35.patch [deleted file]
patches/0007-IB-qib-backport-3.2-for-pinned_vm-field.patch [deleted file]
patches/0008-IB-ipath-backport-qib_fs.c-before-2.6.35.patch [deleted file]
patches/0009-IB-ipath-backport-3.2-for-pinned_vm-field.patch [deleted file]
patches/0013-IB-qib-backport-qib_fs.c-before-2.6.35.patch [new file with mode: 0644]
patches/0014-IB-qib-backport-3.2-for-pinned_vm-field.patch [new file with mode: 0644]
patches/0015-IB-ipath-backport-qib_fs.c-before-2.6.35.patch [new file with mode: 0644]
patches/0016-IB-ipath-backport-3.2-for-pinned_vm-field.patch [new file with mode: 0644]
patches/0017-IB-qib-backport-3.12-struct-pci-changes.patch [new file with mode: 0644]
patches/0018-IB-qib-backport-before-idr-style-init.patch [new file with mode: 0644]

diff --git a/patches/0006-IB-qib-backport-qib_fs.c-before-2.6.35.patch b/patches/0006-IB-qib-backport-qib_fs.c-before-2.6.35.patch
deleted file mode 100644 (file)
index 2bab478..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-From: Mike Marciniszyn <mike.marciniszyn@intel.com>
-Subject: [PATCH] IB/qib: backport qib_fs.c before 2.6.35
-
-Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
----
- drivers/infiniband/hw/qib/qib_fs.c |   29 +++++++++++++++++++++++++++++
- 1 files changed, 29 insertions(+), 0 deletions(-)
-
-diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c
-index xxxxxxx..xxxxxxx xxxxxx
---- a/drivers/infiniband/hw/qib/qib_fs.c
-+++ b/drivers/infiniband/hw/qib/qib_fs.c
-@@ -58,7 +58,9 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
-               goto bail;
-       }
-+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
-       inode->i_ino = get_next_ino();
-+#endif
-       inode->i_mode = mode;
-       inode->i_uid = 0;
-       inode->i_gid = 0;
-@@ -453,14 +455,27 @@ static int remove_file(struct dentry *parent, char *name)
-               goto bail;
-       }
-+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
-+      spin_lock(&dcache_lock);
-+#endif
-       spin_lock(&tmp->d_lock);
-       if (!(d_unhashed(tmp) && tmp->d_inode)) {
-+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
-+              dget_locked(tmp);
-+#else
-               dget_dlock(tmp);
-+#endif
-               __d_drop(tmp);
-               spin_unlock(&tmp->d_lock);
-+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
-+              spin_unlock(&dcache_lock);
-+#endif
-               simple_unlink(parent->d_inode, tmp);
-       } else {
-               spin_unlock(&tmp->d_lock);
-+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
-+              spin_unlock(&dcache_lock);
-+#endif
-       }
-       ret = 0;
-@@ -552,6 +567,7 @@ bail:
-       return ret;
- }
-+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
- static struct dentry *qibfs_mount(struct file_system_type *fs_type, int flags,
-                       const char *dev_name, void *data)
- {
-@@ -559,6 +575,15 @@ static struct dentry *qibfs_mount(struct file_system_type *fs_type, int flags,
-       ret = mount_single(fs_type, flags, data, qibfs_fill_super);
-       if (!IS_ERR(ret))
-               qib_super = ret->d_sb;
-+#else
-+static int qibfs_get_sb(struct file_system_type *fs_type, int flags,
-+                      const char *dev_name, void *data, struct vfsmount *mnt)
-+{
-+      int ret = get_sb_single(fs_type, flags, data,
-+                                      qibfs_fill_super, mnt);
-+      if (ret >= 0)
-+              qib_super = mnt->mnt_sb;
-+#endif
-       return ret;
- }
-@@ -600,7 +625,11 @@ int qibfs_remove(struct qib_devdata *dd)
- static struct file_system_type qibfs_fs_type = {
-       .owner =        THIS_MODULE,
-       .name =         "ipathfs",
-+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
-       .mount =        qibfs_mount,
-+#else
-+      .get_sb =        qibfs_get_sb,
-+#endif
-       .kill_sb =      qibfs_kill_super,
- };
diff --git a/patches/0007-IB-qib-backport-3.2-for-pinned_vm-field.patch b/patches/0007-IB-qib-backport-3.2-for-pinned_vm-field.patch
deleted file mode 100644 (file)
index a57d331..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Mike Marciniszyn <mike.marciniszyn@intel.com>
-Subject: [PATCH] IB/qib: backport < 3.2 for pinned_vm field
-
-Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
----
- drivers/infiniband/hw/qib/qib_user_pages.c |    8 ++++++++
- 1 files changed, 8 insertions(+), 0 deletions(-)
-
-diff --git a/drivers/infiniband/hw/qib/qib_user_pages.c b/drivers/infiniband/hw/qib/qib_user_pages.c
-index xxxxxxx..xxxxxxx xxxxxx
---- a/drivers/infiniband/hw/qib/qib_user_pages.c
-+++ b/drivers/infiniband/hw/qib/qib_user_pages.c
-@@ -74,7 +74,11 @@ static int __qib_get_user_pages(unsigned long start_page, size_t num_pages,
-                       goto bail_release;
-       }
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
-       current->mm->pinned_vm += num_pages;
-+#else
-+      current->mm->locked_vm += num_pages;
-+#endif
-       ret = 0;
-       goto bail;
-@@ -151,7 +155,11 @@ void qib_release_user_pages(struct page **p, size_t num_pages)
-       __qib_release_user_pages(p, num_pages, 1);
-       if (current->mm) {
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
-               current->mm->pinned_vm -= num_pages;
-+#else
-+              current->mm->locked_vm -= num_pages;
-+#endif
-               up_write(&current->mm->mmap_sem);
-       }
- }
diff --git a/patches/0008-IB-ipath-backport-qib_fs.c-before-2.6.35.patch b/patches/0008-IB-ipath-backport-qib_fs.c-before-2.6.35.patch
deleted file mode 100644 (file)
index b751b78..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-From: Mike Marciniszyn <mike.marciniszyn@intel.com>
-Subject: [PATCH] IB/ipath: backport qib_fs.c before 2.6.35
-
-Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
----
- drivers/infiniband/hw/ipath/ipath_fs.c |   26 ++++++++++++++++++++++++++
- 1 files changed, 26 insertions(+), 0 deletions(-)
-
-diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
-index xxxxxxx..xxxxxxx xxxxxx
---- a/drivers/infiniband/hw/ipath/ipath_fs.c
-+++ b/drivers/infiniband/hw/ipath/ipath_fs.c
-@@ -57,7 +57,9 @@ static int ipathfs_mknod(struct inode *dir, struct dentry *dentry,
-               goto bail;
-       }
-+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
-       inode->i_ino = get_next_ino();
-+#endif
-       inode->i_mode = mode;
-       inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
-       inode->i_private = data;
-@@ -277,11 +279,21 @@ static int remove_file(struct dentry *parent, char *name)
-               goto bail;
-       }
-+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
-+      spin_lock(&dcache_lock);
-+#endif
-       spin_lock(&tmp->d_lock);
-       if (!(d_unhashed(tmp) && tmp->d_inode)) {
-+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
-+              dget_locked(tmp);
-+#else
-               dget_dlock(tmp);
-+#endif
-               __d_drop(tmp);
-               spin_unlock(&tmp->d_lock);
-+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
-+              spin_unlock(&dcache_lock);
-+#endif
-               simple_unlink(parent->d_inode, tmp);
-       } else
-               spin_unlock(&tmp->d_lock);
-@@ -358,6 +370,7 @@ bail:
-       return ret;
- }
-+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
- static struct dentry *ipathfs_mount(struct file_system_type *fs_type,
-                       int flags, const char *dev_name, void *data)
- {
-@@ -365,6 +378,15 @@ static struct dentry *ipathfs_mount(struct file_system_type *fs_type,
-       ret = mount_single(fs_type, flags, data, ipathfs_fill_super);
-       if (!IS_ERR(ret))
-               ipath_super = ret->d_sb;
-+#else
-+static int ipathfs_get_sb(struct file_system_type *fs_type, int flags,
-+                      const char *dev_name, void *data, struct vfsmount *mnt)
-+{
-+      int ret = get_sb_single(fs_type, flags, data,
-+                                      ipathfs_fill_super, mnt);
-+      if (ret >= 0)
-+              ipath_super = mnt->mnt_sb;
-+#endif
-       return ret;
- }
-@@ -407,7 +429,11 @@ bail:
- static struct file_system_type ipathfs_fs_type = {
-       .owner =        THIS_MODULE,
-       .name =         "ipathfs",
-+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
-       .mount =        ipathfs_mount,
-+#else
-+      .get_sb =   ipathfs_get_sb,
-+#endif
-       .kill_sb =      ipathfs_kill_super,
- };
diff --git a/patches/0009-IB-ipath-backport-3.2-for-pinned_vm-field.patch b/patches/0009-IB-ipath-backport-3.2-for-pinned_vm-field.patch
deleted file mode 100644 (file)
index d8d2291..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-From: Mike Marciniszyn <mike.marciniszyn@intel.com>
-Subject: [PATCH] IB/ipath: backport < 3.2 for pinned_vm field
-
-Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
----
- drivers/infiniband/hw/ipath/ipath_user_pages.c |   12 ++++++++++++
- 1 files changed, 12 insertions(+), 0 deletions(-)
-
-diff --git a/drivers/infiniband/hw/ipath/ipath_user_pages.c b/drivers/infiniband/hw/ipath/ipath_user_pages.c
-index xxxxxxx..xxxxxxx xxxxxx
---- a/drivers/infiniband/hw/ipath/ipath_user_pages.c
-+++ b/drivers/infiniband/hw/ipath/ipath_user_pages.c
-@@ -79,7 +79,11 @@ static int __ipath_get_user_pages(unsigned long start_page, size_t num_pages,
-                       goto bail_release;
-       }
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
-       current->mm->pinned_vm += num_pages;
-+#else
-+      current->mm->locked_vm += num_pages;
-+#endif
-       ret = 0;
-       goto bail;
-@@ -178,7 +182,11 @@ void ipath_release_user_pages(struct page **p, size_t num_pages)
-       __ipath_release_user_pages(p, num_pages, 1);
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
-       current->mm->pinned_vm -= num_pages;
-+#else
-+      current->mm->locked_vm -= num_pages;
-+#endif
-       up_write(&current->mm->mmap_sem);
- }
-@@ -195,7 +203,11 @@ static void user_pages_account(struct work_struct *_work)
-               container_of(_work, struct ipath_user_pages_work, work);
-       down_write(&work->mm->mmap_sem);
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
-       work->mm->pinned_vm -= work->num_pages;
-+#else
-+      work->mm->locked_vm -= work->num_pages;
-+#endif
-       up_write(&work->mm->mmap_sem);
-       mmput(work->mm);
-       kfree(work);
diff --git a/patches/0013-IB-qib-backport-qib_fs.c-before-2.6.35.patch b/patches/0013-IB-qib-backport-qib_fs.c-before-2.6.35.patch
new file mode 100644 (file)
index 0000000..2bab478
--- /dev/null
@@ -0,0 +1,86 @@
+From: Mike Marciniszyn <mike.marciniszyn@intel.com>
+Subject: [PATCH] IB/qib: backport qib_fs.c before 2.6.35
+
+Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
+---
+ drivers/infiniband/hw/qib/qib_fs.c |   29 +++++++++++++++++++++++++++++
+ 1 files changed, 29 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c
+index xxxxxxx..xxxxxxx xxxxxx
+--- a/drivers/infiniband/hw/qib/qib_fs.c
++++ b/drivers/infiniband/hw/qib/qib_fs.c
+@@ -58,7 +58,9 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
+               goto bail;
+       }
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
+       inode->i_ino = get_next_ino();
++#endif
+       inode->i_mode = mode;
+       inode->i_uid = 0;
+       inode->i_gid = 0;
+@@ -453,14 +455,27 @@ static int remove_file(struct dentry *parent, char *name)
+               goto bail;
+       }
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
++      spin_lock(&dcache_lock);
++#endif
+       spin_lock(&tmp->d_lock);
+       if (!(d_unhashed(tmp) && tmp->d_inode)) {
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
++              dget_locked(tmp);
++#else
+               dget_dlock(tmp);
++#endif
+               __d_drop(tmp);
+               spin_unlock(&tmp->d_lock);
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
++              spin_unlock(&dcache_lock);
++#endif
+               simple_unlink(parent->d_inode, tmp);
+       } else {
+               spin_unlock(&tmp->d_lock);
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
++              spin_unlock(&dcache_lock);
++#endif
+       }
+       ret = 0;
+@@ -552,6 +567,7 @@ bail:
+       return ret;
+ }
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
+ static struct dentry *qibfs_mount(struct file_system_type *fs_type, int flags,
+                       const char *dev_name, void *data)
+ {
+@@ -559,6 +575,15 @@ static struct dentry *qibfs_mount(struct file_system_type *fs_type, int flags,
+       ret = mount_single(fs_type, flags, data, qibfs_fill_super);
+       if (!IS_ERR(ret))
+               qib_super = ret->d_sb;
++#else
++static int qibfs_get_sb(struct file_system_type *fs_type, int flags,
++                      const char *dev_name, void *data, struct vfsmount *mnt)
++{
++      int ret = get_sb_single(fs_type, flags, data,
++                                      qibfs_fill_super, mnt);
++      if (ret >= 0)
++              qib_super = mnt->mnt_sb;
++#endif
+       return ret;
+ }
+@@ -600,7 +625,11 @@ int qibfs_remove(struct qib_devdata *dd)
+ static struct file_system_type qibfs_fs_type = {
+       .owner =        THIS_MODULE,
+       .name =         "ipathfs",
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
+       .mount =        qibfs_mount,
++#else
++      .get_sb =        qibfs_get_sb,
++#endif
+       .kill_sb =      qibfs_kill_super,
+ };
diff --git a/patches/0014-IB-qib-backport-3.2-for-pinned_vm-field.patch b/patches/0014-IB-qib-backport-3.2-for-pinned_vm-field.patch
new file mode 100644 (file)
index 0000000..a57d331
--- /dev/null
@@ -0,0 +1,36 @@
+From: Mike Marciniszyn <mike.marciniszyn@intel.com>
+Subject: [PATCH] IB/qib: backport < 3.2 for pinned_vm field
+
+Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
+---
+ drivers/infiniband/hw/qib/qib_user_pages.c |    8 ++++++++
+ 1 files changed, 8 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/infiniband/hw/qib/qib_user_pages.c b/drivers/infiniband/hw/qib/qib_user_pages.c
+index xxxxxxx..xxxxxxx xxxxxx
+--- a/drivers/infiniband/hw/qib/qib_user_pages.c
++++ b/drivers/infiniband/hw/qib/qib_user_pages.c
+@@ -74,7 +74,11 @@ static int __qib_get_user_pages(unsigned long start_page, size_t num_pages,
+                       goto bail_release;
+       }
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+       current->mm->pinned_vm += num_pages;
++#else
++      current->mm->locked_vm += num_pages;
++#endif
+       ret = 0;
+       goto bail;
+@@ -151,7 +155,11 @@ void qib_release_user_pages(struct page **p, size_t num_pages)
+       __qib_release_user_pages(p, num_pages, 1);
+       if (current->mm) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+               current->mm->pinned_vm -= num_pages;
++#else
++              current->mm->locked_vm -= num_pages;
++#endif
+               up_write(&current->mm->mmap_sem);
+       }
+ }
diff --git a/patches/0015-IB-ipath-backport-qib_fs.c-before-2.6.35.patch b/patches/0015-IB-ipath-backport-qib_fs.c-before-2.6.35.patch
new file mode 100644 (file)
index 0000000..b751b78
--- /dev/null
@@ -0,0 +1,80 @@
+From: Mike Marciniszyn <mike.marciniszyn@intel.com>
+Subject: [PATCH] IB/ipath: backport qib_fs.c before 2.6.35
+
+Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
+---
+ drivers/infiniband/hw/ipath/ipath_fs.c |   26 ++++++++++++++++++++++++++
+ 1 files changed, 26 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
+index xxxxxxx..xxxxxxx xxxxxx
+--- a/drivers/infiniband/hw/ipath/ipath_fs.c
++++ b/drivers/infiniband/hw/ipath/ipath_fs.c
+@@ -57,7 +57,9 @@ static int ipathfs_mknod(struct inode *dir, struct dentry *dentry,
+               goto bail;
+       }
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
+       inode->i_ino = get_next_ino();
++#endif
+       inode->i_mode = mode;
+       inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+       inode->i_private = data;
+@@ -277,11 +279,21 @@ static int remove_file(struct dentry *parent, char *name)
+               goto bail;
+       }
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
++      spin_lock(&dcache_lock);
++#endif
+       spin_lock(&tmp->d_lock);
+       if (!(d_unhashed(tmp) && tmp->d_inode)) {
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
++              dget_locked(tmp);
++#else
+               dget_dlock(tmp);
++#endif
+               __d_drop(tmp);
+               spin_unlock(&tmp->d_lock);
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
++              spin_unlock(&dcache_lock);
++#endif
+               simple_unlink(parent->d_inode, tmp);
+       } else
+               spin_unlock(&tmp->d_lock);
+@@ -358,6 +370,7 @@ bail:
+       return ret;
+ }
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
+ static struct dentry *ipathfs_mount(struct file_system_type *fs_type,
+                       int flags, const char *dev_name, void *data)
+ {
+@@ -365,6 +378,15 @@ static struct dentry *ipathfs_mount(struct file_system_type *fs_type,
+       ret = mount_single(fs_type, flags, data, ipathfs_fill_super);
+       if (!IS_ERR(ret))
+               ipath_super = ret->d_sb;
++#else
++static int ipathfs_get_sb(struct file_system_type *fs_type, int flags,
++                      const char *dev_name, void *data, struct vfsmount *mnt)
++{
++      int ret = get_sb_single(fs_type, flags, data,
++                                      ipathfs_fill_super, mnt);
++      if (ret >= 0)
++              ipath_super = mnt->mnt_sb;
++#endif
+       return ret;
+ }
+@@ -407,7 +429,11 @@ bail:
+ static struct file_system_type ipathfs_fs_type = {
+       .owner =        THIS_MODULE,
+       .name =         "ipathfs",
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
+       .mount =        ipathfs_mount,
++#else
++      .get_sb =   ipathfs_get_sb,
++#endif
+       .kill_sb =      ipathfs_kill_super,
+ };
diff --git a/patches/0016-IB-ipath-backport-3.2-for-pinned_vm-field.patch b/patches/0016-IB-ipath-backport-3.2-for-pinned_vm-field.patch
new file mode 100644 (file)
index 0000000..d8d2291
--- /dev/null
@@ -0,0 +1,48 @@
+From: Mike Marciniszyn <mike.marciniszyn@intel.com>
+Subject: [PATCH] IB/ipath: backport < 3.2 for pinned_vm field
+
+Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
+---
+ drivers/infiniband/hw/ipath/ipath_user_pages.c |   12 ++++++++++++
+ 1 files changed, 12 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/infiniband/hw/ipath/ipath_user_pages.c b/drivers/infiniband/hw/ipath/ipath_user_pages.c
+index xxxxxxx..xxxxxxx xxxxxx
+--- a/drivers/infiniband/hw/ipath/ipath_user_pages.c
++++ b/drivers/infiniband/hw/ipath/ipath_user_pages.c
+@@ -79,7 +79,11 @@ static int __ipath_get_user_pages(unsigned long start_page, size_t num_pages,
+                       goto bail_release;
+       }
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+       current->mm->pinned_vm += num_pages;
++#else
++      current->mm->locked_vm += num_pages;
++#endif
+       ret = 0;
+       goto bail;
+@@ -178,7 +182,11 @@ void ipath_release_user_pages(struct page **p, size_t num_pages)
+       __ipath_release_user_pages(p, num_pages, 1);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+       current->mm->pinned_vm -= num_pages;
++#else
++      current->mm->locked_vm -= num_pages;
++#endif
+       up_write(&current->mm->mmap_sem);
+ }
+@@ -195,7 +203,11 @@ static void user_pages_account(struct work_struct *_work)
+               container_of(_work, struct ipath_user_pages_work, work);
+       down_write(&work->mm->mmap_sem);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+       work->mm->pinned_vm -= work->num_pages;
++#else
++      work->mm->locked_vm -= work->num_pages;
++#endif
+       up_write(&work->mm->mmap_sem);
+       mmput(work->mm);
+       kfree(work);
diff --git a/patches/0017-IB-qib-backport-3.12-struct-pci-changes.patch b/patches/0017-IB-qib-backport-3.12-struct-pci-changes.patch
new file mode 100644 (file)
index 0000000..13bdf33
--- /dev/null
@@ -0,0 +1,72 @@
+Deal with struct pci changes.
+
+From: Dennis Dalessandro <dennis.dalessandro@intel.com>
+
+
+---
+ drivers/infiniband/hw/qib/qib_pcie.c |   21 +++++++++++++++++++++
+ 1 files changed, 21 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/infiniband/hw/qib/qib_pcie.c b/drivers/infiniband/hw/qib/qib_pcie.c
+index 3f14009..340845c 100644
+--- a/drivers/infiniband/hw/qib/qib_pcie.c
++++ b/drivers/infiniband/hw/qib/qib_pcie.c
+@@ -283,12 +283,20 @@ int qib_pcie_params(struct qib_devdata *dd, u32 minw, u32 *nent,
+               goto bail;
+       }
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0))
++      pos = pci_find_capability(dd->pcidev, PCI_CAP_ID_MSIX);
++#else
+       pos = dd->pcidev->msix_cap;
++#endif
+       if (nent && *nent && pos) {
+               qib_msix_setup(dd, pos, nent, entry);
+               ret = 0; /* did it, either MSIx or INTx */
+       } else {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0))
++              pos = pci_find_capability(dd->pcidev, PCI_CAP_ID_MSI);
++#else
+               pos = dd->pcidev->msi_cap;
++#endif                
+               if (pos)
+                       ret = qib_msi_setup(dd, pos);
+               else
+@@ -357,7 +365,11 @@ int qib_reinit_intr(struct qib_devdata *dd)
+       if (!dd->msi_lo)
+               goto bail;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0))
++      pos = pci_find_capability(dd->pcidev, PCI_CAP_ID_MSI);
++#else
+       pos = dd->pcidev->msi_cap;
++#endif
+       if (!pos) {
+               qib_dev_err(dd,
+                       "Can't find MSI capability, can't restore MSI settings\n");
+@@ -425,8 +437,12 @@ void qib_enable_intx(struct pci_dev *pdev)
+       new = cw & ~PCI_COMMAND_INTX_DISABLE;
+       if (new != cw)
+               pci_write_config_word(pdev, PCI_COMMAND, new);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0))
++      pos = pci_find_capability(pdev, PCI_CAP_ID_MSI);
++#else
+       pos = pdev->msi_cap;
++#endif        
+       if (pos) {
+               /* then turn off MSI */
+               pci_read_config_word(pdev, pos + PCI_MSI_FLAGS, &cw);
+@@ -434,7 +450,12 @@ void qib_enable_intx(struct pci_dev *pdev)
+               if (new != cw)
+                       pci_write_config_word(pdev, pos + PCI_MSI_FLAGS, new);
+       }
++      
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0))
++      pos = pci_find_capability(pdev, PCI_CAP_ID_MSIX);
++#else
+       pos = pdev->msix_cap;
++#endif
+       if (pos) {
+               /* then turn off MSIx */
+               pci_read_config_word(pdev, pos + PCI_MSIX_FLAGS, &cw);
diff --git a/patches/0018-IB-qib-backport-before-idr-style-init.patch b/patches/0018-IB-qib-backport-before-idr-style-init.patch
new file mode 100644 (file)
index 0000000..3d422b3
--- /dev/null
@@ -0,0 +1,66 @@
+Work around new idr style
+
+From: Dennis Dalessandro <dennis.dalessandro@intel.com>
+
+
+---
+ drivers/infiniband/hw/qib/qib_init.c |   23 +++++++++++++++++++++--
+ 1 files changed, 21 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/infiniband/hw/qib/qib_init.c b/drivers/infiniband/hw/qib/qib_init.c
+index 24e802f..6dcb460 100644
+--- a/drivers/infiniband/hw/qib/qib_init.c
++++ b/drivers/infiniband/hw/qib/qib_init.c
+@@ -1096,6 +1096,12 @@ struct qib_devdata *qib_alloc_devdata(struct pci_dev *pdev, size_t extra)
+       struct qib_devdata *dd;
+       int ret;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0))
++      if (!idr_pre_get(&qib_unit_table, GFP_KERNEL)) {
++              dd = ERR_PTR(-ENOMEM);
++              goto bail;
++      }
++#endif
+       dd = (struct qib_devdata *) ib_alloc_device(sizeof(*dd) + extra);
+       if (!dd) {
+               dd = ERR_PTR(-ENOMEM);
+@@ -1106,6 +1112,7 @@ struct qib_devdata *qib_alloc_devdata(struct pci_dev *pdev, size_t extra)
+       qib_dbg_ibdev_init(&dd->verbs_dev);
+ #endif
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
+       idr_preload(GFP_KERNEL);
+       spin_lock_irqsave(&qib_devs_lock, flags);
+@@ -1114,10 +1121,15 @@ struct qib_devdata *qib_alloc_devdata(struct pci_dev *pdev, size_t extra)
+               dd->unit = ret;
+               list_add(&dd->list, &qib_dev_list);
+       }
+-
+       spin_unlock_irqrestore(&qib_devs_lock, flags);
+       idr_preload_end();
+-
++#else
++      spin_lock_irqsave(&qib_devs_lock, flags);
++      ret = idr_get_new(&qib_unit_table, dd, &dd->unit);
++      if (ret >= 0)
++              list_add(&dd->list, &qib_dev_list);
++      spin_unlock_irqrestore(&qib_devs_lock, flags);
++#endif
+       if (ret < 0) {
+               qib_early_err(&pdev->dev,
+                             "Could not allocate unit ID: error %d\n", -ret);
+@@ -1247,6 +1259,13 @@ static int __init qlogic_ib_init(void)
+        * the PCI subsystem.
+        */
+       idr_init(&qib_unit_table);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0))
++      if (!idr_pre_get(&qib_unit_table, GFP_KERNEL)) {
++              pr_err("idr_pre_get() failed\n");
++              ret = -ENOMEM;
++              goto bail_dev;
++      }
++#endif
+ #ifdef CONFIG_INFINIBAND_QIB_DCA
+       dca_register_notify(&dca_notifier);