1
0
Fork 0

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB/qib: Remove DCA support until feature is finished
  IB/qib: Use a single txselect module parameter for serdes tuning
  IB/qib: Don't rely on (undefined) order of function parameter evaluation
  IB/ucm: Use memdup_user()
  IB/qib: Fix undefined symbol error when CONFIG_PCI_MSI=n
hifive-unleashed-5.1
Linus Torvalds 2010-05-30 09:12:16 -07:00
commit 3e9345edd8
5 changed files with 203 additions and 622 deletions

View File

@ -706,14 +706,9 @@ static int ib_ucm_alloc_data(const void **dest, u64 src, u32 len)
if (!len) if (!len)
return 0; return 0;
data = kmalloc(len, GFP_KERNEL); data = memdup_user((void __user *)(unsigned long)src, len);
if (!data) if (IS_ERR(data))
return -ENOMEM; return PTR_ERR(data);
if (copy_from_user(data, (void __user *)(unsigned long)src, len)) {
kfree(data);
return -EFAULT;
}
*dest = data; *dest = data;
return 0; return 0;

View File

@ -144,10 +144,11 @@ static ssize_t dev_counters_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
u64 *counters; u64 *counters;
size_t avail;
struct qib_devdata *dd = private2dd(file); struct qib_devdata *dd = private2dd(file);
return simple_read_from_buffer(buf, count, ppos, counters, avail = dd->f_read_cntrs(dd, *ppos, NULL, &counters);
dd->f_read_cntrs(dd, *ppos, NULL, &counters)); return simple_read_from_buffer(buf, count, ppos, counters, avail);
} }
/* read the per-device counters */ /* read the per-device counters */
@ -155,10 +156,11 @@ static ssize_t dev_names_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
char *names; char *names;
size_t avail;
struct qib_devdata *dd = private2dd(file); struct qib_devdata *dd = private2dd(file);
return simple_read_from_buffer(buf, count, ppos, names, avail = dd->f_read_cntrs(dd, *ppos, &names, NULL);
dd->f_read_cntrs(dd, *ppos, &names, NULL)); return simple_read_from_buffer(buf, count, ppos, names, avail);
} }
static const struct file_operations cntr_ops[] = { static const struct file_operations cntr_ops[] = {
@ -176,10 +178,11 @@ static ssize_t portnames_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
char *names; char *names;
size_t avail;
struct qib_devdata *dd = private2dd(file); struct qib_devdata *dd = private2dd(file);
return simple_read_from_buffer(buf, count, ppos, names, avail = dd->f_read_portcntrs(dd, *ppos, 0, &names, NULL);
dd->f_read_portcntrs(dd, *ppos, 0, &names, NULL)); return simple_read_from_buffer(buf, count, ppos, names, avail);
} }
/* read the per-port counters for port 1 (pidx 0) */ /* read the per-port counters for port 1 (pidx 0) */
@ -187,10 +190,11 @@ static ssize_t portcntrs_1_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
u64 *counters; u64 *counters;
size_t avail;
struct qib_devdata *dd = private2dd(file); struct qib_devdata *dd = private2dd(file);
return simple_read_from_buffer(buf, count, ppos, counters, avail = dd->f_read_portcntrs(dd, *ppos, 0, NULL, &counters);
dd->f_read_portcntrs(dd, *ppos, 0, NULL, &counters)); return simple_read_from_buffer(buf, count, ppos, counters, avail);
} }
/* read the per-port counters for port 2 (pidx 1) */ /* read the per-port counters for port 2 (pidx 1) */
@ -198,10 +202,11 @@ static ssize_t portcntrs_2_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
u64 *counters; u64 *counters;
size_t avail;
struct qib_devdata *dd = private2dd(file); struct qib_devdata *dd = private2dd(file);
return simple_read_from_buffer(buf, count, ppos, counters, avail = dd->f_read_portcntrs(dd, *ppos, 1, NULL, &counters);
dd->f_read_portcntrs(dd, *ppos, 1, NULL, &counters)); return simple_read_from_buffer(buf, count, ppos, counters, avail);
} }
static const struct file_operations portcntr_ops[] = { static const struct file_operations portcntr_ops[] = {

View File

@ -3475,14 +3475,6 @@ struct qib_devdata *qib_init_iba6120_funcs(struct pci_dev *pdev,
struct qib_devdata *dd; struct qib_devdata *dd;
int ret; int ret;
#ifndef CONFIG_PCI_MSI
qib_early_err(&pdev->dev, "QLogic PCIE device 0x%x cannot "
"work if CONFIG_PCI_MSI is not enabled\n",
ent->device);
dd = ERR_PTR(-ENODEV);
goto bail;
#endif
dd = qib_alloc_devdata(pdev, sizeof(struct qib_pportdata) + dd = qib_alloc_devdata(pdev, sizeof(struct qib_pportdata) +
sizeof(struct qib_chip_specific)); sizeof(struct qib_chip_specific));
if (IS_ERR(dd)) if (IS_ERR(dd))
@ -3554,10 +3546,6 @@ struct qib_devdata *qib_init_iba6120_funcs(struct pci_dev *pdev,
if (qib_mini_init) if (qib_mini_init)
goto bail; goto bail;
#ifndef CONFIG_PCI_MSI
qib_dev_err(dd, "PCI_MSI not configured, NO interrupts\n");
#endif
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, "Failed to setup PCIe or interrupts; "
"continuing anyway\n"); "continuing anyway\n");

File diff suppressed because it is too large Load Diff

View File

@ -1237,7 +1237,13 @@ static int __devinit qib_init_one(struct pci_dev *pdev,
*/ */
switch (ent->device) { switch (ent->device) {
case PCI_DEVICE_ID_QLOGIC_IB_6120: case PCI_DEVICE_ID_QLOGIC_IB_6120:
#ifdef CONFIG_PCI_MSI
dd = qib_init_iba6120_funcs(pdev, ent); dd = qib_init_iba6120_funcs(pdev, ent);
#else
qib_early_err(&pdev->dev, "QLogic PCIE device 0x%x cannot "
"work if CONFIG_PCI_MSI is not enabled\n",
ent->device);
#endif
break; break;
case PCI_DEVICE_ID_QLOGIC_IB_7220: case PCI_DEVICE_ID_QLOGIC_IB_7220: