From patchwork Wed Aug 22 13:02:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10876 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 B1CE323E41 for ; Wed, 22 Aug 2012 13:03:27 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id CD9B6A1873B for ; Wed, 22 Aug 2012 13:03:15 +0000 (UTC) Received: by yhpp61 with SMTP id p61so625004yhp.11 for ; Wed, 22 Aug 2012 06:03:26 -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:x-auditid :from:to:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-tm-as-mml:cc:subject:x-beenthere :x-mailman-version:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=VbSWfGK5Ep0IDwNP+ZGX4j+h0Y8o34Ly8S9B2OF47Hg=; b=FapRmZ7RdVw4RPKP9ozpmeHa4z6gYv8ph5wjGOn/VfyyCeFhtLB5Px+wi0jaEkJOp3 /yM3RnhgzF3FjIpx/IBS/ghWu58IGOIWcS6PMeWMcHxxRTfw2+2++BjmZUkTsLaaqKV5 utzUoMe50wgohpuJ5eJx1n9iR/v4FEibvxiJt4Ebj+cNYRt5wBjvrr38u/NAIcESPWTh ZHDeU6sCTOq0Q9g5uKL1CRy6+kN6hFvmj099h9X4nAOodNt0TmXIYXEGRxckB/2X5FGa oCj4x6ldt4tQHZtsZKIbFCaanQCh9mDNTfY3Pm4nahHmZC5k/pPUF+oKxrwvkTzCLLd7 pDEw== Received: by 10.50.159.196 with SMTP id xe4mr1992260igb.43.1345640606198; Wed, 22 Aug 2012 06:03:26 -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.50.184.232 with SMTP id ex8csp201242igc; Wed, 22 Aug 2012 06:03:25 -0700 (PDT) Received: by 10.180.78.99 with SMTP id a3mr5769633wix.15.1345640603822; Wed, 22 Aug 2012 06:03:23 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id v15si5867405wed.46.2012.08.22.06.03.21; Wed, 22 Aug 2012 06:03:23 -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 1T4Aae-0003LJ-HU; Wed, 22 Aug 2012 13:03:20 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1T4Aad-0003Kv-6X for linaro-mm-sig@lists.linaro.org; Wed, 22 Aug 2012 13:03:19 +0000 Received: from epcpsbgm2.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M95002Q4QXF1K40@mailout2.samsung.com> for linaro-mm-sig@lists.linaro.org; Wed, 22 Aug 2012 22:03:16 +0900 (KST) X-AuditID: cbfee61b-b7faf6d00000476a-eb-5034d8946c6f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 71.7F.18282.498D4305; Wed, 22 Aug 2012 22:03:16 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M9500L81QX65L20@mmp1.samsung.com> for linaro-mm-sig@lists.linaro.org; Wed, 22 Aug 2012 22:03:16 +0900 (KST) From: Marek Szyprowski To: linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org Date: Wed, 22 Aug 2012 15:02:51 +0200 Message-id: <1345640571-14349-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <20120822083053.42efc6162076534250112652@nvidia.com> References: <20120822083053.42efc6162076534250112652@nvidia.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJMWRmVeSWpSXmKPExsVy+t9jAd0pN0wCDCYcUbX4cuUhkwOjx+1/ j5kDGKO4bFJSczLLUov07RK4Mk7O+sVc8Ii9Yv61S6wNjJvZuhg5OSQETCSOvn7KDGGLSVy4 tx4ozsUhJLCIUaJ/1VEmCGctk8TJRVPBqtgEDCW63naBdYsIeEg8WXGOGaSIWeApk8Tf/f8Y QRLCAtESrzsms4PYLAKqEs9/fASL8wI1PLjTyASxTl7i6f0+sEGcAo4SRy/fBarhANrmILFo stEERt4FjAyrGEVTC5ILipPSc430ihNzi0vz0vWS83M3MYK9/kx6B+OqBotDjAIcjEo8vB4J JgFCrIllxZW5hxglOJiVRHgf7QYK8aYkVlalFuXHF5XmpBYfYpTmYFES5+XvMwwQEkhPLEnN Tk0tSC2CyTJxcEo1MCbEL18Twcm3bnZemZea1e+9R8ROa2udP9W89499HP+lzheRr530fBVb Bb7flRIVYFh/MT0orGNOZB7ng+AtuvnLz4ZuKmScGcLnENjAd7H8uGtY2RnW7Uw7rH/dfj9r l/op/gvCPsJrdh27FvP+RH3t1ZLvP/aVfeeIvr9XdEHVxqW/oqbeWqXEUpyRaKjFXFScCADw HWid9gEAAA== X-TM-AS-MML: No Cc: Andrew Lunn , Russell King - ARM Linux , Jason Cooper , Arnd Bergmann , Aaro Koskinen , Josh Coombs , Kyungmin Park Subject: [Linaro-mm-sig] [PATCH v2] ARM: DMA-Mapping: print warning when atomic coherent allocation fails 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: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQm8KrZGVYQEA0mgtBIT/HckT5RkLnVNU1i/zbhkykTbQTYopy2evOY24Yu3pJoqGII+4vJc Print a loud warning when system runs out of memory from atomic DMA coherent pool to let users notice the potential problem. Reported-by: Aaro Koskinen Signed-off-by: Marek Szyprowski --- arch/arm/mm/dma-mapping.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index d1cc9c1..acced93 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -461,6 +461,10 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page) bitmap_set(pool->bitmap, pageno, count); ptr = pool->vaddr + PAGE_SIZE * pageno; *ret_page = pool->page + pageno; + } else { + pr_err_once("ERROR: %u KiB atomic DMA coherent pool is too small!\n" + "Please increase it with coherent_pool= kernel parameter!\n", + (unsigned)pool->size / 1024); } spin_unlock_irqrestore(&pool->lock, flags);