提交 7fac3301 编写于 作者: M Mike Marciniszyn 提交者: Roland Dreier

IB/qib: checkpatch fixes

Elminate some simple_strto* usage.

checkpatch also noted pr_ conversations, which have been done as
recommended.  The pr_fmt() define is used to shorten line length.

Other multi-line string warnings are also elmininated.
Reviewed-by: NDean Luick <dean.luick@intel.com>
Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 36a8f01c
/* /*
* Copyright (c) 2010 QLogic Corporation. All rights reserved. * Copyright (c) 2012 Intel Corporation. All rights reserved.
* Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved. * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
* Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
* *
* This software is available to you under a choice of one of two * This software is available to you under a choice of one of two
...@@ -53,6 +53,9 @@ ...@@ -53,6 +53,9 @@
#include "qib.h" #include "qib.h"
#include "qib_common.h" #include "qib_common.h"
#undef pr_fmt
#define pr_fmt(fmt) QIB_DRV_NAME ": " fmt
/* /*
* Each client that opens the diag device must read then write * Each client that opens the diag device must read then write
* offset 0, to prevent lossage from random cat or od. diag_state * 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,8 +601,8 @@ static ssize_t qib_diagpkt_write(struct file *fp,
} }
tmpbuf = vmalloc(plen); tmpbuf = vmalloc(plen);
if (!tmpbuf) { if (!tmpbuf) {
qib_devinfo(dd->pcidev, "Unable to allocate tmp buffer, " qib_devinfo(dd->pcidev,
"failing\n"); "Unable to allocate tmp buffer, failing\n");
ret = -ENOMEM; ret = -ENOMEM;
goto bail; goto bail;
} }
...@@ -693,7 +696,7 @@ int qib_register_observer(struct qib_devdata *dd, ...@@ -693,7 +696,7 @@ int qib_register_observer(struct qib_devdata *dd,
ret = -ENOMEM; ret = -ENOMEM;
olp = vmalloc(sizeof *olp); olp = vmalloc(sizeof *olp);
if (!olp) { if (!olp) {
printk(KERN_ERR QIB_DRV_NAME ": vmalloc for observer failed\n"); pr_err("vmalloc for observer failed\n");
goto bail; goto bail;
} }
if (olp) { if (olp) {
......
...@@ -764,8 +764,9 @@ int qib_reset_device(int unit) ...@@ -764,8 +764,9 @@ int qib_reset_device(int unit)
qib_devinfo(dd->pcidev, "Reset on unit %u requested\n", unit); qib_devinfo(dd->pcidev, "Reset on unit %u requested\n", unit);
if (!dd->kregbase || !(dd->flags & QIB_PRESENT)) { if (!dd->kregbase || !(dd->flags & QIB_PRESENT)) {
qib_devinfo(dd->pcidev, "Invalid unit number %u or " qib_devinfo(dd->pcidev,
"not initialized or not present\n", unit); "Invalid unit number %u or not initialized or not present\n",
unit);
ret = -ENXIO; ret = -ENXIO;
goto bail; goto bail;
} }
...@@ -802,11 +803,13 @@ int qib_reset_device(int unit) ...@@ -802,11 +803,13 @@ int qib_reset_device(int unit)
else else
ret = -EAGAIN; ret = -EAGAIN;
if (ret) if (ret)
qib_dev_err(dd, "Reinitialize unit %u after " qib_dev_err(dd,
"reset failed with %d\n", unit, ret); "Reinitialize unit %u after reset failed with %d\n",
unit, ret);
else else
qib_devinfo(dd->pcidev, "Reinitialized unit %u after " qib_devinfo(dd->pcidev,
"resetting\n", unit); "Reinitialized unit %u after resetting\n",
unit);
bail: bail:
return ret; return ret;
......
/* /*
* Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved. * Copyright (c) 2012 Intel Corporation. All rights reserved.
* Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
* Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
* *
* This software is available to you under a choice of one of two * This software is available to you under a choice of one of two
...@@ -160,9 +161,8 @@ void qib_get_eeprom_info(struct qib_devdata *dd) ...@@ -160,9 +161,8 @@ void qib_get_eeprom_info(struct qib_devdata *dd)
if (oguid > bguid[7]) { if (oguid > bguid[7]) {
if (bguid[6] == 0xff) { if (bguid[6] == 0xff) {
if (bguid[5] == 0xff) { if (bguid[5] == 0xff) {
qib_dev_err(dd, "Can't set %s GUID" qib_dev_err(dd,
" from base, wraps to" "Can't set %s GUID from base, wraps to OUI!\n",
" OUI!\n",
qib_get_unit_name(t)); qib_get_unit_name(t));
dd->base_guid = 0; dd->base_guid = 0;
goto bail; goto bail;
...@@ -182,8 +182,9 @@ void qib_get_eeprom_info(struct qib_devdata *dd) ...@@ -182,8 +182,9 @@ void qib_get_eeprom_info(struct qib_devdata *dd)
len = sizeof(struct qib_flash); len = sizeof(struct qib_flash);
buf = vmalloc(len); buf = vmalloc(len);
if (!buf) { if (!buf) {
qib_dev_err(dd, "Couldn't allocate memory to read %u " qib_dev_err(dd,
"bytes from eeprom for GUID\n", len); "Couldn't allocate memory to read %u bytes from eeprom for GUID\n",
len);
goto bail; goto bail;
} }
...@@ -201,13 +202,15 @@ void qib_get_eeprom_info(struct qib_devdata *dd) ...@@ -201,13 +202,15 @@ void qib_get_eeprom_info(struct qib_devdata *dd)
csum = flash_csum(ifp, 0); csum = flash_csum(ifp, 0);
if (csum != ifp->if_csum) { if (csum != ifp->if_csum) {
qib_devinfo(dd->pcidev, "Bad I2C flash checksum: " qib_devinfo(dd->pcidev,
"0x%x, not 0x%x\n", csum, ifp->if_csum); "Bad I2C flash checksum: 0x%x, not 0x%x\n",
csum, ifp->if_csum);
goto done; goto done;
} }
if (*(__be64 *) ifp->if_guid == cpu_to_be64(0) || if (*(__be64 *) ifp->if_guid == cpu_to_be64(0) ||
*(__be64 *) ifp->if_guid == ~cpu_to_be64(0)) { *(__be64 *) ifp->if_guid == ~cpu_to_be64(0)) {
qib_dev_err(dd, "Invalid GUID %llx from flash; ignoring\n", qib_dev_err(dd,
"Invalid GUID %llx from flash; ignoring\n",
*(unsigned long long *) ifp->if_guid); *(unsigned long long *) ifp->if_guid);
/* don't allow GUID if all 0 or all 1's */ /* don't allow GUID if all 0 or all 1's */
goto done; goto done;
...@@ -215,8 +218,8 @@ void qib_get_eeprom_info(struct qib_devdata *dd) ...@@ -215,8 +218,8 @@ void qib_get_eeprom_info(struct qib_devdata *dd)
/* complain, but allow it */ /* complain, but allow it */
if (*(u64 *) ifp->if_guid == 0x100007511000000ULL) if (*(u64 *) ifp->if_guid == 0x100007511000000ULL)
qib_devinfo(dd->pcidev, "Warning, GUID %llx is " qib_devinfo(dd->pcidev,
"default, probably not correct!\n", "Warning, GUID %llx is default, probably not correct!\n",
*(unsigned long long *) ifp->if_guid); *(unsigned long long *) ifp->if_guid);
bguid = ifp->if_guid; bguid = ifp->if_guid;
...@@ -260,8 +263,9 @@ void qib_get_eeprom_info(struct qib_devdata *dd) ...@@ -260,8 +263,9 @@ void qib_get_eeprom_info(struct qib_devdata *dd)
memcpy(dd->serial, ifp->if_serial, memcpy(dd->serial, ifp->if_serial,
sizeof ifp->if_serial); sizeof ifp->if_serial);
if (!strstr(ifp->if_comment, "Tested successfully")) if (!strstr(ifp->if_comment, "Tested successfully"))
qib_dev_err(dd, "Board SN %s did not pass functional " qib_dev_err(dd,
"test: %s\n", dd->serial, ifp->if_comment); "Board SN %s did not pass functional test: %s\n",
dd->serial, ifp->if_comment);
memcpy(&dd->eep_st_errs, &ifp->if_errcntp, QIB_EEP_LOG_CNT); memcpy(&dd->eep_st_errs, &ifp->if_errcntp, QIB_EEP_LOG_CNT);
/* /*
...@@ -323,8 +327,9 @@ int qib_update_eeprom_log(struct qib_devdata *dd) ...@@ -323,8 +327,9 @@ int qib_update_eeprom_log(struct qib_devdata *dd)
buf = vmalloc(len); buf = vmalloc(len);
ret = 1; ret = 1;
if (!buf) { if (!buf) {
qib_dev_err(dd, "Couldn't allocate memory to read %u " qib_dev_err(dd,
"bytes from eeprom for logging\n", len); "Couldn't allocate memory to read %u bytes from eeprom for logging\n",
len);
goto bail; goto bail;
} }
......
/* /*
* Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation. * Copyright (c) 2012 Intel Corporation. All rights reserved.
* All rights reserved. * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
* Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
* *
* This software is available to you under a choice of one of two * This software is available to you under a choice of one of two
...@@ -49,6 +49,9 @@ ...@@ -49,6 +49,9 @@
#include "qib_common.h" #include "qib_common.h"
#include "qib_user_sdma.h" #include "qib_user_sdma.h"
#undef pr_fmt
#define pr_fmt(fmt) QIB_DRV_NAME ": " fmt
static int qib_open(struct inode *, struct file *); static int qib_open(struct inode *, struct file *);
static int qib_close(struct inode *, struct file *); static int qib_close(struct inode *, struct file *);
static ssize_t qib_write(struct file *, const char __user *, size_t, loff_t *); static 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,8 +318,9 @@ static int qib_tid_update(struct qib_ctxtdata *rcd, struct file *fp,
} }
if (cnt > tidcnt) { if (cnt > tidcnt) {
/* make sure it all fits in tid_pg_list */ /* make sure it all fits in tid_pg_list */
qib_devinfo(dd->pcidev, "Process tried to allocate %u " qib_devinfo(dd->pcidev,
"TIDs, only trying max (%u)\n", cnt, tidcnt); "Process tried to allocate %u TIDs, only trying max (%u)\n",
cnt, tidcnt);
cnt = tidcnt; cnt = tidcnt;
} }
pagep = (struct page **) rcd->tid_pg_list; 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,9 +754,9 @@ static int qib_mmap_mem(struct vm_area_struct *vma, struct qib_ctxtdata *rcd,
ret = remap_pfn_range(vma, vma->vm_start, pfn, ret = remap_pfn_range(vma, vma->vm_start, pfn,
len, vma->vm_page_prot); len, vma->vm_page_prot);
if (ret) if (ret)
qib_devinfo(dd->pcidev, "%s ctxt%u mmap of %lx, %x " qib_devinfo(dd->pcidev,
"bytes failed: %d\n", what, rcd->ctxt, "%s ctxt%u mmap of %lx, %x bytes failed: %d\n",
pfn, len, ret); what, rcd->ctxt, pfn, len, ret);
bail: bail:
return ret; return ret;
} }
...@@ -771,8 +775,9 @@ static int mmap_ureg(struct vm_area_struct *vma, struct qib_devdata *dd, ...@@ -771,8 +775,9 @@ static int mmap_ureg(struct vm_area_struct *vma, struct qib_devdata *dd,
*/ */
sz = dd->flags & QIB_HAS_HDRSUPP ? 2 * PAGE_SIZE : PAGE_SIZE; sz = dd->flags & QIB_HAS_HDRSUPP ? 2 * PAGE_SIZE : PAGE_SIZE;
if ((vma->vm_end - vma->vm_start) > sz) { if ((vma->vm_end - vma->vm_start) > sz) {
qib_devinfo(dd->pcidev, "FAIL mmap userreg: reqlen " qib_devinfo(dd->pcidev,
"%lx > PAGE\n", vma->vm_end - vma->vm_start); "FAIL mmap userreg: reqlen %lx > PAGE\n",
vma->vm_end - vma->vm_start);
ret = -EFAULT; ret = -EFAULT;
} else { } else {
phys = dd->physaddr + ureg; phys = dd->physaddr + ureg;
...@@ -802,8 +807,8 @@ static int mmap_piobufs(struct vm_area_struct *vma, ...@@ -802,8 +807,8 @@ static int mmap_piobufs(struct vm_area_struct *vma,
* for it. * for it.
*/ */
if ((vma->vm_end - vma->vm_start) > (piocnt * dd->palign)) { if ((vma->vm_end - vma->vm_start) > (piocnt * dd->palign)) {
qib_devinfo(dd->pcidev, "FAIL mmap piobufs: " qib_devinfo(dd->pcidev,
"reqlen %lx > PAGE\n", "FAIL mmap piobufs: reqlen %lx > PAGE\n",
vma->vm_end - vma->vm_start); vma->vm_end - vma->vm_start);
ret = -EINVAL; ret = -EINVAL;
goto bail; goto bail;
...@@ -847,8 +852,8 @@ static int mmap_rcvegrbufs(struct vm_area_struct *vma, ...@@ -847,8 +852,8 @@ static int mmap_rcvegrbufs(struct vm_area_struct *vma,
size = rcd->rcvegrbuf_size; size = rcd->rcvegrbuf_size;
total_size = rcd->rcvegrbuf_chunks * size; total_size = rcd->rcvegrbuf_chunks * size;
if ((vma->vm_end - vma->vm_start) > total_size) { if ((vma->vm_end - vma->vm_start) > total_size) {
qib_devinfo(dd->pcidev, "FAIL on egr bufs: " qib_devinfo(dd->pcidev,
"reqlen %lx > actual %lx\n", "FAIL on egr bufs: reqlen %lx > actual %lx\n",
vma->vm_end - vma->vm_start, vma->vm_end - vma->vm_start,
(unsigned long) total_size); (unsigned long) total_size);
ret = -EINVAL; ret = -EINVAL;
...@@ -856,8 +861,9 @@ static int mmap_rcvegrbufs(struct vm_area_struct *vma, ...@@ -856,8 +861,9 @@ static int mmap_rcvegrbufs(struct vm_area_struct *vma,
} }
if (vma->vm_flags & VM_WRITE) { if (vma->vm_flags & VM_WRITE) {
qib_devinfo(dd->pcidev, "Can't map eager buffers as " qib_devinfo(dd->pcidev,
"writable (flags=%lx)\n", vma->vm_flags); "Can't map eager buffers as writable (flags=%lx)\n",
vma->vm_flags);
ret = -EPERM; ret = -EPERM;
goto bail; goto bail;
} }
...@@ -1270,8 +1276,8 @@ static int setup_ctxt(struct qib_pportdata *ppd, int ctxt, ...@@ -1270,8 +1276,8 @@ static int setup_ctxt(struct qib_pportdata *ppd, int ctxt,
GFP_KERNEL); GFP_KERNEL);
if (!rcd || !ptmp) { if (!rcd || !ptmp) {
qib_dev_err(dd, "Unable to allocate ctxtdata " qib_dev_err(dd,
"memory, failing open\n"); "Unable to allocate ctxtdata memory, failing open\n");
ret = -ENOMEM; ret = -ENOMEM;
goto bailerr; goto bailerr;
} }
...@@ -1560,8 +1566,8 @@ static int qib_assign_ctxt(struct file *fp, const struct qib_user_info *uinfo) ...@@ -1560,8 +1566,8 @@ static int qib_assign_ctxt(struct file *fp, const struct qib_user_info *uinfo)
} else if (weight == 1 && } else if (weight == 1 &&
test_bit(cpumask_first(tsk_cpus_allowed(current)), test_bit(cpumask_first(tsk_cpus_allowed(current)),
qib_cpulist)) qib_cpulist))
qib_devinfo(dd->pcidev, "%s PID %u affinity " qib_devinfo(dd->pcidev,
"set to cpu %d; already allocated\n", "%s PID %u affinity set to cpu %d; already allocated\n",
current->comm, current->pid, current->comm, current->pid,
cpumask_first(tsk_cpus_allowed(current))); cpumask_first(tsk_cpus_allowed(current)));
} }
...@@ -2185,8 +2191,7 @@ int qib_cdev_init(int minor, const char *name, ...@@ -2185,8 +2191,7 @@ int qib_cdev_init(int minor, const char *name,
cdev = cdev_alloc(); cdev = cdev_alloc();
if (!cdev) { if (!cdev) {
printk(KERN_ERR QIB_DRV_NAME pr_err("Could not allocate cdev for minor %d, %s\n",
": Could not allocate cdev for minor %d, %s\n",
minor, name); minor, name);
ret = -ENOMEM; ret = -ENOMEM;
goto done; goto done;
...@@ -2198,8 +2203,7 @@ int qib_cdev_init(int minor, const char *name, ...@@ -2198,8 +2203,7 @@ int qib_cdev_init(int minor, const char *name,
ret = cdev_add(cdev, dev, 1); ret = cdev_add(cdev, dev, 1);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR QIB_DRV_NAME pr_err("Could not add cdev for minor %d, %s (err %d)\n",
": Could not add cdev for minor %d, %s (err %d)\n",
minor, name, -ret); minor, name, -ret);
goto err_cdev; goto err_cdev;
} }
...@@ -2209,8 +2213,7 @@ int qib_cdev_init(int minor, const char *name, ...@@ -2209,8 +2213,7 @@ int qib_cdev_init(int minor, const char *name,
goto done; goto done;
ret = PTR_ERR(device); ret = PTR_ERR(device);
device = NULL; device = NULL;
printk(KERN_ERR QIB_DRV_NAME ": Could not create " pr_err("Could not create device for minor %d, %s (err %d)\n",
"device for minor %d, %s (err %d)\n",
minor, name, -ret); minor, name, -ret);
err_cdev: err_cdev:
cdev_del(cdev); cdev_del(cdev);
...@@ -2245,16 +2248,14 @@ int __init qib_dev_init(void) ...@@ -2245,16 +2248,14 @@ int __init qib_dev_init(void)
ret = alloc_chrdev_region(&qib_dev, 0, QIB_NMINORS, QIB_DRV_NAME); ret = alloc_chrdev_region(&qib_dev, 0, QIB_NMINORS, QIB_DRV_NAME);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR QIB_DRV_NAME ": Could not allocate " pr_err("Could not allocate chrdev region (err %d)\n", -ret);
"chrdev region (err %d)\n", -ret);
goto done; goto done;
} }
qib_class = class_create(THIS_MODULE, "ipath"); qib_class = class_create(THIS_MODULE, "ipath");
if (IS_ERR(qib_class)) { if (IS_ERR(qib_class)) {
ret = PTR_ERR(qib_class); ret = PTR_ERR(qib_class);
printk(KERN_ERR QIB_DRV_NAME ": Could not create " pr_err("Could not create device class (err %d)\n", -ret);
"device class (err %d)\n", -ret);
unregister_chrdev_region(qib_dev, QIB_NMINORS); unregister_chrdev_region(qib_dev, QIB_NMINORS);
} }
......
/* /*
* Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved. * Copyright (c) 2012 Intel Corporation. All rights reserved.
* Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
* Copyright (c) 2006 PathScale, Inc. All rights reserved. * Copyright (c) 2006 PathScale, Inc. All rights reserved.
* *
* This software is available to you under a choice of one of two * 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,7 +383,7 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd)
ret = create_file(unit, S_IFDIR|S_IRUGO|S_IXUGO, sb->s_root, &dir, ret = create_file(unit, S_IFDIR|S_IRUGO|S_IXUGO, sb->s_root, &dir,
&simple_dir_operations, dd); &simple_dir_operations, dd);
if (ret) { if (ret) {
printk(KERN_ERR "create_file(%s) failed: %d\n", unit, ret); pr_err("create_file(%s) failed: %d\n", unit, ret);
goto bail; goto bail;
} }
...@@ -390,21 +391,21 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd) ...@@ -390,21 +391,21 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd)
ret = create_file("counters", S_IFREG|S_IRUGO, dir, &tmp, ret = create_file("counters", S_IFREG|S_IRUGO, dir, &tmp,
&cntr_ops[0], dd); &cntr_ops[0], dd);
if (ret) { if (ret) {
printk(KERN_ERR "create_file(%s/counters) failed: %d\n", pr_err("create_file(%s/counters) failed: %d\n",
unit, ret); unit, ret);
goto bail; goto bail;
} }
ret = create_file("counter_names", S_IFREG|S_IRUGO, dir, &tmp, ret = create_file("counter_names", S_IFREG|S_IRUGO, dir, &tmp,
&cntr_ops[1], dd); &cntr_ops[1], dd);
if (ret) { if (ret) {
printk(KERN_ERR "create_file(%s/counter_names) failed: %d\n", pr_err("create_file(%s/counter_names) failed: %d\n",
unit, ret); unit, ret);
goto bail; goto bail;
} }
ret = create_file("portcounter_names", S_IFREG|S_IRUGO, dir, &tmp, ret = create_file("portcounter_names", S_IFREG|S_IRUGO, dir, &tmp,
&portcntr_ops[0], dd); &portcntr_ops[0], dd);
if (ret) { if (ret) {
printk(KERN_ERR "create_file(%s/%s) failed: %d\n", pr_err("create_file(%s/%s) failed: %d\n",
unit, "portcounter_names", ret); unit, "portcounter_names", ret);
goto bail; goto bail;
} }
...@@ -416,7 +417,7 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd) ...@@ -416,7 +417,7 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd)
ret = create_file(fname, S_IFREG|S_IRUGO, dir, &tmp, ret = create_file(fname, S_IFREG|S_IRUGO, dir, &tmp,
&portcntr_ops[i], dd); &portcntr_ops[i], dd);
if (ret) { if (ret) {
printk(KERN_ERR "create_file(%s/%s) failed: %d\n", pr_err("create_file(%s/%s) failed: %d\n",
unit, fname, ret); unit, fname, ret);
goto bail; goto bail;
} }
...@@ -426,7 +427,7 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd) ...@@ -426,7 +427,7 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd)
ret = create_file(fname, S_IFREG|S_IRUGO, dir, &tmp, ret = create_file(fname, S_IFREG|S_IRUGO, dir, &tmp,
&qsfp_ops[i - 1], dd); &qsfp_ops[i - 1], dd);
if (ret) { if (ret) {
printk(KERN_ERR "create_file(%s/%s) failed: %d\n", pr_err("create_file(%s/%s) failed: %d\n",
unit, fname, ret); unit, fname, ret);
goto bail; goto bail;
} }
...@@ -435,7 +436,7 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd) ...@@ -435,7 +436,7 @@ static int add_cntr_files(struct super_block *sb, struct qib_devdata *dd)
ret = create_file("flash", S_IFREG|S_IWUSR|S_IRUGO, dir, &tmp, ret = create_file("flash", S_IFREG|S_IWUSR|S_IRUGO, dir, &tmp,
&flash_ops, dd); &flash_ops, dd);
if (ret) if (ret)
printk(KERN_ERR "create_file(%s/flash) failed: %d\n", pr_err("create_file(%s/flash) failed: %d\n",
unit, ret); unit, ret);
bail: bail:
return ret; return ret;
...@@ -486,7 +487,7 @@ static int remove_device_files(struct super_block *sb, ...@@ -486,7 +487,7 @@ static int remove_device_files(struct super_block *sb,
if (IS_ERR(dir)) { if (IS_ERR(dir)) {
ret = PTR_ERR(dir); ret = PTR_ERR(dir);
printk(KERN_ERR "Lookup of %s failed\n", unit); pr_err("Lookup of %s failed\n", unit);
goto bail; goto bail;
} }
...@@ -532,7 +533,7 @@ static int qibfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -532,7 +533,7 @@ static int qibfs_fill_super(struct super_block *sb, void *data, int silent)
ret = simple_fill_super(sb, QIBFS_MAGIC, files); ret = simple_fill_super(sb, QIBFS_MAGIC, files);
if (ret) { if (ret) {
printk(KERN_ERR "simple_fill_super failed: %d\n", ret); pr_err("simple_fill_super failed: %d\n", ret);
goto bail; goto bail;
} }
......
...@@ -753,8 +753,8 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg, ...@@ -753,8 +753,8 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
if (!hwerrs) if (!hwerrs)
return; return;
if (hwerrs == ~0ULL) { if (hwerrs == ~0ULL) {
qib_dev_err(dd, "Read of hardware error status failed " qib_dev_err(dd,
"(all bits set); ignoring\n"); "Read of hardware error status failed (all bits set); ignoring\n");
return; return;
} }
qib_stats.sps_hwerrs++; qib_stats.sps_hwerrs++;
...@@ -779,13 +779,14 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg, ...@@ -779,13 +779,14 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
* or it's occurred within the last 5 seconds. * or it's occurred within the last 5 seconds.
*/ */
if (hwerrs & ~(TXE_PIO_PARITY | RXEMEMPARITYERR_EAGERTID)) if (hwerrs & ~(TXE_PIO_PARITY | RXEMEMPARITYERR_EAGERTID))
qib_devinfo(dd->pcidev, "Hardware error: hwerr=0x%llx " qib_devinfo(dd->pcidev,
"(cleared)\n", (unsigned long long) hwerrs); "Hardware error: hwerr=0x%llx (cleared)\n",
(unsigned long long) hwerrs);
if (hwerrs & ~IB_HWE_BITSEXTANT) if (hwerrs & ~IB_HWE_BITSEXTANT)
qib_dev_err(dd, "hwerror interrupt with unknown errors " qib_dev_err(dd,
"%llx set\n", (unsigned long long) "hwerror interrupt with unknown errors %llx set\n",
(hwerrs & ~IB_HWE_BITSEXTANT)); (unsigned long long)(hwerrs & ~IB_HWE_BITSEXTANT));
ctrl = qib_read_kreg32(dd, kr_control); ctrl = qib_read_kreg32(dd, kr_control);
if ((ctrl & QLOGIC_IB_C_FREEZEMODE) && !dd->diag_client) { 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,8 +816,9 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
if (hwerrs & HWE_MASK(PowerOnBISTFailed)) { if (hwerrs & HWE_MASK(PowerOnBISTFailed)) {
isfatal = 1; isfatal = 1;
strlcat(msg, "[Memory BIST test failed, InfiniPath hardware" strlcat(msg,
" unusable]", msgl); "[Memory BIST test failed, InfiniPath hardware unusable]",
msgl);
/* ignore from now on, so disable until driver reloaded */ /* ignore from now on, so disable until driver reloaded */
dd->cspec->hwerrmask &= ~HWE_MASK(PowerOnBISTFailed); dd->cspec->hwerrmask &= ~HWE_MASK(PowerOnBISTFailed);
qib_write_kreg(dd, kr_hwerrmask, dd->cspec->hwerrmask); 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,8 +870,9 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
*msg = 0; /* recovered from all of them */ *msg = 0; /* recovered from all of them */
if (isfatal && !dd->diag_client) { if (isfatal && !dd->diag_client) {
qib_dev_err(dd, "Fatal Hardware Error, no longer" qib_dev_err(dd,
" usable, SN %.16s\n", dd->serial); "Fatal Hardware Error, no longer usable, SN %.16s\n",
dd->serial);
/* /*
* for /sys status file and user programs to print; if no * for /sys status file and user programs to print; if no
* trailing brace is copied, we'll know it was truncated. * trailing brace is copied, we'll know it was truncated.
...@@ -1017,8 +1020,8 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs) ...@@ -1017,8 +1020,8 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
qib_inc_eeprom_err(dd, log_idx, 1); qib_inc_eeprom_err(dd, log_idx, 1);
if (errs & ~IB_E_BITSEXTANT) if (errs & ~IB_E_BITSEXTANT)
qib_dev_err(dd, "error interrupt with unknown errors " qib_dev_err(dd,
"%llx set\n", "error interrupt with unknown errors %llx set\n",
(unsigned long long) (errs & ~IB_E_BITSEXTANT)); (unsigned long long) (errs & ~IB_E_BITSEXTANT));
if (errs & E_SUM_ERRS) { if (errs & E_SUM_ERRS) {
...@@ -1089,8 +1092,8 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs) ...@@ -1089,8 +1092,8 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
} }
if (errs & ERR_MASK(ResetNegated)) { if (errs & ERR_MASK(ResetNegated)) {
qib_dev_err(dd, "Got reset, requires re-init " qib_dev_err(dd,
"(unload and reload driver)\n"); "Got reset, requires re-init (unload and reload driver)\n");
dd->flags &= ~QIB_INITTED; /* needs re-init */ dd->flags &= ~QIB_INITTED; /* needs re-init */
/* mark as having had error */ /* mark as having had error */
*dd->devstatusp |= QIB_STATUS_HWERROR; *dd->devstatusp |= QIB_STATUS_HWERROR;
...@@ -1541,8 +1544,9 @@ static noinline void unlikely_6120_intr(struct qib_devdata *dd, u64 istat) ...@@ -1541,8 +1544,9 @@ static noinline void unlikely_6120_intr(struct qib_devdata *dd, u64 istat)
qib_stats.sps_errints++; qib_stats.sps_errints++;
estat = qib_read_kreg64(dd, kr_errstatus); estat = qib_read_kreg64(dd, kr_errstatus);
if (!estat) if (!estat)
qib_devinfo(dd->pcidev, "error interrupt (%Lx), " qib_devinfo(dd->pcidev,
"but no error bits set!\n", istat); "error interrupt (%Lx), but no error bits set!\n",
istat);
handle_6120_errors(dd, estat); handle_6120_errors(dd, estat);
} }
...@@ -1715,16 +1719,16 @@ static void qib_setup_6120_interrupt(struct qib_devdata *dd) ...@@ -1715,16 +1719,16 @@ static void qib_setup_6120_interrupt(struct qib_devdata *dd)
} }
if (!dd->cspec->irq) if (!dd->cspec->irq)
qib_dev_err(dd, "irq is 0, BIOS error? Interrupts won't " qib_dev_err(dd,
"work\n"); "irq is 0, BIOS error? Interrupts won't work\n");
else { else {
int ret; int ret;
ret = request_irq(dd->cspec->irq, qib_6120intr, 0, ret = request_irq(dd->cspec->irq, qib_6120intr, 0,
QIB_DRV_NAME, dd); QIB_DRV_NAME, dd);
if (ret) if (ret)
qib_dev_err(dd, "Couldn't setup interrupt " qib_dev_err(dd,
"(irq=%d): %d\n", dd->cspec->irq, "Couldn't setup interrupt (irq=%d): %d\n",
ret); dd->cspec->irq, ret);
} }
} }
...@@ -1759,8 +1763,9 @@ static void pe_boardname(struct qib_devdata *dd) ...@@ -1759,8 +1763,9 @@ static void pe_boardname(struct qib_devdata *dd)
snprintf(dd->boardname, namelen, "%s", n); snprintf(dd->boardname, namelen, "%s", n);
if (dd->majrev != 4 || !dd->minrev || dd->minrev > 2) if (dd->majrev != 4 || !dd->minrev || dd->minrev > 2)
qib_dev_err(dd, "Unsupported InfiniPath hardware revision " qib_dev_err(dd,
"%u.%u!\n", dd->majrev, dd->minrev); "Unsupported InfiniPath hardware revision %u.%u!\n",
dd->majrev, dd->minrev);
snprintf(dd->boardversion, sizeof(dd->boardversion), snprintf(dd->boardversion, sizeof(dd->boardversion),
"ChipABI %u.%u, %s, InfiniPath%u %u.%u, SW Compat %u\n", "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) ...@@ -1833,8 +1838,8 @@ static int qib_6120_setup_reset(struct qib_devdata *dd)
bail: bail:
if (ret) { if (ret) {
if (qib_pcie_params(dd, dd->lbus_width, NULL, NULL)) if (qib_pcie_params(dd, dd->lbus_width, NULL, NULL))
qib_dev_err(dd, "Reset failed to setup PCIe or " qib_dev_err(dd,
"interrupts; continuing anyway\n"); "Reset failed to setup PCIe or interrupts; continuing anyway\n");
/* clear the reset error, init error/hwerror mask */ /* clear the reset error, init error/hwerror mask */
qib_6120_init_hwerrors(dd); qib_6120_init_hwerrors(dd);
/* for Rev2 error interrupts; nop for rev 1 */ /* 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,8 +1881,9 @@ static void qib_6120_put_tid(struct qib_devdata *dd, u64 __iomem *tidptr,
} }
pa >>= 11; pa >>= 11;
if (pa & ~QLOGIC_IB_RT_ADDR_MASK) { if (pa & ~QLOGIC_IB_RT_ADDR_MASK) {
qib_dev_err(dd, "Physical page address 0x%lx " qib_dev_err(dd,
"larger than supported\n", pa); "Physical page address 0x%lx larger than supported\n",
pa);
return; return;
} }
...@@ -1941,8 +1947,9 @@ static void qib_6120_put_tid_2(struct qib_devdata *dd, u64 __iomem *tidptr, ...@@ -1941,8 +1947,9 @@ static void qib_6120_put_tid_2(struct qib_devdata *dd, u64 __iomem *tidptr,
} }
pa >>= 11; pa >>= 11;
if (pa & ~QLOGIC_IB_RT_ADDR_MASK) { if (pa & ~QLOGIC_IB_RT_ADDR_MASK) {
qib_dev_err(dd, "Physical page address 0x%lx " qib_dev_err(dd,
"larger than supported\n", pa); "Physical page address 0x%lx larger than supported\n",
pa);
return; return;
} }
...@@ -2928,8 +2935,9 @@ static int qib_6120_set_loopback(struct qib_pportdata *ppd, const char *what) ...@@ -2928,8 +2935,9 @@ static int qib_6120_set_loopback(struct qib_pportdata *ppd, const char *what)
ppd->dd->unit, ppd->port); ppd->dd->unit, ppd->port);
} else if (!strncmp(what, "off", 3)) { } else if (!strncmp(what, "off", 3)) {
ppd->dd->cspec->ibcctrl &= ~SYM_MASK(IBCCtrl, Loopback); ppd->dd->cspec->ibcctrl &= ~SYM_MASK(IBCCtrl, Loopback);
qib_devinfo(ppd->dd->pcidev, "Disabling IB%u:%u IBC loopback " qib_devinfo(ppd->dd->pcidev,
"(normal)\n", ppd->dd->unit, ppd->port); "Disabling IB%u:%u IBC loopback (normal)\n",
ppd->dd->unit, ppd->port);
} else } else
ret = -EINVAL; ret = -EINVAL;
if (!ret) { if (!ret) {
...@@ -3186,9 +3194,8 @@ static int qib_late_6120_initreg(struct qib_devdata *dd) ...@@ -3186,9 +3194,8 @@ static int qib_late_6120_initreg(struct qib_devdata *dd)
qib_write_kreg(dd, kr_sendpioavailaddr, dd->pioavailregs_phys); qib_write_kreg(dd, kr_sendpioavailaddr, dd->pioavailregs_phys);
val = qib_read_kreg64(dd, kr_sendpioavailaddr); val = qib_read_kreg64(dd, kr_sendpioavailaddr);
if (val != dd->pioavailregs_phys) { if (val != dd->pioavailregs_phys) {
qib_dev_err(dd, "Catastrophic software error, " qib_dev_err(dd,
"SendPIOAvailAddr written as %lx, " "Catastrophic software error, SendPIOAvailAddr written as %lx, read back as %llx\n",
"read back as %llx\n",
(unsigned long) dd->pioavailregs_phys, (unsigned long) dd->pioavailregs_phys,
(unsigned long long) val); (unsigned long long) val);
ret = -EINVAL; ret = -EINVAL;
...@@ -3218,8 +3225,8 @@ static int init_6120_variables(struct qib_devdata *dd) ...@@ -3218,8 +3225,8 @@ static int init_6120_variables(struct qib_devdata *dd)
dd->revision = readq(&dd->kregbase[kr_revision]); dd->revision = readq(&dd->kregbase[kr_revision]);
if ((dd->revision & 0xffffffffU) == 0xffffffffU) { if ((dd->revision & 0xffffffffU) == 0xffffffffU) {
qib_dev_err(dd, "Revision register read failure, " qib_dev_err(dd,
"giving up initialization\n"); "Revision register read failure, giving up initialization\n");
ret = -ENODEV; ret = -ENODEV;
goto bail; goto bail;
} }
...@@ -3551,8 +3558,8 @@ struct qib_devdata *qib_init_iba6120_funcs(struct pci_dev *pdev, ...@@ -3551,8 +3558,8 @@ struct qib_devdata *qib_init_iba6120_funcs(struct pci_dev *pdev,
goto bail; goto bail;
if (qib_pcie_params(dd, 8, NULL, NULL)) if (qib_pcie_params(dd, 8, NULL, NULL))
qib_dev_err(dd, "Failed to setup PCIe or interrupts; " qib_dev_err(dd,
"continuing anyway\n"); "Failed to setup PCIe or interrupts; continuing anyway\n");
dd->cspec->irq = pdev->irq; /* save IRQ */ dd->cspec->irq = pdev->irq; /* save IRQ */
/* clear diagctrl register, in case diags were running and crashed */ /* clear diagctrl register, in case diags were running and crashed */
......
...@@ -1111,9 +1111,9 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs) ...@@ -1111,9 +1111,9 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
sdma_7220_errors(ppd, errs); sdma_7220_errors(ppd, errs);
if (errs & ~IB_E_BITSEXTANT) if (errs & ~IB_E_BITSEXTANT)
qib_dev_err(dd, "error interrupt with unknown errors " qib_dev_err(dd,
"%llx set\n", (unsigned long long) "error interrupt with unknown errors %llx set\n",
(errs & ~IB_E_BITSEXTANT)); (unsigned long long) (errs & ~IB_E_BITSEXTANT));
if (errs & E_SUM_ERRS) { if (errs & E_SUM_ERRS) {
qib_disarm_7220_senderrbufs(ppd); qib_disarm_7220_senderrbufs(ppd);
...@@ -1192,8 +1192,8 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs) ...@@ -1192,8 +1192,8 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
} }
if (errs & ERR_MASK(ResetNegated)) { if (errs & ERR_MASK(ResetNegated)) {
qib_dev_err(dd, "Got reset, requires re-init " qib_dev_err(dd,
"(unload and reload driver)\n"); "Got reset, requires re-init (unload and reload driver)\n");
dd->flags &= ~QIB_INITTED; /* needs re-init */ dd->flags &= ~QIB_INITTED; /* needs re-init */
/* mark as having had error */ /* mark as having had error */
*dd->devstatusp |= QIB_STATUS_HWERROR; *dd->devstatusp |= QIB_STATUS_HWERROR;
...@@ -1305,8 +1305,8 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg, ...@@ -1305,8 +1305,8 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
if (!hwerrs) if (!hwerrs)
goto bail; goto bail;
if (hwerrs == ~0ULL) { if (hwerrs == ~0ULL) {
qib_dev_err(dd, "Read of hardware error status failed " qib_dev_err(dd,
"(all bits set); ignoring\n"); "Read of hardware error status failed (all bits set); ignoring\n");
goto bail; goto bail;
} }
qib_stats.sps_hwerrs++; qib_stats.sps_hwerrs++;
...@@ -1329,13 +1329,14 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg, ...@@ -1329,13 +1329,14 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
qib_inc_eeprom_err(dd, log_idx, 1); qib_inc_eeprom_err(dd, log_idx, 1);
if (hwerrs & ~(TXEMEMPARITYERR_PIOBUF | TXEMEMPARITYERR_PIOPBC | if (hwerrs & ~(TXEMEMPARITYERR_PIOBUF | TXEMEMPARITYERR_PIOPBC |
RXE_PARITY)) RXE_PARITY))
qib_devinfo(dd->pcidev, "Hardware error: hwerr=0x%llx " qib_devinfo(dd->pcidev,
"(cleared)\n", (unsigned long long) hwerrs); "Hardware error: hwerr=0x%llx (cleared)\n",
(unsigned long long) hwerrs);
if (hwerrs & ~IB_HWE_BITSEXTANT) if (hwerrs & ~IB_HWE_BITSEXTANT)
qib_dev_err(dd, "hwerror interrupt with unknown errors " qib_dev_err(dd,
"%llx set\n", (unsigned long long) "hwerror interrupt with unknown errors %llx set\n",
(hwerrs & ~IB_HWE_BITSEXTANT)); (unsigned long long) (hwerrs & ~IB_HWE_BITSEXTANT));
if (hwerrs & QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR) if (hwerrs & QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR)
qib_sd7220_clr_ibpar(dd); qib_sd7220_clr_ibpar(dd);
...@@ -1362,8 +1363,9 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg, ...@@ -1362,8 +1363,9 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
if (hwerrs & HWE_MASK(PowerOnBISTFailed)) { if (hwerrs & HWE_MASK(PowerOnBISTFailed)) {
isfatal = 1; isfatal = 1;
strlcat(msg, "[Memory BIST test failed, " strlcat(msg,
"InfiniPath hardware unusable]", msgl); "[Memory BIST test failed, InfiniPath hardware unusable]",
msgl);
/* ignore from now on, so disable until driver reloaded */ /* ignore from now on, so disable until driver reloaded */
dd->cspec->hwerrmask &= ~HWE_MASK(PowerOnBISTFailed); dd->cspec->hwerrmask &= ~HWE_MASK(PowerOnBISTFailed);
qib_write_kreg(dd, kr_hwerrmask, dd->cspec->hwerrmask); 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,8 +1411,9 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
qib_dev_err(dd, "%s hardware error\n", msg); qib_dev_err(dd, "%s hardware error\n", msg);
if (isfatal && !dd->diag_client) { if (isfatal && !dd->diag_client) {
qib_dev_err(dd, "Fatal Hardware Error, no longer" qib_dev_err(dd,
" usable, SN %.16s\n", dd->serial); "Fatal Hardware Error, no longer usable, SN %.16s\n",
dd->serial);
/* /*
* For /sys status file and user programs to print; if no * For /sys status file and user programs to print; if no
* trailing brace is copied, we'll know it was truncated. * 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,8 +1921,9 @@ static noinline void unlikely_7220_intr(struct qib_devdata *dd, u64 istat)
qib_stats.sps_errints++; qib_stats.sps_errints++;
estat = qib_read_kreg64(dd, kr_errstatus); estat = qib_read_kreg64(dd, kr_errstatus);
if (!estat) if (!estat)
qib_devinfo(dd->pcidev, "error interrupt (%Lx), " qib_devinfo(dd->pcidev,
"but no error bits set!\n", istat); "error interrupt (%Lx), but no error bits set!\n",
istat);
else else
handle_7220_errors(dd, estat); handle_7220_errors(dd, estat);
} }
...@@ -2023,17 +2027,18 @@ static irqreturn_t qib_7220intr(int irq, void *data) ...@@ -2023,17 +2027,18 @@ static irqreturn_t qib_7220intr(int irq, void *data)
static void qib_setup_7220_interrupt(struct qib_devdata *dd) static void qib_setup_7220_interrupt(struct qib_devdata *dd)
{ {
if (!dd->cspec->irq) if (!dd->cspec->irq)
qib_dev_err(dd, "irq is 0, BIOS error? Interrupts won't " qib_dev_err(dd,
"work\n"); "irq is 0, BIOS error? Interrupts won't work\n");
else { else {
int ret = request_irq(dd->cspec->irq, qib_7220intr, int ret = request_irq(dd->cspec->irq, qib_7220intr,
dd->msi_lo ? 0 : IRQF_SHARED, dd->msi_lo ? 0 : IRQF_SHARED,
QIB_DRV_NAME, dd); QIB_DRV_NAME, dd);
if (ret) if (ret)
qib_dev_err(dd, "Couldn't setup %s interrupt " qib_dev_err(dd,
"(irq=%d): %d\n", dd->msi_lo ? "Couldn't setup %s interrupt (irq=%d): %d\n",
"MSI" : "INTx", dd->cspec->irq, ret); dd->msi_lo ? "MSI" : "INTx",
dd->cspec->irq, ret);
} }
} }
...@@ -2072,8 +2077,8 @@ static void qib_7220_boardname(struct qib_devdata *dd) ...@@ -2072,8 +2077,8 @@ static void qib_7220_boardname(struct qib_devdata *dd)
snprintf(dd->boardname, namelen, "%s", n); snprintf(dd->boardname, namelen, "%s", n);
if (dd->majrev != 5 || !dd->minrev || dd->minrev > 2) if (dd->majrev != 5 || !dd->minrev || dd->minrev > 2)
qib_dev_err(dd, "Unsupported InfiniPath hardware " qib_dev_err(dd,
"revision %u.%u!\n", "Unsupported InfiniPath hardware revision %u.%u!\n",
dd->majrev, dd->minrev); dd->majrev, dd->minrev);
snprintf(dd->boardversion, sizeof(dd->boardversion), snprintf(dd->boardversion, sizeof(dd->boardversion),
...@@ -2146,8 +2151,8 @@ static int qib_setup_7220_reset(struct qib_devdata *dd) ...@@ -2146,8 +2151,8 @@ static int qib_setup_7220_reset(struct qib_devdata *dd)
bail: bail:
if (ret) { if (ret) {
if (qib_pcie_params(dd, dd->lbus_width, NULL, NULL)) if (qib_pcie_params(dd, dd->lbus_width, NULL, NULL))
qib_dev_err(dd, "Reset failed to setup PCIe or " qib_dev_err(dd,
"interrupts; continuing anyway\n"); "Reset failed to setup PCIe or interrupts; continuing anyway\n");
/* hold IBC in reset, no sends, etc till later */ /* hold IBC in reset, no sends, etc till later */
qib_write_kreg(dd, kr_control, 0ULL); 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,8 +2192,9 @@ static void qib_7220_put_tid(struct qib_devdata *dd, u64 __iomem *tidptr,
return; return;
} }
if (chippa >= (1UL << IBA7220_TID_SZ_SHIFT)) { if (chippa >= (1UL << IBA7220_TID_SZ_SHIFT)) {
qib_dev_err(dd, "Physical page address 0x%lx " qib_dev_err(dd,
"larger than supported\n", pa); "Physical page address 0x%lx larger than supported\n",
pa);
return; return;
} }
...@@ -2706,8 +2712,9 @@ static int qib_7220_set_loopback(struct qib_pportdata *ppd, const char *what) ...@@ -2706,8 +2712,9 @@ static int qib_7220_set_loopback(struct qib_pportdata *ppd, const char *what)
ppd->cpspec->ibcctrl &= ~SYM_MASK(IBCCtrl, Loopback); ppd->cpspec->ibcctrl &= ~SYM_MASK(IBCCtrl, Loopback);
/* enable heart beat again */ /* enable heart beat again */
val = IBA7220_IBC_HRTBT_MASK << IBA7220_IBC_HRTBT_SHIFT; val = IBA7220_IBC_HRTBT_MASK << IBA7220_IBC_HRTBT_SHIFT;
qib_devinfo(ppd->dd->pcidev, "Disabling IB%u:%u IBC loopback " qib_devinfo(ppd->dd->pcidev,
"(normal)\n", ppd->dd->unit, ppd->port); "Disabling IB%u:%u IBC loopback (normal)\n",
ppd->dd->unit, ppd->port);
} else } else
ret = -EINVAL; ret = -EINVAL;
if (!ret) { if (!ret) {
...@@ -3307,8 +3314,8 @@ static int qib_7220_intr_fallback(struct qib_devdata *dd) ...@@ -3307,8 +3314,8 @@ static int qib_7220_intr_fallback(struct qib_devdata *dd)
if (!dd->msi_lo) if (!dd->msi_lo)
return 0; return 0;
qib_devinfo(dd->pcidev, "MSI interrupt not detected," qib_devinfo(dd->pcidev,
" trying INTx interrupts\n"); "MSI interrupt not detected, trying INTx interrupts\n");
qib_7220_free_irq(dd); qib_7220_free_irq(dd);
qib_enable_intx(dd->pcidev); qib_enable_intx(dd->pcidev);
/* /*
...@@ -3980,9 +3987,8 @@ static int qib_late_7220_initreg(struct qib_devdata *dd) ...@@ -3980,9 +3987,8 @@ static int qib_late_7220_initreg(struct qib_devdata *dd)
qib_write_kreg(dd, kr_sendpioavailaddr, dd->pioavailregs_phys); qib_write_kreg(dd, kr_sendpioavailaddr, dd->pioavailregs_phys);
val = qib_read_kreg64(dd, kr_sendpioavailaddr); val = qib_read_kreg64(dd, kr_sendpioavailaddr);
if (val != dd->pioavailregs_phys) { if (val != dd->pioavailregs_phys) {
qib_dev_err(dd, "Catastrophic software error, " qib_dev_err(dd,
"SendPIOAvailAddr written as %lx, " "Catastrophic software error, SendPIOAvailAddr written as %lx, read back as %llx\n",
"read back as %llx\n",
(unsigned long) dd->pioavailregs_phys, (unsigned long) dd->pioavailregs_phys,
(unsigned long long) val); (unsigned long long) val);
ret = -EINVAL; ret = -EINVAL;
...@@ -4014,8 +4020,8 @@ static int qib_init_7220_variables(struct qib_devdata *dd) ...@@ -4014,8 +4020,8 @@ static int qib_init_7220_variables(struct qib_devdata *dd)
dd->revision = readq(&dd->kregbase[kr_revision]); dd->revision = readq(&dd->kregbase[kr_revision]);
if ((dd->revision & 0xffffffffU) == 0xffffffffU) { if ((dd->revision & 0xffffffffU) == 0xffffffffU) {
qib_dev_err(dd, "Revision register read failure, " qib_dev_err(dd,
"giving up initialization\n"); "Revision register read failure, giving up initialization\n");
ret = -ENODEV; ret = -ENODEV;
goto bail; goto bail;
} }
...@@ -4613,8 +4619,8 @@ struct qib_devdata *qib_init_iba7220_funcs(struct pci_dev *pdev, ...@@ -4613,8 +4619,8 @@ struct qib_devdata *qib_init_iba7220_funcs(struct pci_dev *pdev,
break; break;
} }
if (qib_pcie_params(dd, minwidth, NULL, NULL)) if (qib_pcie_params(dd, minwidth, NULL, NULL))
qib_dev_err(dd, "Failed to setup PCIe or interrupts; " qib_dev_err(dd,
"continuing anyway\n"); "Failed to setup PCIe or interrupts; continuing anyway\n");
/* save IRQ for possible later use */ /* save IRQ for possible later use */
dd->cspec->irq = pdev->irq; dd->cspec->irq = pdev->irq;
......
...@@ -52,6 +52,9 @@ ...@@ -52,6 +52,9 @@
#include "qib_mad.h" #include "qib_mad.h"
#include "qib_verbs.h" #include "qib_verbs.h"
#undef pr_fmt
#define pr_fmt(fmt) QIB_DRV_NAME " " fmt
static void qib_setup_7322_setextled(struct qib_pportdata *, u32); static void qib_setup_7322_setextled(struct qib_pportdata *, u32);
static void qib_7322_handle_hwerrors(struct qib_devdata *, char *, size_t); static void qib_7322_handle_hwerrors(struct qib_devdata *, char *, size_t);
static void sendctrl_7322_mod(struct qib_pportdata *ppd, u32 op); static 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,8 +1580,8 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
qib_stats.sps_errints++; qib_stats.sps_errints++;
errs = qib_read_kreg64(dd, kr_errstatus); errs = qib_read_kreg64(dd, kr_errstatus);
if (!errs) { if (!errs) {
qib_devinfo(dd->pcidev, "device error interrupt, " qib_devinfo(dd->pcidev,
"but no error bits set!\n"); "device error interrupt, but no error bits set!\n");
goto done; goto done;
} }
...@@ -1624,8 +1627,8 @@ static noinline void handle_7322_errors(struct qib_devdata *dd) ...@@ -1624,8 +1627,8 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
if (errs & QIB_E_RESET) { if (errs & QIB_E_RESET) {
int pidx; int pidx;
qib_dev_err(dd, "Got reset, requires re-init " qib_dev_err(dd,
"(unload and reload driver)\n"); "Got reset, requires re-init (unload and reload driver)\n");
dd->flags &= ~QIB_INITTED; /* needs re-init */ dd->flags &= ~QIB_INITTED; /* needs re-init */
/* mark as having had error */ /* mark as having had error */
*dd->devstatusp |= QIB_STATUS_HWERROR; *dd->devstatusp |= QIB_STATUS_HWERROR;
...@@ -1762,9 +1765,9 @@ static void handle_serdes_issues(struct qib_pportdata *ppd, u64 ibcst) ...@@ -1762,9 +1765,9 @@ static void handle_serdes_issues(struct qib_pportdata *ppd, u64 ibcst)
ppd->dd->cspec->r1 ? ppd->dd->cspec->r1 ?
QDR_STATIC_ADAPT_DOWN_R1 : QDR_STATIC_ADAPT_DOWN_R1 :
QDR_STATIC_ADAPT_DOWN); QDR_STATIC_ADAPT_DOWN);
printk(KERN_INFO QIB_DRV_NAME pr_info(
" IB%u:%u re-enabled QDR adaptation " "IB%u:%u re-enabled QDR adaptation ibclt %x\n",
"ibclt %x\n", ppd->dd->unit, ppd->port, ibclt); ppd->dd->unit, ppd->port, ibclt);
} }
} }
} }
...@@ -1806,8 +1809,8 @@ static noinline void handle_7322_p_errors(struct qib_pportdata *ppd) ...@@ -1806,8 +1809,8 @@ static noinline void handle_7322_p_errors(struct qib_pportdata *ppd)
if (!*msg) if (!*msg)
snprintf(msg, sizeof ppd->cpspec->epmsgbuf, snprintf(msg, sizeof ppd->cpspec->epmsgbuf,
"no others"); "no others");
qib_dev_porterr(dd, ppd->port, "error interrupt with unknown" qib_dev_porterr(dd, ppd->port,
" errors 0x%016Lx set (and %s)\n", "error interrupt with unknown errors 0x%016Lx set (and %s)\n",
(errs & ~QIB_E_P_BITSEXTANT), msg); (errs & ~QIB_E_P_BITSEXTANT), msg);
*msg = '\0'; *msg = '\0';
} }
...@@ -2026,8 +2029,8 @@ static void qib_7322_handle_hwerrors(struct qib_devdata *dd, char *msg, ...@@ -2026,8 +2029,8 @@ static void qib_7322_handle_hwerrors(struct qib_devdata *dd, char *msg,
if (!hwerrs) if (!hwerrs)
goto bail; goto bail;
if (hwerrs == ~0ULL) { if (hwerrs == ~0ULL) {
qib_dev_err(dd, "Read of hardware error status failed " qib_dev_err(dd,
"(all bits set); ignoring\n"); "Read of hardware error status failed (all bits set); ignoring\n");
goto bail; goto bail;
} }
qib_stats.sps_hwerrs++; qib_stats.sps_hwerrs++;
...@@ -2041,8 +2044,9 @@ static void qib_7322_handle_hwerrors(struct qib_devdata *dd, char *msg, ...@@ -2041,8 +2044,9 @@ static void qib_7322_handle_hwerrors(struct qib_devdata *dd, char *msg,
/* no EEPROM logging, yet */ /* no EEPROM logging, yet */
if (hwerrs) if (hwerrs)
qib_devinfo(dd->pcidev, "Hardware error: hwerr=0x%llx " qib_devinfo(dd->pcidev,
"(cleared)\n", (unsigned long long) hwerrs); "Hardware error: hwerr=0x%llx (cleared)\n",
(unsigned long long) hwerrs);
ctrl = qib_read_kreg32(dd, kr_control); ctrl = qib_read_kreg32(dd, kr_control);
if ((ctrl & SYM_MASK(Control, FreezeMode)) && !dd->diag_client) { 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,8 +2070,9 @@ static void qib_7322_handle_hwerrors(struct qib_devdata *dd, char *msg,
if (hwerrs & HWE_MASK(PowerOnBISTFailed)) { if (hwerrs & HWE_MASK(PowerOnBISTFailed)) {
isfatal = 1; isfatal = 1;
strlcpy(msg, "[Memory BIST test failed, " strlcpy(msg,
"InfiniPath hardware unusable]", msgl); "[Memory BIST test failed, InfiniPath hardware unusable]",
msgl);
/* ignore from now on, so disable until driver reloaded */ /* ignore from now on, so disable until driver reloaded */
dd->cspec->hwerrmask &= ~HWE_MASK(PowerOnBISTFailed); dd->cspec->hwerrmask &= ~HWE_MASK(PowerOnBISTFailed);
qib_write_kreg(dd, kr_hwerrmask, dd->cspec->hwerrmask); 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,8 +2085,9 @@ static void qib_7322_handle_hwerrors(struct qib_devdata *dd, char *msg,
qib_dev_err(dd, "%s hardware error\n", msg); qib_dev_err(dd, "%s hardware error\n", msg);
if (isfatal && !dd->diag_client) { if (isfatal && !dd->diag_client) {
qib_dev_err(dd, "Fatal Hardware Error, no longer" qib_dev_err(dd,
" usable, SN %.16s\n", dd->serial); "Fatal Hardware Error, no longer usable, SN %.16s\n",
dd->serial);
/* /*
* for /sys status file and user programs to print; if no * for /sys status file and user programs to print; if no
* trailing brace is copied, we'll know it was truncated. * 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,8 +2675,9 @@ static noinline void unknown_7322_ibits(struct qib_devdata *dd, u64 istat)
char msg[128]; char msg[128];
kills = istat & ~QIB_I_BITSEXTANT; kills = istat & ~QIB_I_BITSEXTANT;
qib_dev_err(dd, "Clearing reserved interrupt(s) 0x%016llx:" qib_dev_err(dd,
" %s\n", (unsigned long long) kills, msg); "Clearing reserved interrupt(s) 0x%016llx: %s\n",
(unsigned long long) kills, msg);
qib_write_kreg(dd, kr_intmask, (dd->cspec->int_enable_mask & ~kills)); qib_write_kreg(dd, kr_intmask, (dd->cspec->int_enable_mask & ~kills));
} }
...@@ -3103,15 +3110,15 @@ static void qib_setup_7322_interrupt(struct qib_devdata *dd, int clearpend) ...@@ -3103,15 +3110,15 @@ static void qib_setup_7322_interrupt(struct qib_devdata *dd, int clearpend)
/* Try to get INTx interrupt */ /* Try to get INTx interrupt */
try_intx: try_intx:
if (!dd->pcidev->irq) { if (!dd->pcidev->irq) {
qib_dev_err(dd, "irq is 0, BIOS error? " qib_dev_err(dd,
"Interrupts won't work\n"); "irq is 0, BIOS error? Interrupts won't work\n");
goto bail; goto bail;
} }
ret = request_irq(dd->pcidev->irq, qib_7322intr, ret = request_irq(dd->pcidev->irq, qib_7322intr,
IRQF_SHARED, QIB_DRV_NAME, dd); IRQF_SHARED, QIB_DRV_NAME, dd);
if (ret) { if (ret) {
qib_dev_err(dd, "Couldn't setup INTx " qib_dev_err(dd,
"interrupt (irq=%d): %d\n", "Couldn't setup INTx interrupt (irq=%d): %d\n",
dd->pcidev->irq, ret); dd->pcidev->irq, ret);
goto bail; goto bail;
} }
...@@ -3187,8 +3194,9 @@ static void qib_setup_7322_interrupt(struct qib_devdata *dd, int clearpend) ...@@ -3187,8 +3194,9 @@ static void qib_setup_7322_interrupt(struct qib_devdata *dd, int clearpend)
* Shouldn't happen since the enable said we could * Shouldn't happen since the enable said we could
* have as many as we are trying to setup here. * have as many as we are trying to setup here.
*/ */
qib_dev_err(dd, "Couldn't setup MSIx " qib_dev_err(dd,
"interrupt (vec=%d, irq=%d): %d\n", msixnum, "Couldn't setup MSIx interrupt (vec=%d, irq=%d): %d\n",
msixnum,
dd->cspec->msix_entries[msixnum].msix.vector, dd->cspec->msix_entries[msixnum].msix.vector,
ret); ret);
qib_7322_nomsix(dd); qib_7322_nomsix(dd);
...@@ -3307,8 +3315,9 @@ static unsigned qib_7322_boardname(struct qib_devdata *dd) ...@@ -3307,8 +3315,9 @@ static unsigned qib_7322_boardname(struct qib_devdata *dd)
(unsigned)SYM_FIELD(dd->revision, Revision_R, SW)); (unsigned)SYM_FIELD(dd->revision, Revision_R, SW));
if (qib_singleport && (features >> PORT_SPD_CAP_SHIFT) & PORT_SPD_CAP) { if (qib_singleport && (features >> PORT_SPD_CAP_SHIFT) & PORT_SPD_CAP) {
qib_devinfo(dd->pcidev, "IB%u: Forced to single port mode" qib_devinfo(dd->pcidev,
" by module parameter\n", dd->unit); "IB%u: Forced to single port mode by module parameter\n",
dd->unit);
features &= PORT_SPD_CAP; features &= PORT_SPD_CAP;
} }
...@@ -3402,8 +3411,8 @@ static int qib_do_7322_reset(struct qib_devdata *dd) ...@@ -3402,8 +3411,8 @@ static int qib_do_7322_reset(struct qib_devdata *dd)
if (val == dd->revision) if (val == dd->revision)
break; break;
if (i == 5) { if (i == 5) {
qib_dev_err(dd, "Failed to initialize after reset, " qib_dev_err(dd,
"unusable\n"); "Failed to initialize after reset, unusable\n");
ret = 0; ret = 0;
goto bail; goto bail;
} }
...@@ -3434,8 +3443,8 @@ static int qib_do_7322_reset(struct qib_devdata *dd) ...@@ -3434,8 +3443,8 @@ static int qib_do_7322_reset(struct qib_devdata *dd)
if (qib_pcie_params(dd, dd->lbus_width, if (qib_pcie_params(dd, dd->lbus_width,
&dd->cspec->num_msix_entries, &dd->cspec->num_msix_entries,
dd->cspec->msix_entries)) dd->cspec->msix_entries))
qib_dev_err(dd, "Reset failed to setup PCIe or interrupts; " qib_dev_err(dd,
"continuing anyway\n"); "Reset failed to setup PCIe or interrupts; continuing anyway\n");
qib_setup_7322_interrupt(dd, 1); qib_setup_7322_interrupt(dd, 1);
...@@ -3476,8 +3485,9 @@ static void qib_7322_put_tid(struct qib_devdata *dd, u64 __iomem *tidptr, ...@@ -3476,8 +3485,9 @@ static void qib_7322_put_tid(struct qib_devdata *dd, u64 __iomem *tidptr,
return; return;
} }
if (chippa >= (1UL << IBA7322_TID_SZ_SHIFT)) { if (chippa >= (1UL << IBA7322_TID_SZ_SHIFT)) {
qib_dev_err(dd, "Physical page address 0x%lx " qib_dev_err(dd,
"larger than supported\n", pa); "Physical page address 0x%lx larger than supported\n",
pa);
return; return;
} }
...@@ -4031,8 +4041,9 @@ static int qib_7322_set_loopback(struct qib_pportdata *ppd, const char *what) ...@@ -4031,8 +4041,9 @@ static int qib_7322_set_loopback(struct qib_pportdata *ppd, const char *what)
Loopback); Loopback);
/* enable heart beat again */ /* enable heart beat again */
val = IBA7322_IBC_HRTBT_RMASK << IBA7322_IBC_HRTBT_LSB; val = IBA7322_IBC_HRTBT_RMASK << IBA7322_IBC_HRTBT_LSB;
qib_devinfo(ppd->dd->pcidev, "Disabling IB%u:%u IBC loopback " qib_devinfo(ppd->dd->pcidev,
"(normal)\n", ppd->dd->unit, ppd->port); "Disabling IB%u:%u IBC loopback (normal)\n",
ppd->dd->unit, ppd->port);
} else } else
ret = -EINVAL; ret = -EINVAL;
if (!ret) { if (!ret) {
...@@ -4716,8 +4727,8 @@ static void init_7322_cntrnames(struct qib_devdata *dd) ...@@ -4716,8 +4727,8 @@ static void init_7322_cntrnames(struct qib_devdata *dd)
dd->pport[i].cpspec->portcntrs = kmalloc(dd->cspec->nportcntrs dd->pport[i].cpspec->portcntrs = kmalloc(dd->cspec->nportcntrs
* sizeof(u64), GFP_KERNEL); * sizeof(u64), GFP_KERNEL);
if (!dd->pport[i].cpspec->portcntrs) if (!dd->pport[i].cpspec->portcntrs)
qib_dev_err(dd, "Failed allocation for" qib_dev_err(dd,
" portcounters\n"); "Failed allocation for portcounters\n");
} }
} }
...@@ -4867,8 +4878,8 @@ static int qib_7322_intr_fallback(struct qib_devdata *dd) ...@@ -4867,8 +4878,8 @@ static int qib_7322_intr_fallback(struct qib_devdata *dd)
if (!dd->cspec->num_msix_entries) if (!dd->cspec->num_msix_entries)
return 0; /* already using INTx */ return 0; /* already using INTx */
qib_devinfo(dd->pcidev, "MSIx interrupt not detected," qib_devinfo(dd->pcidev,
" trying INTx interrupts\n"); "MSIx interrupt not detected, trying INTx interrupts\n");
qib_7322_nomsix(dd); qib_7322_nomsix(dd);
qib_enable_intx(dd->pcidev); qib_enable_intx(dd->pcidev);
qib_setup_7322_interrupt(dd, 0); qib_setup_7322_interrupt(dd, 0);
...@@ -5842,22 +5853,21 @@ static int setup_txselect(const char *str, struct kernel_param *kp) ...@@ -5842,22 +5853,21 @@ static int setup_txselect(const char *str, struct kernel_param *kp)
{ {
struct qib_devdata *dd; struct qib_devdata *dd;
unsigned long val; unsigned long val;
char *n; int ret;
if (strlen(str) >= MAX_ATTEN_LEN) { if (strlen(str) >= MAX_ATTEN_LEN) {
printk(KERN_INFO QIB_DRV_NAME " txselect_values string " pr_info("txselect_values string too long\n");
"too long\n");
return -ENOSPC; return -ENOSPC;
} }
val = simple_strtoul(str, &n, 0); ret = kstrtoul(str, 0, &val);
if (n == str || val >= (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + if (ret || val >= (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ +
TXDDS_MFG_SZ)) { TXDDS_MFG_SZ)) {
printk(KERN_INFO QIB_DRV_NAME pr_info("txselect_values must start with a number < %d\n",
"txselect_values must start with a number < %d\n",
TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + TXDDS_MFG_SZ); TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + TXDDS_MFG_SZ);
return -EINVAL; return ret ? ret : -EINVAL;
} }
strcpy(txselect_list, str);
strcpy(txselect_list, str);
list_for_each_entry(dd, &qib_dev_list, list) list_for_each_entry(dd, &qib_dev_list, list)
if (dd->deviceid == PCI_DEVICE_ID_QLOGIC_IB_7322) if (dd->deviceid == PCI_DEVICE_ID_QLOGIC_IB_7322)
set_no_qsfp_atten(dd, 1); set_no_qsfp_atten(dd, 1);
...@@ -5880,9 +5890,8 @@ static int qib_late_7322_initreg(struct qib_devdata *dd) ...@@ -5880,9 +5890,8 @@ static int qib_late_7322_initreg(struct qib_devdata *dd)
qib_write_kreg(dd, kr_sendpioavailaddr, dd->pioavailregs_phys); qib_write_kreg(dd, kr_sendpioavailaddr, dd->pioavailregs_phys);
val = qib_read_kreg64(dd, kr_sendpioavailaddr); val = qib_read_kreg64(dd, kr_sendpioavailaddr);
if (val != dd->pioavailregs_phys) { if (val != dd->pioavailregs_phys) {
qib_dev_err(dd, "Catastrophic software error, " qib_dev_err(dd,
"SendPIOAvailAddr written as %lx, " "Catastrophic software error, SendPIOAvailAddr written as %lx, read back as %llx\n",
"read back as %llx\n",
(unsigned long) dd->pioavailregs_phys, (unsigned long) dd->pioavailregs_phys,
(unsigned long long) val); (unsigned long long) val);
ret = -EINVAL; ret = -EINVAL;
...@@ -6096,8 +6105,8 @@ static int qib_init_7322_variables(struct qib_devdata *dd) ...@@ -6096,8 +6105,8 @@ static int qib_init_7322_variables(struct qib_devdata *dd)
dd->revision = readq(&dd->kregbase[kr_revision]); dd->revision = readq(&dd->kregbase[kr_revision]);
if ((dd->revision & 0xffffffffU) == 0xffffffffU) { if ((dd->revision & 0xffffffffU) == 0xffffffffU) {
qib_dev_err(dd, "Revision register read failure, " qib_dev_err(dd,
"giving up initialization\n"); "Revision register read failure, giving up initialization\n");
ret = -ENODEV; ret = -ENODEV;
goto bail; goto bail;
} }
...@@ -6263,8 +6272,8 @@ static int qib_init_7322_variables(struct qib_devdata *dd) ...@@ -6263,8 +6272,8 @@ static int qib_init_7322_variables(struct qib_devdata *dd)
*/ */
if (!(dd->flags & QIB_HAS_QSFP)) { if (!(dd->flags & QIB_HAS_QSFP)) {
if (!IS_QMH(dd) && !IS_QME(dd)) if (!IS_QMH(dd) && !IS_QME(dd))
qib_devinfo(dd->pcidev, "IB%u:%u: " qib_devinfo(dd->pcidev,
"Unknown mezzanine card type\n", "IB%u:%u: Unknown mezzanine card type\n",
dd->unit, ppd->port); dd->unit, ppd->port);
cp->h1_val = IS_QMH(dd) ? H1_FORCE_QMH : H1_FORCE_QME; cp->h1_val = IS_QMH(dd) ? H1_FORCE_QMH : H1_FORCE_QME;
/* /*
...@@ -6920,8 +6929,8 @@ struct qib_devdata *qib_init_iba7322_funcs(struct pci_dev *pdev, ...@@ -6920,8 +6929,8 @@ struct qib_devdata *qib_init_iba7322_funcs(struct pci_dev *pdev,
dd->cspec->msix_entries[i].msix.entry = i; dd->cspec->msix_entries[i].msix.entry = i;
if (qib_pcie_params(dd, 8, &tabsize, dd->cspec->msix_entries)) if (qib_pcie_params(dd, 8, &tabsize, dd->cspec->msix_entries))
qib_dev_err(dd, "Failed to setup PCIe or interrupts; " qib_dev_err(dd,
"continuing anyway\n"); "Failed to setup PCIe or interrupts; continuing anyway\n");
/* may be less than we wanted, if not enough available */ /* may be less than we wanted, if not enough available */
dd->cspec->num_msix_entries = tabsize; dd->cspec->num_msix_entries = tabsize;
...@@ -7274,8 +7283,7 @@ static void find_best_ent(struct qib_pportdata *ppd, ...@@ -7274,8 +7283,7 @@ static void find_best_ent(struct qib_pportdata *ppd,
ppd->cpspec->no_eep < (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + ppd->cpspec->no_eep < (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ +
TXDDS_MFG_SZ)) { TXDDS_MFG_SZ)) {
idx = ppd->cpspec->no_eep - (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ); idx = ppd->cpspec->no_eep - (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ);
printk(KERN_INFO QIB_DRV_NAME pr_info("IB%u:%u use idx %u into txdds_mfg\n",
" IB%u:%u use idx %u into txdds_mfg\n",
ppd->dd->unit, ppd->port, idx); ppd->dd->unit, ppd->port, idx);
*sdr_dds = &txdds_extra_mfg[idx]; *sdr_dds = &txdds_extra_mfg[idx];
*ddr_dds = &txdds_extra_mfg[idx]; *ddr_dds = &txdds_extra_mfg[idx];
...@@ -7430,11 +7438,11 @@ static void serdes_7322_los_enable(struct qib_pportdata *ppd, int enable) ...@@ -7430,11 +7438,11 @@ static void serdes_7322_los_enable(struct qib_pportdata *ppd, int enable)
u8 state = SYM_FIELD(data, IBSerdesCtrl_0, RXLOSEN); u8 state = SYM_FIELD(data, IBSerdesCtrl_0, RXLOSEN);
if (enable && !state) { if (enable && !state) {
printk(KERN_INFO QIB_DRV_NAME " IB%u:%u Turning LOS on\n", pr_info("IB%u:%u Turning LOS on\n",
ppd->dd->unit, ppd->port); ppd->dd->unit, ppd->port);
data |= SYM_MASK(IBSerdesCtrl_0, RXLOSEN); data |= SYM_MASK(IBSerdesCtrl_0, RXLOSEN);
} else if (!enable && state) { } else if (!enable && state) {
printk(KERN_INFO QIB_DRV_NAME " IB%u:%u Turning LOS off\n", pr_info("IB%u:%u Turning LOS off\n",
ppd->dd->unit, ppd->port); ppd->dd->unit, ppd->port);
data &= ~SYM_MASK(IBSerdesCtrl_0, RXLOSEN); data &= ~SYM_MASK(IBSerdesCtrl_0, RXLOSEN);
} }
...@@ -7670,8 +7678,7 @@ static int serdes_7322_init_new(struct qib_pportdata *ppd) ...@@ -7670,8 +7678,7 @@ static int serdes_7322_init_new(struct qib_pportdata *ppd)
} }
} }
if (chan_done) { if (chan_done) {
printk(KERN_INFO QIB_DRV_NAME pr_info("Serdes %d calibration not done after .5 sec: 0x%x\n",
" Serdes %d calibration not done after .5 sec: 0x%x\n",
IBSD(ppd->hw_pidx), chan_done); IBSD(ppd->hw_pidx), chan_done);
} else { } else {
for (chan = 0; chan < SERDES_CHANS; ++chan) { for (chan = 0; chan < SERDES_CHANS; ++chan) {
...@@ -7679,9 +7686,8 @@ static int serdes_7322_init_new(struct qib_pportdata *ppd) ...@@ -7679,9 +7686,8 @@ static int serdes_7322_init_new(struct qib_pportdata *ppd)
(chan + (chan >> 1)), (chan + (chan >> 1)),
25, 0, 0); 25, 0, 0);
if ((~rxcaldone & (u32)BMASK(10, 10)) == 0) if ((~rxcaldone & (u32)BMASK(10, 10)) == 0)
printk(KERN_INFO QIB_DRV_NAME pr_info("Serdes %d chan %d calibration failed\n",
" Serdes %d chan %d calibration " IBSD(ppd->hw_pidx), chan);
"failed\n", IBSD(ppd->hw_pidx), chan);
} }
} }
......
...@@ -38,11 +38,15 @@ ...@@ -38,11 +38,15 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/idr.h> #include <linux/idr.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/printk.h>
#include "qib.h" #include "qib.h"
#include "qib_common.h" #include "qib_common.h"
#include "qib_mad.h" #include "qib_mad.h"
#undef pr_fmt
#define pr_fmt(fmt) QIB_DRV_NAME ": " fmt
/* /*
* min buffers we want to have per context, after driver * min buffers we want to have per context, after driver
*/ */
...@@ -124,8 +128,8 @@ int qib_create_ctxts(struct qib_devdata *dd) ...@@ -124,8 +128,8 @@ int qib_create_ctxts(struct qib_devdata *dd)
*/ */
dd->rcd = kzalloc(sizeof(*dd->rcd) * dd->ctxtcnt, GFP_KERNEL); dd->rcd = kzalloc(sizeof(*dd->rcd) * dd->ctxtcnt, GFP_KERNEL);
if (!dd->rcd) { if (!dd->rcd) {
qib_dev_err(dd, "Unable to allocate ctxtdata array, " qib_dev_err(dd,
"failing\n"); "Unable to allocate ctxtdata array, failing\n");
ret = -ENOMEM; ret = -ENOMEM;
goto done; goto done;
} }
...@@ -141,8 +145,8 @@ int qib_create_ctxts(struct qib_devdata *dd) ...@@ -141,8 +145,8 @@ int qib_create_ctxts(struct qib_devdata *dd)
ppd = dd->pport + (i % dd->num_pports); ppd = dd->pport + (i % dd->num_pports);
rcd = qib_create_ctxtdata(ppd, i); rcd = qib_create_ctxtdata(ppd, i);
if (!rcd) { if (!rcd) {
qib_dev_err(dd, "Unable to allocate ctxtdata" qib_dev_err(dd,
" for Kernel ctxt, failing\n"); "Unable to allocate ctxtdata for Kernel ctxt, failing\n");
ret = -ENOMEM; ret = -ENOMEM;
goto done; goto done;
} }
...@@ -303,8 +307,8 @@ static int init_pioavailregs(struct qib_devdata *dd) ...@@ -303,8 +307,8 @@ static int init_pioavailregs(struct qib_devdata *dd)
&dd->pcidev->dev, PAGE_SIZE, &dd->pioavailregs_phys, &dd->pcidev->dev, PAGE_SIZE, &dd->pioavailregs_phys,
GFP_KERNEL); GFP_KERNEL);
if (!dd->pioavailregs_dma) { if (!dd->pioavailregs_dma) {
qib_dev_err(dd, "failed to allocate PIOavail reg area " qib_dev_err(dd,
"in memory\n"); "failed to allocate PIOavail reg area in memory\n");
ret = -ENOMEM; ret = -ENOMEM;
goto done; goto done;
} }
...@@ -359,15 +363,15 @@ static void init_shadow_tids(struct qib_devdata *dd) ...@@ -359,15 +363,15 @@ static void init_shadow_tids(struct qib_devdata *dd)
pages = vzalloc(dd->cfgctxts * dd->rcvtidcnt * sizeof(struct page *)); pages = vzalloc(dd->cfgctxts * dd->rcvtidcnt * sizeof(struct page *));
if (!pages) { if (!pages) {
qib_dev_err(dd, "failed to allocate shadow page * " qib_dev_err(dd,
"array, no expected sends!\n"); "failed to allocate shadow page * array, no expected sends!\n");
goto bail; goto bail;
} }
addrs = vzalloc(dd->cfgctxts * dd->rcvtidcnt * sizeof(dma_addr_t)); addrs = vzalloc(dd->cfgctxts * dd->rcvtidcnt * sizeof(dma_addr_t));
if (!addrs) { if (!addrs) {
qib_dev_err(dd, "failed to allocate shadow dma handle " qib_dev_err(dd,
"array, no expected sends!\n"); "failed to allocate shadow dma handle array, no expected sends!\n");
goto bail_free; goto bail_free;
} }
...@@ -391,8 +395,8 @@ static int loadtime_init(struct qib_devdata *dd) ...@@ -391,8 +395,8 @@ static int loadtime_init(struct qib_devdata *dd)
if (((dd->revision >> QLOGIC_IB_R_SOFTWARE_SHIFT) & if (((dd->revision >> QLOGIC_IB_R_SOFTWARE_SHIFT) &
QLOGIC_IB_R_SOFTWARE_MASK) != QIB_CHIP_SWVERSION) { QLOGIC_IB_R_SOFTWARE_MASK) != QIB_CHIP_SWVERSION) {
qib_dev_err(dd, "Driver only handles version %d, " qib_dev_err(dd,
"chip swversion is %d (%llx), failng\n", "Driver only handles version %d, chip swversion is %d (%llx), failng\n",
QIB_CHIP_SWVERSION, QIB_CHIP_SWVERSION,
(int)(dd->revision >> (int)(dd->revision >>
QLOGIC_IB_R_SOFTWARE_SHIFT) & QLOGIC_IB_R_SOFTWARE_SHIFT) &
...@@ -501,8 +505,8 @@ static void verify_interrupt(unsigned long opaque) ...@@ -501,8 +505,8 @@ static void verify_interrupt(unsigned long opaque)
*/ */
if (dd->int_counter == 0) { if (dd->int_counter == 0) {
if (!dd->f_intr_fallback(dd)) if (!dd->f_intr_fallback(dd))
dev_err(&dd->pcidev->dev, "No interrupts detected, " dev_err(&dd->pcidev->dev,
"not usable.\n"); "No interrupts detected, not usable.\n");
else /* re-arm the timer to see if fallback works */ else /* re-arm the timer to see if fallback works */
mod_timer(&dd->intrchk_timer, jiffies + HZ/2); mod_timer(&dd->intrchk_timer, jiffies + HZ/2);
} }
...@@ -587,8 +591,7 @@ static int qib_create_workqueues(struct qib_devdata *dd) ...@@ -587,8 +591,7 @@ static int qib_create_workqueues(struct qib_devdata *dd)
} }
return 0; return 0;
wq_error: wq_error:
pr_err( pr_err("create_singlethread_workqueue failed for port %d\n",
QIB_DRV_NAME ": create_singlethread_workqueue failed for port %d\n",
pidx + 1); pidx + 1);
for (pidx = 0; pidx < dd->num_pports; ++pidx) { for (pidx = 0; pidx < dd->num_pports; ++pidx) {
ppd = dd->pport + pidx; ppd = dd->pport + pidx;
...@@ -665,8 +668,8 @@ int qib_init(struct qib_devdata *dd, int reinit) ...@@ -665,8 +668,8 @@ int qib_init(struct qib_devdata *dd, int reinit)
if (!lastfail) if (!lastfail)
lastfail = qib_setup_eagerbufs(rcd); lastfail = qib_setup_eagerbufs(rcd);
if (lastfail) { if (lastfail) {
qib_dev_err(dd, "failed to allocate kernel ctxt's " qib_dev_err(dd,
"rcvhdrq and/or egr bufs\n"); "failed to allocate kernel ctxt's rcvhdrq and/or egr bufs\n");
continue; continue;
} }
} }
...@@ -1016,8 +1019,7 @@ static void qib_verify_pioperf(struct qib_devdata *dd) ...@@ -1016,8 +1019,7 @@ static void qib_verify_pioperf(struct qib_devdata *dd)
/* 1 GiB/sec, slightly over IB SDR line rate */ /* 1 GiB/sec, slightly over IB SDR line rate */
if (lcnt < (emsecs * 1024U)) if (lcnt < (emsecs * 1024U))
qib_dev_err(dd, qib_dev_err(dd,
"Performance problem: bandwidth to PIO buffers is " "Performance problem: bandwidth to PIO buffers is only %u MiB/sec\n",
"only %u MiB/sec\n",
lcnt / (u32) emsecs); lcnt / (u32) emsecs);
preempt_enable(); preempt_enable();
...@@ -1090,8 +1092,8 @@ struct qib_devdata *qib_alloc_devdata(struct pci_dev *pdev, size_t extra) ...@@ -1090,8 +1092,8 @@ struct qib_devdata *qib_alloc_devdata(struct pci_dev *pdev, size_t extra)
if (qib_cpulist) if (qib_cpulist)
qib_cpulist_count = count; qib_cpulist_count = count;
else else
qib_early_err(&pdev->dev, "Could not alloc cpulist " qib_early_err(&pdev->dev,
"info, cpu affinity might be wrong\n"); "Could not alloc cpulist info, cpu affinity might be wrong\n");
} }
bail: bail:
...@@ -1180,21 +1182,20 @@ static int __init qlogic_ib_init(void) ...@@ -1180,21 +1182,20 @@ static int __init qlogic_ib_init(void)
*/ */
idr_init(&qib_unit_table); idr_init(&qib_unit_table);
if (!idr_pre_get(&qib_unit_table, GFP_KERNEL)) { if (!idr_pre_get(&qib_unit_table, GFP_KERNEL)) {
printk(KERN_ERR QIB_DRV_NAME ": idr_pre_get() failed\n"); pr_err("idr_pre_get() failed\n");
ret = -ENOMEM; ret = -ENOMEM;
goto bail_cq_wq; goto bail_cq_wq;
} }
ret = pci_register_driver(&qib_driver); ret = pci_register_driver(&qib_driver);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR QIB_DRV_NAME pr_err("Unable to register driver: error %d\n", -ret);
": Unable to register driver: error %d\n", -ret);
goto bail_unit; goto bail_unit;
} }
/* not fatal if it doesn't work */ /* not fatal if it doesn't work */
if (qib_init_qibfs()) if (qib_init_qibfs())
printk(KERN_ERR QIB_DRV_NAME ": Unable to register ipathfs\n"); pr_err("Unable to register ipathfs\n");
goto bail; /* all OK */ goto bail; /* all OK */
bail_unit: bail_unit:
...@@ -1218,9 +1219,9 @@ static void __exit qlogic_ib_cleanup(void) ...@@ -1218,9 +1219,9 @@ static void __exit qlogic_ib_cleanup(void)
ret = qib_exit_qibfs(); ret = qib_exit_qibfs();
if (ret) if (ret)
printk(KERN_ERR QIB_DRV_NAME ": " pr_err(
"Unable to cleanup counter filesystem: " "Unable to cleanup counter filesystem: error %d\n",
"error %d\n", -ret); -ret);
pci_unregister_driver(&qib_driver); pci_unregister_driver(&qib_driver);
...@@ -1360,8 +1361,8 @@ static int __devinit qib_init_one(struct pci_dev *pdev, ...@@ -1360,8 +1361,8 @@ static int __devinit qib_init_one(struct pci_dev *pdev,
#ifdef CONFIG_PCI_MSI #ifdef CONFIG_PCI_MSI
dd = qib_init_iba6120_funcs(pdev, ent); dd = qib_init_iba6120_funcs(pdev, ent);
#else #else
qib_early_err(&pdev->dev, "QLogic PCIE device 0x%x cannot " qib_early_err(&pdev->dev,
"work if CONFIG_PCI_MSI is not enabled\n", "QLogic PCIE device 0x%x cannot work if CONFIG_PCI_MSI is not enabled\n",
ent->device); ent->device);
dd = ERR_PTR(-ENODEV); dd = ERR_PTR(-ENODEV);
#endif #endif
...@@ -1376,8 +1377,9 @@ static int __devinit qib_init_one(struct pci_dev *pdev, ...@@ -1376,8 +1377,9 @@ static int __devinit qib_init_one(struct pci_dev *pdev,
break; break;
default: default:
qib_early_err(&pdev->dev, "Failing on unknown QLogic " qib_early_err(&pdev->dev,
"deviceid 0x%x\n", ent->device); "Failing on unknown QLogic deviceid 0x%x\n",
ent->device);
ret = -ENODEV; ret = -ENODEV;
} }
...@@ -1434,8 +1436,8 @@ static int __devinit qib_init_one(struct pci_dev *pdev, ...@@ -1434,8 +1436,8 @@ static int __devinit qib_init_one(struct pci_dev *pdev,
if (!qib_wc_pat) { if (!qib_wc_pat) {
ret = qib_enable_wc(dd); ret = qib_enable_wc(dd);
if (ret) { if (ret) {
qib_dev_err(dd, "Write combining not enabled " qib_dev_err(dd,
"(err %d): performance may be poor\n", "Write combining not enabled (err %d): performance may be poor\n",
-ret); -ret);
ret = 0; ret = 0;
} }
...@@ -1502,8 +1504,8 @@ int qib_create_rcvhdrq(struct qib_devdata *dd, struct qib_ctxtdata *rcd) ...@@ -1502,8 +1504,8 @@ int qib_create_rcvhdrq(struct qib_devdata *dd, struct qib_ctxtdata *rcd)
gfp_flags | __GFP_COMP); gfp_flags | __GFP_COMP);
if (!rcd->rcvhdrq) { if (!rcd->rcvhdrq) {
qib_dev_err(dd, "attempt to allocate %d bytes " qib_dev_err(dd,
"for ctxt %u rcvhdrq failed\n", "attempt to allocate %d bytes for ctxt %u rcvhdrq failed\n",
amt, rcd->ctxt); amt, rcd->ctxt);
goto bail; goto bail;
} }
...@@ -1533,8 +1535,9 @@ int qib_create_rcvhdrq(struct qib_devdata *dd, struct qib_ctxtdata *rcd) ...@@ -1533,8 +1535,9 @@ int qib_create_rcvhdrq(struct qib_devdata *dd, struct qib_ctxtdata *rcd)
return 0; return 0;
bail_free: bail_free:
qib_dev_err(dd, "attempt to allocate 1 page for ctxt %u " qib_dev_err(dd,
"rcvhdrqtailaddr failed\n", rcd->ctxt); "attempt to allocate 1 page for ctxt %u rcvhdrqtailaddr failed\n",
rcd->ctxt);
vfree(rcd->user_event_mask); vfree(rcd->user_event_mask);
rcd->user_event_mask = NULL; rcd->user_event_mask = NULL;
bail_free_hdrq: bail_free_hdrq:
......
...@@ -224,15 +224,15 @@ void qib_bad_intrstatus(struct qib_devdata *dd) ...@@ -224,15 +224,15 @@ void qib_bad_intrstatus(struct qib_devdata *dd)
* We print the message and disable interrupts, in hope of * We print the message and disable interrupts, in hope of
* having a better chance of debugging the problem. * having a better chance of debugging the problem.
*/ */
qib_dev_err(dd, "Read of chip interrupt status failed" qib_dev_err(dd,
" disabling interrupts\n"); "Read of chip interrupt status failed disabling interrupts\n");
if (allbits++) { if (allbits++) {
/* disable interrupt delivery, something is very wrong */ /* disable interrupt delivery, something is very wrong */
if (allbits == 2) if (allbits == 2)
dd->f_set_intr_state(dd, 0); dd->f_set_intr_state(dd, 0);
if (allbits == 3) { if (allbits == 3) {
qib_dev_err(dd, "2nd bad interrupt status, " qib_dev_err(dd,
"unregistering interrupts\n"); "2nd bad interrupt status, unregistering interrupts\n");
dd->flags |= QIB_BADINTR; dd->flags |= QIB_BADINTR;
dd->flags &= ~QIB_INITTED; dd->flags &= ~QIB_INITTED;
dd->f_free_irq(dd); dd->f_free_irq(dd);
......
...@@ -224,8 +224,9 @@ static void qib_msix_setup(struct qib_devdata *dd, int pos, u32 *msixcnt, ...@@ -224,8 +224,9 @@ static void qib_msix_setup(struct qib_devdata *dd, int pos, u32 *msixcnt,
} }
do_intx: do_intx:
if (ret) { if (ret) {
qib_dev_err(dd, "pci_enable_msix %d vectors failed: %d, " qib_dev_err(dd,
"falling back to INTx\n", tabsize, ret); "pci_enable_msix %d vectors failed: %d, falling back to INTx\n",
tabsize, ret);
tabsize = 0; tabsize = 0;
} }
for (i = 0; i < tabsize; i++) for (i = 0; i < tabsize; i++)
...@@ -251,8 +252,9 @@ static int qib_msi_setup(struct qib_devdata *dd, int pos) ...@@ -251,8 +252,9 @@ static int qib_msi_setup(struct qib_devdata *dd, int pos)
ret = pci_enable_msi(pdev); ret = pci_enable_msi(pdev);
if (ret) if (ret)
qib_dev_err(dd, "pci_enable_msi failed: %d, " qib_dev_err(dd,
"interrupts may not work\n", ret); "pci_enable_msi failed: %d, interrupts may not work\n",
ret);
/* continue even if it fails, we may still be OK... */ /* continue even if it fails, we may still be OK... */
pci_read_config_dword(pdev, pos + PCI_MSI_ADDRESS_LO, pci_read_config_dword(pdev, pos + PCI_MSI_ADDRESS_LO,
...@@ -358,8 +360,8 @@ int qib_reinit_intr(struct qib_devdata *dd) ...@@ -358,8 +360,8 @@ int qib_reinit_intr(struct qib_devdata *dd)
pos = pci_find_capability(dd->pcidev, PCI_CAP_ID_MSI); pos = pci_find_capability(dd->pcidev, PCI_CAP_ID_MSI);
if (!pos) { if (!pos) {
qib_dev_err(dd, "Can't find MSI capability, " qib_dev_err(dd,
"can't restore MSI settings\n"); "Can't find MSI capability, can't restore MSI settings\n");
ret = 0; ret = 0;
/* nothing special for MSIx, just MSI */ /* nothing special for MSIx, just MSI */
goto bail; goto bail;
...@@ -471,8 +473,8 @@ void qib_pcie_reenable(struct qib_devdata *dd, u16 cmd, u8 iline, u8 cline) ...@@ -471,8 +473,8 @@ void qib_pcie_reenable(struct qib_devdata *dd, u16 cmd, u8 iline, u8 cline)
pci_write_config_byte(dd->pcidev, PCI_CACHE_LINE_SIZE, cline); pci_write_config_byte(dd->pcidev, PCI_CACHE_LINE_SIZE, cline);
r = pci_enable_device(dd->pcidev); r = pci_enable_device(dd->pcidev);
if (r) if (r)
qib_dev_err(dd, "pci_enable_device failed after " qib_dev_err(dd,
"reset: %d\n", r); "pci_enable_device failed after reset: %d\n", r);
} }
/* code to adjust PCIe capabilities. */ /* code to adjust PCIe capabilities. */
...@@ -717,8 +719,9 @@ qib_pci_mmio_enabled(struct pci_dev *pdev) ...@@ -717,8 +719,9 @@ qib_pci_mmio_enabled(struct pci_dev *pdev)
if (words == ~0ULL) if (words == ~0ULL)
ret = PCI_ERS_RESULT_NEED_RESET; ret = PCI_ERS_RESULT_NEED_RESET;
} }
qib_devinfo(pdev, "QIB mmio_enabled function called, " qib_devinfo(pdev,
"read wordscntr %Lx, returning %d\n", words, ret); "QIB mmio_enabled function called, read wordscntr %Lx, returning %d\n",
words, ret);
return ret; return ret;
} }
......
/* /*
* Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation. * Copyright (c) 2012 Intel Corporation. All rights reserved.
* All rights reserved. * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
* Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
* *
* This software is available to you under a choice of one of two * 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,15 +342,17 @@ static void qib_sd_trimdone_monitor(struct qib_devdata *dd,
ret = qib_sd7220_reg_mod(dd, IB_7220_SERDES, ret = qib_sd7220_reg_mod(dd, IB_7220_SERDES,
IB_CTRL2(chn), 0, 0); IB_CTRL2(chn), 0, 0);
if (ret < 0) if (ret < 0)
qib_dev_err(dd, "Failed checking TRIMDONE, chn %d" qib_dev_err(dd,
" (%s)\n", chn, where); "Failed checking TRIMDONE, chn %d (%s)\n",
chn, where);
if (!(ret & 0x10)) { if (!(ret & 0x10)) {
int probe; int probe;
baduns |= (1 << chn); baduns |= (1 << chn);
qib_dev_err(dd, "TRIMDONE cleared on chn %d (%02X)." qib_dev_err(dd,
" (%s)\n", chn, ret, where); "TRIMDONE cleared on chn %d (%02X). (%s)\n",
chn, ret, where);
probe = qib_sd7220_reg_mod(dd, IB_7220_SERDES, probe = qib_sd7220_reg_mod(dd, IB_7220_SERDES,
IB_PGUDP(0), 0, 0); IB_PGUDP(0), 0, 0);
qib_dev_err(dd, "probe is %d (%02X)\n", qib_dev_err(dd, "probe is %d (%02X)\n",
...@@ -375,8 +377,8 @@ static void qib_sd_trimdone_monitor(struct qib_devdata *dd, ...@@ -375,8 +377,8 @@ static void qib_sd_trimdone_monitor(struct qib_devdata *dd,
ret = qib_sd7220_reg_mod(dd, IB_7220_SERDES, ret = qib_sd7220_reg_mod(dd, IB_7220_SERDES,
IB_CTRL2(chn), 0x10, 0x10); IB_CTRL2(chn), 0x10, 0x10);
if (ret < 0) if (ret < 0)
qib_dev_err(dd, "Failed re-setting " qib_dev_err(dd,
"TRIMDONE, chn %d (%s)\n", "Failed re-setting TRIMDONE, chn %d (%s)\n",
chn, where); chn, where);
} }
} }
...@@ -1144,8 +1146,8 @@ static int ibsd_mod_allchnls(struct qib_devdata *dd, int loc, int val, ...@@ -1144,8 +1146,8 @@ static int ibsd_mod_allchnls(struct qib_devdata *dd, int loc, int val,
if (ret < 0) { if (ret < 0) {
int sloc = loc >> EPB_ADDR_SHF; int sloc = loc >> EPB_ADDR_SHF;
qib_dev_err(dd, "pre-read failed: elt %d," qib_dev_err(dd,
" addr 0x%X, chnl %d\n", "pre-read failed: elt %d, addr 0x%X, chnl %d\n",
(sloc & 0xF), (sloc & 0xF),
(sloc >> 9) & 0x3f, chnl); (sloc >> 9) & 0x3f, chnl);
return ret; return ret;
...@@ -1157,8 +1159,8 @@ static int ibsd_mod_allchnls(struct qib_devdata *dd, int loc, int val, ...@@ -1157,8 +1159,8 @@ static int ibsd_mod_allchnls(struct qib_devdata *dd, int loc, int val,
if (ret < 0) { if (ret < 0) {
int sloc = loc >> EPB_ADDR_SHF; int sloc = loc >> EPB_ADDR_SHF;
qib_dev_err(dd, "Global WR failed: elt %d," qib_dev_err(dd,
" addr 0x%X, val %02X\n", "Global WR failed: elt %d, addr 0x%X, val %02X\n",
(sloc & 0xF), (sloc >> 9) & 0x3f, val); (sloc & 0xF), (sloc >> 9) & 0x3f, val);
} }
return ret; return ret;
...@@ -1173,9 +1175,8 @@ static int ibsd_mod_allchnls(struct qib_devdata *dd, int loc, int val, ...@@ -1173,9 +1175,8 @@ static int ibsd_mod_allchnls(struct qib_devdata *dd, int loc, int val,
if (ret < 0) { if (ret < 0) {
int sloc = loc >> EPB_ADDR_SHF; int sloc = loc >> EPB_ADDR_SHF;
qib_dev_err(dd, "Write failed: elt %d," qib_dev_err(dd,
" addr 0x%X, chnl %d, val 0x%02X," "Write failed: elt %d, addr 0x%X, chnl %d, val 0x%02X, mask 0x%02X\n",
" mask 0x%02X\n",
(sloc & 0xF), (sloc >> 9) & 0x3f, chnl, (sloc & 0xF), (sloc >> 9) & 0x3f, chnl,
val & 0xFF, mask & 0xFF); val & 0xFF, mask & 0xFF);
break; break;
......
/* /*
* Copyright (c) 2007, 2008, 2009, 2010 QLogic Corporation. All rights reserved. * Copyright (c) 2012 Intel Corporation. All rights reserved.
* Copyright (c) 2007 - 2012 QLogic Corporation. All rights reserved.
* *
* This software is available to you under a choice of one of two * This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU * 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,8 +277,8 @@ static int alloc_sdma(struct qib_pportdata *ppd)
GFP_KERNEL); GFP_KERNEL);
if (!ppd->sdma_descq) { if (!ppd->sdma_descq) {
qib_dev_err(ppd->dd, "failed to allocate SendDMA descriptor " qib_dev_err(ppd->dd,
"FIFO memory\n"); "failed to allocate SendDMA descriptor FIFO memory\n");
goto bail; goto bail;
} }
...@@ -285,8 +286,8 @@ static int alloc_sdma(struct qib_pportdata *ppd) ...@@ -285,8 +286,8 @@ static int alloc_sdma(struct qib_pportdata *ppd)
ppd->sdma_head_dma = dma_alloc_coherent(&ppd->dd->pcidev->dev, ppd->sdma_head_dma = dma_alloc_coherent(&ppd->dd->pcidev->dev,
PAGE_SIZE, &ppd->sdma_head_phys, GFP_KERNEL); PAGE_SIZE, &ppd->sdma_head_phys, GFP_KERNEL);
if (!ppd->sdma_head_dma) { if (!ppd->sdma_head_dma) {
qib_dev_err(ppd->dd, "failed to allocate SendDMA " qib_dev_err(ppd->dd,
"head memory\n"); "failed to allocate SendDMA head memory\n");
goto cleanup_descq; goto cleanup_descq;
} }
ppd->sdma_head_dma[0] = 0; ppd->sdma_head_dma[0] = 0;
......
...@@ -36,41 +36,6 @@ ...@@ -36,41 +36,6 @@
#include "qib.h" #include "qib.h"
#include "qib_mad.h" #include "qib_mad.h"
/**
* qib_parse_ushort - parse an unsigned short value in an arbitrary base
* @str: the string containing the number
* @valp: where to put the result
*
* Returns the number of bytes consumed, or negative value on error.
*/
static int qib_parse_ushort(const char *str, unsigned short *valp)
{
unsigned long val;
char *end;
int ret;
if (!isdigit(str[0])) {
ret = -EINVAL;
goto bail;
}
val = simple_strtoul(str, &end, 0);
if (val > 0xffff) {
ret = -EINVAL;
goto bail;
}
*valp = val;
ret = end + 1 - str;
if (ret == 0)
ret = -EINVAL;
bail:
return ret;
}
/* start of per-port functions */ /* start of per-port functions */
/* /*
* Get/Set heartbeat enable. OR of 1=enabled, 2=auto * 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,7 +57,11 @@ static ssize_t store_hrtbt_enb(struct qib_pportdata *ppd, const char *buf,
int ret; int ret;
u16 val; u16 val;
ret = qib_parse_ushort(buf, &val); ret = kstrtou16(buf, 0, &val);
if (ret) {
qib_dev_err(dd, "attempt to set invalid Heartbeat enable\n");
return ret;
}
/* /*
* Set the "intentional" heartbeat enable per either of * 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,10 +70,7 @@ static ssize_t store_hrtbt_enb(struct qib_pportdata *ppd, const char *buf,
* because entering loopback mode overrides it and automatically * because entering loopback mode overrides it and automatically
* disables heartbeat. * disables heartbeat.
*/ */
if (ret >= 0)
ret = dd->f_set_ib_cfg(ppd, QIB_IB_CFG_HRTBT, val); ret = dd->f_set_ib_cfg(ppd, QIB_IB_CFG_HRTBT, val);
if (ret < 0)
qib_dev_err(dd, "attempt to set invalid Heartbeat enable\n");
return ret < 0 ? ret : count; return ret < 0 ? ret : count;
} }
...@@ -128,12 +94,14 @@ static ssize_t store_led_override(struct qib_pportdata *ppd, const char *buf, ...@@ -128,12 +94,14 @@ static ssize_t store_led_override(struct qib_pportdata *ppd, const char *buf,
int ret; int ret;
u16 val; u16 val;
ret = qib_parse_ushort(buf, &val); ret = kstrtou16(buf, 0, &val);
if (ret > 0) if (ret) {
qib_set_led_override(ppd, val);
else
qib_dev_err(dd, "attempt to set invalid LED override\n"); qib_dev_err(dd, "attempt to set invalid LED override\n");
return ret < 0 ? ret : count; return ret;
}
qib_set_led_override(ppd, val);
return count;
} }
static ssize_t show_status(struct qib_pportdata *ppd, char *buf) static 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,12 +469,12 @@ static ssize_t diagc_attr_store(struct kobject *kobj, struct attribute *attr,
struct qib_pportdata *ppd = struct qib_pportdata *ppd =
container_of(kobj, struct qib_pportdata, diagc_kobj); container_of(kobj, struct qib_pportdata, diagc_kobj);
struct qib_ibport *qibp = &ppd->ibport_data; struct qib_ibport *qibp = &ppd->ibport_data;
char *endp; u32 val;
long val = simple_strtol(buf, &endp, 0); int ret;
if (val < 0 || endp == buf)
return -EINVAL;
ret = kstrtou32(buf, 0, &val);
if (ret)
return ret;
*(u32 *)((char *) qibp + dattr->counter) = val; *(u32 *)((char *) qibp + dattr->counter) = val;
return size; return size;
} }
...@@ -739,8 +707,9 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num, ...@@ -739,8 +707,9 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
int ret; int ret;
if (!port_num || port_num > dd->num_pports) { if (!port_num || port_num > dd->num_pports) {
qib_dev_err(dd, "Skipping infiniband class with " qib_dev_err(dd,
"invalid port %u\n", port_num); "Skipping infiniband class with invalid port %u\n",
port_num);
ret = -ENODEV; ret = -ENODEV;
goto bail; goto bail;
} }
...@@ -749,8 +718,9 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num, ...@@ -749,8 +718,9 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
ret = kobject_init_and_add(&ppd->pport_kobj, &qib_port_ktype, kobj, ret = kobject_init_and_add(&ppd->pport_kobj, &qib_port_ktype, kobj,
"linkcontrol"); "linkcontrol");
if (ret) { if (ret) {
qib_dev_err(dd, "Skipping linkcontrol sysfs info, " qib_dev_err(dd,
"(err %d) port %u\n", ret, port_num); "Skipping linkcontrol sysfs info, (err %d) port %u\n",
ret, port_num);
goto bail; goto bail;
} }
kobject_uevent(&ppd->pport_kobj, KOBJ_ADD); kobject_uevent(&ppd->pport_kobj, KOBJ_ADD);
...@@ -758,8 +728,9 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num, ...@@ -758,8 +728,9 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
ret = kobject_init_and_add(&ppd->sl2vl_kobj, &qib_sl2vl_ktype, kobj, ret = kobject_init_and_add(&ppd->sl2vl_kobj, &qib_sl2vl_ktype, kobj,
"sl2vl"); "sl2vl");
if (ret) { if (ret) {
qib_dev_err(dd, "Skipping sl2vl sysfs info, " qib_dev_err(dd,
"(err %d) port %u\n", ret, port_num); "Skipping sl2vl sysfs info, (err %d) port %u\n",
ret, port_num);
goto bail_link; goto bail_link;
} }
kobject_uevent(&ppd->sl2vl_kobj, KOBJ_ADD); kobject_uevent(&ppd->sl2vl_kobj, KOBJ_ADD);
...@@ -767,8 +738,9 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num, ...@@ -767,8 +738,9 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
ret = kobject_init_and_add(&ppd->diagc_kobj, &qib_diagc_ktype, kobj, ret = kobject_init_and_add(&ppd->diagc_kobj, &qib_diagc_ktype, kobj,
"diag_counters"); "diag_counters");
if (ret) { if (ret) {
qib_dev_err(dd, "Skipping diag_counters sysfs info, " qib_dev_err(dd,
"(err %d) port %u\n", ret, port_num); "Skipping diag_counters sysfs info, (err %d) port %u\n",
ret, port_num);
goto bail_sl; goto bail_sl;
} }
kobject_uevent(&ppd->diagc_kobj, KOBJ_ADD); kobject_uevent(&ppd->diagc_kobj, KOBJ_ADD);
......
/* /*
* Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved. * Copyright (c) 2012 Intel Corporation. All rights reserved.
* Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
* Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
* *
* This software is available to you under a choice of one of two * 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,8 +450,9 @@ int qib_twsi_blk_wr(struct qib_devdata *dd, int dev, int addr,
goto failed_write; goto failed_write;
ret = qib_twsi_wr(dd, addr, 0); ret = qib_twsi_wr(dd, addr, 0);
if (ret) { if (ret) {
qib_dev_err(dd, "Failed to write interface" qib_dev_err(dd,
" write addr %02X\n", addr); "Failed to write interface write addr %02X\n",
addr);
goto failed_write; goto failed_write;
} }
} }
......
/* /*
* Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved. * Copyright (c) 2012 Intel Corporation. All rights reserved.
* Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
* Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
* *
* This software is available to you under a choice of one of two * This software is available to you under a choice of one of two
...@@ -102,8 +103,8 @@ int qib_enable_wc(struct qib_devdata *dd) ...@@ -102,8 +103,8 @@ int qib_enable_wc(struct qib_devdata *dd)
u64 atmp; u64 atmp;
atmp = pioaddr & ~(piolen - 1); atmp = pioaddr & ~(piolen - 1);
if (atmp < addr || (atmp + piolen) > (addr + len)) { if (atmp < addr || (atmp + piolen) > (addr + len)) {
qib_dev_err(dd, "No way to align address/size " qib_dev_err(dd,
"(%llx/%llx), no WC mtrr\n", "No way to align address/size (%llx/%llx), no WC mtrr\n",
(unsigned long long) atmp, (unsigned long long) atmp,
(unsigned long long) piolen << 1); (unsigned long long) piolen << 1);
ret = -ENODEV; ret = -ENODEV;
...@@ -120,8 +121,7 @@ int qib_enable_wc(struct qib_devdata *dd) ...@@ -120,8 +121,7 @@ int qib_enable_wc(struct qib_devdata *dd)
if (cookie < 0) { if (cookie < 0) {
{ {
qib_devinfo(dd->pcidev, qib_devinfo(dd->pcidev,
"mtrr_add() WC for PIO bufs " "mtrr_add() WC for PIO bufs failed (%d)\n",
"failed (%d)\n",
cookie); cookie);
ret = -EINVAL; ret = -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册