Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87afd448 authored by Eli Cohen's avatar Eli Cohen Committed by Roland Dreier
Browse files

IB/mthca: Clear ICM pages before handing to FW

Current memfree FW has a bug which in some cases, assumes that ICM
pages passed to it are cleared.  This patch uses __GFP_ZERO to
allocate all ICM pages passed to the FW.  Once firmware with a fix is
released, we can make the workaround conditional on firmware version.

This fixes the bug reported by Arthur Kepner <akepner@sgi.com> here:
http://lists.openfabrics.org/pipermail/general/2008-May/050026.html



Cc: <stable@kernel.org>
Signed-off-by: default avatarEli Cohen <eli@mellanox.co.il>

[ Rewritten to be a one-liner using __GFP_ZERO instead of vmap()ing
  ICM memory and memset()ing it to 0. - Roland ]

Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent f9d1c6ca
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -109,7 +109,11 @@ static int mthca_alloc_icm_pages(struct scatterlist *mem, int order, gfp_t gfp_m
{
	struct page *page;

	page = alloc_pages(gfp_mask, order);
	/*
	 * Use __GFP_ZERO because buggy firmware assumes ICM pages are
	 * cleared, and subtle failures are seen if they aren't.
	 */
	page = alloc_pages(gfp_mask | __GFP_ZERO, order);
	if (!page)
		return -ENOMEM;