Commit 1e27ca69 authored by Marcel Apfelbaum's avatar Marcel Apfelbaum Committed by David S. Miller

mlx4_core: fix mtt range deallocation

The mtt range was allocated in mtt units but deallocated
in segments. Among the rest, this caused crash during hotplug removal
Reported-by: default avatarYinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarMarcel Apfelbaum <marcela@mellanox.co.il>
Reviewed-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
Tested-by: default avatarYinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f7d9821a
......@@ -239,8 +239,8 @@ void __mlx4_free_mtt_range(struct mlx4_dev *dev, u32 offset, int order)
first_seg = offset / (1 << log_mtts_per_seg);
mlx4_buddy_free(&mr_table->mtt_buddy, first_seg, seg_order);
mlx4_table_put_range(dev, &mr_table->mtt_table, first_seg,
first_seg + (1 << seg_order) - 1);
mlx4_table_put_range(dev, &mr_table->mtt_table, offset,
offset + (1 << order) - 1);
}
static void mlx4_free_mtt_range(struct mlx4_dev *dev, u32 offset, int order)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment