From patchwork Thu May 10 13:19:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 8520 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7F74B23E13 for ; Thu, 10 May 2012 13:19:51 +0000 (UTC) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by fiordland.canonical.com (Postfix) with ESMTP id 718ACA18AA8 for ; Thu, 10 May 2012 13:19:51 +0000 (UTC) Received: by wgbdq11 with SMTP id dq11so1105699wgb.17 for ; Thu, 10 May 2012 06:19:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:date:from :in-reply-to:to:message-id:mime-version:x-mailer:references:cc :subject:x-beenthere:x-mailman-version:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:content-transfer-encoding:sender:errors-to :x-gm-message-state; bh=tEp+Rpg2Alscc3znscGD0YzNfNiKRFMUgF8rbkAQjBY=; b=m2HhxDVnt6wwbLjOSQ8gzgsyJoAwegow1XirjioQC53/MQmV/Ez0H2nnUGNFsjPOzS LwVMGKgGsctJUIHmhv5mfvtp1LwYwn5PHmnMvZXkE+PKGXjUC5NdgEPi7fXaaZY2KUpS Oz9AR+V60dKHhZqQ0RXL82BF9RUD/kaG2tcTF5qgIqdtb7PCnPdchbYiDfIyvu+UbkCI BOdRPfnuFk9f3st2yPDH4fA9qjued1oSMCG+Clp1Gnz9rdIrgVl6VYeFf0SiRtZalTaV pcTcaapsw68lHo20XgoxetOFqihlsyOVIsdpN6u3hU1l2h83OQpQ2TTTfIl+sG17Iihe SaLw== Received: by 10.50.57.129 with SMTP id i1mr2402558igq.33.1336655990616; Thu, 10 May 2012 06:19:50 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.73.147 with SMTP id q19csp95563ibj; Thu, 10 May 2012 06:19:49 -0700 (PDT) Received: by 10.180.109.229 with SMTP id hv5mr23653666wib.0.1336655989122; Thu, 10 May 2012 06:19:49 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id i1si2195939wie.38.2012.05.10.06.19.43; Thu, 10 May 2012 06:19:49 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SSTHR-0002Ql-Dl; Thu, 10 May 2012 13:19:41 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SSTHP-0002Ou-Nt for linaro-mm-sig@lists.linaro.org; Thu, 10 May 2012 13:19:39 +0000 Received: from euspt2 (mailout2.w1.samsung.com [210.118.77.12]) by mailout2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0M3T003Z66CGYO@mailout2.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 10 May 2012 14:19:28 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M3T007A06CM4N@spt2.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 10 May 2012 14:19:34 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id DE3D9270050; Thu, 10 May 2012 15:25:13 +0200 (CEST) Date: Thu, 10 May 2012 15:19:35 +0200 From: Marek Szyprowski In-reply-to: <1333462221-3987-1-git-send-email-m.szyprowski@samsung.com> To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-mm@kvack.org, linaro-mm-sig@lists.linaro.org Message-id: <1336655975-15729-1-git-send-email-m.szyprowski@samsung.com> MIME-version: 1.0 X-Mailer: git-send-email 1.7.10 References: <1333462221-3987-1-git-send-email-m.szyprowski@samsung.com> Cc: Ohad Ben-Cohen , Daniel Walker , Russell King , Arnd Bergmann , Jonathan Corbet , Mel Gorman , Michal Nazarewicz , Dave Hansen , Jesse Barker , Kyungmin Park , Andrew Morton , Rob Clark , KAMEZAWA Hiroyuki Subject: [Linaro-mm-sig] [PATCH] drivers: cma: don't fail if migration returns -EAGAIN X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQkVlbVN7PwesvFQgmudeGrIvPvKIrst4CNT198p5XteOxRaHSmsj7FdSuXggH6Emj9UduqT alloc_contig_range() function might return -EAGAIN if migrate_pages() call fails for some temporarily locked pages. Such case should not be fatal to dma_alloc_from_contiguous(), which should retry allocation like in case of -EBUSY error. Reported-by: Haojian Zhuang Signed-off-by: Marek Szyprowski --- drivers/base/dma-contiguous.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c index 78efb03..e46e2fb 100644 --- a/drivers/base/dma-contiguous.c +++ b/drivers/base/dma-contiguous.c @@ -346,7 +346,7 @@ struct page *dma_alloc_from_contiguous(struct device *dev, int count, if (ret == 0) { bitmap_set(cma->bitmap, pageno, count); break; - } else if (ret != -EBUSY) { + } else if (ret != -EBUSY && ret != -EAGAIN) { goto error; } pr_debug("%s(): memory range at %p is busy, retrying\n",