aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/qib/qib_diag.c13
-rw-r--r--drivers/infiniband/hw/qib/qib_driver.c15
-rw-r--r--drivers/infiniband/hw/qib/qib_eeprom.c41
-rw-r--r--drivers/infiniband/hw/qib/qib_file_ops.c63
-rw-r--r--drivers/infiniband/hw/qib/qib_fs.c21
-rw-r--r--drivers/infiniband/hw/qib/qib_iba6120.c91
-rw-r--r--drivers/infiniband/hw/qib/qib_iba7220.c92
-rw-r--r--drivers/infiniband/hw/qib/qib_iba7322.c148
-rw-r--r--drivers/infiniband/hw/qib/qib_init.c97
-rw-r--r--drivers/infiniband/hw/qib/qib_intr.c8
-rw-r--r--drivers/infiniband/hw/qib/qib_pcie.c23
-rw-r--r--drivers/infiniband/hw/qib/qib_sd7220.c41
-rw-r--r--drivers/infiniband/hw/qib/qib_sdma.c11
-rw-r--r--drivers/infiniband/hw/qib/qib_sysfs.c88
-rw-r--r--drivers/infiniband/hw/qib/qib_twsi.c8
-rw-r--r--drivers/infiniband/hw/qib/qib_wc_x86_64.c14
16 files changed, 394 insertions, 380 deletions
diff --git a/drivers/infiniband/hw/qib/qib_diag.c b/drivers/infiniband/hw/qib/qib_diag.c
index 9892456a4348..1686fd4bda87 100644
--- a/drivers/infiniband/hw/qib/qib_diag.c
+++ b/drivers/infiniband/hw/qib/qib_diag.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (c) 2010 QLogic Corporation. All rights reserved. 2 * Copyright (c) 2012 Intel Corporation. All rights reserved.
3 * Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved. 3 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
4 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. 4 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
5 * 5 *
6 * This software is available to you under a choice of one of two 6 * This software is available to you under a choice of one of two
@@ -53,6 +53,9 @@
53#include "qib.h" 53#include "qib.h"
54#include "qib_common.h" 54#include "qib_common.h"
55 55
56#undef pr_fmt
57#define pr_fmt(fmt) QIB_DRV_NAME ": " fmt
58
56/* 59/*
57 * Each client that opens the diag device must read then write 60 * Each client that opens the diag device must read then write
58 * offset 0, to prevent lossage from random cat or od. diag_state 61 * offset 0, to prevent lossage from random cat or od. diag_state
@@ -598,8 +601,8 @@ static ssize_t qib_diagpkt_write(struct file *fp,
598 } 601 }
599 tmpbuf = vmalloc(plen); 602 tmpbuf = vmalloc(plen);
600 if (!tmpbuf) { 603 if (!tmpbuf) {
601 qib_devinfo(dd->pcidev, "Unable to allocate tmp buffer, " 604 qib_devinfo(dd->pcidev,
602 "failing\n"); 605 "Unable to allocate tmp buffer, failing\n");
603 ret = -ENOMEM; 606 ret = -ENOMEM;
604 goto bail; 607 goto bail;
605 } 608 }
@@ -693,7 +696,7 @@ int qib_register_observer(struct qib_devdata *dd,
693 ret = -ENOMEM; 696 ret = -ENOMEM;
694 olp = vmalloc(sizeof *olp); 697 olp = vmalloc(sizeof *olp);
695 if (!olp) { 698 if (!olp) {
696 printk(KERN_ERR QIB_DRV_NAME ": vmalloc for observer failed\n"); 699 pr_err("vmalloc for observer failed\n");
697 goto bail; 700 goto bail;
698 } 701 }
699 if (olp) { 702 if (olp) {
diff --git a/drivers/infiniband/hw/qib/qib_driver.c b/drivers/infiniband/hw/qib/qib_driver.c
index 8895cfec5019..e41e7f7fc763 100644
--- a/drivers/infiniband/hw/qib/qib_driver.c
+++ b/drivers/infiniband/hw/qib/qib_driver.c
@@ -764,8 +764,9 @@ int qib_reset_device(int unit)
764 qib_devinfo(dd->pcidev, "Reset on unit %u requested\n", unit); 764 qib_devinfo(dd->pcidev, "Reset on unit %u requested\n", unit);
765 765
766 if (!dd->kregbase || !(dd->flags & QIB_PRESENT)) { 766 if (!dd->kregbase || !(dd->flags & QIB_PRESENT)) {
767 qib_devinfo(dd->pcidev, "Invalid unit number %u or " 767 qib_devinfo(dd->pcidev,
768 "not initialized or not present\n", unit); 768 "Invalid unit number %u or not initialized or not present\n",
769 unit);
769 ret = -ENXIO; 770 ret = -ENXIO;
770 goto bail; 771 goto bail;
771 } 772 }
@@ -802,11 +803,13 @@ int qib_reset_device(int unit)
802 else 803 else
803 ret = -EAGAIN; 804 ret = -EAGAIN;
804 if (ret) 805 if (ret)
805 qib_dev_err(dd, "Reinitialize unit %u after " 806 qib_dev_err(dd,
806 "reset failed with %d\n", unit, ret); 807 "Reinitialize unit %u after reset failed with %d\n",
808 unit, ret);
807 else 809 else
808 qib_devinfo(dd->pcidev, "Reinitialized unit %u after " 810 qib_devinfo(dd->pcidev,
809 "resetting\n", unit); 811 "Reinitialized unit %u after resetting\n",
812 unit);
810 813
811bail: 814bail:
812 return ret; 815 return ret;
diff --git a/drivers/infiniband/hw/qib/qib_eeprom.c b/drivers/infiniband/hw/qib/qib_eeprom.c
index 92d9cfe98a68..4d5d71aaa2b4 100644
--- a/drivers/infiniband/hw/qib/qib_eeprom.c
+++ b/drivers/infiniband/hw/qib/qib_eeprom.c
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved. 2 * Copyright (c) 2012 Intel Corporation. All rights reserved.
3 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
3 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. 4 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
4 * 5 *
5 * This software is available to you under a choice of one of two 6 * This software is available to you under a choice of one of two
@@ -160,10 +161,9 @@ void qib_get_eeprom_info(struct qib_devdata *dd)
160 if (oguid > bguid[7]) { 161 if (oguid > bguid[7]) {
161 if (bguid[6] == 0xff) { 162 if (bguid[6] == 0xff) {
162 if (bguid[5] == 0xff) { 163 if (bguid[5] == 0xff) {
163 qib_dev_err(dd, "Can't set %s GUID" 164 qib_dev_err(dd,
164 " from base, wraps to" 165 "Can't set %s GUID from base, wraps to OUI!\n",
165 " OUI!\n", 166 qib_get_unit_name(t));
166 qib_get_unit_name(t));
167 dd->base_guid = 0; 167 dd->base_guid = 0;
168 goto bail; 168 goto bail;
169 } 169 }
@@ -182,8 +182,9 @@ void qib_get_eeprom_info(struct qib_devdata *dd)
182 len = sizeof(struct qib_flash); 182 len = sizeof(struct qib_flash);
183 buf = vmalloc(len); 183 buf = vmalloc(len);
184 if (!buf) { 184 if (!buf) {
185 qib_dev_err(dd, "Couldn't allocate memory to read %u " 185 qib_dev_err(dd,
186 "bytes from eeprom for GUID\n", len); 186 "Couldn't allocate memory to read %u bytes from eeprom for GUID\n",
187 len);
187 goto bail; 188 goto bail;
188 } 189 }
189 190
@@ -201,23 +202,25 @@ void qib_get_eeprom_info(struct qib_devdata *dd)
201 202
202 csum = flash_csum(ifp, 0); 203 csum = flash_csum(ifp, 0);
203 if (csum != ifp->if_csum) { 204 if (csum != ifp->if_csum) {
204 qib_devinfo(dd->pcidev, "Bad I2C flash checksum: " 205 qib_devinfo(dd->pcidev,
205 "0x%x, not 0x%x\n", csum, ifp->if_csum); 206 "Bad I2C flash checksum: 0x%x, not 0x%x\n",
207 csum, ifp->if_csum);
206 goto done; 208 goto done;
207 } 209 }
208 if (*(__be64 *) ifp->if_guid == cpu_to_be64(0) || 210 if (*(__be64 *) ifp->if_guid == cpu_to_be64(0) ||
209 *(__be64 *) ifp->if_guid == ~cpu_to_be64(0)) { 211 *(__be64 *) ifp->if_guid == ~cpu_to_be64(0)) {
210 qib_dev_err(dd, "Invalid GUID %llx from flash; ignoring\n", 212 qib_dev_err(dd,
211 *(unsigned long long *) ifp->if_guid); 213 "Invalid GUID %llx from flash; ignoring\n",
214 *(unsigned long long *) ifp->if_guid);
212 /* don't allow GUID if all 0 or all 1's */ 215 /* don't allow GUID if all 0 or all 1's */
213 goto done; 216 goto done;
214 } 217 }
215 218
216 /* complain, but allow it */ 219 /* complain, but allow it */
217 if (*(u64 *) ifp->if_guid == 0x100007511000000ULL) 220 if (*(u64 *) ifp->if_guid == 0x100007511000000ULL)
218 qib_devinfo(dd->pcidev, "Warning, GUID %llx is " 221 qib_devinfo(dd->pcidev,
219 "default, probably not correct!\n", 222 "Warning, GUID %llx is default, probably not correct!\n",
220 *(unsigned long long *) ifp->if_guid); 223 *(unsigned long long *) ifp->if_guid);
221 224
222 bguid = ifp->if_guid; 225 bguid = ifp->if_guid;
223 if (!bguid[0] && !bguid[1] && !bguid[2]) { 226 if (!bguid[0] && !bguid[1] && !bguid[2]) {
@@ -260,8 +263,9 @@ void qib_get_eeprom_info(struct qib_devdata *dd)
260 memcpy(dd->serial, ifp->if_serial, 263 memcpy(dd->serial, ifp->if_serial,
261 sizeof ifp->if_serial); 264 sizeof ifp->if_serial);
262 if (!strstr(ifp->if_comment, "Tested successfully")) 265 if (!strstr(ifp->if_comment, "Tested successfully"))
263 qib_dev_err(dd, "Board SN %s did not pass functional " 266 qib_dev_err(dd,
264 "test: %s\n", dd->serial, ifp->if_comment); 267 "Board SN %s did not pass functional test: %s\n",
268 dd->serial, ifp->if_comment);
265 269
266 memcpy(&dd->eep_st_errs, &ifp->if_errcntp, QIB_EEP_LOG_CNT); 270 memcpy(&dd->eep_st_errs, &ifp->if_errcntp, QIB_EEP_LOG_CNT);
267 /* 271 /*
@@ -323,8 +327,9 @@ int qib_update_eeprom_log(struct qib_devdata *dd)
323 buf = vmalloc(len); 327 buf = vmalloc(len);
324 ret = 1; 328 ret = 1;
325 if (!buf) { 329 if (!buf) {
326 qib_dev_err(dd, "Couldn't allocate memory to read %u " 330 qib_dev_err(dd,
327 "bytes from eeprom for logging\n", len); 331 "Couldn't allocate memory to read %u bytes from eeprom for logging\n",
332 len);
328 goto bail; 333 goto bail;
329 } 334 }
330 335
diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c
index a7403248d83d..faa44cb08071 100644
--- a/drivers/infiniband/hw/qib/qib_file_ops.c
+++ b/drivers/infiniband/hw/qib/qib_file_ops.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation. 2 * Copyright (c) 2012 Intel Corporation. All rights reserved.
3 * All rights reserved. 3 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
4 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. 4 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
5 * 5 *
6 * This software is available to you under a choice of one of two 6 * This software is available to you under a choice of one of two
@@ -49,6 +49,9 @@
49#include "qib_common.h" 49#include "qib_common.h"
50#include "qib_user_sdma.h" 50#include "qib_user_sdma.h"
51 51
52#undef pr_fmt
53#define pr_fmt(fmt) QIB_DRV_NAME ": " fmt
54
52static int qib_open(struct inode *, struct file *); 55static int qib_open(struct inode *, struct file *);
53static int qib_close(struct inode *, struct file *); 56static int qib_close(struct inode *, struct file *);
54static ssize_t qib_write(struct file *, const char __user *, size_t, loff_t *); 57static ssize_t qib_write(struct file *, const char __user *, size_t, loff_t *);
@@ -315,8 +318,9 @@ static int qib_tid_update(struct qib_ctxtdata *rcd, struct file *fp,
315 } 318 }
316 if (cnt > tidcnt) { 319 if (cnt > tidcnt) {
317 /* make sure it all fits in tid_pg_list */ 320 /* make sure it all fits in tid_pg_list */
318 qib_devinfo(dd->pcidev, "Process tried to allocate %u " 321 qib_devinfo(dd->pcidev,
319 "TIDs, only trying max (%u)\n", cnt, tidcnt); 322 "Process tried to allocate %u TIDs, only trying max (%u)\n",
323 cnt, tidcnt);
320 cnt = tidcnt; 324 cnt = tidcnt;
321 } 325 }
322 pagep = (struct page **) rcd->tid_pg_list; 326 pagep = (struct page **) rcd->tid_pg_list;
@@ -750,9 +754,9 @@ static int qib_mmap_mem(struct vm_area_struct *vma, struct qib_ctxtdata *rcd,
750 ret = remap_pfn_range(vma, vma->vm_start, pfn, 754 ret = remap_pfn_range(vma, vma->vm_start, pfn,
751 len, vma->vm_page_prot); 755 len, vma->vm_page_prot);
752 if (ret) 756 if (ret)
753 qib_devinfo(dd->pcidev, "%s ctxt%u mmap of %lx, %x " 757 qib_devinfo(dd->pcidev,
754 "bytes failed: %d\n", what, rcd->ctxt, 758 "%s ctxt%u mmap of %lx, %x bytes failed: %d\n",
755 pfn, len, ret); 759 what, rcd->ctxt, pfn, len, ret);
756bail: 760bail:
757 return ret; 761 return ret;
758} 762}
@@ -771,8 +775,9 @@ static int mmap_ureg(struct vm_area_struct *vma, struct qib_devdata *dd,
771 */ 775 */
772 sz = dd->flags & QIB_HAS_HDRSUPP ? 2 * PAGE_SIZE : PAGE_SIZE; 776 sz = dd->flags & QIB_HAS_HDRSUPP ? 2 * PAGE_SIZE : PAGE_SIZE;
773 if ((vma->vm_end - vma->vm_start) > sz) { 777 if ((vma->vm_end - vma->vm_start) > sz) {
774 qib_devinfo(dd->pcidev, "FAIL mmap userreg: reqlen " 778 qib_devinfo(dd->pcidev,
775 "%lx > PAGE\n", vma->vm_end - vma->vm_start); 779 "FAIL mmap userreg: reqlen %lx > PAGE\n",
780 vma->vm_end - vma->vm_start);
776 ret = -EFAULT; 781 ret = -EFAULT;
777 } else { 782 } else {
778 phys = dd->physaddr + ureg; 783 phys = dd->physaddr + ureg;
@@ -802,8 +807,8 @@ static int mmap_piobufs(struct vm_area_struct *vma,
802 * for it. 807 * for it.
803 */ 808 */
804 if ((vma->vm_end - vma->vm_start) > (piocnt * dd->palign)) { 809 if ((vma->vm_end - vma->vm_start) > (piocnt * dd->palign)) {
805 qib_devinfo(dd->pcidev, "FAIL mmap piobufs: " 810 qib_devinfo(dd->pcidev,
806 "reqlen %lx > PAGE\n", 811 "FAIL mmap piobufs: reqlen %lx > PAGE\n",
807 vma->vm_end - vma->vm_start); 812 vma->vm_end - vma->vm_start);
808 ret = -EINVAL; 813 ret = -EINVAL;
809 goto bail; 814 goto bail;
@@ -847,8 +852,8 @@ static int mmap_rcvegrbufs(struct vm_area_struct *vma,
847 size = rcd->rcvegrbuf_size; 852 size = rcd->rcvegrbuf_size;
848 total_size = rcd->rcvegrbuf_chunks * size; 853 total_size = rcd->rcvegrbuf_chunks * size;
849 if ((vma->vm_end - vma->vm_start) > total_size) { 854 if ((vma->vm_end - vma->vm_start) > total_size) {
850 qib_devinfo(dd->pcidev, "FAIL on egr bufs: " 855 qib_devinfo(dd->pcidev,
851 "reqlen %lx > actual %lx\n", 856 "FAIL on egr bufs: reqlen %lx > actual %lx\n",
852 vma->vm_end - vma->vm_start, 857 vma->vm_end - vma->vm_start,
853 (unsigned long) total_size); 858 (unsigned long) total_size);
854 ret = -EINVAL; 859 ret = -EINVAL;
@@ -856,8 +861,9 @@ static int mmap_rcvegrbufs(struct vm_area_struct *vma,
856 } 861 }
857 862
858 if (vma->vm_flags & VM_WRITE) { 863 if (vma->vm_flags & VM_WRITE) {
859 qib_devinfo(dd->pcidev, "Can't map eager buffers as " 864 qib_devinfo(dd->pcidev,
860 "writable (flags=%lx)\n", vma->vm_flags); 865 "Can't map eager buffers as writable (flags=%lx)\n",
866 vma->vm_flags);
861 ret = -EPERM; 867 ret = -EPERM;
862 goto bail; 868 goto bail;
863 } 869 }
@@ -1270,8 +1276,8 @@ static int setup_ctxt(struct qib_pportdata *ppd, int ctxt,
1270 GFP_KERNEL); 1276 GFP_KERNEL);
1271 1277
1272 if (!rcd || !ptmp) { 1278 if (!rcd || !ptmp) {
1273 qib_dev_err(dd, "Unable to allocate ctxtdata " 1279 qib_dev_err(dd,
1274 "memory, failing open\n"); 1280 "Unable to allocate ctxtdata memory, failing open\n");
1275 ret = -ENOMEM; 1281 ret = -ENOMEM;
1276 goto bailerr; 1282 goto bailerr;
1277 } 1283 }
@@ -1560,10 +1566,10 @@ done_chk_sdma:
1560 } else if (weight == 1 && 1566 } else if (weight == 1 &&
1561 test_bit(cpumask_first(tsk_cpus_allowed(current)), 1567 test_bit(cpumask_first(tsk_cpus_allowed(current)),
1562 qib_cpulist)) 1568 qib_cpulist))
1563 qib_devinfo(dd->pcidev, "%s PID %u affinity " 1569 qib_devinfo(dd->pcidev,
1564 "set to cpu %d; already allocated\n", 1570 "%s PID %u affinity set to cpu %d; already allocated\n",
1565 current->comm, current->pid, 1571 current->comm, current->pid,
1566 cpumask_first(tsk_cpus_allowed(current))); 1572 cpumask_first(tsk_cpus_allowed(current)));
1567 } 1573 }
1568 1574
1569 mutex_unlock(&qib_mutex); 1575 mutex_unlock(&qib_mutex);
@@ -2185,8 +2191,7 @@ int qib_cdev_init(int minor, const char *name,
2185 2191
2186 cdev = cdev_alloc(); 2192 cdev = cdev_alloc();
2187 if (!cdev) { 2193 if (!cdev) {
2188 printk(KERN_ERR QIB_DRV_NAME 2194 pr_err("Could not allocate cdev for minor %d, %s\n",
2189 ": Could not allocate cdev for minor %d, %s\n",
2190 minor, name); 2195 minor, name);
2191 ret = -ENOMEM; 2196 ret = -ENOMEM;
2192 goto done; 2197 goto done;
@@ -2198,8 +2203,7 @@ int qib_cdev_init(int minor, const char *name,
2198 2203
2199 ret = cdev_add(cdev, dev, 1); 2204 ret = cdev_add(cdev, dev, 1);
2200 if (ret < 0) { 2205 if (ret < 0) {
2201 printk(KERN_ERR QIB_DRV_NAME 2206 pr_err("Could not add cdev for minor %d, %s (err %d)\n",
2202 ": Could not add cdev for minor %d, %s (err %d)\n",
2203 minor, name, -ret); 2207 minor, name, -ret);
2204 goto err_cdev; 2208 goto err_cdev;
2205 } 2209 }
@@ -2209,8 +2213,7 @@ int qib_cdev_init(int minor, const char *name,
2209 goto done; 2213 goto done;
2210 ret = PTR_ERR(device); 2214 ret = PTR_ERR(device);
2211 device = NULL; 2215 device = NULL;
2212 printk(KERN_ERR QIB_DRV_NAME ": Could not create " 2216 pr_err("Could not create device for minor %d, %s (err %d)\n",
2213 "device for minor %d, %s (err %d)\n",
2214 minor, name, -ret); 2217 minor, name, -ret);
2215err_cdev: 2218err_cdev:
2216 cdev_del(cdev); 2219 cdev_del(cdev);
@@ -2245,16 +2248,14 @@ int __init qib_dev_init(void)
2245 2248
2246 ret = alloc_chrdev_region(&qib_dev, 0, QIB_NMINORS, QIB_DRV_NAME); 2249 ret = alloc_chrdev_region(&qib_dev, 0, QIB_NMINORS, QIB_DRV_NAME);
2247 if (ret < 0) { 2250 if (ret < 0) {
2248 printk(KERN_ERR QIB_DRV_NAME ": Could not allocate " 2251 pr_err("Could not allocate chrdev region (err %d)\n", -ret);
2249 "chrdev region (err %d)\n", -ret);
2250 goto done; 2252 goto done;
2251 } 2253 }
2252 2254
2253 qib_class = class_create(THIS_MODULE, "ipath"); 2255 qib_class = class_create(THIS_MODULE, "ipath");
2254 if (IS_ERR(qib_class)) { 2256 if (IS_ERR(qib_class)) {
2255 ret = PTR_ERR(qib_class); 2257 ret = PTR_ERR(qib_class);
2256 printk(KERN_ERR QIB_DRV_NAME ": Could not create " 2258 pr_err("Could not create device class (err %d)\n", -ret);
2257 "device class (err %d)\n", -ret);
2258 unregister_chrdev_region(qib_dev, QIB_NMINORS); 2259 unregister_chrdev_region(qib_dev, QIB_NMINORS);
2259 } 2260 }
2260 2261
diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c
index 05e0f17c5b44..cff8a6c32161 100644
--- a/drivers/infiniband/hw/qib/qib_fs.c
+++ b/drivers/infiniband/hw/qib/qib_fs.c
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved. 2 * Copyright (c) 2012 Intel Corporation. All rights reserved.
3 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
3 * Copyright (c) 2006 PathScale, Inc. All rights reserved. 4 * Copyright (c) 2006 PathScale, Inc. All rights reserved.
4 * 5 *
5 * This software is available to you under a choice of one of two 6 * This software is available to you under a choice of one of two
@@ -382,7 +383,7 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd)
382 ret = create_file(unit, S_IFDIR|S_IRUGO|S_IXUGO, sb->s_root, &dir, 383 ret = create_file(unit, S_IFDIR|S_IRUGO|S_IXUGO, sb->s_root, &dir,
383 &simple_dir_operations, dd); 384 &simple_dir_operations, dd);
384 if (ret) { 385 if (ret) {
385 printk(KERN_ERR "create_file(%s) failed: %d\n", unit, ret); 386 pr_err("create_file(%s) failed: %d\n", unit, ret);
386 goto bail; 387 goto bail;
387 } 388 }
388 389
@@ -390,21 +391,21 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd)
390 ret = create_file("counters", S_IFREG|S_IRUGO, dir, &tmp, 391 ret = create_file("counters", S_IFREG|S_IRUGO, dir, &tmp,
391 &cntr_ops[0], dd); 392 &cntr_ops[0], dd);
392 if (ret) { 393 if (ret) {
393 printk(KERN_ERR "create_file(%s/counters) failed: %d\n", 394 pr_err("create_file(%s/counters) failed: %d\n",
394 unit, ret); 395 unit, ret);
395 goto bail; 396 goto bail;
396 } 397 }
397 ret = create_file("counter_names", S_IFREG|S_IRUGO, dir, &tmp, 398 ret = create_file("counter_names", S_IFREG|S_IRUGO, dir, &tmp,
398 &cntr_ops[1], dd); 399 &cntr_ops[1], dd);
399 if (ret) { 400 if (ret) {
400 printk(KERN_ERR "create_file(%s/counter_names) failed: %d\n", 401 pr_err("create_file(%s/counter_names) failed: %d\n",
401 unit, ret); 402 unit, ret);
402 goto bail; 403 goto bail;
403 } 404 }
404 ret = create_file("portcounter_names", S_IFREG|S_IRUGO, dir, &tmp, 405 ret = create_file("portcounter_names", S_IFREG|S_IRUGO, dir, &tmp,
405 &portcntr_ops[0], dd); 406 &portcntr_ops[0], dd);
406 if (ret) { 407 if (ret) {
407 printk(KERN_ERR "create_file(%s/%s) failed: %d\n", 408 pr_err("create_file(%s/%s) failed: %d\n",
408 unit, "portcounter_names", ret); 409 unit, "portcounter_names", ret);
409 goto bail; 410 goto bail;
410 } 411 }
@@ -416,7 +417,7 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd)
416 ret = create_file(fname, S_IFREG|S_IRUGO, dir, &tmp, 417 ret = create_file(fname, S_IFREG|S_IRUGO, dir, &tmp,
417 &portcntr_ops[i], dd); 418 &portcntr_ops[i], dd);
418 if (ret) { 419 if (ret) {
419 printk(KERN_ERR "create_file(%s/%s) failed: %d\n", 420 pr_err("create_file(%s/%s) failed: %d\n",
420 unit, fname, ret); 421 unit, fname, ret);
421 goto bail; 422 goto bail;
422 } 423 }
@@ -426,7 +427,7 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd)
426 ret = create_file(fname, S_IFREG|S_IRUGO, dir, &tmp, 427 ret = create_file(fname, S_IFREG|S_IRUGO, dir, &tmp,
427 &qsfp_ops[i - 1], dd); 428 &qsfp_ops[i - 1], dd);
428 if (ret) { 429 if (ret) {
429 printk(KERN_ERR "create_file(%s/%s) failed: %d\n", 430 pr_err("create_file(%s/%s) failed: %d\n",
430 unit, fname, ret); 431 unit, fname, ret);
431 goto bail; 432 goto bail;
432 } 433 }
@@ -435,7 +436,7 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd)
435 ret = create_file("flash", S_IFREG|S_IWUSR|S_IRUGO, dir, &tmp, 436 ret = create_file("flash", S_IFREG|S_IWUSR|S_IRUGO, dir, &tmp,
436 &flash_ops, dd); 437 &flash_ops, dd);
437 if (ret) 438 if (ret)
438 printk(KERN_ERR "create_file(%s/flash) failed: %d\n", 439 pr_err("create_file(%s/flash) failed: %d\n",
439 unit, ret); 440 unit, ret);
440bail: 441bail:
441 return ret; 442 return ret;
@@ -486,7 +487,7 @@ static int remove_device_files(struct super_block *sb,
486 487
487 if (IS_ERR(dir)) { 488 if (IS_ERR(dir)) {
488 ret = PTR_ERR(dir); 489 ret = PTR_ERR(dir);
489 printk(KERN_ERR "Lookup of %s failed\n", unit); 490 pr_err("Lookup of %s failed\n", unit);
490 goto bail; 491 goto bail;
491 } 492 }
492 493
@@ -532,7 +533,7 @@ static int qibfs_fill_super(struct super_block *sb, void *data, int silent)
532 533
533 ret = simple_fill_super(sb, QIBFS_MAGIC, files); 534 ret = simple_fill_super(sb, QIBFS_MAGIC, files);
534 if (ret) { 535 if (ret) {
535 printk(KERN_ERR "simple_fill_super failed: %d\n", ret); 536 pr_err("simple_fill_super failed: %d\n", ret);
536 goto bail; 537 goto bail;
537 } 538 }
538 539
diff --git a/drivers/infiniband/hw/qib/qib_iba6120.c b/drivers/infiniband/hw/qib/qib_iba6120.c
index 4d352b90750a..a099ac171e22 100644
--- a/drivers/infiniband/hw/qib/qib_iba6120.c
+++ b/drivers/infiniband/hw/qib/qib_iba6120.c
@@ -753,8 +753,8 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
753 if (!hwerrs) 753 if (!hwerrs)
754 return; 754 return;
755 if (hwerrs == ~0ULL) { 755 if (hwerrs == ~0ULL) {
756 qib_dev_err(dd, "Read of hardware error status failed " 756 qib_dev_err(dd,
757 "(all bits set); ignoring\n"); 757 "Read of hardware error status failed (all bits set); ignoring\n");
758 return; 758 return;
759 } 759 }
760 qib_stats.sps_hwerrs++; 760 qib_stats.sps_hwerrs++;
@@ -779,13 +779,14 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
779 * or it's occurred within the last 5 seconds. 779 * or it's occurred within the last 5 seconds.
780 */ 780 */
781 if (hwerrs & ~(TXE_PIO_PARITY | RXEMEMPARITYERR_EAGERTID)) 781 if (hwerrs & ~(TXE_PIO_PARITY | RXEMEMPARITYERR_EAGERTID))
782 qib_devinfo(dd->pcidev, "Hardware error: hwerr=0x%llx " 782 qib_devinfo(dd->pcidev,
783 "(cleared)\n", (unsigned long long) hwerrs); 783 "Hardware error: hwerr=0x%llx (cleared)\n",
784 (unsigned long long) hwerrs);
784 785
785 if (hwerrs & ~IB_HWE_BITSEXTANT) 786 if (hwerrs & ~IB_HWE_BITSEXTANT)
786 qib_dev_err(dd, "hwerror interrupt with unknown errors " 787 qib_dev_err(dd,
787 "%llx set\n", (unsigned long long) 788 "hwerror interrupt with unknown errors %llx set\n",
788 (hwerrs & ~IB_HWE_BITSEXTANT)); 789 (unsigned long long)(hwerrs & ~IB_HWE_BITSEXTANT));
789 790
790 ctrl = qib_read_kreg32(dd, kr_control); 791 ctrl = qib_read_kreg32(dd, kr_control);
791 if ((ctrl & QLOGIC_IB_C_FREEZEMODE) && !dd->diag_client) { 792 if ((ctrl & QLOGIC_IB_C_FREEZEMODE) && !dd->diag_client) {
@@ -815,8 +816,9 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
815 816
816 if (hwerrs & HWE_MASK(PowerOnBISTFailed)) { 817 if (hwerrs & HWE_MASK(PowerOnBISTFailed)) {
817 isfatal = 1; 818 isfatal = 1;
818 strlcat(msg, "[Memory BIST test failed, InfiniPath hardware" 819 strlcat(msg,
819 " unusable]", msgl); 820 "[Memory BIST test failed, InfiniPath hardware unusable]",
821 msgl);
820 /* ignore from now on, so disable until driver reloaded */ 822 /* ignore from now on, so disable until driver reloaded */
821 dd->cspec->hwerrmask &= ~HWE_MASK(PowerOnBISTFailed); 823 dd->cspec->hwerrmask &= ~HWE_MASK(PowerOnBISTFailed);
822 qib_write_kreg(dd, kr_hwerrmask, dd->cspec->hwerrmask); 824 qib_write_kreg(dd, kr_hwerrmask, dd->cspec->hwerrmask);
@@ -868,8 +870,9 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
868 *msg = 0; /* recovered from all of them */ 870 *msg = 0; /* recovered from all of them */
869 871
870 if (isfatal && !dd->diag_client) { 872 if (isfatal && !dd->diag_client) {
871 qib_dev_err(dd, "Fatal Hardware Error, no longer" 873 qib_dev_err(dd,
872 " usable, SN %.16s\n", dd->serial); 874 "Fatal Hardware Error, no longer usable, SN %.16s\n",
875 dd->serial);
873 /* 876 /*
874 * for /sys status file and user programs to print; if no 877 * for /sys status file and user programs to print; if no
875 * trailing brace is copied, we'll know it was truncated. 878 * trailing brace is copied, we'll know it was truncated.
@@ -1017,9 +1020,9 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
1017 qib_inc_eeprom_err(dd, log_idx, 1); 1020 qib_inc_eeprom_err(dd, log_idx, 1);
1018 1021
1019 if (errs & ~IB_E_BITSEXTANT) 1022 if (errs & ~IB_E_BITSEXTANT)
1020 qib_dev_err(dd, "error interrupt with unknown errors " 1023 qib_dev_err(dd,
1021 "%llx set\n", 1024 "error interrupt with unknown errors %llx set\n",
1022 (unsigned long long) (errs & ~IB_E_BITSEXTANT)); 1025 (unsigned long long) (errs & ~IB_E_BITSEXTANT));
1023 1026
1024 if (errs & E_SUM_ERRS) { 1027 if (errs & E_SUM_ERRS) {
1025 qib_disarm_6120_senderrbufs(ppd); 1028 qib_disarm_6120_senderrbufs(ppd);
@@ -1089,8 +1092,8 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
1089 } 1092 }
1090 1093
1091 if (errs & ERR_MASK(ResetNegated)) { 1094 if (errs & ERR_MASK(ResetNegated)) {
1092 qib_dev_err(dd, "Got reset, requires re-init " 1095 qib_dev_err(dd,
1093 "(unload and reload driver)\n"); 1096 "Got reset, requires re-init (unload and reload driver)\n");
1094 dd->flags &= ~QIB_INITTED; /* needs re-init */ 1097 dd->flags &= ~QIB_INITTED; /* needs re-init */
1095 /* mark as having had error */ 1098 /* mark as having had error */
1096 *dd->devstatusp |= QIB_STATUS_HWERROR; 1099 *dd->devstatusp |= QIB_STATUS_HWERROR;
@@ -1541,8 +1544,9 @@ static noinline void unlikely_6120_intr(struct qib_devdata *dd, u64 istat)
1541 qib_stats.sps_errints++; 1544 qib_stats.sps_errints++;
1542 estat = qib_read_kreg64(dd, kr_errstatus); 1545 estat = qib_read_kreg64(dd, kr_errstatus);
1543 if (!estat) 1546 if (!estat)
1544 qib_devinfo(dd->pcidev, "error interrupt (%Lx), " 1547 qib_devinfo(dd->pcidev,
1545 "but no error bits set!\n", istat); 1548 "error interrupt (%Lx), but no error bits set!\n",
1549 istat);
1546 handle_6120_errors(dd, estat); 1550 handle_6120_errors(dd, estat);
1547 } 1551 }
1548 1552
@@ -1715,16 +1719,16 @@ static void qib_setup_6120_interrupt(struct qib_devdata *dd)
1715 } 1719 }
1716 1720
1717 if (!dd->cspec->irq) 1721 if (!dd->cspec->irq)
1718 qib_dev_err(dd, "irq is 0, BIOS error? Interrupts won't " 1722 qib_dev_err(dd,
1719 "work\n"); 1723 "irq is 0, BIOS error? Interrupts won't work\n");
1720 else { 1724 else {
1721 int ret; 1725 int ret;
1722 ret = request_irq(dd->cspec->irq, qib_6120intr, 0, 1726 ret = request_irq(dd->cspec->irq, qib_6120intr, 0,
1723 QIB_DRV_NAME, dd); 1727 QIB_DRV_NAME, dd);
1724 if (ret) 1728 if (ret)
1725 qib_dev_err(dd, "Couldn't setup interrupt " 1729 qib_dev_err(dd,
1726 "(irq=%d): %d\n", dd->cspec->irq, 1730 "Couldn't setup interrupt (irq=%d): %d\n",
1727 ret); 1731 dd->cspec->irq, ret);
1728 } 1732 }
1729} 1733}
1730 1734
@@ -1759,8 +1763,9 @@ static void pe_boardname(struct qib_devdata *dd)
1759 snprintf(dd->boardname, namelen, "%s", n); 1763 snprintf(dd->boardname, namelen, "%s", n);
1760 1764
1761 if (dd->majrev != 4 || !dd->minrev || dd->minrev > 2) 1765 if (dd->majrev != 4 || !dd->minrev || dd->minrev > 2)
1762 qib_dev_err(dd, "Unsupported InfiniPath hardware revision " 1766 qib_dev_err(dd,
1763 "%u.%u!\n", dd->majrev, dd->minrev); 1767 "Unsupported InfiniPath hardware revision %u.%u!\n",
1768 dd->majrev, dd->minrev);
1764 1769
1765 snprintf(dd->boardversion, sizeof(dd->boardversion), 1770 snprintf(dd->boardversion, sizeof(dd->boardversion),
1766 "ChipABI %u.%u, %s, InfiniPath%u %u.%u, SW Compat %u\n", 1771 "ChipABI %u.%u, %s, InfiniPath%u %u.%u, SW Compat %u\n",
@@ -1833,8 +1838,8 @@ static int qib_6120_setup_reset(struct qib_devdata *dd)
1833bail: 1838bail:
1834 if (ret) { 1839 if (ret) {
1835 if (qib_pcie_params(dd, dd->lbus_width, NULL, NULL)) 1840 if (qib_pcie_params(dd, dd->lbus_width, NULL, NULL))
1836 qib_dev_err(dd, "Reset failed to setup PCIe or " 1841 qib_dev_err(dd,
1837 "interrupts; continuing anyway\n"); 1842 "Reset failed to setup PCIe or interrupts; continuing anyway\n");
1838 /* clear the reset error, init error/hwerror mask */ 1843 /* clear the reset error, init error/hwerror mask */
1839 qib_6120_init_hwerrors(dd); 1844 qib_6120_init_hwerrors(dd);
1840 /* for Rev2 error interrupts; nop for rev 1 */ 1845 /* for Rev2 error interrupts; nop for rev 1 */
@@ -1876,8 +1881,9 @@ static void qib_6120_put_tid(struct qib_devdata *dd, u64 __iomem *tidptr,
1876 } 1881 }
1877 pa >>= 11; 1882 pa >>= 11;
1878 if (pa & ~QLOGIC_IB_RT_ADDR_MASK) { 1883 if (pa & ~QLOGIC_IB_RT_ADDR_MASK) {
1879 qib_dev_err(dd, "Physical page address 0x%lx " 1884 qib_dev_err(dd,
1880 "larger than supported\n", pa); 1885 "Physical page address 0x%lx larger than supported\n",
1886 pa);
1881 return; 1887 return;
1882 } 1888 }
1883 1889
@@ -1941,8 +1947,9 @@ static void qib_6120_put_tid_2(struct qib_devdata *dd, u64 __iomem *tidptr,
1941 } 1947 }
1942 pa >>= 11; 1948 pa >>= 11;
1943 if (pa & ~QLOGIC_IB_RT_ADDR_MASK) { 1949 if (pa & ~QLOGIC_IB_RT_ADDR_MASK) {
1944 qib_dev_err(dd, "Physical page address 0x%lx " 1950 qib_dev_err(dd,
1945 "larger than supported\n", pa); 1951 "Physical page address 0x%lx larger than supported\n",
1952 pa);
1946 return; 1953 return;
1947 } 1954 }
1948 1955
@@ -2928,8 +2935,9 @@ static int qib_6120_set_loopback(struct qib_pportdata *ppd, const char *what)
2928 ppd->dd->unit, ppd->port); 2935 ppd->dd->unit, ppd->port);
2929 } else if (!strncmp(what, "off", 3)) { 2936 } else if (!strncmp(what, "off", 3)) {
2930 ppd->dd->cspec->ibcctrl &= ~SYM_MASK(IBCCtrl, Loopback); 2937 ppd->dd->cspec->ibcctrl &= ~SYM_MASK(IBCCtrl, Loopback);
2931 qib_devinfo(ppd->dd->pcidev, "Disabling IB%u:%u IBC loopback " 2938 qib_devinfo(ppd->dd->pcidev,
2932 "(normal)\n", ppd->dd->unit, ppd->port); 2939 "Disabling IB%u:%u IBC loopback (normal)\n",
2940 ppd->dd->unit, ppd->port);
2933 } else 2941 } else
2934 ret = -EINVAL; 2942 ret = -EINVAL;
2935 if (!ret) { 2943 if (!ret) {
@@ -3186,11 +3194,10 @@ static int qib_late_6120_initreg(struct qib_devdata *dd)
3186 qib_write_kreg(dd, kr_sendpioavailaddr, dd->pioavailregs_phys); 3194 qib_write_kreg(dd, kr_sendpioavailaddr, dd->pioavailregs_phys);
3187 val = qib_read_kreg64(dd, kr_sendpioavailaddr); 3195 val = qib_read_kreg64(dd, kr_sendpioavailaddr);
3188 if (val != dd->pioavailregs_phys) { 3196 if (val != dd->pioavailregs_phys) {
3189 qib_dev_err(dd, "Catastrophic software error, " 3197 qib_dev_err(dd,
3190 "SendPIOAvailAddr written as %lx, " 3198 "Catastrophic software error, SendPIOAvailAddr written as %lx, read back as %llx\n",
3191 "read back as %llx\n", 3199 (unsigned long) dd->pioavailregs_phys,
3192 (unsigned long) dd->pioavailregs_phys, 3200 (unsigned long long) val);
3193 (unsigned long long) val);
3194 ret = -EINVAL; 3201 ret = -EINVAL;
3195 } 3202 }
3196 return ret; 3203 return ret;
@@ -3218,8 +3225,8 @@ static int init_6120_variables(struct qib_devdata *dd)
3218 dd->revision = readq(&dd->kregbase[kr_revision]); 3225 dd->revision = readq(&dd->kregbase[kr_revision]);
3219 3226
3220 if ((dd->revision & 0xffffffffU) == 0xffffffffU) { 3227 if ((dd->revision & 0xffffffffU) == 0xffffffffU) {
3221 qib_dev_err(dd, "Revision register read failure, " 3228 qib_dev_err(dd,
3222 "giving up initialization\n"); 3229 "Revision register read failure, giving up initialization\n");
3223 ret = -ENODEV; 3230 ret = -ENODEV;
3224 goto bail; 3231 goto bail;
3225 } 3232 }
@@ -3551,8 +3558,8 @@ struct qib_devdata *qib_init_iba6120_funcs(struct pci_dev *pdev,
3551 goto bail; 3558 goto bail;
3552 3559
3553 if (qib_pcie_params(dd, 8, NULL, NULL)) 3560 if (qib_pcie_params(dd, 8, NULL, NULL))
3554 qib_dev_err(dd, "Failed to setup PCIe or interrupts; " 3561 qib_dev_err(dd,
3555 "continuing anyway\n"); 3562 "Failed to setup PCIe or interrupts; continuing anyway\n");
3556 dd->cspec->irq = pdev->irq; /* save IRQ */ 3563 dd->cspec->irq = pdev->irq; /* save IRQ */
3557 3564
3558 /* clear diagctrl register, in case diags were running and crashed */ 3565 /* clear diagctrl register, in case diags were running and crashed */
diff --git a/drivers/infiniband/hw/qib/qib_iba7220.c b/drivers/infiniband/hw/qib/qib_iba7220.c
index 86a0ba7ca0c2..64d0ecb90cdc 100644
--- a/drivers/infiniband/hw/qib/qib_iba7220.c
+++ b/drivers/infiniband/hw/qib/qib_iba7220.c
@@ -1111,9 +1111,9 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
1111 sdma_7220_errors(ppd, errs); 1111 sdma_7220_errors(ppd, errs);
1112 1112
1113 if (errs & ~IB_E_BITSEXTANT) 1113 if (errs & ~IB_E_BITSEXTANT)
1114 qib_dev_err(dd, "error interrupt with unknown errors " 1114 qib_dev_err(dd,
1115 "%llx set\n", (unsigned long long) 1115 "error interrupt with unknown errors %llx set\n",
1116 (errs & ~IB_E_BITSEXTANT)); 1116 (unsigned long long) (errs & ~IB_E_BITSEXTANT));
1117 1117
1118 if (errs & E_SUM_ERRS) { 1118 if (errs & E_SUM_ERRS) {
1119 qib_disarm_7220_senderrbufs(ppd); 1119 qib_disarm_7220_senderrbufs(ppd);
@@ -1192,8 +1192,8 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
1192 } 1192 }
1193 1193
1194 if (errs & ERR_MASK(ResetNegated)) { 1194 if (errs & ERR_MASK(ResetNegated)) {
1195 qib_dev_err(dd, "Got reset, requires re-init " 1195 qib_dev_err(dd,
1196 "(unload and reload driver)\n"); 1196 "Got reset, requires re-init (unload and reload driver)\n");
1197 dd->flags &= ~QIB_INITTED; /* needs re-init */ 1197 dd->flags &= ~QIB_INITTED; /* needs re-init */
1198 /* mark as having had error */ 1198 /* mark as having had error */
1199 *dd->devstatusp |= QIB_STATUS_HWERROR; 1199 *dd->devstatusp |= QIB_STATUS_HWERROR;
@@ -1305,8 +1305,8 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
1305 if (!hwerrs) 1305 if (!hwerrs)
1306 goto bail; 1306 goto bail;
1307 if (hwerrs == ~0ULL) { 1307 if (hwerrs == ~0ULL) {
1308 qib_dev_err(dd, "Read of hardware error status failed " 1308 qib_dev_err(dd,
1309 "(all bits set); ignoring\n"); 1309 "Read of hardware error status failed (all bits set); ignoring\n");
1310 goto bail; 1310 goto bail;
1311 } 1311 }
1312 qib_stats.sps_hwerrs++; 1312 qib_stats.sps_hwerrs++;
@@ -1329,13 +1329,14 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
1329 qib_inc_eeprom_err(dd, log_idx, 1); 1329 qib_inc_eeprom_err(dd, log_idx, 1);
1330 if (hwerrs & ~(TXEMEMPARITYERR_PIOBUF | TXEMEMPARITYERR_PIOPBC | 1330 if (hwerrs & ~(TXEMEMPARITYERR_PIOBUF | TXEMEMPARITYERR_PIOPBC |
1331 RXE_PARITY)) 1331 RXE_PARITY))
1332 qib_devinfo(dd->pcidev, "Hardware error: hwerr=0x%llx " 1332 qib_devinfo(dd->pcidev,
1333 "(cleared)\n", (unsigned long long) hwerrs); 1333 "Hardware error: hwerr=0x%llx (cleared)\n",
1334 (unsigned long long) hwerrs);
1334 1335
1335 if (hwerrs & ~IB_HWE_BITSEXTANT) 1336 if (hwerrs & ~IB_HWE_BITSEXTANT)
1336 qib_dev_err(dd, "hwerror interrupt with unknown errors " 1337 qib_dev_err(dd,
1337 "%llx set\n", (unsigned long long) 1338 "hwerror interrupt with unknown errors %llx set\n",
1338 (hwerrs & ~IB_HWE_BITSEXTANT)); 1339 (unsigned long long) (hwerrs & ~IB_HWE_BITSEXTANT));
1339 1340
1340 if (hwerrs & QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR) 1341 if (hwerrs & QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR)
1341 qib_sd7220_clr_ibpar(dd); 1342 qib_sd7220_clr_ibpar(dd);
@@ -1362,8 +1363,9 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
1362 1363
1363 if (hwerrs & HWE_MASK(PowerOnBISTFailed)) { 1364 if (hwerrs & HWE_MASK(PowerOnBISTFailed)) {
1364 isfatal = 1; 1365 isfatal = 1;
1365 strlcat(msg, "[Memory BIST test failed, " 1366 strlcat(msg,
1366 "InfiniPath hardware unusable]", msgl); 1367 "[Memory BIST test failed, InfiniPath hardware unusable]",
1368 msgl);
1367 /* ignore from now on, so disable until driver reloaded */ 1369 /* ignore from now on, so disable until driver reloaded */
1368 dd->cspec->hwerrmask &= ~HWE_MASK(PowerOnBISTFailed); 1370 dd->cspec->hwerrmask &= ~HWE_MASK(PowerOnBISTFailed);
1369 qib_write_kreg(dd, kr_hwerrmask, dd->cspec->hwerrmask); 1371 qib_write_kreg(dd, kr_hwerrmask, dd->cspec->hwerrmask);
@@ -1409,8 +1411,9 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
1409 qib_dev_err(dd, "%s hardware error\n", msg); 1411 qib_dev_err(dd, "%s hardware error\n", msg);
1410 1412
1411 if (isfatal && !dd->diag_client) { 1413 if (isfatal && !dd->diag_client) {
1412 qib_dev_err(dd, "Fatal Hardware Error, no longer" 1414 qib_dev_err(dd,
1413 " usable, SN %.16s\n", dd->serial); 1415 "Fatal Hardware Error, no longer usable, SN %.16s\n",
1416 dd->serial);
1414 /* 1417 /*
1415 * For /sys status file and user programs to print; if no 1418 * For /sys status file and user programs to print; if no
1416 * trailing brace is copied, we'll know it was truncated. 1419 * trailing brace is copied, we'll know it was truncated.
@@ -1918,8 +1921,9 @@ static noinline void unlikely_7220_intr(struct qib_devdata *dd, u64 istat)
1918 qib_stats.sps_errints++; 1921 qib_stats.sps_errints++;
1919 estat = qib_read_kreg64(dd, kr_errstatus); 1922 estat = qib_read_kreg64(dd, kr_errstatus);
1920 if (!estat) 1923 if (!estat)
1921 qib_devinfo(dd->pcidev, "error interrupt (%Lx), " 1924 qib_devinfo(dd->pcidev,
1922 "but no error bits set!\n", istat); 1925 "error interrupt (%Lx), but no error bits set!\n",
1926 istat);
1923 else 1927 else
1924 handle_7220_errors(dd, estat); 1928 handle_7220_errors(dd, estat);
1925 } 1929 }
@@ -2023,17 +2027,18 @@ bail:
2023static void qib_setup_7220_interrupt(struct qib_devdata *dd) 2027static void qib_setup_7220_interrupt(struct qib_devdata *dd)
2024{ 2028{
2025 if (!dd->cspec->irq) 2029 if (!dd->cspec->irq)
2026 qib_dev_err(dd, "irq is 0, BIOS error? Interrupts won't " 2030 qib_dev_err(dd,
2027 "work\n"); 2031 "irq is 0, BIOS error? Interrupts won't work\n");
2028 else { 2032 else {
2029 int ret = request_irq(dd->cspec->irq, qib_7220intr, 2033 int ret = request_irq(dd->cspec->irq, qib_7220intr,
2030 dd->msi_lo ? 0 : IRQF_SHARED, 2034 dd->msi_lo ? 0 : IRQF_SHARED,
2031 QIB_DRV_NAME, dd); 2035 QIB_DRV_NAME, dd);
2032 2036
2033 if (ret) 2037 if (ret)
2034 qib_dev_err(dd, "Couldn't setup %s interrupt " 2038 qib_dev_err(dd,
2035 "(irq=%d): %d\n", dd->msi_lo ? 2039 "Couldn't setup %s interrupt (irq=%d): %d\n",
2036 "MSI" : "INTx", dd->cspec->irq, ret); 2040 dd->msi_lo ? "MSI" : "INTx",
2041 dd->cspec->irq, ret);
2037 } 2042 }
2038} 2043}
2039 2044
@@ -2072,9 +2077,9 @@ static void qib_7220_boardname(struct qib_devdata *dd)
2072 snprintf(dd->boardname, namelen, "%s", n); 2077 snprintf(dd->boardname, namelen, "%s", n);
2073 2078
2074 if (dd->majrev != 5 || !dd->minrev || dd->minrev > 2) 2079 if (dd->majrev != 5 || !dd->minrev || dd->minrev > 2)
2075 qib_dev_err(dd, "Unsupported InfiniPath hardware " 2080 qib_dev_err(dd,
2076 "revision %u.%u!\n", 2081 "Unsupported InfiniPath hardware revision %u.%u!\n",
2077 dd->majrev, dd->minrev); 2082 dd->majrev, dd->minrev);
2078 2083
2079 snprintf(dd->boardversion, sizeof(dd->boardversion), 2084 snprintf(dd->boardversion, sizeof(dd->boardversion),
2080 "ChipABI %u.%u, %s, InfiniPath%u %u.%u, SW Compat %u\n", 2085 "ChipABI %u.%u, %s, InfiniPath%u %u.%u, SW Compat %u\n",
@@ -2146,8 +2151,8 @@ static int qib_setup_7220_reset(struct qib_devdata *dd)
2146bail: 2151bail:
2147 if (ret) { 2152 if (ret) {
2148 if (qib_pcie_params(dd, dd->lbus_width, NULL, NULL)) 2153 if (qib_pcie_params(dd, dd->lbus_width, NULL, NULL))
2149 qib_dev_err(dd, "Reset failed to setup PCIe or " 2154 qib_dev_err(dd,
2150 "interrupts; continuing anyway\n"); 2155 "Reset failed to setup PCIe or interrupts; continuing anyway\n");
2151 2156
2152 /* hold IBC in reset, no sends, etc till later */ 2157 /* hold IBC in reset, no sends, etc till later */
2153 qib_write_kreg(dd, kr_control, 0ULL); 2158 qib_write_kreg(dd, kr_control, 0ULL);
@@ -2187,8 +2192,9 @@ static void qib_7220_put_tid(struct qib_devdata *dd, u64 __iomem *tidptr,
2187 return; 2192 return;
2188 } 2193 }
2189 if (chippa >= (1UL << IBA7220_TID_SZ_SHIFT)) { 2194 if (chippa >= (1UL << IBA7220_TID_SZ_SHIFT)) {
2190 qib_dev_err(dd, "Physical page address 0x%lx " 2195 qib_dev_err(dd,
2191 "larger than supported\n", pa); 2196 "Physical page address 0x%lx larger than supported\n",
2197 pa);
2192 return; 2198 return;
2193 } 2199 }
2194 2200
@@ -2706,8 +2712,9 @@ static int qib_7220_set_loopback(struct qib_pportdata *ppd, const char *what)
2706 ppd->cpspec->ibcctrl &= ~SYM_MASK(IBCCtrl, Loopback); 2712 ppd->cpspec->ibcctrl &= ~SYM_MASK(IBCCtrl, Loopback);
2707 /* enable heart beat again */ 2713 /* enable heart beat again */
2708 val = IBA7220_IBC_HRTBT_MASK << IBA7220_IBC_HRTBT_SHIFT; 2714 val = IBA7220_IBC_HRTBT_MASK << IBA7220_IBC_HRTBT_SHIFT;
2709 qib_devinfo(ppd->dd->pcidev, "Disabling IB%u:%u IBC loopback " 2715 qib_devinfo(ppd->dd->pcidev,
2710 "(normal)\n", ppd->dd->unit, ppd->port); 2716 "Disabling IB%u:%u IBC loopback (normal)\n",
2717 ppd->dd->unit, ppd->port);
2711 } else 2718 } else
2712 ret = -EINVAL; 2719 ret = -EINVAL;
2713 if (!ret) { 2720 if (!ret) {
@@ -3307,8 +3314,8 @@ static int qib_7220_intr_fallback(struct qib_devdata *dd)
3307 if (!dd->msi_lo) 3314 if (!dd->msi_lo)
3308 return 0; 3315 return 0;
3309 3316
3310 qib_devinfo(dd->pcidev, "MSI interrupt not detected," 3317 qib_devinfo(dd->pcidev,
3311 " trying INTx interrupts\n"); 3318 "MSI interrupt not detected, trying INTx interrupts\n");
3312 qib_7220_free_irq(dd); 3319 qib_7220_free_irq(dd);
3313 qib_enable_intx(dd->pcidev); 3320 qib_enable_intx(dd->pcidev);
3314 /* 3321 /*
@@ -3980,11 +3987,10 @@ static int qib_late_7220_initreg(struct qib_devdata *dd)
3980 qib_write_kreg(dd, kr_sendpioavailaddr, dd->pioavailregs_phys); 3987 qib_write_kreg(dd, kr_sendpioavailaddr, dd->pioavailregs_phys);
3981 val = qib_read_kreg64(dd, kr_sendpioavailaddr); 3988 val = qib_read_kreg64(dd, kr_sendpioavailaddr);
3982 if (val != dd->pioavailregs_phys) { 3989 if (val != dd->pioavailregs_phys) {
3983 qib_dev_err(dd, "Catastrophic software error, " 3990 qib_dev_err(dd,
3984 "SendPIOAvailAddr written as %lx, " 3991 "Catastrophic software error, SendPIOAvailAddr written as %lx, read back as %llx\n",
3985 "read back as %llx\n", 3992 (unsigned long) dd->pioavailregs_phys,
3986 (unsigned long) dd->pioavailregs_phys, 3993 (unsigned long long) val);
3987 (unsigned long long) val);
3988 ret = -EINVAL; 3994 ret = -EINVAL;
3989 } 3995 }
3990 qib_register_observer(dd, &sendctrl_observer); 3996 qib_register_observer(dd, &sendctrl_observer);
@@ -4014,8 +4020,8 @@ static int qib_init_7220_variables(struct qib_devdata *dd)
4014 dd->revision = readq(&dd->kregbase[kr_revision]); 4020 dd->revision = readq(&dd->kregbase[kr_revision]);
4015 4021
4016 if ((dd->revision & 0xffffffffU) == 0xffffffffU) { 4022 if ((dd->revision & 0xffffffffU) == 0xffffffffU) {
4017 qib_dev_err(dd, "Revision register read failure, " 4023 qib_dev_err(dd,
4018 "giving up initialization\n"); 4024 "Revision register read failure, giving up initialization\n");
4019 ret = -ENODEV; 4025 ret = -ENODEV;
4020 goto bail; 4026 goto bail;
4021 } 4027 }
@@ -4613,8 +4619,8 @@ struct qib_devdata *qib_init_iba7220_funcs(struct pci_dev *pdev,
4613 break; 4619 break;
4614 } 4620 }
4615 if (qib_pcie_params(dd, minwidth, NULL, NULL)) 4621 if (qib_pcie_params(dd, minwidth, NULL, NULL))
4616 qib_dev_err(dd, "Failed to setup PCIe or interrupts; " 4622 qib_dev_err(dd,
4617 "continuing anyway\n"); 4623 "Failed to setup PCIe or interrupts; continuing anyway\n");
4618 4624
4619 /* save IRQ for possible later use */ 4625 /* save IRQ for possible later use */
4620 dd->cspec->irq = pdev->irq; 4626 dd->cspec->irq = pdev->irq;
diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
index 78e85503c509..0d7280af99bc 100644
--- a/drivers/infiniband/hw/qib/qib_iba7322.c
+++ b/drivers/infiniband/hw/qib/qib_iba7322.c
@@ -52,6 +52,9 @@
52#include "qib_mad.h" 52#include "qib_mad.h"
53#include "qib_verbs.h" 53#include "qib_verbs.h"
54 54
55#undef pr_fmt
56#define pr_fmt(fmt) QIB_DRV_NAME " " fmt
57
55static void qib_setup_7322_setextled(struct qib_pportdata *, u32); 58static void qib_setup_7322_setextled(struct qib_pportdata *, u32);
56static void qib_7322_handle_hwerrors(struct qib_devdata *, char *, size_t); 59static void qib_7322_handle_hwerrors(struct qib_devdata *, char *, size_t);
57static void sendctrl_7322_mod(struct qib_pportdata *ppd, u32 op); 60static void sendctrl_7322_mod(struct qib_pportdata *ppd, u32 op);
@@ -1577,8 +1580,8 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
1577 qib_stats.sps_errints++; 1580 qib_stats.sps_errints++;
1578 errs = qib_read_kreg64(dd, kr_errstatus); 1581 errs = qib_read_kreg64(dd, kr_errstatus);
1579 if (!errs) { 1582 if (!errs) {
1580 qib_devinfo(dd->pcidev, "device error interrupt, " 1583 qib_devinfo(dd->pcidev,
1581 "but no error bits set!\n"); 1584 "device error interrupt, but no error bits set!\n");
1582 goto done; 1585 goto done;
1583 } 1586 }
1584 1587
@@ -1624,8 +1627,8 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
1624 if (errs & QIB_E_RESET) { 1627 if (errs & QIB_E_RESET) {
1625 int pidx; 1628 int pidx;
1626 1629
1627 qib_dev_err(dd, "Got reset, requires re-init " 1630 qib_dev_err(dd,
1628 "(unload and reload driver)\n"); 1631 "Got reset, requires re-init (unload and reload driver)\n");
1629 dd->flags &= ~QIB_INITTED; /* needs re-init */ 1632 dd->flags &= ~QIB_INITTED; /* needs re-init */
1630 /* mark as having had error */ 1633 /* mark as having had error */
1631 *dd->devstatusp |= QIB_STATUS_HWERROR; 1634 *dd->devstatusp |= QIB_STATUS_HWERROR;
@@ -1762,9 +1765,9 @@ static void handle_serdes_issues(struct qib_pportdata *ppd, u64 ibcst)
1762 ppd->dd->cspec->r1 ? 1765 ppd->dd->cspec->r1 ?
1763 QDR_STATIC_ADAPT_DOWN_R1 : 1766 QDR_STATIC_ADAPT_DOWN_R1 :
1764 QDR_STATIC_ADAPT_DOWN); 1767 QDR_STATIC_ADAPT_DOWN);
1765 printk(KERN_INFO QIB_DRV_NAME 1768 pr_info(
1766 " IB%u:%u re-enabled QDR adaptation " 1769 "IB%u:%u re-enabled QDR adaptation ibclt %x\n",
1767 "ibclt %x\n", ppd->dd->unit, ppd->port, ibclt); 1770 ppd->dd->unit, ppd->port, ibclt);
1768 } 1771 }
1769 } 1772 }
1770} 1773}
@@ -1806,9 +1809,9 @@ static noinline void handle_7322_p_errors(struct qib_pportdata *ppd)
1806 if (!*msg) 1809 if (!*msg)
1807 snprintf(msg, sizeof ppd->cpspec->epmsgbuf, 1810 snprintf(msg, sizeof ppd->cpspec->epmsgbuf,
1808 "no others"); 1811 "no others");
1809 qib_dev_porterr(dd, ppd->port, "error interrupt with unknown" 1812 qib_dev_porterr(dd, ppd->port,
1810 " errors 0x%016Lx set (and %s)\n", 1813 "error interrupt with unknown errors 0x%016Lx set (and %s)\n",
1811 (errs & ~QIB_E_P_BITSEXTANT), msg); 1814 (errs & ~QIB_E_P_BITSEXTANT), msg);
1812 *msg = '\0'; 1815 *msg = '\0';
1813 } 1816 }
1814 1817
@@ -2026,8 +2029,8 @@ static void qib_7322_handle_hwerrors(struct qib_devdata *dd, char *msg,
2026 if (!hwerrs) 2029 if (!hwerrs)
2027 goto bail; 2030 goto bail;
2028 if (hwerrs == ~0ULL) { 2031 if (hwerrs == ~0ULL) {
2029 qib_dev_err(dd, "Read of hardware error status failed " 2032 qib_dev_err(dd,
2030 "(all bits set); ignoring\n"); 2033 "Read of hardware error status failed (all bits set); ignoring\n");
2031 goto bail; 2034 goto bail;
2032 } 2035 }
2033 qib_stats.sps_hwerrs++; 2036 qib_stats.sps_hwerrs++;
@@ -2041,8 +2044,9 @@ static void qib_7322_handle_hwerrors(struct qib_devdata *dd, char *msg,
2041 /* no EEPROM logging, yet */ 2044 /* no EEPROM logging, yet */
2042 2045
2043 if (hwerrs) 2046 if (hwerrs)
2044 qib_devinfo(dd->pcidev, "Hardware error: hwerr=0x%llx " 2047 qib_devinfo(dd->pcidev,
2045 "(cleared)\n", (unsigned long long) hwerrs); 2048 "Hardware error: hwerr=0x%llx (cleared)\n",
2049 (unsigned long long) hwerrs);
2046 2050
2047 ctrl = qib_read_kreg32(dd, kr_control); 2051 ctrl = qib_read_kreg32(dd, kr_control);
2048 if ((ctrl & SYM_MASK(Control, FreezeMode)) && !dd->diag_client) { 2052 if ((ctrl & SYM_MASK(Control, FreezeMode)) && !dd->diag_client) {
@@ -2066,8 +2070,9 @@ static void qib_7322_handle_hwerrors(struct qib_devdata *dd, char *msg,
2066 2070
2067 if (hwerrs & HWE_MASK(PowerOnBISTFailed)) { 2071 if (hwerrs & HWE_MASK(PowerOnBISTFailed)) {
2068 isfatal = 1; 2072 isfatal = 1;
2069 strlcpy(msg, "[Memory BIST test failed, " 2073 strlcpy(msg,
2070 "InfiniPath hardware unusable]", msgl); 2074 "[Memory BIST test failed, InfiniPath hardware unusable]",
2075 msgl);
2071 /* ignore from now on, so disable until driver reloaded */ 2076 /* ignore from now on, so disable until driver reloaded */
2072 dd->cspec->hwerrmask &= ~HWE_MASK(PowerOnBISTFailed); 2077 dd->cspec->hwerrmask &= ~HWE_MASK(PowerOnBISTFailed);
2073 qib_write_kreg(dd, kr_hwerrmask, dd->cspec->hwerrmask); 2078 qib_write_kreg(dd, kr_hwerrmask, dd->cspec->hwerrmask);
@@ -2080,8 +2085,9 @@ static void qib_7322_handle_hwerrors(struct qib_devdata *dd, char *msg,
2080 qib_dev_err(dd, "%s hardware error\n", msg); 2085 qib_dev_err(dd, "%s hardware error\n", msg);
2081 2086
2082 if (isfatal && !dd->diag_client) { 2087 if (isfatal && !dd->diag_client) {
2083 qib_dev_err(dd, "Fatal Hardware Error, no longer" 2088 qib_dev_err(dd,
2084 " usable, SN %.16s\n", dd->serial); 2089 "Fatal Hardware Error, no longer usable, SN %.16s\n",
2090 dd->serial);
2085 /* 2091 /*
2086 * for /sys status file and user programs to print; if no 2092 * for /sys status file and user programs to print; if no
2087 * trailing brace is copied, we'll know it was truncated. 2093 * trailing brace is copied, we'll know it was truncated.
@@ -2669,8 +2675,9 @@ static noinline void unknown_7322_ibits(struct qib_devdata *dd, u64 istat)
2669 char msg[128]; 2675 char msg[128];
2670 2676
2671 kills = istat & ~QIB_I_BITSEXTANT; 2677 kills = istat & ~QIB_I_BITSEXTANT;
2672 qib_dev_err(dd, "Clearing reserved interrupt(s) 0x%016llx:" 2678 qib_dev_err(dd,
2673 " %s\n", (unsigned long long) kills, msg); 2679 "Clearing reserved interrupt(s) 0x%016llx: %s\n",
2680 (unsigned long long) kills, msg);
2674 qib_write_kreg(dd, kr_intmask, (dd->cspec->int_enable_mask & ~kills)); 2681 qib_write_kreg(dd, kr_intmask, (dd->cspec->int_enable_mask & ~kills));
2675} 2682}
2676 2683
@@ -3103,16 +3110,16 @@ static void qib_setup_7322_interrupt(struct qib_devdata *dd, int clearpend)
3103 /* Try to get INTx interrupt */ 3110 /* Try to get INTx interrupt */
3104try_intx: 3111try_intx:
3105 if (!dd->pcidev->irq) { 3112 if (!dd->pcidev->irq) {
3106 qib_dev_err(dd, "irq is 0, BIOS error? " 3113 qib_dev_err(dd,
3107 "Interrupts won't work\n"); 3114 "irq is 0, BIOS error? Interrupts won't work\n");
3108 goto bail; 3115 goto bail;
3109 } 3116 }
3110 ret = request_irq(dd->pcidev->irq, qib_7322intr, 3117 ret = request_irq(dd->pcidev->irq, qib_7322intr,
3111 IRQF_SHARED, QIB_DRV_NAME, dd); 3118 IRQF_SHARED, QIB_DRV_NAME, dd);
3112 if (ret) { 3119 if (ret) {
3113 qib_dev_err(dd, "Couldn't setup INTx " 3120 qib_dev_err(dd,
3114 "interrupt (irq=%d): %d\n", 3121 "Couldn't setup INTx interrupt (irq=%d): %d\n",
3115 dd->pcidev->irq, ret); 3122 dd->pcidev->irq, ret);
3116 goto bail; 3123 goto bail;
3117 } 3124 }
3118 dd->cspec->irq = dd->pcidev->irq; 3125 dd->cspec->irq = dd->pcidev->irq;
@@ -3187,8 +3194,9 @@ try_intx:
3187 * Shouldn't happen since the enable said we could 3194 * Shouldn't happen since the enable said we could
3188 * have as many as we are trying to setup here. 3195 * have as many as we are trying to setup here.
3189 */ 3196 */
3190 qib_dev_err(dd, "Couldn't setup MSIx " 3197 qib_dev_err(dd,
3191 "interrupt (vec=%d, irq=%d): %d\n", msixnum, 3198 "Couldn't setup MSIx interrupt (vec=%d, irq=%d): %d\n",
3199 msixnum,
3192 dd->cspec->msix_entries[msixnum].msix.vector, 3200 dd->cspec->msix_entries[msixnum].msix.vector,
3193 ret); 3201 ret);
3194 qib_7322_nomsix(dd); 3202 qib_7322_nomsix(dd);
@@ -3307,8 +3315,9 @@ static unsigned qib_7322_boardname(struct qib_devdata *dd)
3307 (unsigned)SYM_FIELD(dd->revision, Revision_R, SW)); 3315 (unsigned)SYM_FIELD(dd->revision, Revision_R, SW));
3308 3316
3309 if (qib_singleport && (features >> PORT_SPD_CAP_SHIFT) & PORT_SPD_CAP) { 3317 if (qib_singleport && (features >> PORT_SPD_CAP_SHIFT) & PORT_SPD_CAP) {
3310 qib_devinfo(dd->pcidev, "IB%u: Forced to single port mode" 3318 qib_devinfo(dd->pcidev,
3311 " by module parameter\n", dd->unit); 3319 "IB%u: Forced to single port mode by module parameter\n",
3320 dd->unit);
3312 features &= PORT_SPD_CAP; 3321 features &= PORT_SPD_CAP;
3313 } 3322 }
3314 3323
@@ -3402,8 +3411,8 @@ static int qib_do_7322_reset(struct qib_devdata *dd)
3402 if (val == dd->revision) 3411 if (val == dd->revision)
3403 break; 3412 break;
3404 if (i == 5) { 3413 if (i == 5) {
3405 qib_dev_err(dd, "Failed to initialize after reset, " 3414 qib_dev_err(dd,
3406 "unusable\n"); 3415 "Failed to initialize after reset, unusable\n");
3407 ret = 0; 3416 ret = 0;
3408 goto bail; 3417 goto bail;
3409 } 3418 }
@@ -3434,8 +3443,8 @@ static int qib_do_7322_reset(struct qib_devdata *dd)
3434 if (qib_pcie_params(dd, dd->lbus_width, 3443 if (qib_pcie_params(dd, dd->lbus_width,
3435 &dd->cspec->num_msix_entries, 3444 &dd->cspec->num_msix_entries,
3436 dd->cspec->msix_entries)) 3445 dd->cspec->msix_entries))
3437 qib_dev_err(dd, "Reset failed to setup PCIe or interrupts; " 3446 qib_dev_err(dd,
3438 "continuing anyway\n"); 3447 "Reset failed to setup PCIe or interrupts; continuing anyway\n");
3439 3448
3440 qib_setup_7322_interrupt(dd, 1); 3449 qib_setup_7322_interrupt(dd, 1);
3441 3450
@@ -3476,8 +3485,9 @@ static void qib_7322_put_tid(struct qib_devdata *dd, u64 __iomem *tidptr,
3476 return; 3485 return;
3477 } 3486 }
3478 if (chippa >= (1UL << IBA7322_TID_SZ_SHIFT)) { 3487 if (chippa >= (1UL << IBA7322_TID_SZ_SHIFT)) {
3479 qib_dev_err(dd, "Physical page address 0x%lx " 3488 qib_dev_err(dd,
3480 "larger than supported\n", pa); 3489 "Physical page address 0x%lx larger than supported\n",
3490 pa);
3481 return; 3491 return;
3482 } 3492 }
3483 3493
@@ -4031,8 +4041,9 @@ static int qib_7322_set_loopback(struct qib_pportdata *ppd, const char *what)
4031 Loopback); 4041 Loopback);
4032 /* enable heart beat again */ 4042 /* enable heart beat again */
4033 val = IBA7322_IBC_HRTBT_RMASK << IBA7322_IBC_HRTBT_LSB; 4043 val = IBA7322_IBC_HRTBT_RMASK << IBA7322_IBC_HRTBT_LSB;
4034 qib_devinfo(ppd->dd->pcidev, "Disabling IB%u:%u IBC loopback " 4044 qib_devinfo(ppd->dd->pcidev,
4035 "(normal)\n", ppd->dd->unit, ppd->port); 4045 "Disabling IB%u:%u IBC loopback (normal)\n",
4046 ppd->dd->unit, ppd->port);
4036 } else 4047 } else
4037 ret = -EINVAL; 4048 ret = -EINVAL;
4038 if (!ret) { 4049 if (!ret) {
@@ -4716,8 +4727,8 @@ static void init_7322_cntrnames(struct qib_devdata *dd)
4716 dd->pport[i].cpspec->portcntrs = kmalloc(dd->cspec->nportcntrs 4727 dd->pport[i].cpspec->portcntrs = kmalloc(dd->cspec->nportcntrs
4717 * sizeof(u64), GFP_KERNEL); 4728 * sizeof(u64), GFP_KERNEL);
4718 if (!dd->pport[i].cpspec->portcntrs) 4729 if (!dd->pport[i].cpspec->portcntrs)
4719 qib_dev_err(dd, "Failed allocation for" 4730 qib_dev_err(dd,
4720 " portcounters\n"); 4731 "Failed allocation for portcounters\n");
4721 } 4732 }
4722} 4733}
4723 4734
@@ -4867,8 +4878,8 @@ static int qib_7322_intr_fallback(struct qib_devdata *dd)
4867 if (!dd->cspec->num_msix_entries) 4878 if (!dd->cspec->num_msix_entries)
4868 return 0; /* already using INTx */ 4879 return 0; /* already using INTx */
4869 4880
4870 qib_devinfo(dd->pcidev, "MSIx interrupt not detected," 4881 qib_devinfo(dd->pcidev,
4871 " trying INTx interrupts\n"); 4882 "MSIx interrupt not detected, trying INTx interrupts\n");
4872 qib_7322_nomsix(dd); 4883 qib_7322_nomsix(dd);
4873 qib_enable_intx(dd->pcidev); 4884 qib_enable_intx(dd->pcidev);
4874 qib_setup_7322_interrupt(dd, 0); 4885 qib_setup_7322_interrupt(dd, 0);
@@ -5842,22 +5853,21 @@ static int setup_txselect(const char *str, struct kernel_param *kp)
5842{ 5853{
5843 struct qib_devdata *dd; 5854 struct qib_devdata *dd;
5844 unsigned long val; 5855 unsigned long val;
5845 char *n; 5856 int ret;
5857
5846 if (strlen(str) >= MAX_ATTEN_LEN) { 5858 if (strlen(str) >= MAX_ATTEN_LEN) {
5847 printk(KERN_INFO QIB_DRV_NAME " txselect_values string " 5859 pr_info("txselect_values string too long\n");
5848 "too long\n");
5849 return -ENOSPC; 5860 return -ENOSPC;
5850 } 5861 }
5851 val = simple_strtoul(str, &n, 0); 5862 ret = kstrtoul(str, 0, &val);
5852 if (n == str || val >= (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + 5863 if (ret || val >= (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ +
5853 TXDDS_MFG_SZ)) { 5864 TXDDS_MFG_SZ)) {
5854 printk(KERN_INFO QIB_DRV_NAME 5865 pr_info("txselect_values must start with a number < %d\n",
5855 "txselect_values must start with a number < %d\n",
5856 TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + TXDDS_MFG_SZ); 5866 TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + TXDDS_MFG_SZ);
5857 return -EINVAL; 5867 return ret ? ret : -EINVAL;
5858 } 5868 }
5859 strcpy(txselect_list, str);
5860 5869
5870 strcpy(txselect_list, str);
5861 list_for_each_entry(dd, &qib_dev_list, list) 5871 list_for_each_entry(dd, &qib_dev_list, list)
5862 if (dd->deviceid == PCI_DEVICE_ID_QLOGIC_IB_7322) 5872 if (dd->deviceid == PCI_DEVICE_ID_QLOGIC_IB_7322)
5863 set_no_qsfp_atten(dd, 1); 5873 set_no_qsfp_atten(dd, 1);
@@ -5880,11 +5890,10 @@ static int qib_late_7322_initreg(struct qib_devdata *dd)
5880 qib_write_kreg(dd, kr_sendpioavailaddr, dd->pioavailregs_phys); 5890 qib_write_kreg(dd, kr_sendpioavailaddr, dd->pioavailregs_phys);
5881 val = qib_read_kreg64(dd, kr_sendpioavailaddr); 5891 val = qib_read_kreg64(dd, kr_sendpioavailaddr);
5882 if (val != dd->pioavailregs_phys) { 5892 if (val != dd->pioavailregs_phys) {
5883 qib_dev_err(dd, "Catastrophic software error, " 5893 qib_dev_err(dd,
5884 "SendPIOAvailAddr written as %lx, " 5894 "Catastrophic software error, SendPIOAvailAddr written as %lx, read back as %llx\n",
5885 "read back as %llx\n", 5895 (unsigned long) dd->pioavailregs_phys,
5886 (unsigned long) dd->pioavailregs_phys, 5896 (unsigned long long) val);
5887 (unsigned long long) val);
5888 ret = -EINVAL; 5897 ret = -EINVAL;
5889 } 5898 }
5890 5899
@@ -6096,8 +6105,8 @@ static int qib_init_7322_variables(struct qib_devdata *dd)
6096 dd->revision = readq(&dd->kregbase[kr_revision]); 6105 dd->revision = readq(&dd->kregbase[kr_revision]);
6097 6106
6098 if ((dd->revision & 0xffffffffU) == 0xffffffffU) { 6107 if ((dd->revision & 0xffffffffU) == 0xffffffffU) {
6099 qib_dev_err(dd, "Revision register read failure, " 6108 qib_dev_err(dd,
6100 "giving up initialization\n"); 6109 "Revision register read failure, giving up initialization\n");
6101 ret = -ENODEV; 6110 ret = -ENODEV;
6102 goto bail; 6111 goto bail;
6103 } 6112 }
@@ -6263,9 +6272,9 @@ static int qib_init_7322_variables(struct qib_devdata *dd)
6263 */ 6272 */
6264 if (!(dd->flags & QIB_HAS_QSFP)) { 6273 if (!(dd->flags & QIB_HAS_QSFP)) {
6265 if (!IS_QMH(dd) && !IS_QME(dd)) 6274 if (!IS_QMH(dd) && !IS_QME(dd))
6266 qib_devinfo(dd->pcidev, "IB%u:%u: " 6275 qib_devinfo(dd->pcidev,
6267 "Unknown mezzanine card type\n", 6276 "IB%u:%u: Unknown mezzanine card type\n",
6268 dd->unit, ppd->port); 6277 dd->unit, ppd->port);
6269 cp->h1_val = IS_QMH(dd) ? H1_FORCE_QMH : H1_FORCE_QME; 6278 cp->h1_val = IS_QMH(dd) ? H1_FORCE_QMH : H1_FORCE_QME;
6270 /* 6279 /*
6271 * Choose center value as default tx serdes setting 6280 * Choose center value as default tx serdes setting
@@ -6920,8 +6929,8 @@ struct qib_devdata *qib_init_iba7322_funcs(struct pci_dev *pdev,
6920 dd->cspec->msix_entries[i].msix.entry = i; 6929 dd->cspec->msix_entries[i].msix.entry = i;
6921 6930
6922 if (qib_pcie_params(dd, 8, &tabsize, dd->cspec->msix_entries)) 6931 if (qib_pcie_params(dd, 8, &tabsize, dd->cspec->msix_entries))
6923 qib_dev_err(dd, "Failed to setup PCIe or interrupts; " 6932 qib_dev_err(dd,
6924 "continuing anyway\n"); 6933 "Failed to setup PCIe or interrupts; continuing anyway\n");
6925 /* may be less than we wanted, if not enough available */ 6934 /* may be less than we wanted, if not enough available */
6926 dd->cspec->num_msix_entries = tabsize; 6935 dd->cspec->num_msix_entries = tabsize;
6927 6936
@@ -7274,8 +7283,7 @@ static void find_best_ent(struct qib_pportdata *ppd,
7274 ppd->cpspec->no_eep < (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + 7283 ppd->cpspec->no_eep < (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ +
7275 TXDDS_MFG_SZ)) { 7284 TXDDS_MFG_SZ)) {
7276 idx = ppd->cpspec->no_eep - (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ); 7285 idx = ppd->cpspec->no_eep - (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ);
7277 printk(KERN_INFO QIB_DRV_NAME 7286 pr_info("IB%u:%u use idx %u into txdds_mfg\n",
7278 " IB%u:%u use idx %u into txdds_mfg\n",
7279 ppd->dd->unit, ppd->port, idx); 7287 ppd->dd->unit, ppd->port, idx);
7280 *sdr_dds = &txdds_extra_mfg[idx]; 7288 *sdr_dds = &txdds_extra_mfg[idx];
7281 *ddr_dds = &txdds_extra_mfg[idx]; 7289 *ddr_dds = &txdds_extra_mfg[idx];
@@ -7430,11 +7438,11 @@ static void serdes_7322_los_enable(struct qib_pportdata *ppd, int enable)
7430 u8 state = SYM_FIELD(data, IBSerdesCtrl_0, RXLOSEN); 7438 u8 state = SYM_FIELD(data, IBSerdesCtrl_0, RXLOSEN);
7431 7439
7432 if (enable && !state) { 7440 if (enable && !state) {
7433 printk(KERN_INFO QIB_DRV_NAME " IB%u:%u Turning LOS on\n", 7441 pr_info("IB%u:%u Turning LOS on\n",
7434 ppd->dd->unit, ppd->port); 7442 ppd->dd->unit, ppd->port);
7435 data |= SYM_MASK(IBSerdesCtrl_0, RXLOSEN); 7443 data |= SYM_MASK(IBSerdesCtrl_0, RXLOSEN);
7436 } else if (!enable && state) { 7444 } else if (!enable && state) {
7437 printk(KERN_INFO QIB_DRV_NAME " IB%u:%u Turning LOS off\n", 7445 pr_info("IB%u:%u Turning LOS off\n",
7438 ppd->dd->unit, ppd->port); 7446 ppd->dd->unit, ppd->port);
7439 data &= ~SYM_MASK(IBSerdesCtrl_0, RXLOSEN); 7447 data &= ~SYM_MASK(IBSerdesCtrl_0, RXLOSEN);
7440 } 7448 }
@@ -7670,8 +7678,7 @@ static int serdes_7322_init_new(struct qib_pportdata *ppd)
7670 } 7678 }
7671 } 7679 }
7672 if (chan_done) { 7680 if (chan_done) {
7673 printk(KERN_INFO QIB_DRV_NAME 7681 pr_info("Serdes %d calibration not done after .5 sec: 0x%x\n",
7674 " Serdes %d calibration not done after .5 sec: 0x%x\n",
7675 IBSD(ppd->hw_pidx), chan_done); 7682 IBSD(ppd->hw_pidx), chan_done);
7676 } else { 7683 } else {
7677 for (chan = 0; chan < SERDES_CHANS; ++chan) { 7684 for (chan = 0; chan < SERDES_CHANS; ++chan) {
@@ -7679,9 +7686,8 @@ static int serdes_7322_init_new(struct qib_pportdata *ppd)
7679 (chan + (chan >> 1)), 7686 (chan + (chan >> 1)),
7680 25, 0, 0); 7687 25, 0, 0);
7681 if ((~rxcaldone & (u32)BMASK(10, 10)) == 0) 7688 if ((~rxcaldone & (u32)BMASK(10, 10)) == 0)
7682 printk(KERN_INFO QIB_DRV_NAME 7689 pr_info("Serdes %d chan %d calibration failed\n",
7683 " Serdes %d chan %d calibration " 7690 IBSD(ppd->hw_pidx), chan);
7684 "failed\n", IBSD(ppd->hw_pidx), chan);
7685 } 7691 }
7686 } 7692 }
7687 7693
diff --git a/drivers/infiniband/hw/qib/qib_init.c b/drivers/infiniband/hw/qib/qib_init.c
index 24ad901c95c4..4443adfcd9ee 100644
--- a/drivers/infiniband/hw/qib/qib_init.c
+++ b/drivers/infiniband/hw/qib/qib_init.c
@@ -38,11 +38,15 @@
38#include <linux/delay.h> 38#include <linux/delay.h>
39#include <linux/idr.h> 39#include <linux/idr.h>
40#include <linux/module.h> 40#include <linux/module.h>
41#include <linux/printk.h>
41 42
42#include "qib.h" 43#include "qib.h"
43#include "qib_common.h" 44#include "qib_common.h"
44#include "qib_mad.h" 45#include "qib_mad.h"
45 46
47#undef pr_fmt
48#define pr_fmt(fmt) QIB_DRV_NAME ": " fmt
49
46/* 50/*
47 * min buffers we want to have per context, after driver 51 * min buffers we want to have per context, after driver
48 */ 52 */
@@ -124,8 +128,8 @@ int qib_create_ctxts(struct qib_devdata *dd)
124 */ 128 */
125 dd->rcd = kzalloc(sizeof(*dd->rcd) * dd->ctxtcnt, GFP_KERNEL); 129 dd->rcd = kzalloc(sizeof(*dd->rcd) * dd->ctxtcnt, GFP_KERNEL);
126 if (!dd->rcd) { 130 if (!dd->rcd) {
127 qib_dev_err(dd, "Unable to allocate ctxtdata array, " 131 qib_dev_err(dd,
128 "failing\n"); 132 "Unable to allocate ctxtdata array, failing\n");
129 ret = -ENOMEM; 133 ret = -ENOMEM;
130 goto done; 134 goto done;
131 } 135 }
@@ -141,8 +145,8 @@ int qib_create_ctxts(struct qib_devdata *dd)
141 ppd = dd->pport + (i % dd->num_pports); 145 ppd = dd->pport + (i % dd->num_pports);
142 rcd = qib_create_ctxtdata(ppd, i); 146 rcd = qib_create_ctxtdata(ppd, i);
143 if (!rcd) { 147 if (!rcd) {
144 qib_dev_err(dd, "Unable to allocate ctxtdata" 148 qib_dev_err(dd,
145 " for Kernel ctxt, failing\n"); 149 "Unable to allocate ctxtdata for Kernel ctxt, failing\n");
146 ret = -ENOMEM; 150 ret = -ENOMEM;
147 goto done; 151 goto done;
148 } 152 }
@@ -303,8 +307,8 @@ static int init_pioavailregs(struct qib_devdata *dd)
303 &dd->pcidev->dev, PAGE_SIZE, &dd->pioavailregs_phys, 307 &dd->pcidev->dev, PAGE_SIZE, &dd->pioavailregs_phys,
304 GFP_KERNEL); 308 GFP_KERNEL);
305 if (!dd->pioavailregs_dma) { 309 if (!dd->pioavailregs_dma) {
306 qib_dev_err(dd, "failed to allocate PIOavail reg area " 310 qib_dev_err(dd,
307 "in memory\n"); 311 "failed to allocate PIOavail reg area in memory\n");
308 ret = -ENOMEM; 312 ret = -ENOMEM;
309 goto done; 313 goto done;
310 } 314 }
@@ -359,15 +363,15 @@ static void init_shadow_tids(struct qib_devdata *dd)
359 363
360 pages = vzalloc(dd->cfgctxts * dd->rcvtidcnt * sizeof(struct page *)); 364 pages = vzalloc(dd->cfgctxts * dd->rcvtidcnt * sizeof(struct page *));
361 if (!pages) { 365 if (!pages) {
362 qib_dev_err(dd, "failed to allocate shadow page * " 366 qib_dev_err(dd,
363 "array, no expected sends!\n"); 367 "failed to allocate shadow page * array, no expected sends!\n");
364 goto bail; 368 goto bail;
365 } 369 }
366 370
367 addrs = vzalloc(dd->cfgctxts * dd->rcvtidcnt * sizeof(dma_addr_t)); 371 addrs = vzalloc(dd->cfgctxts * dd->rcvtidcnt * sizeof(dma_addr_t));
368 if (!addrs) { 372 if (!addrs) {
369 qib_dev_err(dd, "failed to allocate shadow dma handle " 373 qib_dev_err(dd,
370 "array, no expected sends!\n"); 374 "failed to allocate shadow dma handle array, no expected sends!\n");
371 goto bail_free; 375 goto bail_free;
372 } 376 }
373 377
@@ -391,13 +395,13 @@ static int loadtime_init(struct qib_devdata *dd)
391 395
392 if (((dd->revision >> QLOGIC_IB_R_SOFTWARE_SHIFT) & 396 if (((dd->revision >> QLOGIC_IB_R_SOFTWARE_SHIFT) &
393 QLOGIC_IB_R_SOFTWARE_MASK) != QIB_CHIP_SWVERSION) { 397 QLOGIC_IB_R_SOFTWARE_MASK) != QIB_CHIP_SWVERSION) {
394 qib_dev_err(dd, "Driver only handles version %d, " 398 qib_dev_err(dd,
395 "chip swversion is %d (%llx), failng\n", 399 "Driver only handles version %d, chip swversion is %d (%llx), failng\n",
396 QIB_CHIP_SWVERSION, 400 QIB_CHIP_SWVERSION,
397 (int)(dd->revision >> 401 (int)(dd->revision >>
398 QLOGIC_IB_R_SOFTWARE_SHIFT) & 402 QLOGIC_IB_R_SOFTWARE_SHIFT) &
399 QLOGIC_IB_R_SOFTWARE_MASK, 403 QLOGIC_IB_R_SOFTWARE_MASK,
400 (unsigned long long) dd->revision); 404 (unsigned long long) dd->revision);
401 ret = -ENOSYS; 405 ret = -ENOSYS;
402 goto done; 406 goto done;
403 } 407 }
@@ -501,8 +505,8 @@ static void verify_interrupt(unsigned long opaque)
501 */ 505 */
502 if (dd->int_counter == 0) { 506 if (dd->int_counter == 0) {
503 if (!dd->f_intr_fallback(dd)) 507 if (!dd->f_intr_fallback(dd))
504 dev_err(&dd->pcidev->dev, "No interrupts detected, " 508 dev_err(&dd->pcidev->dev,
505 "not usable.\n"); 509 "No interrupts detected, not usable.\n");
506 else /* re-arm the timer to see if fallback works */ 510 else /* re-arm the timer to see if fallback works */
507 mod_timer(&dd->intrchk_timer, jiffies + HZ/2); 511 mod_timer(&dd->intrchk_timer, jiffies + HZ/2);
508 } 512 }
@@ -587,9 +591,8 @@ static int qib_create_workqueues(struct qib_devdata *dd)
587 } 591 }
588 return 0; 592 return 0;
589wq_error: 593wq_error:
590 pr_err( 594 pr_err("create_singlethread_workqueue failed for port %d\n",
591 QIB_DRV_NAME ": create_singlethread_workqueue failed for port %d\n", 595 pidx + 1);
592 pidx + 1);
593 for (pidx = 0; pidx < dd->num_pports; ++pidx) { 596 for (pidx = 0; pidx < dd->num_pports; ++pidx) {
594 ppd = dd->pport + pidx; 597 ppd = dd->pport + pidx;
595 if (ppd->qib_wq) { 598 if (ppd->qib_wq) {
@@ -665,8 +668,8 @@ int qib_init(struct qib_devdata *dd, int reinit)
665 if (!lastfail) 668 if (!lastfail)
666 lastfail = qib_setup_eagerbufs(rcd); 669 lastfail = qib_setup_eagerbufs(rcd);
667 if (lastfail) { 670 if (lastfail) {
668 qib_dev_err(dd, "failed to allocate kernel ctxt's " 671 qib_dev_err(dd,
669 "rcvhdrq and/or egr bufs\n"); 672 "failed to allocate kernel ctxt's rcvhdrq and/or egr bufs\n");
670 continue; 673 continue;
671 } 674 }
672 } 675 }
@@ -1016,8 +1019,7 @@ static void qib_verify_pioperf(struct qib_devdata *dd)
1016 /* 1 GiB/sec, slightly over IB SDR line rate */ 1019 /* 1 GiB/sec, slightly over IB SDR line rate */
1017 if (lcnt < (emsecs * 1024U)) 1020 if (lcnt < (emsecs * 1024U))
1018 qib_dev_err(dd, 1021 qib_dev_err(dd,
1019 "Performance problem: bandwidth to PIO buffers is " 1022 "Performance problem: bandwidth to PIO buffers is only %u MiB/sec\n",
1020 "only %u MiB/sec\n",
1021 lcnt / (u32) emsecs); 1023 lcnt / (u32) emsecs);
1022 1024
1023 preempt_enable(); 1025 preempt_enable();
@@ -1090,8 +1092,8 @@ struct qib_devdata *qib_alloc_devdata(struct pci_dev *pdev, size_t extra)
1090 if (qib_cpulist) 1092 if (qib_cpulist)
1091 qib_cpulist_count = count; 1093 qib_cpulist_count = count;
1092 else 1094 else
1093 qib_early_err(&pdev->dev, "Could not alloc cpulist " 1095 qib_early_err(&pdev->dev,
1094 "info, cpu affinity might be wrong\n"); 1096 "Could not alloc cpulist info, cpu affinity might be wrong\n");
1095 } 1097 }
1096 1098
1097bail: 1099bail:
@@ -1180,21 +1182,20 @@ static int __init qlogic_ib_init(void)
1180 */ 1182 */
1181 idr_init(&qib_unit_table); 1183 idr_init(&qib_unit_table);
1182 if (!idr_pre_get(&qib_unit_table, GFP_KERNEL)) { 1184 if (!idr_pre_get(&qib_unit_table, GFP_KERNEL)) {
1183 printk(KERN_ERR QIB_DRV_NAME ": idr_pre_get() failed\n"); 1185 pr_err("idr_pre_get() failed\n");
1184 ret = -ENOMEM; 1186 ret = -ENOMEM;
1185 goto bail_cq_wq; 1187 goto bail_cq_wq;
1186 } 1188 }
1187 1189
1188 ret = pci_register_driver(&qib_driver); 1190 ret = pci_register_driver(&qib_driver);
1189 if (ret < 0) { 1191 if (ret < 0) {
1190 printk(KERN_ERR QIB_DRV_NAME 1192 pr_err("Unable to register driver: error %d\n", -ret);
1191 ": Unable to register driver: error %d\n", -ret);
1192 goto bail_unit; 1193 goto bail_unit;
1193 } 1194 }
1194 1195
1195 /* not fatal if it doesn't work */ 1196 /* not fatal if it doesn't work */
1196 if (qib_init_qibfs()) 1197 if (qib_init_qibfs())
1197 printk(KERN_ERR QIB_DRV_NAME ": Unable to register ipathfs\n"); 1198 pr_err("Unable to register ipathfs\n");
1198 goto bail; /* all OK */ 1199 goto bail; /* all OK */
1199 1200
1200bail_unit: 1201bail_unit:
@@ -1218,9 +1219,9 @@ static void __exit qlogic_ib_cleanup(void)
1218 1219
1219 ret = qib_exit_qibfs(); 1220 ret = qib_exit_qibfs();
1220 if (ret) 1221 if (ret)
1221 printk(KERN_ERR QIB_DRV_NAME ": " 1222 pr_err(
1222 "Unable to cleanup counter filesystem: " 1223 "Unable to cleanup counter filesystem: error %d\n",
1223 "error %d\n", -ret); 1224 -ret);
1224 1225
1225 pci_unregister_driver(&qib_driver); 1226 pci_unregister_driver(&qib_driver);
1226 1227
@@ -1360,9 +1361,9 @@ static int __devinit qib_init_one(struct pci_dev *pdev,
1360#ifdef CONFIG_PCI_MSI 1361#ifdef CONFIG_PCI_MSI
1361 dd = qib_init_iba6120_funcs(pdev, ent); 1362 dd = qib_init_iba6120_funcs(pdev, ent);
1362#else 1363#else
1363 qib_early_err(&pdev->dev, "QLogic PCIE device 0x%x cannot " 1364 qib_early_err(&pdev->dev,
1364 "work if CONFIG_PCI_MSI is not enabled\n", 1365 "QLogic PCIE device 0x%x cannot work if CONFIG_PCI_MSI is not enabled\n",
1365 ent->device); 1366 ent->device);
1366 dd = ERR_PTR(-ENODEV); 1367 dd = ERR_PTR(-ENODEV);
1367#endif 1368#endif
1368 break; 1369 break;
@@ -1376,8 +1377,9 @@ static int __devinit qib_init_one(struct pci_dev *pdev,
1376 break; 1377 break;
1377 1378
1378 default: 1379 default:
1379 qib_early_err(&pdev->dev, "Failing on unknown QLogic " 1380 qib_early_err(&pdev->dev,
1380 "deviceid 0x%x\n", ent->device); 1381 "Failing on unknown QLogic deviceid 0x%x\n",
1382 ent->device);
1381 ret = -ENODEV; 1383 ret = -ENODEV;
1382 } 1384 }
1383 1385
@@ -1434,9 +1436,9 @@ static int __devinit qib_init_one(struct pci_dev *pdev,
1434 if (!qib_wc_pat) { 1436 if (!qib_wc_pat) {
1435 ret = qib_enable_wc(dd); 1437 ret = qib_enable_wc(dd);
1436 if (ret) { 1438 if (ret) {
1437 qib_dev_err(dd, "Write combining not enabled " 1439 qib_dev_err(dd,
1438 "(err %d): performance may be poor\n", 1440 "Write combining not enabled (err %d): performance may be poor\n",
1439 -ret); 1441 -ret);
1440 ret = 0; 1442 ret = 0;
1441 } 1443 }
1442 } 1444 }
@@ -1502,9 +1504,9 @@ int qib_create_rcvhdrq(struct qib_devdata *dd, struct qib_ctxtdata *rcd)
1502 gfp_flags | __GFP_COMP); 1504 gfp_flags | __GFP_COMP);
1503 1505
1504 if (!rcd->rcvhdrq) { 1506 if (!rcd->rcvhdrq) {
1505 qib_dev_err(dd, "attempt to allocate %d bytes " 1507 qib_dev_err(dd,
1506 "for ctxt %u rcvhdrq failed\n", 1508 "attempt to allocate %d bytes for ctxt %u rcvhdrq failed\n",
1507 amt, rcd->ctxt); 1509 amt, rcd->ctxt);
1508 goto bail; 1510 goto bail;
1509 } 1511 }
1510 1512
@@ -1533,8 +1535,9 @@ int qib_create_rcvhdrq(struct qib_devdata *dd, struct qib_ctxtdata *rcd)
1533 return 0; 1535 return 0;
1534 1536
1535bail_free: 1537bail_free:
1536 qib_dev_err(dd, "attempt to allocate 1 page for ctxt %u " 1538 qib_dev_err(dd,
1537 "rcvhdrqtailaddr failed\n", rcd->ctxt); 1539 "attempt to allocate 1 page for ctxt %u rcvhdrqtailaddr failed\n",
1540 rcd->ctxt);
1538 vfree(rcd->user_event_mask); 1541 vfree(rcd->user_event_mask);
1539 rcd->user_event_mask = NULL; 1542 rcd->user_event_mask = NULL;
1540bail_free_hdrq: 1543bail_free_hdrq:
diff --git a/drivers/infiniband/hw/qib/qib_intr.c b/drivers/infiniband/hw/qib/qib_intr.c
index 6ae57d23004a..f4918f2165ec 100644
--- a/drivers/infiniband/hw/qib/qib_intr.c
+++ b/drivers/infiniband/hw/qib/qib_intr.c
@@ -224,15 +224,15 @@ void qib_bad_intrstatus(struct qib_devdata *dd)
224 * We print the message and disable interrupts, in hope of 224 * We print the message and disable interrupts, in hope of
225 * having a better chance of debugging the problem. 225 * having a better chance of debugging the problem.
226 */ 226 */
227 qib_dev_err(dd, "Read of chip interrupt status failed" 227 qib_dev_err(dd,
228 " disabling interrupts\n"); 228 "Read of chip interrupt status failed disabling interrupts\n");
229 if (allbits++) { 229 if (allbits++) {
230 /* disable interrupt delivery, something is very wrong */ 230 /* disable interrupt delivery, something is very wrong */
231 if (allbits == 2) 231 if (allbits == 2)
232 dd->f_set_intr_state(dd, 0); 232 dd->f_set_intr_state(dd, 0);
233 if (allbits == 3) { 233 if (allbits == 3) {
234 qib_dev_err(dd, "2nd bad interrupt status, " 234 qib_dev_err(dd,
235 "unregistering interrupts\n"); 235 "2nd bad interrupt status, unregistering interrupts\n");
236 dd->flags |= QIB_BADINTR; 236 dd->flags |= QIB_BADINTR;
237 dd->flags &= ~QIB_INITTED; 237 dd->flags &= ~QIB_INITTED;
238 dd->f_free_irq(dd); 238 dd->f_free_irq(dd);
diff --git a/drivers/infiniband/hw/qib/qib_pcie.c b/drivers/infiniband/hw/qib/qib_pcie.c
index 4f9d91823f15..062c301ebf53 100644
--- a/drivers/infiniband/hw/qib/qib_pcie.c
+++ b/drivers/infiniband/hw/qib/qib_pcie.c
@@ -224,8 +224,9 @@ static void qib_msix_setup(struct qib_devdata *dd, int pos, u32 *msixcnt,
224 } 224 }
225do_intx: 225do_intx:
226 if (ret) { 226 if (ret) {
227 qib_dev_err(dd, "pci_enable_msix %d vectors failed: %d, " 227 qib_dev_err(dd,
228 "falling back to INTx\n", tabsize, ret); 228 "pci_enable_msix %d vectors failed: %d, falling back to INTx\n",
229 tabsize, ret);
229 tabsize = 0; 230 tabsize = 0;
230 } 231 }
231 for (i = 0; i < tabsize; i++) 232 for (i = 0; i < tabsize; i++)
@@ -251,8 +252,9 @@ static int qib_msi_setup(struct qib_devdata *dd, int pos)
251 252
252 ret = pci_enable_msi(pdev); 253 ret = pci_enable_msi(pdev);
253 if (ret) 254 if (ret)
254 qib_dev_err(dd, "pci_enable_msi failed: %d, " 255 qib_dev_err(dd,
255 "interrupts may not work\n", ret); 256 "pci_enable_msi failed: %d, interrupts may not work\n",
257 ret);
256 /* continue even if it fails, we may still be OK... */ 258 /* continue even if it fails, we may still be OK... */
257 259
258 pci_read_config_dword(pdev, pos + PCI_MSI_ADDRESS_LO, 260 pci_read_config_dword(pdev, pos + PCI_MSI_ADDRESS_LO,
@@ -358,8 +360,8 @@ int qib_reinit_intr(struct qib_devdata *dd)
358 360
359 pos = pci_find_capability(dd->pcidev, PCI_CAP_ID_MSI); 361 pos = pci_find_capability(dd->pcidev, PCI_CAP_ID_MSI);
360 if (!pos) { 362 if (!pos) {
361 qib_dev_err(dd, "Can't find MSI capability, " 363 qib_dev_err(dd,
362 "can't restore MSI settings\n"); 364 "Can't find MSI capability, can't restore MSI settings\n");
363 ret = 0; 365 ret = 0;
364 /* nothing special for MSIx, just MSI */ 366 /* nothing special for MSIx, just MSI */
365 goto bail; 367 goto bail;
@@ -471,8 +473,8 @@ void qib_pcie_reenable(struct qib_devdata *dd, u16 cmd, u8 iline, u8 cline)
471 pci_write_config_byte(dd->pcidev, PCI_CACHE_LINE_SIZE, cline); 473 pci_write_config_byte(dd->pcidev, PCI_CACHE_LINE_SIZE, cline);
472 r = pci_enable_device(dd->pcidev); 474 r = pci_enable_device(dd->pcidev);
473 if (r) 475 if (r)
474 qib_dev_err(dd, "pci_enable_device failed after " 476 qib_dev_err(dd,
475 "reset: %d\n", r); 477 "pci_enable_device failed after reset: %d\n", r);
476} 478}
477 479
478/* code to adjust PCIe capabilities. */ 480/* code to adjust PCIe capabilities. */
@@ -717,8 +719,9 @@ qib_pci_mmio_enabled(struct pci_dev *pdev)
717 if (words == ~0ULL) 719 if (words == ~0ULL)
718 ret = PCI_ERS_RESULT_NEED_RESET; 720 ret = PCI_ERS_RESULT_NEED_RESET;
719 } 721 }
720 qib_devinfo(pdev, "QIB mmio_enabled function called, " 722 qib_devinfo(pdev,
721 "read wordscntr %Lx, returning %d\n", words, ret); 723 "QIB mmio_enabled function called, read wordscntr %Lx, returning %d\n",
724 words, ret);
722 return ret; 725 return ret;
723} 726}
724 727
diff --git a/drivers/infiniband/hw/qib/qib_sd7220.c b/drivers/infiniband/hw/qib/qib_sd7220.c
index ac065dd6b693..a322d5171a2c 100644
--- a/drivers/infiniband/hw/qib/qib_sd7220.c
+++ b/drivers/infiniband/hw/qib/qib_sd7220.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation. 2 * Copyright (c) 2012 Intel Corporation. All rights reserved.
3 * All rights reserved. 3 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
4 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. 4 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
5 * 5 *
6 * This software is available to you under a choice of one of two 6 * This software is available to you under a choice of one of two
@@ -342,15 +342,17 @@ static void qib_sd_trimdone_monitor(struct qib_devdata *dd,
342 ret = qib_sd7220_reg_mod(dd, IB_7220_SERDES, 342 ret = qib_sd7220_reg_mod(dd, IB_7220_SERDES,
343 IB_CTRL2(chn), 0, 0); 343 IB_CTRL2(chn), 0, 0);
344 if (ret < 0) 344 if (ret < 0)
345 qib_dev_err(dd, "Failed checking TRIMDONE, chn %d" 345 qib_dev_err(dd,
346 " (%s)\n", chn, where); 346 "Failed checking TRIMDONE, chn %d (%s)\n",
347 chn, where);
347 348
348 if (!(ret & 0x10)) { 349 if (!(ret & 0x10)) {
349 int probe; 350 int probe;
350 351
351 baduns |= (1 << chn); 352 baduns |= (1 << chn);
352 qib_dev_err(dd, "TRIMDONE cleared on chn %d (%02X)." 353 qib_dev_err(dd,
353 " (%s)\n", chn, ret, where); 354 "TRIMDONE cleared on chn %d (%02X). (%s)\n",
355 chn, ret, where);
354 probe = qib_sd7220_reg_mod(dd, IB_7220_SERDES, 356 probe = qib_sd7220_reg_mod(dd, IB_7220_SERDES,
355 IB_PGUDP(0), 0, 0); 357 IB_PGUDP(0), 0, 0);
356 qib_dev_err(dd, "probe is %d (%02X)\n", 358 qib_dev_err(dd, "probe is %d (%02X)\n",
@@ -375,8 +377,8 @@ static void qib_sd_trimdone_monitor(struct qib_devdata *dd,
375 ret = qib_sd7220_reg_mod(dd, IB_7220_SERDES, 377 ret = qib_sd7220_reg_mod(dd, IB_7220_SERDES,
376 IB_CTRL2(chn), 0x10, 0x10); 378 IB_CTRL2(chn), 0x10, 0x10);
377 if (ret < 0) 379 if (ret < 0)
378 qib_dev_err(dd, "Failed re-setting " 380 qib_dev_err(dd,
379 "TRIMDONE, chn %d (%s)\n", 381 "Failed re-setting TRIMDONE, chn %d (%s)\n",
380 chn, where); 382 chn, where);
381 } 383 }
382 } 384 }
@@ -1144,10 +1146,10 @@ static int ibsd_mod_allchnls(struct qib_devdata *dd, int loc, int val,
1144 if (ret < 0) { 1146 if (ret < 0) {
1145 int sloc = loc >> EPB_ADDR_SHF; 1147 int sloc = loc >> EPB_ADDR_SHF;
1146 1148
1147 qib_dev_err(dd, "pre-read failed: elt %d," 1149 qib_dev_err(dd,
1148 " addr 0x%X, chnl %d\n", 1150 "pre-read failed: elt %d, addr 0x%X, chnl %d\n",
1149 (sloc & 0xF), 1151 (sloc & 0xF),
1150 (sloc >> 9) & 0x3f, chnl); 1152 (sloc >> 9) & 0x3f, chnl);
1151 return ret; 1153 return ret;
1152 } 1154 }
1153 val = (ret & ~mask) | (val & mask); 1155 val = (ret & ~mask) | (val & mask);
@@ -1157,9 +1159,9 @@ static int ibsd_mod_allchnls(struct qib_devdata *dd, int loc, int val,
1157 if (ret < 0) { 1159 if (ret < 0) {
1158 int sloc = loc >> EPB_ADDR_SHF; 1160 int sloc = loc >> EPB_ADDR_SHF;
1159 1161
1160 qib_dev_err(dd, "Global WR failed: elt %d," 1162 qib_dev_err(dd,
1161 " addr 0x%X, val %02X\n", 1163 "Global WR failed: elt %d, addr 0x%X, val %02X\n",
1162 (sloc & 0xF), (sloc >> 9) & 0x3f, val); 1164 (sloc & 0xF), (sloc >> 9) & 0x3f, val);
1163 } 1165 }
1164 return ret; 1166 return ret;
1165 } 1167 }
@@ -1173,11 +1175,10 @@ static int ibsd_mod_allchnls(struct qib_devdata *dd, int loc, int val,
1173 if (ret < 0) { 1175 if (ret < 0) {
1174 int sloc = loc >> EPB_ADDR_SHF; 1176 int sloc = loc >> EPB_ADDR_SHF;
1175 1177
1176 qib_dev_err(dd, "Write failed: elt %d," 1178 qib_dev_err(dd,
1177 " addr 0x%X, chnl %d, val 0x%02X," 1179 "Write failed: elt %d, addr 0x%X, chnl %d, val 0x%02X, mask 0x%02X\n",
1178 " mask 0x%02X\n", 1180 (sloc & 0xF), (sloc >> 9) & 0x3f, chnl,
1179 (sloc & 0xF), (sloc >> 9) & 0x3f, chnl, 1181 val & 0xFF, mask & 0xFF);
1180 val & 0xFF, mask & 0xFF);
1181 break; 1182 break;
1182 } 1183 }
1183 } 1184 }
diff --git a/drivers/infiniband/hw/qib/qib_sdma.c b/drivers/infiniband/hw/qib/qib_sdma.c
index 12a9604310d7..3fc514431212 100644
--- a/drivers/infiniband/hw/qib/qib_sdma.c
+++ b/drivers/infiniband/hw/qib/qib_sdma.c
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (c) 2007, 2008, 2009, 2010 QLogic Corporation. All rights reserved. 2 * Copyright (c) 2012 Intel Corporation. All rights reserved.
3 * Copyright (c) 2007 - 2012 QLogic Corporation. All rights reserved.
3 * 4 *
4 * This software is available to you under a choice of one of two 5 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU 6 * licenses. You may choose to be licensed under the terms of the GNU
@@ -276,8 +277,8 @@ static int alloc_sdma(struct qib_pportdata *ppd)
276 GFP_KERNEL); 277 GFP_KERNEL);
277 278
278 if (!ppd->sdma_descq) { 279 if (!ppd->sdma_descq) {
279 qib_dev_err(ppd->dd, "failed to allocate SendDMA descriptor " 280 qib_dev_err(ppd->dd,
280 "FIFO memory\n"); 281 "failed to allocate SendDMA descriptor FIFO memory\n");
281 goto bail; 282 goto bail;
282 } 283 }
283 284
@@ -285,8 +286,8 @@ static int alloc_sdma(struct qib_pportdata *ppd)
285 ppd->sdma_head_dma = dma_alloc_coherent(&ppd->dd->pcidev->dev, 286 ppd->sdma_head_dma = dma_alloc_coherent(&ppd->dd->pcidev->dev,
286 PAGE_SIZE, &ppd->sdma_head_phys, GFP_KERNEL); 287 PAGE_SIZE, &ppd->sdma_head_phys, GFP_KERNEL);
287 if (!ppd->sdma_head_dma) { 288 if (!ppd->sdma_head_dma) {
288 qib_dev_err(ppd->dd, "failed to allocate SendDMA " 289 qib_dev_err(ppd->dd,
289 "head memory\n"); 290 "failed to allocate SendDMA head memory\n");
290 goto cleanup_descq; 291 goto cleanup_descq;
291 } 292 }
292 ppd->sdma_head_dma[0] = 0; 293 ppd->sdma_head_dma[0] = 0;
diff --git a/drivers/infiniband/hw/qib/qib_sysfs.c b/drivers/infiniband/hw/qib/qib_sysfs.c
index ae78305b59d0..034cc821de5c 100644
--- a/drivers/infiniband/hw/qib/qib_sysfs.c
+++ b/drivers/infiniband/hw/qib/qib_sysfs.c
@@ -36,41 +36,6 @@
36#include "qib.h" 36#include "qib.h"
37#include "qib_mad.h" 37#include "qib_mad.h"
38 38
39/**
40 * qib_parse_ushort - parse an unsigned short value in an arbitrary base
41 * @str: the string containing the number
42 * @valp: where to put the result
43 *
44 * Returns the number of bytes consumed, or negative value on error.
45 */
46static int qib_parse_ushort(const char *str, unsigned short *valp)
47{
48 unsigned long val;
49 char *end;
50 int ret;
51
52 if (!isdigit(str[0])) {
53 ret = -EINVAL;
54 goto bail;
55 }
56
57 val = simple_strtoul(str, &end, 0);
58
59 if (val > 0xffff) {
60 ret = -EINVAL;
61 goto bail;
62 }
63
64 *valp = val;
65
66 ret = end + 1 - str;
67 if (ret == 0)
68 ret = -EINVAL;
69
70bail:
71 return ret;
72}
73
74/* start of per-port functions */ 39/* start of per-port functions */
75/* 40/*
76 * Get/Set heartbeat enable. OR of 1=enabled, 2=auto 41 * Get/Set heartbeat enable. OR of 1=enabled, 2=auto
@@ -92,7 +57,11 @@ static ssize_t store_hrtbt_enb(struct qib_pportdata *ppd, const char *buf,
92 int ret; 57 int ret;
93 u16 val; 58 u16 val;
94 59
95 ret = qib_parse_ushort(buf, &val); 60 ret = kstrtou16(buf, 0, &val);
61 if (ret) {
62 qib_dev_err(dd, "attempt to set invalid Heartbeat enable\n");
63 return ret;
64 }
96 65
97 /* 66 /*
98 * Set the "intentional" heartbeat enable per either of 67 * Set the "intentional" heartbeat enable per either of
@@ -101,10 +70,7 @@ static ssize_t store_hrtbt_enb(struct qib_pportdata *ppd, const char *buf,
101 * because entering loopback mode overrides it and automatically 70 * because entering loopback mode overrides it and automatically
102 * disables heartbeat. 71 * disables heartbeat.
103 */ 72 */
104 if (ret >= 0) 73 ret = dd->f_set_ib_cfg(ppd, QIB_IB_CFG_HRTBT, val);
105 ret = dd->f_set_ib_cfg(ppd, QIB_IB_CFG_HRTBT, val);
106 if (ret < 0)
107 qib_dev_err(dd, "attempt to set invalid Heartbeat enable\n");
108 return ret < 0 ? ret : count; 74 return ret < 0 ? ret : count;
109} 75}
110 76
@@ -128,12 +94,14 @@ static ssize_t store_led_override(struct qib_pportdata *ppd, const char *buf,
128 int ret; 94 int ret;
129 u16 val; 95 u16 val;
130 96
131 ret = qib_parse_ushort(buf, &val); 97 ret = kstrtou16(buf, 0, &val);
132 if (ret > 0) 98 if (ret) {
133 qib_set_led_override(ppd, val);
134 else
135 qib_dev_err(dd, "attempt to set invalid LED override\n"); 99 qib_dev_err(dd, "attempt to set invalid LED override\n");
136 return ret < 0 ? ret : count; 100 return ret;
101 }
102
103 qib_set_led_override(ppd, val);
104 return count;
137} 105}
138 106
139static ssize_t show_status(struct qib_pportdata *ppd, char *buf) 107static ssize_t show_status(struct qib_pportdata *ppd, char *buf)
@@ -501,12 +469,12 @@ static ssize_t diagc_attr_store(struct kobject *kobj, struct attribute *attr,
501 struct qib_pportdata *ppd = 469 struct qib_pportdata *ppd =
502 container_of(kobj, struct qib_pportdata, diagc_kobj); 470 container_of(kobj, struct qib_pportdata, diagc_kobj);
503 struct qib_ibport *qibp = &ppd->ibport_data; 471 struct qib_ibport *qibp = &ppd->ibport_data;
504 char *endp; 472 u32 val;
505 long val = simple_strtol(buf, &endp, 0); 473 int ret;
506
507 if (val < 0 || endp == buf)
508 return -EINVAL;
509 474
475 ret = kstrtou32(buf, 0, &val);
476 if (ret)
477 return ret;
510 *(u32 *)((char *) qibp + dattr->counter) = val; 478 *(u32 *)((char *) qibp + dattr->counter) = val;
511 return size; 479 return size;
512} 480}
@@ -739,8 +707,9 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
739 int ret; 707 int ret;
740 708
741 if (!port_num || port_num > dd->num_pports) { 709 if (!port_num || port_num > dd->num_pports) {
742 qib_dev_err(dd, "Skipping infiniband class with " 710 qib_dev_err(dd,
743 "invalid port %u\n", port_num); 711 "Skipping infiniband class with invalid port %u\n",
712 port_num);
744 ret = -ENODEV; 713 ret = -ENODEV;
745 goto bail; 714 goto bail;
746 } 715 }
@@ -749,8 +718,9 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
749 ret = kobject_init_and_add(&ppd->pport_kobj, &qib_port_ktype, kobj, 718 ret = kobject_init_and_add(&ppd->pport_kobj, &qib_port_ktype, kobj,
750 "linkcontrol"); 719 "linkcontrol");
751 if (ret) { 720 if (ret) {
752 qib_dev_err(dd, "Skipping linkcontrol sysfs info, " 721 qib_dev_err(dd,
753 "(err %d) port %u\n", ret, port_num); 722 "Skipping linkcontrol sysfs info, (err %d) port %u\n",
723 ret, port_num);
754 goto bail; 724 goto bail;
755 } 725 }
756 kobject_uevent(&ppd->pport_kobj, KOBJ_ADD); 726 kobject_uevent(&ppd->pport_kobj, KOBJ_ADD);
@@ -758,8 +728,9 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
758 ret = kobject_init_and_add(&ppd->sl2vl_kobj, &qib_sl2vl_ktype, kobj, 728 ret = kobject_init_and_add(&ppd->sl2vl_kobj, &qib_sl2vl_ktype, kobj,
759 "sl2vl"); 729 "sl2vl");
760 if (ret) { 730 if (ret) {
761 qib_dev_err(dd, "Skipping sl2vl sysfs info, " 731 qib_dev_err(dd,
762 "(err %d) port %u\n", ret, port_num); 732 "Skipping sl2vl sysfs info, (err %d) port %u\n",
733 ret, port_num);
763 goto bail_link; 734 goto bail_link;
764 } 735 }
765 kobject_uevent(&ppd->sl2vl_kobj, KOBJ_ADD); 736 kobject_uevent(&ppd->sl2vl_kobj, KOBJ_ADD);
@@ -767,8 +738,9 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
767 ret = kobject_init_and_add(&ppd->diagc_kobj, &qib_diagc_ktype, kobj, 738 ret = kobject_init_and_add(&ppd->diagc_kobj, &qib_diagc_ktype, kobj,
768 "diag_counters"); 739 "diag_counters");
769 if (ret) { 740 if (ret) {
770 qib_dev_err(dd, "Skipping diag_counters sysfs info, " 741 qib_dev_err(dd,
771 "(err %d) port %u\n", ret, port_num); 742 "Skipping diag_counters sysfs info, (err %d) port %u\n",
743 ret, port_num);
772 goto bail_sl; 744 goto bail_sl;
773 } 745 }
774 kobject_uevent(&ppd->diagc_kobj, KOBJ_ADD); 746 kobject_uevent(&ppd->diagc_kobj, KOBJ_ADD);
diff --git a/drivers/infiniband/hw/qib/qib_twsi.c b/drivers/infiniband/hw/qib/qib_twsi.c
index ddde72e11edb..647f7beb1b0a 100644
--- a/drivers/infiniband/hw/qib/qib_twsi.c
+++ b/drivers/infiniband/hw/qib/qib_twsi.c
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved. 2 * Copyright (c) 2012 Intel Corporation. All rights reserved.
3 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
3 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. 4 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
4 * 5 *
5 * This software is available to you under a choice of one of two 6 * This software is available to you under a choice of one of two
@@ -449,8 +450,9 @@ int qib_twsi_blk_wr(struct qib_devdata *dd, int dev, int addr,
449 goto failed_write; 450 goto failed_write;
450 ret = qib_twsi_wr(dd, addr, 0); 451 ret = qib_twsi_wr(dd, addr, 0);
451 if (ret) { 452 if (ret) {
452 qib_dev_err(dd, "Failed to write interface" 453 qib_dev_err(dd,
453 " write addr %02X\n", addr); 454 "Failed to write interface write addr %02X\n",
455 addr);
454 goto failed_write; 456 goto failed_write;
455 } 457 }
456 } 458 }
diff --git a/drivers/infiniband/hw/qib/qib_wc_x86_64.c b/drivers/infiniband/hw/qib/qib_wc_x86_64.c
index 561b8bca4060..1d7281c5a02e 100644
--- a/drivers/infiniband/hw/qib/qib_wc_x86_64.c
+++ b/drivers/infiniband/hw/qib/qib_wc_x86_64.c
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved. 2 * Copyright (c) 2012 Intel Corporation. All rights reserved.
3 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
3 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. 4 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
4 * 5 *
5 * This software is available to you under a choice of one of two 6 * This software is available to you under a choice of one of two
@@ -102,10 +103,10 @@ int qib_enable_wc(struct qib_devdata *dd)
102 u64 atmp; 103 u64 atmp;
103 atmp = pioaddr & ~(piolen - 1); 104 atmp = pioaddr & ~(piolen - 1);
104 if (atmp < addr || (atmp + piolen) > (addr + len)) { 105 if (atmp < addr || (atmp + piolen) > (addr + len)) {
105 qib_dev_err(dd, "No way to align address/size " 106 qib_dev_err(dd,
106 "(%llx/%llx), no WC mtrr\n", 107 "No way to align address/size (%llx/%llx), no WC mtrr\n",
107 (unsigned long long) atmp, 108 (unsigned long long) atmp,
108 (unsigned long long) piolen << 1); 109 (unsigned long long) piolen << 1);
109 ret = -ENODEV; 110 ret = -ENODEV;
110 } else { 111 } else {
111 pioaddr = atmp; 112 pioaddr = atmp;
@@ -120,8 +121,7 @@ int qib_enable_wc(struct qib_devdata *dd)
120 if (cookie < 0) { 121 if (cookie < 0) {
121 { 122 {
122 qib_devinfo(dd->pcidev, 123 qib_devinfo(dd->pcidev,
123 "mtrr_add() WC for PIO bufs " 124 "mtrr_add() WC for PIO bufs failed (%d)\n",
124 "failed (%d)\n",
125 cookie); 125 cookie);
126 ret = -EINVAL; 126 ret = -EINVAL;
127 } 127 }