Skip to content

Commit

Permalink
Merge branch 'misc' into k.o/for-next
Browse files Browse the repository at this point in the history
Conflicts:
	drivers/infiniband/core/iwcm.c - The rdma_netlink patches in
	HEAD and the iwarp cm workqueue fix (don't use WQ_MEM_RECLAIM,
	we aren't safe for that context) touched the same code.

Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
dledford committed Aug 18, 2017
2 parents 3e5f088 + 9d6fd7a commit d3cf4d9
Show file tree
Hide file tree
Showing 22 changed files with 53 additions and 95 deletions.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -4304,7 +4304,7 @@ static int __init ib_cm_init(void)
goto error1;
}

cm.wq = create_workqueue("ib_cm");
cm.wq = alloc_workqueue("ib_cm", 0, 1);
if (!cm.wq) {
ret = -ENOMEM;
goto error2;
Expand Down
4 changes: 2 additions & 2 deletions drivers/infiniband/core/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ int ib_register_device(struct ib_device *device,
device->reg_state = IB_DEV_REGISTERED;

list_for_each_entry(client, &client_list, list)
if (client->add && !add_client_context(device, client))
if (!add_client_context(device, client) && client->add)
client->add(device);

device->index = __dev_new_index();
Expand Down Expand Up @@ -612,7 +612,7 @@ int ib_register_client(struct ib_client *client)
mutex_lock(&device_mutex);

list_for_each_entry(device, &device_list, core_list)
if (client->add && !add_client_context(device, client))
if (!add_client_context(device, client) && client->add)
client->add(device);

down_write(&lists_rwsem);
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/core/iwcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ static int __init iw_cm_init(void)
pr_err("iw_cm: couldn't init iwpm\n");
else
rdma_nl_register(RDMA_NL_IWCM, iwcm_nl_cb_table);
iwcm_wq = alloc_ordered_workqueue("iw_cm_wq", WQ_MEM_RECLAIM);
iwcm_wq = alloc_ordered_workqueue("iw_cm_wq", 0);
if (!iwcm_wq)
return -ENOMEM;

Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/core/uverbs_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ static struct ib_ucq_object *create_cq(struct ib_uverbs_file *file,
cq->uobject = &obj->uobject;
cq->comp_handler = ib_uverbs_comp_handler;
cq->event_handler = ib_uverbs_cq_event_handler;
cq->cq_context = &ev_file->ev_queue;
cq->cq_context = ev_file ? &ev_file->ev_queue : NULL;
atomic_set(&cq->usecnt, 0);

obj->uobject.object = cq;
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/bnxt_re/ib_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3372,7 +3372,7 @@ int bnxt_re_dealloc_ucontext(struct ib_ucontext *ib_uctx)
&rdev->qplib_res.dpi_tbl,
&uctx->dpi);
if (rc)
dev_err(rdev_to_dev(rdev), "Deallocte HW DPI failed!");
dev_err(rdev_to_dev(rdev), "Deallocate HW DPI failed!");
/* Don't fail, continue*/
uctx->dpi.dbr = NULL;
}
Expand Down
1 change: 0 additions & 1 deletion drivers/infiniband/hw/cxgb4/cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2871,7 +2871,6 @@ static int close_con_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
return 0;

pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
BUG_ON(!ep);

/* The cm_id may be null if we failed to connect */
mutex_lock(&ep->com.mutex);
Expand Down
6 changes: 3 additions & 3 deletions drivers/infiniband/hw/hfi1/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -7380,7 +7380,7 @@ void handle_verify_cap(struct work_struct *work)
struct hfi1_devdata *dd = ppd->dd;
u64 reg;
u8 power_management;
u8 continious;
u8 continuous;
u8 vcu;
u8 vau;
u8 z;
Expand All @@ -7399,7 +7399,7 @@ void handle_verify_cap(struct work_struct *work)
lcb_shutdown(dd, 0);
adjust_lcb_for_fpga_serdes(dd);

read_vc_remote_phy(dd, &power_management, &continious);
read_vc_remote_phy(dd, &power_management, &continuous);
read_vc_remote_fabric(dd, &vau, &z, &vcu, &vl15buf,
&partner_supported_crc);
read_vc_remote_link_width(dd, &remote_tx_rate, &link_widths);
Expand All @@ -7413,7 +7413,7 @@ void handle_verify_cap(struct work_struct *work)
get_link_widths(dd, &active_tx, &active_rx);
dd_dev_info(dd,
"Peer PHY: power management 0x%x, continuous updates 0x%x\n",
(int)power_management, (int)continious);
(int)power_management, (int)continuous);
dd_dev_info(dd,
"Peer Fabric: vAU %d, Z %d, vCU %d, vl15 credits 0x%x, CRC sizes 0x%x\n",
(int)vau, (int)z, (int)vcu, (int)vl15buf,
Expand Down
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/hfi1/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static void port_release(struct kobject *kobj)
/* nothing to do since memory is freed by hfi1_free_devdata() */
}

static struct bin_attribute cc_table_bin_attr = {
static const struct bin_attribute cc_table_bin_attr = {
.attr = {.name = "cc_table_bin", .mode = 0444},
.read = read_cc_table_bin,
.size = PAGE_SIZE,
Expand Down Expand Up @@ -137,7 +137,7 @@ static ssize_t read_cc_setting_bin(struct file *filp, struct kobject *kobj,
return count;
}

static struct bin_attribute cc_setting_bin_attr = {
static const struct bin_attribute cc_setting_bin_attr = {
.attr = {.name = "cc_settings_bin", .mode = 0444},
.read = read_cc_setting_bin,
.size = PAGE_SIZE,
Expand Down
9 changes: 1 addition & 8 deletions drivers/infiniband/hw/i40iw/i40iw_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3687,8 +3687,6 @@ int i40iw_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)

cm_node->accelerated = 1;
if (cm_node->accept_pend) {
if (!cm_node->listener)
i40iw_pr_err("cm_node->listener NULL for passive node\n");
atomic_dec(&cm_node->listener->pend_accepts_cnt);
cm_node->accept_pend = 0;
}
Expand Down Expand Up @@ -4056,12 +4054,7 @@ static void i40iw_cm_event_connected(struct i40iw_cm_event *event)
i40iw_modify_qp(&iwqp->ibqp, &attr, IB_QP_STATE, NULL);

cm_node->accelerated = 1;
if (cm_node->accept_pend) {
if (!cm_node->listener)
i40iw_pr_err("listener is null for passive node\n");
atomic_dec(&cm_node->listener->pend_accepts_cnt);
cm_node->accept_pend = 0;
}

return;

error:
Expand Down
9 changes: 3 additions & 6 deletions drivers/infiniband/hw/i40iw/i40iw_pble.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,19 +269,16 @@ static enum i40iw_status_code add_bp_pages(struct i40iw_sc_dev *dev,
status = i40iw_add_sd_table_entry(dev->hw, hmc_info,
info->idx.sd_idx, I40IW_SD_TYPE_PAGED,
I40IW_HMC_DIRECT_BP_SIZE);
if (status) {
i40iw_free_vmalloc_mem(dev->hw, chunk);
return status;
}
if (status)
goto error;
if (!dev->is_pf) {
status = i40iw_vchnl_vf_add_hmc_objs(dev, I40IW_HMC_IW_PBLE,
fpm_to_idx(pble_rsrc,
pble_rsrc->next_fpm_addr),
(info->pages << PBLE_512_SHIFT));
if (status) {
i40iw_pr_err("allocate PBLEs in the PF. Error %i\n", status);
i40iw_free_vmalloc_mem(dev->hw, chunk);
return status;
goto error;
}
}
addr = chunk->vaddr;
Expand Down
6 changes: 4 additions & 2 deletions drivers/infiniband/hw/i40iw/i40iw_puda.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,14 +949,16 @@ enum i40iw_status_code i40iw_puda_create_rsrc(struct i40iw_sc_vsi *vsi,
ret = i40iw_puda_qp_create(rsrc);
}
if (ret) {
i40iw_debug(dev, I40IW_DEBUG_PUDA, "[%s] error qp_create\n", __func__);
i40iw_debug(dev, I40IW_DEBUG_PUDA, "[%s] error qp_create\n",
__func__);
goto error;
}
rsrc->completion = PUDA_QP_CREATED;

ret = i40iw_puda_allocbufs(rsrc, info->tx_buf_cnt + info->rq_size);
if (ret) {
i40iw_debug(dev, I40IW_DEBUG_PUDA, "[%s] error allloc_buf\n", __func__);
i40iw_debug(dev, I40IW_DEBUG_PUDA, "[%s] error alloc_buf\n",
__func__);
goto error;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/mthca/mthca_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ static void mthca_remove_one(struct pci_dev *pdev)
mutex_unlock(&mthca_device_mutex);
}

static struct pci_device_id mthca_pci_table[] = {
static const struct pci_device_id mthca_pci_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_MELLANOX, PCI_DEVICE_ID_MELLANOX_TAVOR),
.driver_data = TAVOR },
{ PCI_DEVICE(PCI_VENDOR_ID_TOPSPIN, PCI_DEVICE_ID_MELLANOX_TAVOR),
Expand Down
69 changes: 24 additions & 45 deletions drivers/infiniband/hw/nes/nes.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static unsigned int ee_flsh_adapter;
static unsigned int sysfs_nonidx_addr;
static unsigned int sysfs_idx_addr;

static struct pci_device_id nes_pci_table[] = {
static const struct pci_device_id nes_pci_table[] = {
{ PCI_VDEVICE(NETEFFECT, PCI_DEVICE_ID_NETEFFECT_NE020), },
{ PCI_VDEVICE(NETEFFECT, PCI_DEVICE_ID_NETEFFECT_NE020_KR), },
{0}
Expand Down Expand Up @@ -807,13 +807,6 @@ static void nes_remove(struct pci_dev *pcidev)
}


static struct pci_driver nes_pci_driver = {
.name = DRV_NAME,
.id_table = nes_pci_table,
.probe = nes_probe,
.remove = nes_remove,
};

static ssize_t adapter_show(struct device_driver *ddp, char *buf)
{
unsigned int devfn = 0xffffffff;
Expand Down Expand Up @@ -1155,56 +1148,43 @@ static DRIVER_ATTR_RW(idx_addr);
static DRIVER_ATTR_RW(idx_data);
static DRIVER_ATTR_RW(wqm_quanta);

static int nes_create_driver_sysfs(struct pci_driver *drv)
{
int error;
error = driver_create_file(&drv->driver, &driver_attr_adapter);
error |= driver_create_file(&drv->driver, &driver_attr_eeprom_cmd);
error |= driver_create_file(&drv->driver, &driver_attr_eeprom_data);
error |= driver_create_file(&drv->driver, &driver_attr_flash_cmd);
error |= driver_create_file(&drv->driver, &driver_attr_flash_data);
error |= driver_create_file(&drv->driver, &driver_attr_nonidx_addr);
error |= driver_create_file(&drv->driver, &driver_attr_nonidx_data);
error |= driver_create_file(&drv->driver, &driver_attr_idx_addr);
error |= driver_create_file(&drv->driver, &driver_attr_idx_data);
error |= driver_create_file(&drv->driver, &driver_attr_wqm_quanta);
return error;
}
static struct attribute *nes_attrs[] = {
&driver_attr_adapter.attr,
&driver_attr_eeprom_cmd.attr,
&driver_attr_eeprom_data.attr,
&driver_attr_flash_cmd.attr,
&driver_attr_flash_data.attr,
&driver_attr_nonidx_addr.attr,
&driver_attr_nonidx_data.attr,
&driver_attr_idx_addr.attr,
&driver_attr_idx_data.attr,
&driver_attr_wqm_quanta.attr,
NULL,
};
ATTRIBUTE_GROUPS(nes);

static struct pci_driver nes_pci_driver = {
.name = DRV_NAME,
.id_table = nes_pci_table,
.probe = nes_probe,
.remove = nes_remove,
.groups = nes_groups,
};

static void nes_remove_driver_sysfs(struct pci_driver *drv)
{
driver_remove_file(&drv->driver, &driver_attr_adapter);
driver_remove_file(&drv->driver, &driver_attr_eeprom_cmd);
driver_remove_file(&drv->driver, &driver_attr_eeprom_data);
driver_remove_file(&drv->driver, &driver_attr_flash_cmd);
driver_remove_file(&drv->driver, &driver_attr_flash_data);
driver_remove_file(&drv->driver, &driver_attr_nonidx_addr);
driver_remove_file(&drv->driver, &driver_attr_nonidx_data);
driver_remove_file(&drv->driver, &driver_attr_idx_addr);
driver_remove_file(&drv->driver, &driver_attr_idx_data);
driver_remove_file(&drv->driver, &driver_attr_wqm_quanta);
}

/**
* nes_init_module - module initialization entry point
*/
static int __init nes_init_module(void)
{
int retval;
int retval1;

retval = nes_cm_start();
if (retval) {
printk(KERN_ERR PFX "Unable to start NetEffect iWARP CM.\n");
return retval;
}
retval = pci_register_driver(&nes_pci_driver);
if (retval >= 0) {
retval1 = nes_create_driver_sysfs(&nes_pci_driver);
if (retval1 < 0)
printk(KERN_ERR PFX "Unable to create NetEffect sys files.\n");
}
return retval;
return pci_register_driver(&nes_pci_driver);
}


Expand All @@ -1214,7 +1194,6 @@ static int __init nes_init_module(void)
static void __exit nes_exit_module(void)
{
nes_cm_stop();
nes_remove_driver_sysfs(&nes_pci_driver);

pci_unregister_driver(&nes_pci_driver);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/qib/qib_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ static int loadtime_init(struct qib_devdata *dd)
if (((dd->revision >> QLOGIC_IB_R_SOFTWARE_SHIFT) &
QLOGIC_IB_R_SOFTWARE_MASK) != QIB_CHIP_SWVERSION) {
qib_dev_err(dd,
"Driver only handles version %d, chip swversion is %d (%llx), failng\n",
"Driver only handles version %d, chip swversion is %d (%llx), failing\n",
QIB_CHIP_SWVERSION,
(int)(dd->revision >>
QLOGIC_IB_R_SOFTWARE_SHIFT) &
Expand Down
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/qib/qib_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static struct kobj_type qib_port_cc_ktype = {
.release = qib_port_release,
};

static struct bin_attribute cc_table_bin_attr = {
static const struct bin_attribute cc_table_bin_attr = {
.attr = {.name = "cc_table_bin", .mode = 0444},
.read = read_cc_table_bin,
.size = PAGE_SIZE,
Expand Down Expand Up @@ -286,7 +286,7 @@ static ssize_t read_cc_setting_bin(struct file *filp, struct kobject *kobj,
return count;
}

static struct bin_attribute cc_setting_bin_attr = {
static const struct bin_attribute cc_setting_bin_attr = {
.attr = {.name = "cc_settings_bin", .mode = 0444},
.read = read_cc_setting_bin,
.size = PAGE_SIZE,
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ static void pvrdma_pci_remove(struct pci_dev *pdev)
pci_set_drvdata(pdev, NULL);
}

static struct pci_device_id pvrdma_pci_table[] = {
static const struct pci_device_id pvrdma_pci_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_VMWARE, PCI_DEVICE_ID_VMWARE_PVRDMA), },
{ 0 },
};
Expand Down
7 changes: 1 addition & 6 deletions drivers/infiniband/sw/rxe/rxe_av.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,13 @@ int rxe_av_chk_attr(struct rxe_dev *rxe, struct rdma_ah_attr *attr)
{
struct rxe_port *port;

if (rdma_ah_get_port_num(attr) != 1) {
pr_info("invalid port_num = %d\n", rdma_ah_get_port_num(attr));
return -EINVAL;
}

port = &rxe->port;

if (rdma_ah_get_ah_flags(attr) & IB_AH_GRH) {
u8 sgid_index = rdma_ah_read_grh(attr)->sgid_index;

if (sgid_index > port->attr.gid_tbl_len) {
pr_info("invalid sgid index = %d\n", sgid_index);
pr_warn("invalid sgid index = %d\n", sgid_index);
return -EINVAL;
}
}
Expand Down
5 changes: 0 additions & 5 deletions drivers/nvme/host/rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1961,10 +1961,6 @@ static struct nvmf_transport_ops nvme_rdma_transport = {
.create_ctrl = nvme_rdma_create_ctrl,
};

static void nvme_rdma_add_one(struct ib_device *ib_device)
{
}

static void nvme_rdma_remove_one(struct ib_device *ib_device, void *client_data)
{
struct nvme_rdma_ctrl *ctrl;
Expand All @@ -1986,7 +1982,6 @@ static void nvme_rdma_remove_one(struct ib_device *ib_device, void *client_data)

static struct ib_client nvme_rdma_ib_client = {
.name = "nvme_rdma",
.add = nvme_rdma_add_one,
.remove = nvme_rdma_remove_one
};

Expand Down
5 changes: 0 additions & 5 deletions drivers/nvme/target/rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1510,10 +1510,6 @@ static struct nvmet_fabrics_ops nvmet_rdma_ops = {
.delete_ctrl = nvmet_rdma_delete_ctrl,
};

static void nvmet_rdma_add_one(struct ib_device *ib_device)
{
}

static void nvmet_rdma_remove_one(struct ib_device *ib_device, void *client_data)
{
struct nvmet_rdma_queue *queue;
Expand All @@ -1534,7 +1530,6 @@ static void nvmet_rdma_remove_one(struct ib_device *ib_device, void *client_data

static struct ib_client nvmet_rdma_ib_client = {
.name = "nvmet_rdma",
.add = nvmet_rdma_add_one,
.remove = nvmet_rdma_remove_one
};

Expand Down
1 change: 1 addition & 0 deletions drivers/pci/pci-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,7 @@ int __pci_register_driver(struct pci_driver *drv, struct module *owner,
drv->driver.bus = &pci_bus_type;
drv->driver.owner = owner;
drv->driver.mod_name = mod_name;
drv->driver.groups = drv->groups;

spin_lock_init(&drv->dynids.lock);
INIT_LIST_HEAD(&drv->dynids.list);
Expand Down
Loading

0 comments on commit d3cf4d9

Please sign in to comment.