Skip to content

Commit 3be28e9

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Jason Gunthorpe: "The last two weeks have been quiet here, just the usual smattering of long standing bug fixes. A collection of error case bug fixes: - Improper nesting of spinlock types in cm - Missing error codes and kfree() - Ensure dma_virt_ops users have the right kconfig symbols to work properly - Compilation failure of tools/testing" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: tools/testing/scatterlist: Fix test to compile and run IB/hfi1: Fix error return code in hfi1_init_dd() RMDA/sw: Don't allow drivers using dma_virt_ops on highmem configs RDMA/pvrdma: Fix missing kfree() in pvrdma_register_device() RDMA/cm: Make the local_id_table xarray non-irq
2 parents dda3f42 + ee415d7 commit 3be28e9

File tree

9 files changed

+19
-12
lines changed

9 files changed

+19
-12
lines changed

drivers/infiniband/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ config INFINIBAND_ADDR_TRANS_CONFIGFS
7373
This allows the user to config the default GID type that the CM
7474
uses for each device, when initiaing new connections.
7575

76+
config INFINIBAND_VIRT_DMA
77+
def_bool !HIGHMEM
78+
7679
if INFINIBAND_USER_ACCESS || !INFINIBAND_USER_ACCESS
7780
source "drivers/infiniband/hw/mthca/Kconfig"
7881
source "drivers/infiniband/hw/qib/Kconfig"

drivers/infiniband/core/cm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -859,8 +859,8 @@ static struct cm_id_private *cm_alloc_id_priv(struct ib_device *device,
859859
atomic_set(&cm_id_priv->work_count, -1);
860860
refcount_set(&cm_id_priv->refcount, 1);
861861

862-
ret = xa_alloc_cyclic_irq(&cm.local_id_table, &id, NULL, xa_limit_32b,
863-
&cm.local_id_next, GFP_KERNEL);
862+
ret = xa_alloc_cyclic(&cm.local_id_table, &id, NULL, xa_limit_32b,
863+
&cm.local_id_next, GFP_KERNEL);
864864
if (ret < 0)
865865
goto error;
866866
cm_id_priv->id.local_id = (__force __be32)id ^ cm.random_id_operand;
@@ -878,8 +878,8 @@ static struct cm_id_private *cm_alloc_id_priv(struct ib_device *device,
878878
*/
879879
static void cm_finalize_id(struct cm_id_private *cm_id_priv)
880880
{
881-
xa_store_irq(&cm.local_id_table, cm_local_id(cm_id_priv->id.local_id),
882-
cm_id_priv, GFP_KERNEL);
881+
xa_store(&cm.local_id_table, cm_local_id(cm_id_priv->id.local_id),
882+
cm_id_priv, GFP_ATOMIC);
883883
}
884884

885885
struct ib_cm_id *ib_create_cm_id(struct ib_device *device,
@@ -1169,7 +1169,7 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err)
11691169
spin_unlock(&cm.lock);
11701170
spin_unlock_irq(&cm_id_priv->lock);
11711171

1172-
xa_erase_irq(&cm.local_id_table, cm_local_id(cm_id->local_id));
1172+
xa_erase(&cm.local_id_table, cm_local_id(cm_id->local_id));
11731173
cm_deref_id(cm_id_priv);
11741174
wait_for_completion(&cm_id_priv->comp);
11751175
while ((work = cm_dequeue_work(cm_id_priv)) != NULL)
@@ -4482,7 +4482,7 @@ static int __init ib_cm_init(void)
44824482
cm.remote_id_table = RB_ROOT;
44834483
cm.remote_qp_table = RB_ROOT;
44844484
cm.remote_sidr_table = RB_ROOT;
4485-
xa_init_flags(&cm.local_id_table, XA_FLAGS_ALLOC | XA_FLAGS_LOCK_IRQ);
4485+
xa_init_flags(&cm.local_id_table, XA_FLAGS_ALLOC);
44864486
get_random_bytes(&cm.random_id_operand, sizeof cm.random_id_operand);
44874487
INIT_LIST_HEAD(&cm.timewait_list);
44884488

drivers/infiniband/hw/hfi1/chip.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15245,7 +15245,8 @@ int hfi1_init_dd(struct hfi1_devdata *dd)
1524515245
& CCE_REVISION_SW_MASK);
1524615246

1524715247
/* alloc netdev data */
15248-
if (hfi1_netdev_alloc(dd))
15248+
ret = hfi1_netdev_alloc(dd);
15249+
if (ret)
1524915250
goto bail_cleanup;
1525015251

1525115252
ret = set_up_context_variables(dd);

drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static int pvrdma_register_device(struct pvrdma_dev *dev)
266266
}
267267
ret = ib_device_set_netdev(&dev->ib_dev, dev->netdev, 1);
268268
if (ret)
269-
return ret;
269+
goto err_srq_free;
270270
spin_lock_init(&dev->srq_tbl_lock);
271271
rdma_set_device_sysfs_group(&dev->ib_dev, &pvrdma_attr_group);
272272

drivers/infiniband/sw/rdmavt/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
config INFINIBAND_RDMAVT
33
tristate "RDMA verbs transport library"
4-
depends on X86_64 && ARCH_DMA_ADDR_T_64BIT
4+
depends on INFINIBAND_VIRT_DMA
5+
depends on X86_64
56
depends on PCI
67
select DMA_VIRT_OPS
78
help

drivers/infiniband/sw/rxe/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
config RDMA_RXE
33
tristate "Software RDMA over Ethernet (RoCE) driver"
44
depends on INET && PCI && INFINIBAND
5-
depends on !64BIT || ARCH_DMA_ADDR_T_64BIT
5+
depends on INFINIBAND_VIRT_DMA
66
select NET_UDP_TUNNEL
77
select CRYPTO_CRC32
88
select DMA_VIRT_OPS

drivers/infiniband/sw/siw/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config RDMA_SIW
22
tristate "Software RDMA over TCP/IP (iWARP) driver"
33
depends on INET && INFINIBAND && LIBCRC32C
4+
depends on INFINIBAND_VIRT_DMA
45
select DMA_VIRT_OPS
56
help
67
This driver implements the iWARP RDMA transport over

tools/testing/scatterlist/linux/mm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ typedef unsigned long dma_addr_t;
3333
#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
3434
#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
3535
#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
36+
#define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a))
3637

3738
#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)
3839

tools/testing/scatterlist/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ int main(void)
5252
{
5353
const unsigned int sgmax = SCATTERLIST_MAX_SEGMENT;
5454
struct test *test, tests[] = {
55-
{ -EINVAL, 1, pfn(0), PAGE_SIZE, PAGE_SIZE + 1, 1 },
5655
{ -EINVAL, 1, pfn(0), PAGE_SIZE, 0, 1 },
57-
{ -EINVAL, 1, pfn(0), PAGE_SIZE, sgmax + 1, 1 },
56+
{ 0, 1, pfn(0), PAGE_SIZE, PAGE_SIZE + 1, 1 },
57+
{ 0, 1, pfn(0), PAGE_SIZE, sgmax + 1, 1 },
5858
{ 0, 1, pfn(0), PAGE_SIZE, sgmax, 1 },
5959
{ 0, 1, pfn(0), 1, sgmax, 1 },
6060
{ 0, 2, pfn(0, 1), 2 * PAGE_SIZE, sgmax, 1 },

0 commit comments

Comments
 (0)