linux/drivers/net/ethernet/mellanox/mlx5/core
Honggang LI 59d2d18cc4 mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures
If CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for x86 systems and physical
memory is more than 4GB, dma_map_page may return a valid memory
address which greater than 0xffffffff. As a result, the mlx5 device page
allocator RB tree will be initialized with valid addresses greater than
0xfffffff.

However, (addr & PAGE_MASK) set the high four bytes to zeros. So, it's
impossible for the function, free_4k, to release the pages whose
addresses greater than 4GB. Memory leaks. And mlx5_ib module can't
release the pages when user try to remove the module, as a result,
system hang.

[root@rdma05 root]# dmesg  | grep addr | head
addr             = 3fe384000
addr & PAGE_MASK =  fe384000
[root@rdma05 root]# rmmod mlx5_ib   <---- hang on

---------------------- cosnole log -----------------
mlx5_ib 0000:04:00.0: irq 138 for MSI/MSI-X
  alloc irq_desc for 139 on node -1
  alloc kstat_irqs on node -1
mlx5_ib 0000:04:00.0: irq 139 for MSI/MSI-X
0000:04:00.0:free_4k:221:(pid 1519): page not found
0000:04:00.0:free_4k:221:(pid 1519): page not found
0000:04:00.0:free_4k:221:(pid 1519): page not found
0000:04:00.0:free_4k:221:(pid 1519): page not found
---------------------- cosnole log -----------------

Fixes: bf0bf77f65 ('mlx5: Support communicating arbitrary host page size to firmware')
Signed-off-by: Honggang Li <honli@redhat.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-04-15 16:20:51 -04:00
..
Kconfig IB/mlx5: Remove dependency on X86 2014-02-13 20:48:02 -08:00
Makefile
alloc.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
cmd.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
cq.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
debugfs.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
eq.c mlx4/mlx5: Use dma_wmb/rmb where appropriate 2015-04-09 14:25:25 -04:00
fw.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
health.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
mad.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
main.c net/mlx5_core: Extend struct mlx5_interface to support multiple protocols 2015-04-02 16:33:43 -04:00
mcg.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
mlx5_core.h net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
mr.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
pagealloc.c mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures 2015-04-15 16:20:51 -04:00
pd.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
port.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
qp.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
srq.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00
uar.c net/mlx5_core: Fix Mellanox copyright note 2015-04-02 16:33:42 -04:00