Re: [PATCH linux-next v2] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures

2015-04-14 Thread Honggang LI
On Tue, Apr 14, 2015 at 10:23:16PM +0300, Eli Cohen wrote: > On Mon, Apr 13, 2015 at 05:21:58PM +0800, Honggang Li wrote: > > @@ -241,7 +243,7 @@ static void free_4k(struct mlx5_core_dev *dev, u64 addr) > > static int alloc_system_page(struct mlx5_core_dev *dev, u16 func_id) > > { > > struct

Re: [PATCH linux-next v2] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures

2015-04-14 Thread Eli Cohen
On Mon, Apr 13, 2015 at 05:21:58PM +0800, Honggang Li wrote: > @@ -241,7 +243,7 @@ static void free_4k(struct mlx5_core_dev *dev, u64 addr) > static int alloc_system_page(struct mlx5_core_dev *dev, u16 func_id) > { > struct page *page; > - u64 addr; > + u64 addr = 0; > int err

Re: [PATCH linux-next v2] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures

2015-04-14 Thread David Miller
From: Honggang Li Date: Mon, 13 Apr 2015 17:21:58 +0800 > 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 0x. As a result, the mlx5 device page > allocator RB tree will be i

[PATCH linux-next v2] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures

2015-04-13 Thread Honggang Li
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 0x. As a result, the mlx5 device page allocator RB tree will be initialized with valid addresses greater than 0xfff. However,