Skip to content

Commit 3d74747

Browse files
Jack Morgensteindavem330
authored andcommitted
mlx4_core: Do not map BF area if capability is 0
BF can be disabled in some cases, the capability field, bf_reg_size is set to zero in this case. Don't map the BF area in this case, it would cause failures. In addition, leaving the BF area unmapped also alerts the ETH driver to not use BF. Signed-off-by: Jack Morgenstein <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 834fa12 commit 3d74747

File tree

1 file changed

+3
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx4

1 file changed

+3
-0
lines changed

drivers/net/ethernet/mellanox/mlx4/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,9 @@ static int map_bf_area(struct mlx4_dev *dev)
986986
resource_size_t bf_len;
987987
int err = 0;
988988

989+
if (!dev->caps.bf_reg_size)
990+
return -ENXIO;
991+
989992
bf_start = pci_resource_start(dev->pdev, 2) +
990993
(dev->caps.num_uars << PAGE_SHIFT);
991994
bf_len = pci_resource_len(dev->pdev, 2) -

0 commit comments

Comments
 (0)