summaryrefslogtreecommitdiff
path: root/drivers/infiniband/sw/siw/siw_main.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2020-11-17 15:20:26 -0400
committerJason Gunthorpe <jgg@nvidia.com>2020-11-17 15:20:26 -0400
commitbf3b7b7ba9e3db55d164ec7bf05e6947f79637cd (patch)
tree7de81ebc8339c2a985b2af0e360368e281564c93 /drivers/infiniband/sw/siw/siw_main.c
parent8a7904a672a1d33c848e5129f886ee69e0773a2e (diff)
parentdabbd6abcdbeb1358a53ec28a244429320eb0e3a (diff)
Merge branch 'for-rc' into rdma.git
From https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git The rc RDMA branch is needed due to dependencies on the next patches. Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/sw/siw/siw_main.c')
-rw-r--r--drivers/infiniband/sw/siw/siw_main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/infiniband/sw/siw/siw_main.c b/drivers/infiniband/sw/siw/siw_main.c
index 9cf596429dbf..ac6756227677 100644
--- a/drivers/infiniband/sw/siw/siw_main.c
+++ b/drivers/infiniband/sw/siw/siw_main.c
@@ -306,6 +306,7 @@ static struct siw_device *siw_device_create(struct net_device *netdev)
struct siw_device *sdev = NULL;
struct ib_device *base_dev;
struct device *parent = netdev->dev.parent;
+ u64 dma_mask;
int rv;
if (!parent) {
@@ -362,8 +363,10 @@ static struct siw_device *siw_device_create(struct net_device *netdev)
base_dev->dev.parent = parent;
base_dev->dev.dma_parms = &sdev->dma_parms;
dma_set_max_seg_size(&base_dev->dev, UINT_MAX);
- dma_set_coherent_mask(&base_dev->dev,
- dma_get_required_mask(&base_dev->dev));
+ dma_mask = IS_ENABLED(CONFIG_64BIT) ? DMA_BIT_MASK(64) : DMA_BIT_MASK(32);
+ if (dma_coerce_mask_and_coherent(&base_dev->dev, dma_mask))
+ goto error;
+
base_dev->num_comp_vectors = num_possible_cpus();
xa_init_flags(&sdev->qp_xa, XA_FLAGS_ALLOC1);